Fix crashes & improve GNUSocial urls

This commit is contained in:
stom79 2019-02-06 14:59:52 +01:00
parent 0c62d37574
commit 893928985a
3 changed files with 22 additions and 7 deletions

View File

@ -2517,12 +2517,16 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
imageView.setOnClickListener(new View.OnClickListener() { imageView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Intent intent = new Intent(context, MediaActivity.class); if( attachment.getType().equals("web")){
Bundle b = new Bundle(); Helper.openBrowser(context, attachment.getUrl());
intent.putParcelableArrayListExtra("mediaArray", status.getMedia_attachments()); }else {
b.putInt("position", finalPosition); Intent intent = new Intent(context, MediaActivity.class);
intent.putExtras(b); Bundle b = new Bundle();
context.startActivity(intent); intent.putParcelableArrayListExtra("mediaArray", status.getMedia_attachments());
b.putInt("position", finalPosition);
intent.putExtras(b);
context.startActivity(intent);
}
} }
}); });
i++; i++;

View File

@ -2938,7 +2938,9 @@ public class Helper {
try { try {
takenImage = MediaStore.Images.Media.getBitmap(context.getContentResolver(), uriFile); takenImage = MediaStore.Images.Media.getBitmap(context.getContentResolver(), uriFile);
} catch (IOException e) { } catch (IOException e) {
Toasty.error(context, context.getString(R.string.toast_error),Toast.LENGTH_LONG).show(); try {
Toasty.error(context, context.getString(R.string.toast_error), Toast.LENGTH_LONG).show();
}catch (Exception ignored){};
return null; return null;
} }
ExifInterface exif = null; ExifInterface exif = null;

View File

@ -156,6 +156,15 @@
android:id="@+id/account_type" android:id="@+id/account_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="5dp"
android:visibility="gone"
android:textColor="@color/mastodonC4"
android:background="@drawable/blue_border"
android:text="@string/bot"
android:id="@+id/account_bot"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView <TextView
android:id="@+id/temp_mute" android:id="@+id/temp_mute"
android:visibility="gone" android:visibility="gone"