aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-07-30 17:32:18 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-07-30 17:35:08 +0200
commitc6458ba67438378da94742d242dfdf8048d5b51d (patch)
tree1e5e2e36506bd2fbe846eceb019ff380c519d8d9 /app/src/main/java/com/wireguard
parentShow different color for multiselection (diff)
downloadwireguard-android-c6458ba67438378da94742d242dfdf8048d5b51d.tar.xz
wireguard-android-c6458ba67438378da94742d242dfdf8048d5b51d.zip
FloatingActionsMenu: don't wrap context on asus api 21
Works around frameworks bug.
Diffstat (limited to 'app/src/main/java/com/wireguard')
-rw-r--r--app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java
index e71793d9..ca71d712 100644
--- a/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java
+++ b/app/src/main/java/com/wireguard/android/widget/fab/FloatingActionsMenu.java
@@ -17,6 +17,7 @@ import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
+import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Keep;
@@ -392,8 +393,10 @@ public class FloatingActionsMenu extends ViewGroup {
}
}
+ private static final boolean BROKEN_LABEL_STYLE = Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1 && Build.BRAND.equals("ASUS");
+
private void createLabels() {
- final Context context = new ContextThemeWrapper(getContext(), mLabelsStyle);
+ final Context context = BROKEN_LABEL_STYLE ? getContext() : new ContextThemeWrapper(getContext(), mLabelsStyle);
for (int i = 0; i < mButtonsCount; i++) {
final FloatingActionButton button = (FloatingActionButton) getChildAt(i);
@@ -402,7 +405,8 @@ public class FloatingActionsMenu extends ViewGroup {
final String title = ((LabeledFloatingActionButton) button).getTitle();
final AppCompatTextView label = new AppCompatTextView(context);
- label.setTextAppearance(context, mLabelsStyle);
+ if (!BROKEN_LABEL_STYLE)
+ label.setTextAppearance(context, mLabelsStyle);
label.setText(title);
addView(label);