Commit 8841d900 authored by Thomas's avatar Thomas
Browse files

Some fixes

parent 70d32d07
Pipeline #310872 passed with stage
in 8 minutes and 22 seconds
......@@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 370
versionName "2.35.6"
versionCode 371
versionName "2.35.7"
multiDexEnabled true
renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true
......
Added:
- Silesian localization
Changed:
- Add Silesian in language picker
- Fill status with tag when composing from a search
Fixed:
- Some URLs not clickable
- Empty home timeline
- Some crashes when scrolling
- Question mark bug
\ No newline at end of file
- Some issues with content and URLs
- Some crashes
......@@ -32,6 +32,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
......@@ -42,6 +44,7 @@ import app.fedilab.android.asynctasks.RetrieveFeedsAsyncTask;
import app.fedilab.android.client.APIResponse;
import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.StatusDrawerParams;
import app.fedilab.android.client.Entities.StoredStatus;
import app.fedilab.android.drawers.StatusListAdapter;
import app.fedilab.android.helper.Helper;
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
......@@ -112,6 +115,21 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
swipeRefreshLayout.setColorSchemeColors(
c1, c2, c1
);
FloatingActionButton toot = findViewById(R.id.toot);
toot.setOnClickListener(v -> {
Intent intentToot = new Intent(HashTagActivity.this, TootActivity.class);
Bundle val = new Bundle();
StoredStatus storedStatus = new StoredStatus();
Status tagStatus = new Status();
tagStatus.setVisibility("public");
tagStatus.setContent(HashTagActivity.this, String.format("#%s ", tag));
storedStatus.setStatus(tagStatus);
val.putParcelable("storedStatus", storedStatus);
intentToot.putExtras(val);
startActivity(intentToot);
});
toolbar.setBackgroundColor(ContextCompat.getColor(HashTagActivity.this, R.color.cyanea_primary));
final RecyclerView lv_status = findViewById(R.id.lv_status);
tootsPerPage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);
......
......@@ -109,12 +109,7 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close);
TextView toolbar_title = actionBar.getCustomView().findViewById(R.id.toolbar_title);
toolbar_close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbar_close.setOnClickListener(v -> finish());
if (!forTrends) {
toolbar_title.setText(search);
} else {
......@@ -134,13 +129,11 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
if (item.getItemId() == android.R.id.home) {
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
......
......@@ -92,10 +92,14 @@ public class SlideMediaActivity extends BaseFragmentActivity implements OnDownlo
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
ContentResolver cR = context.getContentResolver();
shareIntent.setType(cR.getType(uri));
try {
startActivity(shareIntent);
} catch (Exception ignored) {
if( cR != null && uri != null) {
shareIntent.setType(cR.getType(uri));
try {
startActivity(shareIntent);
} catch (Exception ignored) {
}
}else {
Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
}
} else {
Toasty.success(context, context.getString(R.string.save_over), Toasty.LENGTH_LONG).show();
......
......@@ -3243,6 +3243,12 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
toot_cw_content.setText("");
toot_cw_content.setVisibility(View.GONE);
}
if( status.getVisibility() == null) {
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
String defaultVisibility = account.isLocked() ? "private" : "public";
String settingsVisibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
status.setVisibility(settingsVisibility);
}
toot_content.setText(content);
toot_space_left.setText(String.valueOf(countLength(social, toot_content, toot_cw_content)));
......
......@@ -2654,7 +2654,8 @@ public class Helper {
public static List<String> restoreArrayFromString(String serializedArray) {
Gson gson = new Gson();
try {
return gson.fromJson(serializedArray, List.class);
Type listType = new TypeToken<ArrayList<String>>() {}.getType();
return gson.fromJson(serializedArray, listType);
} catch (Exception e) {
return null;
}
......
......@@ -78,7 +78,7 @@
android:typeface="serif" />
</RelativeLayout>
<!-- Main Loader -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout
android:id="@+id/loader"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -106,5 +106,14 @@
android:indeterminate="true" />
</RelativeLayout>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/toot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin_floating"
android:contentDescription="@string/toot_it"
android:src="@drawable/ic_edit" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.drawerlayout.widget.DrawerLayout>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment