This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources.Theme theme = new ContextThemeWrapper(getContext(), category.getThemeId()).getTheme(); | |
Drawable drawable = getResources().getDrawable(drawableResId, theme); | |
someImageView.setImageDrawable(drawable); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CardDetailActivity extends AppCompatActivity { | |
public static final String EXTRA_CARD = "card"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Card card = getIntent().getParcelableExtra(EXTRA_CARD); | |
setTheme(card.category.getThemeId()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<vector xmlns:android="http://schemas.android.com/apk/res/android" | |
android:width="360dp" | |
android:height="230dp" | |
android:viewportWidth="360" | |
android:viewportHeight="230"> | |
<path | |
android:fillColor="?attr/medium_dark" | |
android:pathData="..." /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<declare-styleable name="ColourPalette"> | |
<attr name="light_base" format="color" /> | |
<attr name="base" format="color" /> | |
<attr name="light" format="color" /> | |
<attr name="ultra_light" format="color" /> | |
<attr name="medium_dark" format="color" /> | |
<attr name="dark" format="color" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<resources> | |
<style name="CategoryTheme" parent="Theme.AppCompat.Light"/> | |
<style name="Motorsports" parent="CategoryTheme"> | |
<item name="light_base">@color/motoring_light_base</item> | |
<item name="base">@color/motoring_base</item> | |
<item name="light">@color/motoring_light</item> | |
<item name="ultra_light">@color/motoring_ultra_light</item> | |
<item name="medium_dark">@color/motoring_medium_dark</item> | |
<item name="dark">@color/motoring_dark</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<declare-styleable name="CategoryTheme"> | |
<attr name="light_base" format="color" /> | |
<attr name="base" format="color" /> | |
<attr name="light" format="color" /> | |
<attr name="ultra_light" format="color" /> | |
<attr name="medium_dark" format="color" /> | |
<attr name="dark" format="color" /> | |
<attr name="ultra_dark" format="color" /> | |
</declare-styleable> |