![]() Now to change theme in overall screen in your application you have to put below code in your Base or Main Activity so when ever you start app your your new themes gets apply for whole app. it is good practice that you declare it in strings.xml and dimen.xml and then apply here. i have directly given values for text and padding and margin but for this tutorial only. ![]() it will allow user to select weather they want to apply light or dark theme. you can create as you want but for basic setup you can put below code into your activity. now in this step i am going to create layout for theme chooser. In step - 1 we have set all things for themes. check out below code for different themes i have created light and dark and both version of my theme in - 2 You can create your hole theme over here as i have created in styles.xml. ![]() i have created themes.xml file for only declaring base of theme. And user can change theme from it run now your basic theme is set. Now create theme.xml in values folder where you will define all themes that you want to implement. It is really lengthy process but if you go step by step it will be so much easy for you. ![]() I have taken only two colors but you can add as many as you want. Create activity where user can select theme color. ![]()
0 Comments
Leave a Reply. |