Skingchange_ex includes and involves skin changes as follows

  1. Background Changes the background color
  2. TextColor Changes the font color
  3. SRC Replace the image resource, (prepare the image that needs to be skinned)
  4. Divider Changes the color of the dividing line in the middle of the ListView
  5. ImageViewColor Changes the image color (the object to be skinned is a Vector)
  6. Background_d Changes the background color (peels the resource)
  7. Background_c Change the background color (change the color)
  8. SelectorColor selector peels
  9. SelectortextColor SelectortextColor font color peels
  10. ShapeSolidColor Change the color of shapeSolidColor separately
  11. ShapeStrokeColor changes the color of shape wire frame separately
  12. ShapeStrokeColorFONT changes the shape line frame and font color separately
  13. ShapeGradientColor changes the gradient color separately
  14. ShapeGradientStrokeColor replaces the gradient color separately with a border
  15. ShapeeGradientColorFONT_S changes the gradient border and font color separately

Use effect

The usage modes and functions are described as follows

Android :tag=”skin:color_theme:background” android:tag=”skin:color_theme:background” First the original judgment is a resource, a replacement resources background, did not change the background color, so easy to put some only need to change the color of the controls, with resources, for example, a LinearLayout is to change the background picture, a Button to change the background color, it’ll be easier both for the same kind of resource, or, Do not change the same background color writing method, to distinguish can also be. In the RES folder, the colors file has the corresponding color to be skinned

<color name="colorPrimary">#03A9F4</color>
Copy the code

The color of the skin

<color name="colorPrimary_test">#A700EE</color>
Copy the code

Skinmanager.getinstance ().changeskin (“test”); In the control

<TextView
     android:layout_width="150dp"
     android:layout_height="40dp"
     android:background="@drawable/btn_sp_bg_2"
    android:tag="skin:colorPrimaryDark:background"
         />
Copy the code

Android :tag=”skin:color_theme:textColor” android:tag=”skin:color_theme:textColor

3. SRC use the format Android :tag=”skin:color_theme: SRC “note: you need to prepare a color_theme. PNG image and a color_theme_test. PNG image

4. Divider uses the format Android :tag=”skin:color_theme: Divider “Note: This is a resource file and you need a drawBL file to divide the skin

Android :tag=”skin:color_theme:ImageViewColor” note: We must use a Vector of images

Android :tag=”skin:color_theme:background_d” PNG image and color_theme_test. PNG image

Android :tag=”skin:color_theme:background_c” android:tag=”skin:color_theme:background_c

Android :tag=”skin:color_theme:SelectorColor

<color name="colorPrimary_set_1">#A700EE</color>
Copy the code

The color of the selector after the skin change

<color name="colorPrimary_set_1_test">#A700EE</color>
Copy the code

True is hollow, and Fasle is solid

Android :tag=”skin:color_theme:SelectortextColor” It is necessary to use the Color, to have the corresponding Color in the Color, the requirements are the same as the above SelectorColor, need to add _set_1 to the Color. True is the default color, false is color-changing

Android :tag=”skin:color_theme:shapeSolidColor” You have to use the Color, you have to have the corresponding Color in the Color and change the Color of the shapeSolidColor separately

11. Use shapeStrokeColor format Android :tag=”skin:color_theme:shapeStrokeColor” Note: Change the color of shapeStroke separately

12. ShapeStrokeColorFONT format using android: tag = “skin: color_theme: shapeStrokeColorFON” note: separate change shape wire frame and font color

ShapeGradientColor android:tag=”skin:color_theme:shapeGradientColor” You have to use the Color, you have to have a Color in the Color change the gradient Color separately and you have to add _str and _end to the Color. Only two gradients are considered here. There is no intermediate gradient. If you need it, please download the source code and add it yourself or contact me. Gradient start, gradient end two colors gradually change skin color

<color name="colorPrimary_str">#590BE4</color>
<color name="colorPrimary_end">#FFC107</color>
Copy the code

Gradually change the skin color

<color name="colorPrimary_str_test">#E42113</color>
<color name="colorPrimary_end_test">#09DDF8</color>
Copy the code

14. ShapeGradientStrokeColor format using android: tag = “skin: color_theme: shapeGradientStrokeColor” note: You have to use the Color, you have to have the Color in the Color and you have to change the Color of the gradient to have a border as above

15. ShapeeGradientColorFONT_S format using android: tag = “skin: color_theme: shapeeGradientColorFONT_S” note: The Color must be used here, and the corresponding Color must be in the Color to change the gradient border and font Color separately as above

Finally attached is the project address [portal]github.com/chenStill/c… Also attached is the project address of Hongyang Daishen [Changeskin]github.com/hongyangAnd…