mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 16:55:03 +01:00
Disable alpha for bottom buttons
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
c74a71c599
commit
a95e279e4e
@ -32,30 +32,6 @@ import android.view.inputmethod.InputMethodManager;
|
|||||||
public class KeyboardUtils {
|
public class KeyboardUtils {
|
||||||
private View decorView;
|
private View decorView;
|
||||||
private View contentView;
|
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
|
//a small helper to allow showing the editText focus
|
||||||
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
|
ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
@Override
|
@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
|
* Helper to hide the keyboard
|
||||||
@ -98,4 +83,16 @@ public class KeyboardUtils {
|
|||||||
inputMethodManager.hideSoftInputFromWindow(act.getCurrentFocus().getWindowToken(), 0);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,9 @@
|
|||||||
android:id="@+id/bottom_buttons_layout"
|
android:id="@+id/bottom_buttons_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:alpha="0.7"
|
android:layout_gravity="bottom"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user