Merge pull request #9615 from osmandapp/fix_material

Fix material theme
This commit is contained in:
Vitaliy 2020-08-11 18:46:45 +03:00 committed by GitHub
commit 44b84bf65d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 16 deletions

View file

@ -16,6 +16,7 @@
android:contentDescription="@string/quick_action_new_action" android:contentDescription="@string/quick_action_new_action"
app:srcCompat="@drawable/ic_action_plus" app:srcCompat="@drawable/ic_action_plus"
app:backgroundTint="?attr/active_color_basic" app:backgroundTint="?attr/active_color_basic"
app:tint="?attr/app_bar_primary_item_color"
app:fabSize="normal" app:fabSize="normal"
app:useCompatPadding="true"/> app:useCompatPadding="true"/>
@ -33,6 +34,7 @@
app:srcCompat="@drawable/ic_action_marker_dark" app:srcCompat="@drawable/ic_action_marker_dark"
android:visibility="gone" android:visibility="gone"
app:backgroundTint="@color/fab_green" app:backgroundTint="@color/fab_green"
app:tint="?attr/app_bar_primary_item_color"
app:fabSize="mini" app:fabSize="mini"
app:useCompatPadding="true" app:useCompatPadding="true"
tools:visibility="visible"/> tools:visibility="visible"/>
@ -78,6 +80,7 @@
app:srcCompat="@drawable/ic_action_markers_dark" app:srcCompat="@drawable/ic_action_markers_dark"
android:visibility="gone" android:visibility="gone"
app:backgroundTint="@color/fab_green" app:backgroundTint="@color/fab_green"
app:tint="?attr/app_bar_primary_item_color"
app:fabSize="mini" app:fabSize="mini"
app:useCompatPadding="true" app:useCompatPadding="true"
tools:visibility="visible"/> tools:visibility="visible"/>
@ -123,6 +126,7 @@
app:srcCompat="@drawable/ic_action_polygom_dark" app:srcCompat="@drawable/ic_action_polygom_dark"
android:visibility="gone" android:visibility="gone"
app:backgroundTint="@color/fab_green" app:backgroundTint="@color/fab_green"
app:tint="?attr/app_bar_primary_item_color"
app:fabSize="mini" app:fabSize="mini"
app:useCompatPadding="true" app:useCompatPadding="true"
tools:visibility="visible"/> tools:visibility="visible"/>

View file

@ -6,17 +6,17 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:background="?attr/bg_color" android:background="?attr/bg_color"
android:minHeight="48dp" android:minHeight="@dimen/card_row_min_height"
android:clickable="false" android:clickable="false"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="@dimen/card_row_min_height"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"> android:paddingEnd="@dimen/content_padding">
<LinearLayout <LinearLayout
android:layout_width="54dp" android:layout_width="54dp"
@ -25,8 +25,8 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="24dp" android:layout_width="@dimen/standard_icon_size"
android:layout_height="24dp" android:layout_height="@dimen/standard_icon_size"
osmand:srcCompat="@drawable/ic_action_search_dark"/> osmand:srcCompat="@drawable/ic_action_search_dark"/>
</LinearLayout> </LinearLayout>
@ -107,6 +107,6 @@
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginLeft="54dp" android:layout_marginLeft="54dp"
android:background="?attr/dashboard_divider" android:background="?attr/dashboard_divider"
android:layout_marginStart="54dp" /> android:layout_marginStart="54dp" />
</LinearLayout> </LinearLayout>

View file

@ -44,7 +44,7 @@
<dimen name="subHeaderPadding">2dp</dimen> <dimen name="subHeaderPadding">2dp</dimen>
<dimen name="subHeaderMarginLeft">15dp</dimen> <dimen name="subHeaderMarginLeft">15dp</dimen>
<dimen name = "subHeaderMarginRight">15dp</dimen> <dimen name="subHeaderMarginRight">15dp</dimen>
<dimen name="showAllButtonMarginRight">14dp</dimen> <dimen name="showAllButtonMarginRight">14dp</dimen>
<dimen name="showAllButtonHeight">36dp</dimen> <dimen name="showAllButtonHeight">36dp</dimen>
<dimen name="dashFavIconSize">28dp</dimen> <dimen name="dashFavIconSize">28dp</dimen>
@ -396,4 +396,7 @@
<dimen name="info_description_line_spacing_multiplier" format="float">1.4</dimen> <dimen name="info_description_line_spacing_multiplier" format="float">1.4</dimen>
<dimen name="screen_alert_big_warning_icon_size">92dp</dimen> <dimen name="screen_alert_big_warning_icon_size">92dp</dimen>
<dimen name="radioButtonSize">32dp</dimen>
<dimen name="checkBoxSize">24dp</dimen>
</resources> </resources>

View file

@ -240,6 +240,8 @@
<item name="btn_radio_button_left">@drawable/radio_button_left_light</item> <item name="btn_radio_button_left">@drawable/radio_button_left_light</item>
<item name="btn_radio_button_right">@drawable/radio_button_right_light</item> <item name="btn_radio_button_right">@drawable/radio_button_right_light</item>
<item name="btn_radio_button_center">@drawable/radio_button_center_light</item> <item name="btn_radio_button_center">@drawable/radio_button_center_light</item>
<item name="checkboxStyle">@style/CheckboxStyle</item>
<item name="radioButtonStyle">@style/RadioButtonStyle</item>
</style> </style>
<style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> <style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar">
@ -284,9 +286,10 @@
</style> </style>
<style name="OsmandLightTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout"> <style name="OsmandLightTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout">
<item name="android:textColorPrimary">@color/osmand_orange</item> <item name="tabIndicatorColor">@color/app_bar_main_light</item>
<item name="tabTextColor">@color/osmand_orange</item> <item name="tabTextColor">@color/text_color_secondary_light</item>
<item name="colorAccent">@color/osmand_orange</item> <item name="colorAccent">@color/osmand_orange</item>
<item name="tabSelectedTextColor">@color/osmand_orange</item>
<item name="android:textColorSecondary">@color/text_color_secondary_light</item> <item name="android:textColorSecondary">@color/text_color_secondary_light</item>
<item name="android:textColorHint">@color/text_color_secondary_light</item> <item name="android:textColorHint">@color/text_color_secondary_light</item>
</style> </style>
@ -313,10 +316,10 @@
</style> </style>
<style name="OsmandDarkTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout"> <style name="OsmandDarkTheme.SearchTabbar" parent="Widget.MaterialComponents.TabLayout">
<item name="android:textColorPrimary">@color/osmand_orange</item> <item name="tabIndicatorColor">@color/app_bar_main_light</item>
<item name="tabIndicatorColor">@color/osmand_orange</item> <item name="tabTextColor">@color/text_color_secondary_dark</item>
<item name="tabTextColor">@color/osmand_orange</item>
<item name="colorAccent">@color/osmand_orange</item> <item name="colorAccent">@color/osmand_orange</item>
<item name="tabSelectedTextColor">@color/osmand_orange</item>
<item name="android:textColorSecondary">@color/text_color_secondary_dark</item> <item name="android:textColorSecondary">@color/text_color_secondary_dark</item>
<item name="android:textColorHint">@color/text_color_secondary_dark</item> <item name="android:textColorHint">@color/text_color_secondary_dark</item>
</style> </style>
@ -530,6 +533,8 @@
<item name="btn_radio_button_left">@drawable/radio_button_left_dark</item> <item name="btn_radio_button_left">@drawable/radio_button_left_dark</item>
<item name="btn_radio_button_right">@drawable/radio_button_right_dark</item> <item name="btn_radio_button_right">@drawable/radio_button_right_dark</item>
<item name="btn_radio_button_center">@drawable/radio_button_center_dark</item> <item name="btn_radio_button_center">@drawable/radio_button_center_dark</item>
<item name="checkboxStyle">@style/CheckboxStyle</item>
<item name="radioButtonStyle">@style/RadioButtonStyle</item>
</style> </style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme"> <style name="FreeVersionBanner" parent="OsmandDarkTheme">
@ -580,6 +585,16 @@
<item name="elevation">0dp</item> <item name="elevation">0dp</item>
</style> </style>
<style name="CheckboxStyle" parent="Widget.AppCompat.CompoundButton.CheckBox">
<item name="android:height">@dimen/checkBoxSize</item>
<item name="android:width">@dimen/checkBoxSize</item>
</style>
<style name="RadioButtonStyle" parent="Widget.AppCompat.CompoundButton.RadioButton">
<item name="android:height">@dimen/radioButtonSize</item>
<item name="android:width">@dimen/radioButtonSize</item>
</style>
<style name="Widget.Styled.LightActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"> <style name="Widget.Styled.LightActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">@color/color_white</item> <item name="android:textColor">@color/color_white</item>
</style> </style>

View file

@ -22,8 +22,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.material.textfield.MaterialAutoCompleteTextView;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
@ -215,7 +213,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
public void addTagView(String tg, String vl) { public void addTagView(String tg, String vl) {
View convertView = LayoutInflater.from(linearLayout.getContext()) View convertView = LayoutInflater.from(linearLayout.getContext())
.inflate(R.layout.poi_tag_list_item, null, false); .inflate(R.layout.poi_tag_list_item, null, false);
final MaterialAutoCompleteTextView tagEditText = convertView.findViewById(R.id.tagEditText); final AutoCompleteTextView tagEditText = convertView.findViewById(R.id.tagEditText);
ImageButton deleteItemImageButton = ImageButton deleteItemImageButton =
(ImageButton) convertView.findViewById(R.id.deleteItemImageButton); (ImageButton) convertView.findViewById(R.id.deleteItemImageButton);
deleteItemImageButton.setImageDrawable(deleteDrawable); deleteItemImageButton.setImageDrawable(deleteDrawable);
@ -227,7 +225,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
editPoiData.removeTag(tagEditText.getText().toString()); editPoiData.removeTag(tagEditText.getText().toString());
} }
}); });
final MaterialAutoCompleteTextView valueEditText = convertView.findViewById(R.id.valueEditText); final AutoCompleteTextView valueEditText = convertView.findViewById(R.id.valueEditText);
valueEditText.setFilters(new InputFilter[]{ valueEditText.setFilters(new InputFilter[]{
new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH) new InputFilter.LengthFilter(AMENITY_TEXT_LENGTH)
}); });