Android UI换皮肤或 白天黑夜模式

> 白天夜间模式场景,换肤框架

-- 关于三种『应用内主题切换』开源项目的一点思考- https://www.jianshu.com/p/2164fa5803b9

1.Theme的方案,在style文件中定义不同的主题即可 
2.遍历View,对主题的更换,使用遍历View,然后单独设置更改后的属性即可。
即可以采用的是Theme+遍历更新View的思路。

-- 夜间模式需要对屏幕上的文字/图片/视频三种表现形式做特殊处理,具体细化如下: 
1)对界面背景,白色等浅色背景应该变成黑色/灰色之类的深色背景,以此降低屏幕亮度减少视觉刺激; 
2)对文字,因背景色变深,文字颜色需变浅,以形成对比效果; 
3)对图片,对图片加蒙层,避免加载浅色图片带来的视觉刺激; 
4)对视频,通常在播放界面增加亮度变化功能,由用户来决定屏幕亮度。

-- 换肤功能的实现,总的来讲分为两类:主题换肤(Theme)和插件换肤(APK换肤)。attr不依赖于styleable,styleable只是为了方便attr的使用。
主题换肤- https://github.com/chuyun923/CustomAttrExmp 
the day and night mode switch by switch app theme- https://github.com/WuLiFei/DayNightModeSwitch
An Android reading app, including articles from Zhihu Daily, Guokr Handpick and Douban Moment- https://github.com/TonnyL/PaperPlane

> 换肤框架AndroidChangeSkin和AndroidSkinLoader
AndroidChangeSkin和AndroidSkinLoader两个框架内选择一个合适的框架做夜间模式的实现效果。 
换肤AndroidSkinLoader- https://github.com/fengjundev/Android-Skin-Loader
- 换肤AndroidChangeSkin是基于View的Tag指定另一套皮肤的资源Id的框架,此框架有一个优化版本Injor,本文基于此版本与AndroidSkinLoader做对比。整体来看,Injor和AndroidSkinLoader的换肤速度都是满足需求的,大约在200~500ms之间;两者都不需要重启Activity使换肤生效。其他的对比如下:
 1.Injor需要占用View的Tag标签来指定资源id,标签内容格式比较复杂(类似:skin:textColor:color_text|Background:color_bg);但支持自定义View的属性,可扩展性比较好;
  2.AndroidSkinLoader通过代理LayoutInflater创建View的过程来解析属性id,再从其他资源包中找出相同id的资源来做皮肤切换;不过所有View都被存在框架内,可能会导致内存泄露;并且不支持自定义属性,可扩展性比较差;
- 换肤框架QSkinLoader- https://github.com/qqliu10u/QSkinLoader 

> 其他换肤

Android拍照适配问题,Matrix,夜间模式实现套路- https://github.com/D-clock/AndroidStudyCode
一种完全无侵入的换肤方式,支持插件式和应用内,无需重启Activity.- https://github.com/hongyangAndroid/AndroidChangeSkin
基于Theme的Android动态换肤库- https://github.com/hehonghui/Colorful
Android换肤/夜间模式的Android框架- https://github.com/dersoncheng/MultipleTheme
Android夜间模式官方最佳实践,AppCompat v23.2 的新特性- https://github.com/liaohuqiu/android-support-23.2-sample
Android 夜间模式的实现(一) - https://github.com/brokge/NightModel
Android主题切换(Theme)实现日夜间功能- http://blog.csdn.net/mario_0824/article/details/60775014
Yet another daynight switcher solution without recreating activity- https://github.com/geminiwen/SkinSprite
Anroid主题切换—夜间/白天模式探究- http://blog.csdn.net/u010687392/article/details/48088571

知乎和简书的夜间模式实现套路-http://www.jianshu.com/p/3b55e84742e5#
夜间模式实现套路- https://github.com/D-clock/AndroidStudyCode
Android夜间模式的几种实现-http://www.cnblogs.com/yuanzhanxue/p/3470820.html
Android-skin-support 一款用心去做的Android 换肤框架- https://blog.csdn.net/ximsfei/article/details/54586827
Android 换肤框架- https://github.com/ximsfei/Android-skin-support
Android换肤功能实现与换肤框架QSkinLoader- https://blog.csdn.net/u013478336/article/details/53083054
injor- https://github.com/hackware1993/injor

Android换肤技术总结- http://blog.zhaiyifan.cn/2015/09/10/Android%E6%8D%A2%E8%82%A4%E6%8A%80%E6%9C%AF%E6%80%BB%E7%BB%93/
Android的主题换肤- https://github.com/burgessjp/MaterialDesignDemo 
Android的主题换肤- https://github.com/burgessjp/ThemeSkinning
Android 主题切换的一个Demo - http://download.csdn.net/download/u012814963/9493559

猜你喜欢

转载自blog.csdn.net/ShareUs/article/details/82120433