Giter Site home page Giter Site logo

immersive's Introduction

Immersive



一行代码实现沉浸式,适配android4.4到8.0+,沉浸式前所未有的简单。

Image Text

代码示例

public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Immersive.setContentView(this, R.layout.activity_main, R.color.blue, R.color.green, false, false);
    }
}

使用以下方法代替Activity.setContentView(),即可实现沉浸式。

    /**
     * @param activity 当前需要使用沉浸式的Activity
     * @param layoutRes 当前activity使用的布局资源Id
     * @param statusRes 状态栏颜色资源Id
     * @param navigationRes 底部导航栏颜色Id
     * @param statusEmbed 是否隐藏状态栏
     * @param navigationEmbed 是否隐藏导航栏
     */
    Immersive.setContentView(Activity activity, @LayoutRes int layoutRes, int statusRes, int navigationRes, boolean statusEmbed, boolean navigationEmbed)

动态修改状态栏颜色,前提是必须使用Immersive.setContentView设置布局。

    /**
     *
     * @param activity 当前Activity
     * @param color 颜色
     */
    Immersive.setStatusBarColor(Activity activity, int color)

动态修改导航栏颜色,前提是必须使用Immersive.setContentView设置布局。

    /**
     *
     * @param activity 当前Activity
     * @param color 颜色
     */
    Immersive.setNavigationBarColor(Activity activity, int color)

快速引入项目

	dependencies {
                ...
	        implementation 'com.hacknife:immersive:1.1.0'
	}




感谢浏览

如果你有任何疑问,请加入QQ群,我将竭诚为你解答。欢迎Star和Fork本仓库,当然也欢迎你关注我。
Image Text

immersive's People

Contributors

iwdael 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.