forked from organicmaps/organicmaps
[android] Added production colors for tags screen
This commit is contained in:
parent
b8ec365a66
commit
04c94bccfb
1 changed files with 11 additions and 4 deletions
|
@ -14,6 +14,7 @@ import android.graphics.drawable.shapes.RectShape;
|
|||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.mapswithme.maps.R;
|
||||
import com.mapswithme.util.ThemeUtils;
|
||||
|
||||
public class TagsResFactory
|
||||
{
|
||||
|
@ -25,12 +26,19 @@ public class TagsResFactory
|
|||
makeSelectedDrawable(color));
|
||||
drawable.addState(new int[] { -android.R.attr.state_selected, android.R.attr.state_enabled },
|
||||
makeDefaultDrawable(context, color));
|
||||
int unselectedDisabledColor = getUnselectedDisabledTagColor(context);
|
||||
drawable.addState(new int[] { -android.R.attr.state_selected, -android.R.attr.state_enabled },
|
||||
/* FIXME */
|
||||
makeDefaultDrawable(context, Color.BLACK));
|
||||
makeDefaultDrawable(context, unselectedDisabledColor));
|
||||
return drawable;
|
||||
}
|
||||
|
||||
private static int getUnselectedDisabledTagColor(@NonNull Context context)
|
||||
{
|
||||
Resources res = context.getResources();
|
||||
return ThemeUtils.isNightTheme() ? res.getColor(R.color.white_12)
|
||||
: res.getColor(R.color.black_12);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static Drawable makeDefaultDrawable(@NonNull Context context, int color)
|
||||
{
|
||||
|
@ -54,8 +62,7 @@ public class TagsResFactory
|
|||
new int[] {
|
||||
context.getResources().getColor(android.R.color.white),
|
||||
color,
|
||||
/* FIXME */
|
||||
Color.GRAY
|
||||
getUnselectedDisabledTagColor(context)
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue