Giter Site home page Giter Site logo

sn790519 / multipletheme Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dersoncheng/multipletheme

0.0 1.0 0.0 1.61 MB

Android换肤/夜间模式的Android框架,配合theme和换肤控件框架可以做到无缝切换换肤(无需重启应用和当前页面)。 This framework of Android app support multiple theme(such as day/night mode) and needn’t finish current application or current activity when you switch theme-mode.

Java 100.00%

multipletheme's Introduction

MultipleTheme

真正的支持无缝换肤/夜间模式的Android框架,配合theme和换肤控件框架可以做到无缝切换换肤(无需重启应用和当前页面)。

该应用框架可以实现无缝换肤/切换夜间模式的需求,需要在换肤/切换夜间模式的界面只需要使用框架里的自封装控件,其他界面的控件使用原生android控件即可。

This framework of Android app support multiple theme(such as day/night mode) and needn’t finish current application or current activity.

第一步:在项目的attr.xml声明自定义属性(各种模式都会用到的属性)

Setup 1:declare attribute in attr.xml

github

第二步:在项目的style.xml指定各种模式主题下的自定义属性值

Setup 2:declare attribute in style.xml

github

第三步:在页面布局文件里使用自定义属性值

Setup 3:use attribute in layout

github

第四步:在基类的onCreate方法里添加切换主题模式的逻辑代码

Setup 4:add the code of switch theme-mode in base activity

github

第五步:调用工具类方法切换主题模式

Setup 5:switch theme-mode in code

github

第六步:针对切换主题模式时需要立即更新页面ui的页面,需要使用框架里的封装控件

Setup 6:use customize-widget of framework at the activity that need update ui when switch theme-mode.

github github

multipletheme's People

Contributors

derson2388 avatar dersoncheng avatar wayou avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.