Android 实现一键切换应用主题颜色

上传者: baidu_23478311 | 上传时间: 2021-03-03 16:50:13 | 文件大小: 2.39MB | 文件类型: ZIP
一般我们需要改变整个应用的背景颜色可以直接这样设置getWindow().getDecorView().setBackgroundColor(int color)。但是这种方式显然不是我们想要的,而且还有许多不好的地方。为什么呢?第一、它会把整个页面的背景颜色都改变了。第二、布局的背景还必须是透明的才会有效果。所以这种方式有的时候是满足不了我们的需求的。

文件下载

资源详情

[{"title":"( 61 个子文件 2.39MB ) Android 实现一键切换应用主题颜色","children":[{"title":"ChangedMotiveColorTest","children":[{"title":".project <span style='color:#111;'> 858B </span>","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 607B </span>","children":null,"spread":false},{"title":"src","children":[{"title":"com","children":[{"title":"qiulong","children":[{"title":"changedmotivecolortest","children":[{"title":"view","children":[{"title":"SquareLayout.java <span style='color:#111;'> 830B </span>","children":null,"spread":false},{"title":"ColorLinearLayout.java <span style='color:#111;'> 1.43KB </span>","children":null,"spread":false}],"spread":true},{"title":"activity","children":[{"title":"MyApplication.java <span style='color:#111;'> 382B </span>","children":null,"spread":false},{"title":"MotiveActivity.java <span style='color:#111;'> 1.86KB </span>","children":null,"spread":false},{"title":"MainActivity.java <span style='color:#111;'> 775B </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"MyPreference.java <span style='color:#111;'> 700B </span>","children":null,"spread":false}],"spread":true},{"title":"mode","children":[{"title":"ColorManager.java <span style='color:#111;'> 1.63KB </span>","children":null,"spread":false},{"title":"OnColorChangedListener.java <span style='color:#111;'> 132B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.23KB </span>","children":null,"spread":false},{"title":"res","children":[{"title":"drawable-ldpi","children":null,"spread":false},{"title":"drawable-hdpi","children":[{"title":"skin_selected.png <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 7.48KB </span>","children":null,"spread":false},{"title":"title_back.png <span style='color:#111;'> 1.25KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.69KB </span>","children":null,"spread":false}],"spread":true},{"title":"layout","children":[{"title":"activity_motive.xml <span style='color:#111;'> 2.71KB </span>","children":null,"spread":false},{"title":"activity_motive_item.xml <span style='color:#111;'> 867B </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 902B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 24.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 12.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"arrays.xml <span style='color:#111;'> 337B </span>","children":null,"spread":false},{"title":"strings.xml <span style='color:#111;'> 214B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 34B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":true},{"title":"assets","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"qiulong","children":[{"title":"changedmotivecolortest","children":[{"title":"BuildConfig.java <span style='color:#111;'> 176B </span>","children":null,"spread":false},{"title":"R.java <span style='color:#111;'> 1.64KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 1.13MB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 475B </span>","children":null,"spread":false},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 50.19KB </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"resources.ap_ <span style='color:#111;'> 42.62KB </span>","children":null,"spread":false},{"title":"ChangedMotiveColorTest.apk <span style='color:#111;'> 445.70KB </span>","children":null,"spread":false},{"title":"classes","children":[{"title":"com","children":[{"title":"qiulong","children":[{"title":"changedmotivecolortest","children":[{"title":"R$layout.class <span style='color:#111;'> 534B </span>","children":null,"spread":false},{"title":"R$array.class <span style='color:#111;'> 454B </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 377B </span>","children":null,"spread":false},{"title":"view","children":[{"title":"SquareLayout.class <span style='color:#111;'> 1.09KB </span>","children":null,"spread":false},{"title":"ColorLinearLayout.class <span style='color:#111;'> 1.83KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 526B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 388B </span>","children":null,"spread":false},{"title":"activity","children":[{"title":"MyApplication.class <span style='color:#111;'> 715B </span>","children":null,"spread":false},{"title":"MotiveActivity$1.class <span style='color:#111;'> 911B </span>","children":null,"spread":false},{"title":"MotiveActivity.class <span style='color:#111;'> 2.26KB </span>","children":null,"spread":false},{"title":"MotiveActivity$OnSkinColorClickListener.class <span style='color:#111;'> 1.54KB </span>","children":null,"spread":false},{"title":"MainActivity$1.class <span style='color:#111;'> 1.20KB </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 972B </span>","children":null,"spread":false}],"spread":false},{"title":"util","children":[{"title":"MyPreference.class <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$id.class <span style='color:#111;'> 710B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 707B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 516B </span>","children":null,"spread":false},{"title":"mode","children":[{"title":"ColorManager.class <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"OnColorChangedListener.class <span style='color:#111;'> 197B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"AndroidManifest.xml <span style='color:#111;'> 1.23KB </span>","children":null,"spread":false},{"title":"dexedLibs","children":[{"title":"android-support-v4-11ff9706c5fdcbc814d8f69ab0f01799.jar <span style='color:#111;'> 399.97KB </span>","children":null,"spread":false}],"spread":false},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-hdpi","children":[{"title":"skin_selected.png <span style='color:#111;'> 689B </span>","children":null,"spread":false},{"title":"ic_launcher.png <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false},{"title":"title_back.png <span style='color:#111;'> 222B </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 17.47KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false},{"title":"classes.dex <span style='color:#111;'> 1.17MB </span>","children":null,"spread":false}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • baldoor :
    不错,挺好的
    2016-05-20

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明