From 037d10a7db3ca75a60ad5e238a29ab693c71100f Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Thu, 17 Sep 2020 15:11:05 +1000 Subject: [PATCH 01/12] Back button for the base action bar activity. --- .../securesms/BaseActionBarActivity.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/org/thoughtcrime/securesms/BaseActionBarActivity.java b/src/org/thoughtcrime/securesms/BaseActionBarActivity.java index 17e06dfea0..07af397071 100644 --- a/src/org/thoughtcrime/securesms/BaseActionBarActivity.java +++ b/src/org/thoughtcrime/securesms/BaseActionBarActivity.java @@ -12,6 +12,7 @@ import android.os.Build; import android.os.Build.VERSION_CODES; import android.os.Bundle; import androidx.annotation.NonNull; +import androidx.appcompat.app.ActionBar; import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityOptionsCompat; import androidx.localbroadcastmanager.content.LocalBroadcastManager; @@ -42,6 +43,13 @@ public abstract class BaseActionBarActivity extends AppCompatActivity { if (BaseActivity.isMenuWorkaroundRequired()) { forceOverflowMenu(); } + + ActionBar actionBar = getSupportActionBar(); + if (actionBar != null) { + actionBar.setDisplayHomeAsUpEnabled(true); + actionBar.setHomeButtonEnabled(true); + } + super.onCreate(savedInstanceState); } @@ -69,6 +77,14 @@ public abstract class BaseActionBarActivity extends AppCompatActivity { LocalBroadcastManager.getInstance(this).registerReceiver(broadcastReceiver, new IntentFilter("unexpectedDeviceLinkRequestReceived")); } + @Override + public boolean onSupportNavigateUp() { + if (super.onSupportNavigateUp()) return true; + + onBackPressed(); + return true; + } + @Override protected void onDestroy() { LocalBroadcastManager.getInstance(this).unregisterReceiver(broadcastReceiver); From 3deb9602d114d9340cdcab5b192241a05f4b4fd8 Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Thu, 17 Sep 2020 16:56:26 +1000 Subject: [PATCH 02/12] Back button for conversation activity. --- .../conversation_home_touch_highlight.xml | 15 +++++++ .../ic_baseline_arrow_back_compact_24.xml | 10 +++++ res/layout/conversation_activity.xml | 40 ++++++++++++++++--- .../conversation/ConversationActivity.java | 4 ++ 4 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 res/drawable/conversation_home_touch_highlight.xml create mode 100644 res/drawable/ic_baseline_arrow_back_compact_24.xml diff --git a/res/drawable/conversation_home_touch_highlight.xml b/res/drawable/conversation_home_touch_highlight.xml new file mode 100644 index 0000000000..5fbf5ba7d0 --- /dev/null +++ b/res/drawable/conversation_home_touch_highlight.xml @@ -0,0 +1,15 @@ + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable/ic_baseline_arrow_back_compact_24.xml b/res/drawable/ic_baseline_arrow_back_compact_24.xml new file mode 100644 index 0000000000..f632160152 --- /dev/null +++ b/res/drawable/ic_baseline_arrow_back_compact_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/res/layout/conversation_activity.xml b/res/layout/conversation_activity.xml index de99e57802..394ad2d311 100644 --- a/res/layout/conversation_activity.xml +++ b/res/layout/conversation_activity.xml @@ -11,19 +11,47 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + android:clipChildren="false" + android:contentInsetLeft="24dp" + android:contentInsetStart="24dp" app:contentInsetLeft="24dp" - app:contentInsetRight="20dp"> + app:contentInsetStart="24dp" + android:contentInsetRight="20dp" + android:contentInsetEnd="20dp" + app:contentInsetRight="20dp" + app:contentInsetEnd="20dp"> + android:orientation="horizontal" + android:clipChildren="false"> - + + + + + + + handleAddAttachment()); + + homeButtonContainer.setOnClickListener(v -> onSupportNavigateUp()); } protected void initializeActionBar() { From 5147bdfbcb36b46ec83befea461239c8e3aef640 Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Thu, 17 Sep 2020 19:16:29 +1000 Subject: [PATCH 03/12] Search view style cleanup. --- res/values/styles.xml | 4 ++-- res/values/themes.xml | 6 +++--- .../securesms/components/SearchToolbar.java | 10 ++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/res/values/styles.xml b/res/values/styles.xml index 268915c03a..db1af0eab2 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -18,8 +18,8 @@ @dimen/very_large_font_size -