Merge pull request #5308 from osmandapp/WikivoyageFixes

fixed attr in xml drawables
This commit is contained in:
Alexander Sytnyk 2018-04-30 18:29:57 +03:00 committed by GitHub
commit 1a06ec78d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 88 additions and 36 deletions

View file

@ -5,8 +5,8 @@
</item>
<item>
<shape>
<stroke android:color="?attr/wikivoyage_active_color" android:width="1dp"/>
<solid android:color="?attr/wikivoyage_card_bg_color"/>
<stroke android:color="@color/wikivoyage_active_dark" android:width="1dp"/>
<solid android:color="@color/wikivoyage_card_bg_dark"/>
<corners android:radius="3dp"/>
</shape>
</item>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<nine-patch android:src="@drawable/bg_card_shadow_cr3dp"/>
</item>
<item>
<shape>
<stroke android:color="@color/wikivoyage_active_light" android:width="1dp"/>
<solid android:color="@color/wikivoyage_card_bg_light"/>
<corners android:radius="3dp"/>
</shape>
</item>
</layer-list>

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<nine-patch android:src="@drawable/bg_card_shadow_cr3dp"/>
</item>
<item>
<shape>
<solid android:color="?attr/wikivoyage_card_bg_color"/>
<corners android:radius="3dp"/>
</shape>
</item>
</layer-list>

View file

@ -5,7 +5,7 @@
</item>
<item>
<shape>
<solid android:color="?attr/wikivoyage_card_bg_color"/>
<solid android:color="@color/wikivoyage_card_bg_dark"/>
<corners android:radius="3dp"/>
</shape>
</item>

View file

@ -5,7 +5,7 @@
</item>
<item>
<shape>
<solid android:color="?attr/wikivoyage_card_bg_color"/>
<solid android:color="@color/wikivoyage_card_bg_light"/>
<corners android:radius="3dp"/>
</shape>
</item>

View file

@ -5,7 +5,7 @@
<stroke
android:width="1dp"
android:color="?attr/wikivoyage_card_divider_color"/>
android:color="@color/wikivoyage_card_divider_dark"/>
<corners android:radius="3dp"/>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/wikivoyage_card_divider_light"/>
<corners android:radius="3dp"/>
</shape>

View file

@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/wikivoyage_active_color"/>
<solid android:color="@color/wikivoyage_active_dark"/>
<corners android:radius="3dp"/>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/wikivoyage_active_light"/>
<corners android:radius="3dp"/>
</shape>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
android:shape="rectangle">
<solid android:color="?attr/wikivoyage_secondary_btn_bg_color"/>
<solid android:color="@color/wikivoyage_secondary_btn_bg_dark"/>
<corners android:radius="3dp"/>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/wikivoyage_secondary_btn_bg_light"/>
<corners android:radius="3dp"/>
</shape>

View file

@ -75,7 +75,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/text_margin_small"
android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/wikivoyage_search_card_bg">
android:background="?attr/wikivoyage_travel_card_bg">
<LinearLayout
android:id="@+id/search_button"

View file

@ -62,7 +62,7 @@
android:layout_marginEnd="@dimen/bottom_sheet_content_margin_small"
android:layout_marginRight="@dimen/bottom_sheet_content_margin_small"
android:layout_weight="1"
android:background="@drawable/wikivoyage_secondary_btn_bg">
android:background="?attr/wikivoyage_secondary_btn_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/button_no"
@ -88,7 +88,7 @@
android:layout_marginEnd="@dimen/bottom_sheet_content_margin_small"
android:layout_marginRight="@dimen/bottom_sheet_content_margin_small"
android:layout_weight="1"
android:background="@drawable/wikivoyage_secondary_btn_bg">
android:background="?attr/wikivoyage_secondary_btn_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/button_wifi"
@ -112,7 +112,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/wikivoyage_primary_btn_bg">
android:background="?attr/wikivoyage_primary_btn_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/button_yes"

View file

@ -8,7 +8,7 @@
android:layout_marginBottom="@dimen/list_header_padding"
android:layout_marginLeft="@dimen/card_padding"
android:layout_marginRight="@dimen/card_padding"
android:background="@drawable/dialog_active_card_bg"
android:background="?attr/purchase_dialog_active_card_bg"
android:orientation="vertical">
<include layout="@layout/purchase_dialog_card_header"/>

View file

@ -7,7 +7,7 @@
android:layout_marginBottom="@dimen/list_header_padding"
android:layout_marginLeft="@dimen/card_padding"
android:layout_marginRight="@dimen/card_padding"
android:background="@drawable/dialog_card_bg"
android:background="?attr/wikivoyage_travel_card_bg"
android:orientation="vertical">
<include layout="@layout/purchase_dialog_card_header"/>

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/wikivoyage_active_card_bg">
android:background="?attr/wikivoyage_primary_btn_bg">
<LinearLayout
android:id="@+id/card_button"

View file

@ -87,7 +87,7 @@
android:layout_marginLeft="@dimen/card_padding"
android:layout_marginRight="@dimen/card_padding"
android:layout_marginTop="4dp"
android:background="@drawable/wikivoyage_search_card_bg">
android:background="?attr/wikivoyage_travel_card_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/button_later"

View file

@ -7,7 +7,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/text_margin_small"
android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/travel_card_bg"
android:background="?attr/wikivoyage_travel_card_bg"
android:orientation="vertical">
<LinearLayout
@ -64,7 +64,7 @@
android:layout_marginBottom="@dimen/content_padding"
android:layout_marginLeft="@dimen/bottom_sheet_content_margin_small"
android:layout_marginRight="@dimen/bottom_sheet_content_margin_small"
android:background="@drawable/travel_card_stroke_bg"
android:background="?attr/wikivoyage_travel_card_stroke_bg"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
@ -135,7 +135,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/wikivoyage_secondary_btn_bg">
android:background="?attr/wikivoyage_secondary_btn_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/secondary_button"
@ -165,7 +165,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/wikivoyage_primary_btn_bg">
android:background="?attr/wikivoyage_primary_btn_bg">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/primary_button"

View file

@ -8,7 +8,7 @@
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/text_margin_small"
android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/travel_card_bg"
android:background="?attr/wikivoyage_travel_card_bg"
android:orientation="vertical">
<LinearLayout

View file

@ -8,7 +8,7 @@
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginLeft="@dimen/text_margin_small"
android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/travel_card_bg">
android:background="?attr/wikivoyage_travel_card_bg">
<LinearLayout
android:layout_width="match_parent"

View file

@ -81,6 +81,13 @@
<attr name="wikivoyage_primary_btn_text_color" format="reference"/>
<attr name="wikivoyage_welcome_bg_color" format="reference"/>
<attr name="wikivoyage_primary_text_color" format="reference"/>
<attr name="wikivoyage_travel_card_bg" format="reference"/>
<attr name="wikivoyage_travel_card_stroke_bg" format="reference"/>
<attr name="wikivoyage_secondary_btn_bg" format="reference"/>
<attr name="wikivoyage_primary_btn_bg" format="reference"/>
<attr name="purchase_dialog_active_card_bg" format="reference"/>
</declare-styleable>
<declare-styleable name="PagerSlidingTabStrip">

View file

@ -213,6 +213,13 @@
<item name="wikivoyage_primary_btn_text_color">@color/wikivoyage_primary_btn_text_light</item>
<item name="wikivoyage_welcome_bg_color">@color/wikivoyage_welcome_bg_light</item>
<item name="wikivoyage_primary_text_color">@color/wikivoyage_primary_text_light</item>
<item name="wikivoyage_travel_card_bg">@drawable/travel_card_bg_light</item>
<item name="wikivoyage_travel_card_stroke_bg">@drawable/travel_card_stroke_bg_light</item>
<item name="wikivoyage_secondary_btn_bg">@drawable/wikivoyage_secondary_btn_bg_light</item>
<item name="wikivoyage_primary_btn_bg">@drawable/wikivoyage_primary_btn_bg_light</item>
<item name="purchase_dialog_active_card_bg">@drawable/dialog_active_card_bg_light</item>
</style>
<style name="OverflowMenuButton" parent="@style/Widget.AppCompat.ActionButton.Overflow">
@ -414,6 +421,13 @@
<item name="wikivoyage_primary_btn_text_color">@color/wikivoyage_primary_btn_text_dark</item>
<item name="wikivoyage_welcome_bg_color">@color/wikivoyage_welcome_bg_dark</item>
<item name="wikivoyage_primary_text_color">@color/wikivoyage_primary_text_dark</item>
<item name="wikivoyage_travel_card_bg">@drawable/travel_card_bg_dark</item>
<item name="wikivoyage_travel_card_stroke_bg">@drawable/travel_card_stroke_bg_dark</item>
<item name="wikivoyage_secondary_btn_bg">@drawable/wikivoyage_secondary_btn_bg_dark</item>
<item name="wikivoyage_primary_btn_bg">@drawable/wikivoyage_primary_btn_bg_dark</item>
<item name="purchase_dialog_active_card_bg">@drawable/dialog_active_card_bg_dark</item>
</style>
<style name="FreeVersionBanner" parent="OsmandDarkTheme">

View file

@ -206,9 +206,9 @@ public class TravelDownloadUpdateCard extends BaseTravelCard {
@DrawableRes
private int getPrimaryBtnBgRes(boolean enabled) {
if (enabled) {
return R.drawable.wikivoyage_primary_btn_bg;
return nightMode ? R.drawable.wikivoyage_primary_btn_bg_dark : R.drawable.wikivoyage_primary_btn_bg_light;
}
return R.drawable.wikivoyage_secondary_btn_bg;
return nightMode ? R.drawable.wikivoyage_secondary_btn_bg_dark : R.drawable.wikivoyage_secondary_btn_bg_light;
}
@ColorRes