This commit is contained in:
stom79 2019-02-22 11:29:23 +01:00
parent 61874a59c5
commit 007c0c8c8b
2 changed files with 27 additions and 12 deletions

View File

@ -314,11 +314,20 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface,
toot_emoji.setVisibility(View.GONE); toot_emoji.setVisibility(View.GONE);
} }
if(MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.GNU ) { switch (MainActivity.social){
toot_it.setText(getText(R.string.queet_it)); 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() { drawer_layout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
@ -421,15 +430,20 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface,
if( tootMention != null && urlMention != null && fileMention != null) { if( tootMention != null && urlMention != null && fileMention != null) {
Bitmap pictureMention = BitmapFactory.decodeFile(getCacheDir() + "/" + fileMention); Bitmap pictureMention = BitmapFactory.decodeFile(getCacheDir() + "/" + fileMention);
if (pictureMention != null) { if (pictureMention != null) {
ByteArrayOutputStream bos = new ByteArrayOutputStream(); AsyncTask.execute(new Runnable() {
pictureMention.compress(Bitmap.CompressFormat.PNG, 0, bos); @Override
byte[] bitmapdata = bos.toByteArray(); public void run() {
ByteArrayInputStream bs = new ByteArrayInputStream(bitmapdata); ByteArrayOutputStream bos = new ByteArrayOutputStream();
toot_picture_container.setVisibility(View.VISIBLE); pictureMention.compress(Bitmap.CompressFormat.PNG, 0, bos);
picture_scrollview.setVisibility(View.VISIBLE); byte[] bitmapdata = bos.toByteArray();
toot_picture.setEnabled(false); ByteArrayInputStream bs = new ByteArrayInputStream(bitmapdata);
toot_it.setEnabled(false); toot_picture_container.setVisibility(View.VISIBLE);
new HttpsConnection(TootActivity.this).upload(bs, fileMention, accountReply!=null?accountReply.getToken():null, TootActivity.this); 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_content.setText(String.format("\n\nvia @%s\n\n%s\n\n", tootMention, urlMention));
toot_space_left.setText(String.valueOf(toot_content.length())); toot_space_left.setText(String.valueOf(toot_content.length()));

View File

@ -896,6 +896,7 @@
<string name="tracking_db_updated">The tracking data base has been updated!</string> <string name="tracking_db_updated">The tracking data base has been updated!</string>
<string name="calls_blocked">http calls blocked by the application</string> <string name="calls_blocked">http calls blocked by the application</string>
<string name="list_of_blocked_domains">List of blocked calls</string> <string name="list_of_blocked_domains">List of blocked calls</string>
<string name="submit">Submit</string>
<!-- end languages --> <!-- end languages -->