ui tweaks

This commit is contained in:
madwasp79 2019-07-02 11:11:22 +03:00
parent 36672ba7db
commit 50ea24a893
3 changed files with 21 additions and 13 deletions

View file

@ -102,27 +102,32 @@
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/bg_shadow_list_bottom"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/selector_shadow"
android:layout_width="match_parent"
android:layout_height="@dimen/abp__shadow_height"
android:src="@drawable/preference_activity_action_bar_shadow"
android:visibility="invisible"/>
<ImageView
android:id="@+id/shadowView"
android:layout_width="match_parent"
android:layout_height="@dimen/abp__shadow_height"
android:src="@drawable/preference_activity_action_bar_shadow"
tools:ignore="ContentDescription" />
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/shadowView"
android:layout_width="match_parent"
android:layout_height="@dimen/abp__shadow_height"
android:src="@drawable/preference_activity_action_bar_shadow"
tools:ignore="ContentDescription" />
</FrameLayout>
</LinearLayout>

View file

@ -333,6 +333,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
if (profileSettings) {
modes.clear();
findViewById(R.id.selector_shadow).setVisibility(View.VISIBLE);
for (ApplicationMode a : ApplicationMode.values(app)) {
if (a != ApplicationMode.DEFAULT) {
modes.add(a);

View file

@ -122,11 +122,13 @@ public class AppModeDialog {
View tb = buttons[i];
final ApplicationMode mode = visible.get(i);
final boolean checked = selected.contains(mode);
final View selection = tb.findViewById(R.id.selection);
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
if (checked) {
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)));
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_checked)));
tb.findViewById(R.id.selection).setVisibility(View.VISIBLE);
selection.setBackgroundResource(mode.getIconColorInfo().getColor(nightMode));
selection.setVisibility(View.VISIBLE);
} else {
if (useMapTheme) {
iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getIconRes(), mode.getIconColorInfo().getColor(nightMode)));
@ -135,7 +137,7 @@ public class AppModeDialog {
iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getIconRes()));
}
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_unchecked)));
tb.findViewById(R.id.selection).setVisibility(View.INVISIBLE);
selection.setVisibility(View.INVISIBLE);
}
iv.setOnClickListener(new View.OnClickListener() {