Small fixes UI

This commit is contained in:
androiddevkotlin 2021-04-19 15:05:33 +03:00
parent bd1fbe859e
commit ea553717d8
5 changed files with 49 additions and 14 deletions

View file

@ -83,11 +83,11 @@
android:id="@+id/compound_button" android:id="@+id/compound_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/title_padding"
android:layout_marginRight="@dimen/title_padding"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:scaleType="center" android:scaleType="center"
android:background="@null" android:background="@null"
android:layout_marginEnd="@dimen/dashFavDirectionSize"
android:layout_marginRight="@dimen/dashFavDirectionSize"
android:clickable="false" android:clickable="false"
android:focusable="false" android:focusable="false"
android:visibility="gone" android:visibility="gone"
@ -96,11 +96,9 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/secondary_icon" android:id="@+id/secondary_icon"
android:layout_width="wrap_content" android:layout_width="@dimen/list_item_height"
android:layout_height="wrap_content" android:layout_height="@dimen/list_item_height"
android:scaleType="center" android:scaleType="center"
android:layout_marginEnd="@dimen/title_padding"
android:layout_marginRight="@dimen/title_padding"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:visibility="gone" android:visibility="gone"
tools:src="@drawable/ic_action_import" tools:src="@drawable/ic_action_import"

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/card_row_min_height"
android:background="?attr/list_background_color"
android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_cancel_button_height"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding" />
<net.osmand.plus.widgets.TextViewEx
android:id="@android:id/title"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textColor="@color/preference_category_title"
android:layout_gravity="center_vertical|start"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/plugin_settings"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding" />
</LinearLayout>

View file

@ -6,7 +6,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/list_background_color" android:background="?attr/list_background_color"
android:gravity="center_vertical" android:gravity="center_vertical"
android:minHeight="@dimen/bottom_sheet_list_item_height" android:minHeight="@dimen/bottom_sheet_cancel_button_height_small"
android:orientation="horizontal"> android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView

View file

@ -25,7 +25,7 @@
<PreferenceCategory <PreferenceCategory
android:key="announce_header" android:key="announce_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_title"
android:title="@string/accessibility_announce" /> android:title="@string/accessibility_announce" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
@ -78,7 +78,7 @@
<PreferenceCategory <PreferenceCategory
android:key="user_points_header" android:key="user_points_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_title"
android:title="@string/user_points" /> android:title="@string/user_points" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
@ -103,7 +103,7 @@
<PreferenceCategory <PreferenceCategory
android:key="speed_limit_header" android:key="speed_limit_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_title"
android:title="@string/speak_speed_limit" /> android:title="@string/speak_speed_limit" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
@ -123,7 +123,7 @@
<PreferenceCategory <PreferenceCategory
android:key="options_header" android:key="options_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_title"
android:title="@string/shared_string_options" /> android:title="@string/shared_string_options" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
@ -143,7 +143,7 @@
<PreferenceCategory <PreferenceCategory
android:key="output_header" android:key="output_header"
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_title"
android:title="@string/output" /> android:title="@string/output" />
</PreferenceScreen> </PreferenceScreen>

View file

@ -162,6 +162,7 @@ public class VoiceLanguageBottomSheetFragment extends MenuBottomSheetDialogFragm
LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
BaseBottomSheetItem titleItem = new BottomSheetItemWithDescription.Builder() BaseBottomSheetItem titleItem = new BottomSheetItemWithDescription.Builder()
.setDescription(getString(R.string.language_description)) .setDescription(getString(R.string.language_description))
.setDescriptionColorId(nightMode ? R.color.text_color_primary_dark : R.color.text_color_primary_light)
.setTitle(getString(R.string.shared_string_language)) .setTitle(getString(R.string.shared_string_language))
.setLayoutId(R.layout.bottom_sheet_item_title_with_description) .setLayoutId(R.layout.bottom_sheet_item_title_with_description)
.create(); .create();
@ -253,9 +254,8 @@ public class VoiceLanguageBottomSheetFragment extends MenuBottomSheetDialogFragm
int position = isDefault ? DEFAULT_LANGUAGE_POSITION : -1; int position = isDefault ? DEFAULT_LANGUAGE_POSITION : -1;
final ImageView secondaryIcon = view.findViewById(R.id.secondary_icon); final ImageView secondaryIcon = view.findViewById(R.id.secondary_icon);
int color = ContextCompat.getColor(context, nightMode ? R.color.wikivoyage_active_dark : R.color.wikivoyage_active_light);
int activeColorResId = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light; int activeColorResId = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
secondaryIcon.setColorFilter(color, android.graphics.PorterDuff.Mode.MULTIPLY); secondaryIcon.setColorFilter(ContextCompat.getColor(context, activeColorResId));
final ProgressBar progressBar = view.findViewById(R.id.ProgressBar); final ProgressBar progressBar = view.findViewById(R.id.ProgressBar);
final TextView textDescription = view.findViewById(R.id.description); final TextView textDescription = view.findViewById(R.id.description);