From b92900bda1b2d8822889a6474530fd953f31bbe2 Mon Sep 17 00:00:00 2001 From: Zachary Epps Date: Mon, 10 Apr 2017 10:23:44 -0400 Subject: [PATCH] actually added the other files, whoops --- .../keylesspalace/tusky/ComposeActivity.java | 14 +++- app/src/main/res/layout/activity_compose.xml | 71 +++++++++++-------- 2 files changed, 53 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index d5b5f10bb..e7bbf2de1 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -28,6 +28,7 @@ import android.content.res.Resources; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.graphics.PorterDuff; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.media.MediaMetadataRetriever; @@ -69,6 +70,7 @@ import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.ProgressBar; import android.widget.RelativeLayout; import android.widget.TextView; @@ -119,6 +121,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag private Button floatingBtn; private ImageButton pickBtn; private Button nsfwBtn; + private ProgressBar postProgress; private static class QueuedMedia { enum Type { @@ -338,11 +341,17 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag floatingBtn = (Button) findViewById(R.id.floating_btn); pickBtn = (ImageButton) findViewById(R.id.compose_photo_pick); nsfwBtn = (Button) findViewById(R.id.action_toggle_nsfw); - ImageButton visibilityBtn = (ImageButton) findViewById(R.id.action_toggle_visibility); + final ImageButton visibilityBtn = (ImageButton) findViewById(R.id.action_toggle_visibility); floatingBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { + pickBtn.setClickable(false); + nsfwBtn.setClickable(false); + visibilityBtn.setClickable(false); + floatingBtn.setEnabled(false); + + postProgress.setVisibility(View.VISIBLE); sendStatus(); } }); @@ -392,6 +401,8 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag startingHideText = false; } + postProgress = (ProgressBar) findViewById(R.id.postProgress); + postProgress.setVisibility(View.INVISIBLE); updateNsfwButtonColor(); String[] mentionedUsernames = null; @@ -802,6 +813,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFrag } private void onSendFailure() { + postProgress.setVisibility(View.INVISIBLE); textEditor.setError(getString(R.string.error_generic)); statusAlreadyInFlight = false; } diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index e3620fef3..fd3dd7982 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -18,6 +18,43 @@ android:background="@android:color/transparent" android:elevation="4dp" /> + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - -