From a95e279e4e1db313976bd2b112b4e0ea699a4fb7 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 6 Mar 2018 18:37:23 +0100 Subject: [PATCH] Disable alpha for bottom buttons Signed-off-by: Mario Danic --- .../nextcloud/talk/utils/KeyboardUtils.java | 45 +++++++++---------- app/src/main/res/layout/bottom_buttons.xml | 3 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/utils/KeyboardUtils.java b/app/src/main/java/com/nextcloud/talk/utils/KeyboardUtils.java index 71dc8eade..0e6e68e86 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/KeyboardUtils.java +++ b/app/src/main/java/com/nextcloud/talk/utils/KeyboardUtils.java @@ -32,30 +32,6 @@ import android.view.inputmethod.InputMethodManager; public class KeyboardUtils { private View decorView; private View contentView; - - public KeyboardUtils(Activity act, View contentView) { - this.decorView = act.getWindow().getDecorView(); - this.contentView = contentView; - - //only required on newer android versions. it was working on API level 19 - if (Build.VERSION.SDK_INT >= 19) { - decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener); - } - } - - public void enable() { - if (Build.VERSION.SDK_INT >= 19) { - decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener); - } - } - - public void disable() { - if (Build.VERSION.SDK_INT >= 19) { - decorView.getViewTreeObserver().removeOnGlobalLayoutListener(onGlobalLayoutListener); - } - } - - //a small helper to allow showing the editText focus ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { @Override @@ -86,6 +62,15 @@ public class KeyboardUtils { } }; + public KeyboardUtils(Activity act, View contentView) { + this.decorView = act.getWindow().getDecorView(); + this.contentView = contentView; + + //only required on newer android versions. it was working on API level 19 + if (Build.VERSION.SDK_INT >= 19) { + decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener); + } + } /** * Helper to hide the keyboard @@ -98,4 +83,16 @@ public class KeyboardUtils { inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0); } } + + public void enable() { + if (Build.VERSION.SDK_INT >= 19) { + decorView.getViewTreeObserver().addOnGlobalLayoutListener(onGlobalLayoutListener); + } + } + + public void disable() { + if (Build.VERSION.SDK_INT >= 19) { + decorView.getViewTreeObserver().removeOnGlobalLayoutListener(onGlobalLayoutListener); + } + } } diff --git a/app/src/main/res/layout/bottom_buttons.xml b/app/src/main/res/layout/bottom_buttons.xml index 191b4da7a..5c1b36d93 100644 --- a/app/src/main/res/layout/bottom_buttons.xml +++ b/app/src/main/res/layout/bottom_buttons.xml @@ -23,10 +23,9 @@ android:id="@+id/bottom_buttons_layout" android:layout_width="match_parent" android:layout_height="48dp" - android:alpha="0.7" + android:layout_gravity="bottom" android:animateLayoutChanges="true" android:gravity="bottom" - android:layout_gravity="bottom" android:orientation="horizontal" android:visibility="visible">