Some fixes

This commit is contained in:
Thomas 2020-06-08 17:59:12 +02:00
parent 70d32d07a9
commit 8841d900ad
8 changed files with 54 additions and 28 deletions

View File

@ -6,8 +6,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 29 targetSdkVersion 29
versionCode 370 versionCode 371
versionName "2.35.6" versionName "2.35.7"
multiDexEnabled true multiDexEnabled true
renderscriptTargetApi 28 as int renderscriptTargetApi 28 as int
renderscriptSupportModeEnabled true renderscriptSupportModeEnabled true

View File

@ -1,11 +1,6 @@
Added: Added:
- Silesian localization - Fill status with tag when composing from a search
Changed:
- Add Silesian in language picker
Fixed: Fixed:
- Some URLs not clickable - Some issues with content and URLs
- Empty home timeline - Some crashes
- Some crashes when scrolling
- Question mark bug

View File

@ -32,6 +32,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; 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.APIResponse;
import app.fedilab.android.client.Entities.Status; import app.fedilab.android.client.Entities.Status;
import app.fedilab.android.client.Entities.StatusDrawerParams; import app.fedilab.android.client.Entities.StatusDrawerParams;
import app.fedilab.android.client.Entities.StoredStatus;
import app.fedilab.android.drawers.StatusListAdapter; import app.fedilab.android.drawers.StatusListAdapter;
import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.Helper;
import app.fedilab.android.interfaces.OnRetrieveFeedsInterface; import app.fedilab.android.interfaces.OnRetrieveFeedsInterface;
@ -112,6 +115,21 @@ public class HashTagActivity extends BaseActivity implements OnRetrieveFeedsInte
swipeRefreshLayout.setColorSchemeColors( swipeRefreshLayout.setColorSchemeColors(
c1, c2, c1 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)); toolbar.setBackgroundColor(ContextCompat.getColor(HashTagActivity.this, R.color.cyanea_primary));
final RecyclerView lv_status = findViewById(R.id.lv_status); final RecyclerView lv_status = findViewById(R.id.lv_status);
tootsPerPage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE); tootsPerPage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);

View File

@ -109,12 +109,7 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close); ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close);
TextView toolbar_title = actionBar.getCustomView().findViewById(R.id.toolbar_title); TextView toolbar_title = actionBar.getCustomView().findViewById(R.id.toolbar_title);
toolbar_close.setOnClickListener(new View.OnClickListener() { toolbar_close.setOnClickListener(v -> finish());
@Override
public void onClick(View v) {
finish();
}
});
if (!forTrends) { if (!forTrends) {
toolbar_title.setText(search); toolbar_title.setText(search);
} else { } else {
@ -134,13 +129,11 @@ public class SearchResultActivity extends BaseActivity implements OnRetrieveSear
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { if (item.getItemId() == android.R.id.home) {
case android.R.id.home: finish();
finish(); return true;
return true;
default:
return super.onOptionsItemSelected(item);
} }
return super.onOptionsItemSelected(item);
} }

View File

@ -92,10 +92,14 @@ public class SlideMediaActivity extends BaseFragmentActivity implements OnDownlo
Intent shareIntent = new Intent(Intent.ACTION_SEND); Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uri); shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
ContentResolver cR = context.getContentResolver(); ContentResolver cR = context.getContentResolver();
shareIntent.setType(cR.getType(uri)); if( cR != null && uri != null) {
try { shareIntent.setType(cR.getType(uri));
startActivity(shareIntent); try {
} catch (Exception ignored) { startActivity(shareIntent);
} catch (Exception ignored) {
}
}else {
Toasty.error(context, context.getString(R.string.toast_error), Toasty.LENGTH_LONG).show();
} }
} else { } else {
Toasty.success(context, context.getString(R.string.save_over), Toasty.LENGTH_LONG).show(); Toasty.success(context, context.getString(R.string.save_over), Toasty.LENGTH_LONG).show();

View File

@ -3243,6 +3243,12 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
toot_cw_content.setText(""); toot_cw_content.setText("");
toot_cw_content.setVisibility(View.GONE); 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_content.setText(content);
toot_space_left.setText(String.valueOf(countLength(social, toot_content, toot_cw_content))); toot_space_left.setText(String.valueOf(countLength(social, toot_content, toot_cw_content)));

View File

@ -2654,7 +2654,8 @@ public class Helper {
public static List<String> restoreArrayFromString(String serializedArray) { public static List<String> restoreArrayFromString(String serializedArray) {
Gson gson = new Gson(); Gson gson = new Gson();
try { try {
return gson.fromJson(serializedArray, List.class); Type listType = new TypeToken<ArrayList<String>>() {}.getType();
return gson.fromJson(serializedArray, listType);
} catch (Exception e) { } catch (Exception e) {
return null; return null;
} }

View File

@ -78,7 +78,7 @@
android:typeface="serif" /> android:typeface="serif" />
</RelativeLayout> </RelativeLayout>
<!-- Main Loader --> <!-- Main Loader -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout
android:id="@+id/loader" android:id="@+id/loader"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -106,5 +106,14 @@
android:indeterminate="true" /> android:indeterminate="true" />
</RelativeLayout> </RelativeLayout>
</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.coordinatorlayout.widget.CoordinatorLayout>
</androidx.drawerlayout.widget.DrawerLayout> </androidx.drawerlayout.widget.DrawerLayout>