一键换肤

移动开发
APP一键换肤的实现

源码简介

APP一键换肤的实现
源码运行截图

 

源码片段:

public final static String SHARED_PREFERENCES_NAME = "andnav_preferences"
  
    public final static String PREF_THEME_RESID_ID = "theme_resid"
      
    public final static String TITLE_ID ="title_id"
      
    public static void setTitle(Activity act) 
    { 
          SharedPreferences sPref = act.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); 
        TextView title = (TextView) act.findViewById(R.id.titleTv); 
        int title_resid = sPref.getInt(TITLE_ID, R.drawable.color1); 
        title.setBackgroundResource(title_resid); 
    } 
    public static void setValue(Activity act,int theme_resid,int title_resid) 
    { 
         SharedPreferences sPref = act.getSharedPreferences(SHARED_PREFERENCES_NAME, 0); 
         Editor editor = sPref.edit(); 
         editor.putInt(PREF_THEME_RESID_ID, theme_resid); 
         editor.putInt(TITLE_ID, title_resid); 
         editor.commit(); 
    } 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.

源码下载:http://down.51cto.com/data/1982408

责任编辑:chenqingxiang 来源: 网络整理
相关推荐

2022-04-07 13:56:13

前端一键换肤

2021-04-23 10:38:52

Spring BootSpringMVC源码

2015-11-03 15:29:49

ONOS开放网络操作系统SDN

2023-06-15 10:00:00

Jenkins任务操作

2020-11-24 11:00:24

前端

2021-12-02 07:50:29

分支服务git worktre

2024-10-17 11:09:46

2023-05-29 09:08:27

SQL日志数据

2012-03-01 14:00:08

2018-03-20 12:30:44

iOSPush抓包

2022-01-09 23:09:08

Windows 10Windows微软

2018-08-02 11:05:00

安全狗

2022-08-02 14:27:01

HDF驱动框架驱动开发

2024-04-08 13:59:03

大模型Replicate

2021-08-03 15:25:09

数据库Sharding SpSQL

2024-03-15 14:34:12

Oracle数据库一键巡检

2011-09-15 19:05:49

windows 7一键关机

2020-03-31 15:03:56

Spring Boot代码Java

2012-11-26 17:09:42

Windows 8

2011-01-27 10:40:08

点赞
收藏

51CTO技术栈公众号