mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-11 08:27:50 -04:00
Improve back to top button redability in night mode
This commit is contained in:
parent
0e0c90080e
commit
5d7713fe59
@ -486,6 +486,24 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
|
|||||||
pageBottomTabLayout.addOnTabSelectedListener(pageBottomTabListener);
|
pageBottomTabLayout.addOnTabSelectedListener(pageBottomTabListener);
|
||||||
|
|
||||||
wasHideToolbar = isHideToolbar;
|
wasHideToolbar = isHideToolbar;
|
||||||
|
|
||||||
|
if (nightMode) {
|
||||||
|
backToTopAppearNightly();
|
||||||
|
} else {
|
||||||
|
backToTopAppearDaily();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void backToTopAppearDaily() {
|
||||||
|
backToTopButton.getBackground().setAlpha((int) (0.6 * 255));
|
||||||
|
backToTopButton.setBackgroundColor(getResources().getColor(R.color.back_to_top_background));
|
||||||
|
backToTopButton.setTextColor(getResources().getColor(R.color.back_to_top_text));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void backToTopAppearNightly() {
|
||||||
|
backToTopButton.getBackground().setAlpha((int) (0.7 * 255));
|
||||||
|
backToTopButton.setBackgroundColor(getResources().getColor(R.color.back_to_top_background_night));
|
||||||
|
backToTopButton.setTextColor(getResources().getColor(R.color.back_to_top_text_night));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initPlayStoreUri() {
|
private void initPlayStoreUri() {
|
||||||
@ -1278,6 +1296,8 @@ public class KiwixMobileActivity extends BaseActivity implements WebViewCallback
|
|||||||
|
|
||||||
}
|
}
|
||||||
updateWidgets(this);
|
updateWidgets(this);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -58,10 +58,10 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:background="#DDFFFFFF"
|
android:background="@color/back_to_top_background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/button_backtotop"
|
android:text="@string/button_backtotop"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@color/back_to_top_text"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
@ -22,4 +22,8 @@
|
|||||||
<color name="grey">#5a5a5a</color>
|
<color name="grey">#5a5a5a</color>
|
||||||
<color name="blue_grey">#ECEFF1</color>
|
<color name="blue_grey">#ECEFF1</color>
|
||||||
<color name="foreground_material_dark">@android:color/white</color>
|
<color name="foreground_material_dark">@android:color/white</color>
|
||||||
|
<color name="back_to_top_background">#DDFFFFFF</color>
|
||||||
|
<color name="back_to_top_text">@android:color/black</color>
|
||||||
|
<color name="back_to_top_background_night">#FF000000</color>
|
||||||
|
<color name="back_to_top_text_night">#FFFFFFFF</color>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user