forked from organicmaps/organicmaps
[android] Fixed drawable resources for pre lollipop devices.
This commit is contained in:
parent
62978cd788
commit
182a4af37f
11 changed files with 59 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
|||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?activeIconBackground"/>
|
||||
<solid android:color="@color/base_accent"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
|
|
15
android/res/drawable-v21/bg_active_icon_night.xml
Normal file
15
android/res/drawable-v21/bg_active_icon_night.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/base_accent_night"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -6,7 +6,7 @@
|
|||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?steadyIconBackground"/>
|
||||
<solid android:color="@color/black_8"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
|
|
15
android/res/drawable-v21/bg_steady_icon_night.xml
Normal file
15
android/res/drawable-v21/bg_steady_icon_night.xml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/white_8"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
|
@ -1,6 +1,6 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?activeIconBackground"/>
|
||||
<solid android:color="@color/base_accent"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
|
|
7
android/res/drawable/bg_active_icon_night.xml
Normal file
7
android/res/drawable/bg_active_icon_night.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/base_accent_night"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
</shape>
|
|
@ -1,6 +1,6 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?steadyIconBackground"/>
|
||||
<solid android:color="@color/black_8"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
|
|
7
android/res/drawable/bg_steady_icon_night.xml
Normal file
7
android/res/drawable/bg_steady_icon_night.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/white_8"/>
|
||||
<size
|
||||
android:height="40dp"
|
||||
android:width="40dp"/>
|
||||
</shape>
|
|
@ -71,9 +71,9 @@
|
|||
<attr name="bannerBackground" format="color"/>
|
||||
|
||||
<attr name="steadyIconTint" format="color"/>
|
||||
<attr name="steadyIconBackground" format="color"/>
|
||||
<attr name="steadyIconBackground" format="reference"/>
|
||||
<attr name="activeIconTint" format="color"/>
|
||||
<attr name="activeIconBackground" format="color"/>
|
||||
<attr name="activeIconBackground" format="reference"/>
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="ThemeAttrs.NavButtons">
|
||||
|
|
|
@ -87,9 +87,9 @@
|
|||
<item name="bannerBackground">@color/bg_banner_color</item>
|
||||
|
||||
<item name="steadyIconTint">@color/black_secondary</item>
|
||||
<item name="steadyIconBackground">@color/black_8</item>
|
||||
<item name="steadyIconBackground">@drawable/bg_steady_icon</item>
|
||||
<item name="activeIconTint">@color/bg_cards</item>
|
||||
<item name="activeIconBackground">?colorAccent</item>
|
||||
<item name="activeIconBackground">@drawable/bg_active_icon</item>
|
||||
</style>
|
||||
|
||||
<!-- Night theme -->
|
||||
|
@ -180,7 +180,8 @@
|
|||
<item name="bannerBackground">@color/bg_banner_color_night</item>
|
||||
|
||||
<item name="steadyIconTint">@color/white_secondary</item>
|
||||
<item name="steadyIconBackground">@color/white_8</item>
|
||||
<item name="steadyIconBackground">@drawable/bg_steady_icon_night</item>
|
||||
<item name="activeIconTint">@color/bg_cards_night</item>
|
||||
<item name="activeIconBackground">@drawable/bg_active_icon_night</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
|
|||
import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
|
||||
import com.mapswithme.maps.widget.recycler.RecyclerLongClickListener;
|
||||
import com.mapswithme.util.Graphics;
|
||||
import com.mapswithme.util.UiUtils;
|
||||
|
||||
public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter<BookmarkCategoriesAdapter.ViewHolder>
|
||||
{
|
||||
|
@ -134,12 +135,14 @@ public class BookmarkCategoriesAdapter extends BaseBookmarkCategoryAdapter<Bookm
|
|||
Drawable drawable;
|
||||
if (visible)
|
||||
{
|
||||
visibilityMarker.setBackgroundResource(R.drawable.bg_active_icon);
|
||||
visibilityMarker.setBackgroundResource(UiUtils.getStyledResourceId(
|
||||
visibilityMarker.getContext(), R.attr.activeIconBackground));
|
||||
drawable = Graphics.tint(visibilityMarker.getContext(), R.drawable.ic_bookmark_show, R.attr.activeIconTint);
|
||||
}
|
||||
else
|
||||
{
|
||||
visibilityMarker.setBackgroundResource(R.drawable.bg_steady_icon);
|
||||
visibilityMarker.setBackgroundResource(UiUtils.getStyledResourceId(
|
||||
visibilityMarker.getContext(), R.attr.steadyIconBackground));
|
||||
drawable = Graphics.tint(visibilityMarker.getContext(), R.drawable.ic_bookmark_hide,
|
||||
R.attr.steadyIconTint);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue