From 4f2970b7311c2ba20dfc09e182ee343c36ef86a9 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Tue, 19 Feb 2019 15:10:09 +0100 Subject: [PATCH] Add shadow and improve text quality on widgets --- .../vrbrowser/ui/widgets/MenuWidget.java | 3 +++ .../ui/widgets/SuggestionsWidget.java | 4 +++- app/src/main/res/layout/honeycomb_button.xml | 1 + app/src/main/res/layout/settings.xml | 2 ++ app/src/main/res/values/colors.xml | 2 ++ app/src/main/res/values/dimen.xml | 2 +- app/src/main/res/values/styles.xml | 18 ++++++++++++++++++ 7 files changed, 30 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MenuWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MenuWidget.java index a47b87586f..5fcc928c82 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MenuWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/MenuWidget.java @@ -7,6 +7,7 @@ package org.mozilla.vrbrowser.ui.widgets; import android.content.Context; +import android.graphics.Color; import android.graphics.drawable.Drawable; import android.view.LayoutInflater; import android.view.MotionEvent; @@ -158,11 +159,13 @@ public boolean onHover(View view, MotionEvent event) { case MotionEvent.ACTION_HOVER_ENTER: view.setHovered(true); label.setHovered(true); + label.setShadowLayer(label.getShadowRadius(), label.getShadowDx(), label.getShadowDy(), getContext().getColor(R.color.text_shadow_light)); image.setHovered(true); return true; case MotionEvent.ACTION_HOVER_EXIT: view.setHovered(false); + label.setShadowLayer(label.getShadowRadius(), label.getShadowDx(), label.getShadowDy(), getContext().getColor(R.color.text_shadow)); label.setHovered(false); image.setHovered(false); return true; diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/SuggestionsWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/SuggestionsWidget.java index 15a7655003..544107e43e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/SuggestionsWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/SuggestionsWidget.java @@ -345,7 +345,7 @@ public View getView(int position, View convertView, ViewGroup parent) { return false; View favicon = view.findViewById(R.id.favicon); - View title = view.findViewById(R.id.title); + TextView title = view.findViewById(R.id.title); View url = view.findViewById(R.id.url); View delete = view.findViewById(R.id.delete); int ev = motionEvent.getActionMasked(); @@ -354,6 +354,7 @@ public View getView(int position, View convertView, ViewGroup parent) { view.setHovered(true); favicon.setHovered(true); title.setHovered(true); + title.setShadowLayer(title.getShadowRadius(), title.getShadowDx(), title.getShadowDy(), getContext().getColor(R.color.text_shadow_light)); url.setHovered(true); delete.setHovered(true); return true; @@ -362,6 +363,7 @@ public View getView(int position, View convertView, ViewGroup parent) { view.setHovered(false); favicon.setHovered(false); title.setHovered(false); + title.setShadowLayer(title.getShadowRadius(), title.getShadowDx(), title.getShadowDy(), getContext().getColor(R.color.text_shadow)); url.setHovered(false); delete.setHovered(false); return true; diff --git a/app/src/main/res/layout/honeycomb_button.xml b/app/src/main/res/layout/honeycomb_button.xml index c2affc3305..d2444d06d8 100644 --- a/app/src/main/res/layout/honeycomb_button.xml +++ b/app/src/main/res/layout/honeycomb_button.xml @@ -36,6 +36,7 @@ android:fontFamily="sans-serif-light" android:gravity="center" android:text="Secondary text" + android:textStyle="bold" android:textSize="@dimen/text_smaller_size" /> diff --git a/app/src/main/res/layout/settings.xml b/app/src/main/res/layout/settings.xml index 0657a00693..a880cf58b2 100644 --- a/app/src/main/res/layout/settings.xml +++ b/app/src/main/res/layout/settings.xml @@ -35,6 +35,7 @@ android:layout_gravity="center" android:layout_marginTop="5dp" android:fontFamily="sans-serif-light" + android:textStyle="bold" android:gravity="center" android:text="@string/settings_version" android:textColor="@color/white" @@ -49,6 +50,7 @@ android:layout_gravity="center" android:layout_marginTop="0dp" android:fontFamily="sans-serif-light" + android:textStyle="bold" android:gravity="center" android:text="@string/settings_version_developer" android:textColor="@color/white" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 7d579cacdd..259f0ddef7 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -24,4 +24,6 @@ #5d5d5d #8c898a #d73e5a + #8F000000 + #7FFFFFFF diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml index a132583c6e..b16a0b69ea 100644 --- a/app/src/main/res/values/dimen.xml +++ b/app/src/main/res/values/dimen.xml @@ -136,7 +136,7 @@ 18sp 14sp 12sp - 10sp + 11sp 4 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 72924fe956..4011a032ce 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -16,6 +16,21 @@ + + + + +