Java Code Examples for com.gyf.barlibrary.ImmersionBar#with()

The following examples show how to use com.gyf.barlibrary.ImmersionBar#with() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseActivity.java    From youqu_master with Apache License 2.0 6 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    isConfigChange=false;
    mRxManager=new RxManager();
    doBeforeSetcontentView();
    setContentView(getLayoutId());

    if(isImmersionEnabled()){
        mImmersionBar = ImmersionBar.with(this);
        mImmersionBar .statusBarDarkFont(true)
                .keyboardEnable(true)  //解决软键盘与底部输入框冲突问题,默认为false,还有一个重载方法,可以指定软键盘mode
                .init();   //所有子类都将继承这些相同的属性
    }


    ButterKnife.bind(this);
    mContext = this;
    mPresenter = TUtil.getT(this, 0);
    mModel=TUtil.getT(this,1);
    if(mPresenter!=null){
        mPresenter.mContext=this;
    }
    this.initPresenter();
    this.initView();
}
 
Example 2
Source File: BaseAcitvity.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SuppressLint("ResourceAsColor")
protected void initImmersionBar() {
    mImmersionBar = ImmersionBar.with(this);
    TextView textView = getId(R.id.tv_title);
    if (!activity.getLocalClassName().contains("Vote")) {
        if (textView != null) {
            if (textView.getCurrentTextColor() == -1) {
                mImmersionBar.fitsSystemWindows(true).statusBarColor(R.color.black_box_color);
                mImmersionBar.statusBarDarkFont(false, 0.2f);
            } else {
                mImmersionBar.fitsSystemWindows(true).statusBarColor(R.color.white);
                mImmersionBar.statusBarDarkFont(true, 0.2f);
            }
        }
    }else {
        mImmersionBar.fitsSystemWindows(true).statusBarColor(R.color.black);
        mImmersionBar.statusBarDarkFont(false, 0.2f);
    }

    mImmersionBar.keyboardEnable(true); //解决软键盘与底部输入框冲突问题;
    KeyboardPatch.patch(this).enable();
    mImmersionBar.init();
}
 
Example 3
Source File: FollowActivity.java    From SmartLoadingView with MIT License 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = DataBindingUtil.setContentView(this,R.layout.activity_follow);
    binding.setOnclickListener(this);
    mImmersionBar = ImmersionBar.with(this);
    mImmersionBar.init();

}
 
Example 4
Source File: MainActivity.java    From SmartLoadingView with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
    binding.setOnClickListener(this);
    mImmersionBar = ImmersionBar.with(this);
    mImmersionBar.init();


}
 
Example 5
Source File: LoginActivity.java    From SmartLoadingView with MIT License 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    binding = DataBindingUtil.setContentView(this, R.layout.activity_login);
    binding.setOnclickListener(this);
    mImmersionBar = ImmersionBar.with(this);
    mImmersionBar.init();
    binding.relativeNormal.setSelected(true);
    binding.editPhone.addTextChangedListener(this);
    binding.editPassWord.addTextChangedListener(this);
}
 
Example 6
Source File: BaseActivity.java    From FriendBook with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onContentChanged() {
    super.onContentChanged();
    //设置沉淀式状态栏
    mImmersionBar = ImmersionBar.with(this);
    initImmersionBar(mImmersionBar);
    if (isEnableSlideFinish()) {
        Slidr.attach(this, new SlidrConfig
                .Builder()
                .edge(true)
                .edgeSize(0.18f)// The % of the screen that counts as the edge, default 18%
                .listener(new SlidrListenerAdapter() {
                    @Override
                    public void onSlideStateChanged(int state) {
                        BaseActivity.this.onSlideStateChanged(state);
                    }

                    @Override
                    public void onSlideOpened() {
                        BaseActivity.this.onSlideCancel();
                    }

                    @Override
                    public void onSlideClosed() {
                        BaseActivity.this.onSlideClosed();
                    }
                })
                .build());
    }
}
 
Example 7
Source File: BaseFragment.java    From PocketEOS-Android with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected void initImmersionBar() {
    mImmersionBar = ImmersionBar.with(this);
    mImmersionBar.keyboardEnable(true).statusBarDarkFont(true, 0.2f).init();
}