{"action":"created","issue":{"url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/4","labels_url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/4/comments","events_url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/4/events","html_url":"https://github.com/afollestad/app-theme-engine/issues/4","id":123390025,"number":4,"title":"Setting RES value doesn't seem to work","user":{"login":"ccrama","id":3819844,"avatar_url":"https://avatars.githubusercontent.com/u/3819844?v=3","gravatar_id":"","url":"https://api.github.com/users/ccrama","html_url":"https://github.com/ccrama","followers_url":"https://api.github.com/users/ccrama/followers","following_url":"https://api.github.com/users/ccrama/following{/other_user}","gists_url":"https://api.github.com/users/ccrama/gists{/gist_id}","starred_url":"https://api.github.com/users/ccrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccrama/subscriptions","organizations_url":"https://api.github.com/users/ccrama/orgs","repos_url":"https://api.github.com/users/ccrama/repos","events_url":"https://api.github.com/users/ccrama/events{/privacy}","received_events_url":"https://api.github.com/users/ccrama/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-22T00:59:31Z","updated_at":"2015-12-22T01:20:28Z","closed_at":null,"body":"Whenever I set the resource value of a custom color resource (via `primaryColorRes()`) and recreate the activity, the value of the resource seems to remain the same. \r\n\r\nCode I am using to set the colors:\r\n\r\n```java\r\n@Override\r\npublic void onColorSelection(ColorChooserDialog dialog, int selectedColor) {\r\n    Config real = ATE.config(Setup.this);\r\n    if (dialog.isAccentMode()) {\r\n        real.accentColor(selectedColor);\r\n        real.accentColorRes(R.color.colorAccentCustom);\r\n    } else {\r\n        real.primaryColor(selectedColor);\r\n        real.accentColorRes(R.color.colorPrimaryCustom);\r\n    }\r\n    real.commit();\r\n    recreate();\r\n}\r\n```\r\n\r\nOutput from changing the colors between blue and green run from the onViewCreated method of my fragment in a ViewPager, using this code\r\n\r\n```java\r\nLog.v(\"Spiral\", \"COLOR PRIMARY IS \" + getActivity().getResources().getColor(R.color.colorPrimaryCustom) + \" COLOR SECONDARY IS \" + getActivity().getResources().getColor(R.color.colorAccentCustom));\r\n```\r\n\r\n```Gradle\r\n12-21 18:41:30.601 19702-19702/? V/Spiral: COLOR PRIMARY IS -16537100 COLOR SECONDARY IS -28416\r\n12-21 18:41:26.771 19702-19702/? V/Spiral: COLOR PRIMARY IS -16537100 COLOR SECONDARY IS -28416\r\n```\r\n\r\nI am trying to make one of my activities theme using the color resources `colorAccentCustom` and `colorPrimaryCustom`. The statusbar does change, but the values in this layout file do not\r\n\r\n```xml\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<android.support.percent.PercentRelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\r\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:orientation=\"vertical\">\r\n\r\n    <LinearLayout\r\n        android:layout_width=\"match_parent\"\r\n        android:background=\"@color/colorPrimaryCustom\"\r\n        android:elevation=\"8dp\"\r\n        android:id=\"@+id/header\"\r\n        app:layout_heightPercent=\"25%\">\r\n\r\n        <TextView\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:layout_gravity=\"bottom\"\r\n            android:padding=\"20dp\"\r\n            android:text=\"R.string.school_info\"\r\n            android:textColor=\"#fff\"\r\n            android:textSize=\"24dp\" />\r\n    </LinearLayout>\r\n\r\n    <ScrollView\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_below=\"@+id/header\"\r\n        android:layout_above=\"@+id/bottomBar\"\r\n        android:layout_height=\"match_parent\">\r\n\r\n        <LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:orientation=\"vertical\"\r\n            android:layout_height=\"wrap_content\">\r\n\r\n            <LinearLayout\r\n                android:layout_width=\"match_parent\"\r\n                android:padding=\"16dp\"\r\n\r\n                android:orientation=\"horizontal\"\r\n                android:id=\"@+id/primary\"\r\n                android:background=\"?android:selectableItemBackground\"\r\n\r\n                android:layout_height=\"wrap_content\">\r\n                <View\r\n                    android:layout_width=\"36dp\"\r\n                    android:layout_height=\"36dp\"\r\n                    android:padding=\"8dp\"\r\n                    android:elevation=\"2dp\"\r\n                    android:background=\"@drawable/circle\"\r\n                    android:backgroundTint=\"@color/colorPrimaryCustom\"\r\n                    />\r\n                <TextView\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:gravity=\"center_vertical\"\r\n                    android:text=\"R.string.color_primary\"\r\n                    android:textSize=\"18sp\"\r\n                    android:padding=\"8dp\"\r\n                    android:layout_height=\"match_parent\" />\r\n\r\n            </LinearLayout>\r\n            <LinearLayout\r\n                android:layout_width=\"match_parent\"\r\n                android:padding=\"16dp\"\r\n                android:id=\"@+id/secondary\"\r\n\r\n                android:orientation=\"horizontal\"\r\n                android:background=\"?android:selectableItemBackground\"\r\n\r\n                android:layout_height=\"wrap_content\">\r\n                <View\r\n                    android:layout_width=\"36dp\"\r\n                    android:layout_height=\"36dp\"\r\n                    android:elevation=\"2dp\"\r\n                    android:background=\"@drawable/circle\"\r\n                    android:backgroundTint=\"@color/colorAccentCustom\"\r\n                    />\r\n                <TextView\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_gravity=\"center_vertical\"\r\n                    android:gravity=\"center_vertical\"\r\n                    android:text=\"R.string.color_secondary\"\r\n                    android:textSize=\"18sp\"\r\n                    android:padding=\"8dp\"\r\n                    android:layout_height=\"match_parent\" />\r\n\r\n            </LinearLayout>\r\n            <View\r\n                android:layout_width=\"match_parent\"\r\n                android:layout_height=\"0.5dp\"\r\n                android:background=\"#000\"\r\n                android:alpha=\"0.3\"\r\n                />\r\n        </LinearLayout>\r\n    </ScrollView>\r\n\r\n    <RelativeLayout\r\n        android:id=\"@+id/bottomBar\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"56dp\"\r\n        android:layout_alignParentBottom=\"true\">\r\n\r\n        <ImageView\r\n            android:id=\"@+id/back\"\r\n            android:layout_width=\"48dp\"\r\n            android:layout_height=\"56dp\"\r\n\r\n            android:padding=\"10dp\"\r\n            android:src=\"@drawable/back\" />\r\n\r\n        <TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"56dp\"\r\n            android:layout_toLeftOf=\"@+id/next\"\r\n            android:gravity=\"center\"\r\n            android:padding=\"16dp\"\r\n            android:text=\"R.string.skip\"\r\n            android:textSize=\"14dp\"\r\n            android:textStyle=\"bold\" />\r\n\r\n        <ImageView\r\n            android:id=\"@+id/next\"\r\n            android:layout_width=\"48dp\"\r\n            android:layout_height=\"56dp\"\r\n            android:layout_alignParentRight=\"true\"\r\n            android:padding=\"10dp\"\r\n            android:src=\"@drawable/forw\" />\r\n    </RelativeLayout>\r\n</android.support.percent.PercentRelativeLayout>\r\n```\r\n\r\nPlease let me know if I am doing anything wrong! If you need me to do any more testing, please let me know. \r\n\r\nEDIT: Whoops messed up that formatting. Thank you for whoever fixed it!"},"comment":{"url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/comments/166472313","html_url":"https://github.com/afollestad/app-theme-engine/issues/4#issuecomment-166472313","issue_url":"https://api.github.com/repos/afollestad/app-theme-engine/issues/4","id":166472313,"user":{"login":"ccrama","id":3819844,"avatar_url":"https://avatars.githubusercontent.com/u/3819844?v=3","gravatar_id":"","url":"https://api.github.com/users/ccrama","html_url":"https://github.com/ccrama","followers_url":"https://api.github.com/users/ccrama/followers","following_url":"https://api.github.com/users/ccrama/following{/other_user}","gists_url":"https://api.github.com/users/ccrama/gists{/gist_id}","starred_url":"https://api.github.com/users/ccrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ccrama/subscriptions","organizations_url":"https://api.github.com/users/ccrama/orgs","repos_url":"https://api.github.com/users/ccrama/repos","events_url":"https://api.github.com/users/ccrama/events{/privacy}","received_events_url":"https://api.github.com/users/ccrama/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T01:20:28Z","updated_at":"2015-12-22T01:20:28Z","body":"Ah, that makes more sense. All seems to be working now! \r\n\r\nI would suggest an edit to the readme as it makes it sound like setting the attr or res value would change those respective values, and I was trying to figure out how you bypassed the fact that they were constant. \r\n\r\nAlso setting the tags instead of background/tint values was the other half of my issue, would it be possible to detect if the background of a view is set to the colorPrimary or colorAccent within the ATEActivity, and recolor them respectively? That would be pretty neat and would allow devs who already have coded with the colorPrimary and colorAccent to use the same layout files! I don't know how ATEActivity works at the moment but if you do cycle through the views in the activity, that would be a pretty useful addition to the library!"}}