From 5fe1a289547fb4cf36b256ded6b1badbc330e0f5 Mon Sep 17 00:00:00 2001 From: McLoo Date: Fri, 31 Jul 2015 15:22:07 +0200 Subject: [PATCH] Fix broken multiple contact selection Increased tap area of action button too Closes #3855 --- res/layout/contact_selection_activity.xml | 94 ++++++++++--------- .../securesms/ContactSelectionActivity.java | 20 ++-- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/res/layout/contact_selection_activity.xml b/res/layout/contact_selection_activity.xml index 98719b0a98..5d30ff92f5 100644 --- a/res/layout/contact_selection_activity.xml +++ b/res/layout/contact_selection_activity.xml @@ -26,56 +26,62 @@ android:background="@drawable/circle_touch_highlight_background" android:src="@drawable/ic_search_white_24dp" /> - + - + - + - + + - + - + + + diff --git a/src/org/thoughtcrime/securesms/ContactSelectionActivity.java b/src/org/thoughtcrime/securesms/ContactSelectionActivity.java index 04a9c0ede2..ff7f43d078 100644 --- a/src/org/thoughtcrime/securesms/ContactSelectionActivity.java +++ b/src/org/thoughtcrime/securesms/ContactSelectionActivity.java @@ -30,6 +30,7 @@ import android.view.TouchDelegate; import android.view.View; import android.widget.EditText; import android.widget.ImageView; +import android.widget.LinearLayout; import org.thoughtcrime.securesms.components.AnimatingToggle; import org.thoughtcrime.securesms.crypto.MasterSecret; @@ -67,6 +68,7 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB private ImageView keyboardToggle; private ImageView dialpadToggle; private ImageView clearToggle; + private LinearLayout toggleContainer; @Override protected void onPreCreate() { @@ -99,12 +101,13 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB } private void initializeResources() { - this.action = (ImageView) findViewById(R.id.action_icon); - this.searchText = (EditText) findViewById(R.id.search_view); - this.toggle = (AnimatingToggle) findViewById(R.id.button_toggle); - this.keyboardToggle = (ImageView) findViewById(R.id.search_keyboard); - this.dialpadToggle = (ImageView) findViewById(R.id.search_dialpad); - this.clearToggle = (ImageView) findViewById(R.id.search_clear); + this.action = (ImageView) findViewById(R.id.action_icon); + this.searchText = (EditText) findViewById(R.id.search_view); + this.toggle = (AnimatingToggle) findViewById(R.id.button_toggle); + this.keyboardToggle = (ImageView) findViewById(R.id.search_keyboard); + this.dialpadToggle = (ImageView) findViewById(R.id.search_dialpad); + this.clearToggle = (ImageView) findViewById(R.id.search_clear); + this.toggleContainer = (LinearLayout) findViewById(R.id.toggle_container); contactsFragment = (ContactSelectionListFragment) getSupportFragmentManager().findFragmentById(R.id.contact_selection_list_fragment); contactsFragment.setOnContactSelectedListener(this); @@ -138,7 +141,8 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB } }); - expandTapArea(toolbar, dialpadToggle, 500); + expandTapArea(toolbar, action, 500); + expandTapArea(toggleContainer, dialpadToggle, 500); } private void initializeSearch() { @@ -174,7 +178,7 @@ public abstract class ContactSelectionActivity extends PassphraseRequiredActionB private void displayTogglingView(View view) { toggle.display(view); - expandTapArea(toolbar, view, 500); + expandTapArea(toggleContainer, view, 500); } private void expandTapArea(final View container, final View child, final int padding) {