diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java index a21527474..b4a9cbf01 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java @@ -314,11 +314,20 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface, toot_emoji.setVisibility(View.GONE); } - if(MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.GNU ) { - toot_it.setText(getText(R.string.queet_it)); + switch (MainActivity.social){ + case GNU: + toot_it.setText(getText(R.string.queet_it)); + break; + case PLEROMA: + toot_it.setText(getText(R.string.submit)); + break; + case FRIENDICA: + toot_it.setText(getText(R.string.share)); + break; + default: + toot_it.setText(getText(R.string.toot_it)); } - drawer_layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { @@ -421,15 +430,20 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface, if( tootMention != null && urlMention != null && fileMention != null) { Bitmap pictureMention = BitmapFactory.decodeFile(getCacheDir() + "/" + fileMention); if (pictureMention != null) { - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - pictureMention.compress(Bitmap.CompressFormat.PNG, 0, bos); - byte[] bitmapdata = bos.toByteArray(); - ByteArrayInputStream bs = new ByteArrayInputStream(bitmapdata); - toot_picture_container.setVisibility(View.VISIBLE); - picture_scrollview.setVisibility(View.VISIBLE); - toot_picture.setEnabled(false); - toot_it.setEnabled(false); - new HttpsConnection(TootActivity.this).upload(bs, fileMention, accountReply!=null?accountReply.getToken():null, TootActivity.this); + AsyncTask.execute(new Runnable() { + @Override + public void run() { + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + pictureMention.compress(Bitmap.CompressFormat.PNG, 0, bos); + byte[] bitmapdata = bos.toByteArray(); + ByteArrayInputStream bs = new ByteArrayInputStream(bitmapdata); + toot_picture_container.setVisibility(View.VISIBLE); + picture_scrollview.setVisibility(View.VISIBLE); + toot_picture.setEnabled(false); + toot_it.setEnabled(false); + new HttpsConnection(TootActivity.this).upload(bs, fileMention, accountReply!=null?accountReply.getToken():null, TootActivity.this); + } + }); } toot_content.setText(String.format("\n\nvia @%s\n\n%s\n\n", tootMention, urlMention)); toot_space_left.setText(String.valueOf(toot_content.length())); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bdb59f866..e470b77ff 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -896,6 +896,7 @@ The tracking data base has been updated! http calls blocked by the application List of blocked calls + Submit