Java Code Examples for com.jaeger.library.StatusBarUtil#setColor()

The following examples show how to use com.jaeger.library.StatusBarUtil#setColor() . 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: BaseTitleActivity.java    From qvod with MIT License 6 votes vote down vote up
@Override
public void setContentView(int layoutResID) {
    super.setContentView(R.layout.activity_top);
    //
    llTitleMenu = $(R.id.ll_title_menu);
    llTitleMenu.setOnClickListener(this);
    toolbar = $(R.id.toolbar);
    svContent = $(R.id.sv_content);
    getLayoutInflater().inflate(layoutResID, svContent);
    //ActionBar
    setSupportActionBar(toolbar);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        //去除默认Title显示
        actionBar.setDisplayShowTitleEnabled(false);
    }
    //
    StatusBarUtil.setColor(this,ContextCompat.getColor(this, R.color.colorTheme));
}
 
Example 2
Source File: BaseActivity.java    From LQRWeChat with MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MyApp.activities.add(this);
    init();

    //判断是否使用MVP模式
    mPresenter = createPresenter();
    if (mPresenter != null) {
        mPresenter.attachView((V) this);//因为之后所有的子类都要实现对应的View接口
    }

    //子类不再需要设置布局ID,也不再需要使用ButterKnife.bind()
    setContentView(provideContentViewId());
    ButterKnife.bind(this);

    setupAppBarAndToolbar();

    //沉浸式状态栏
    StatusBarUtil.setColor(this, UIUtils.getColor(R.color.colorPrimaryDark), 10);

    initView();
    initData();
    initListener();
}
 
Example 3
Source File: BaseFragmentActivity.java    From LQRWeChat with MIT License 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MyApp.activities.add(this);
    init();

    //判断是否使用MVP模式
    mPresenter = createPresenter();
    if (mPresenter != null) {
        mPresenter.attachView((V) this);//因为之后所有的子类都要实现对应的View接口
    }

    //子类不再需要设置布局ID,也不再需要使用ButterKnife.bind()
    setContentView(provideContentViewId());
    ButterKnife.bind(this);

    setupAppBarAndToolbar();

    //沉浸式状态栏
    StatusBarUtil.setColor(this, UIUtils.getColor(R.color.colorPrimaryDark), 10);

    initView();
    initData();
    initListener();
}
 
Example 4
Source File: SearchActivity.java    From Memory-capsule with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.M)
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_search);
    StatusBarUtil.setColor(this, getColor(R.color.colorFloatingButton));
    prestenerImpSeacher=new Prestener_seacher(this);
    initview();
    prestenerImpSeacher.setBackgroundcolorfromSeting();
}
 
Example 5
Source File: BaseActivity.java    From XposedWechatHelper with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 初始化状态栏颜色
 * 更多详情https://github.com/laobie/StatusBarUtil
 */
protected void initStatusBar() {
    if (isStatusBarTransparent()) {
        StatusBarUtil.setTransparent(BaseActivity.this);
        return;
    }
    StatusBarUtil.setColor(this,
            (ContextCompat.getColor(this, getStatusBarColor())), 0);
}
 
Example 6
Source File: MainActivity.java    From Memory-capsule with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void setBackgroundcolorfromSeting(List<Integer>mlist) {
    maincolor=mlist.get(0);//设置主体颜色
    StatusBarUtil.setColor(this, mlist.get(0));
    toolbar_main.setBackgroundColor(mlist.get(0));
    relativeLayout.setBackgroundColor(mlist.get(1));
    floatingActionButton_diarly.setColorNormal(mlist.get(0));
    floatingActionButton_live.setColorNormal(mlist.get(0));
    floatingActionButton_study.setColorNormal(mlist.get(0));
    floatingActionButton_travel.setColorNormal(mlist.get(0));
    floatingActionButton_work.setColorNormal(mlist.get(0));
}
 
Example 7
Source File: CalendarActivity.java    From Memory-capsule with Apache License 2.0 5 votes vote down vote up
@TargetApi(Build.VERSION_CODES.M)
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setSwipeAnyWhere(false);
    setContentView(R.layout.activity_calendar);
    prestenerImp_calendar=new Prestener_calendar(this);
    prestenerImp_calendar.setBackgroundcolorfromSeting();
    prestenerImp_calendar.readNotecreatimeOnCalendar();
    StatusBarUtil.setColor(this,integer0);
    initview();
}
 
Example 8
Source File: SplashActivity.java    From Mp3Cutter with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    StatusBarUtil.setColor(this, Color.TRANSPARENT);
    mBinding = DataBindingUtil.setContentView(this, R.layout.activity_splash);
    setListener();
}
 
Example 9
Source File: AboutActivity.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
@Override
public void setBackgroundcolorfromSeting(List<Integer>colorlist) {
    niceSpinner.setSelectedIndex(prestenerImp_about.getcurrentcolorNumfromSeting());
    StatusBarUtil.setColor(this,colorlist.get(0));
    toolbar_about.setBackgroundColor(colorlist.get(0));
}
 
Example 10
Source File: BaseCompatActivity.java    From meiShi with Apache License 2.0 4 votes vote down vote up
protected void setStateBarColor(int resId) {
    StatusBarUtil.setColor(this,getResources().getColor(resId));
}
 
Example 11
Source File: RxBusRecyclerIView.java    From MeiZiNews with MIT License 4 votes vote down vote up
protected void setStatusBarColor(Activity activity, int color , int statusBarAlpha) {
    StatusBarUtil.setColor(activity, color, statusBarAlpha);
}
 
Example 12
Source File: ListSecretActivity.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
@Override
public void setBackgroundcolorfromSeting(List<Integer> colorlist) {
    StatusBarUtil.setColor(this, colorlist.get(0));
    toolbar_listsecret.setBackgroundColor(colorlist.get(0));
}
 
Example 13
Source File: SearchMusicActivity.java    From MusicPlayer_XiangDa with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_searchmusic);
    //状态栏透明化
    StatusBarUtil.setColor(SearchMusicActivity.this, Color.parseColor("#31c25c"), 112);

    //搜索图标
    imageViewSearch = findViewById(R.id.searchMusicActivity_searchImageView);

    //进度条
    avi = findViewById(R.id.searchMusicActivity_loadingView);

    //搜索文字显示
    tv = findViewById(R.id.searchMusicActivity_textView);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        // 检查该权限是否已经获取
        // 权限是否已经 授权 GRANTED---授权  DINIED---拒绝
        List<String> permissionList = new ArrayList<>();
        if (ContextCompat.checkSelfPermission(this, Manifest.
                permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
            permissionList.add(Manifest.permission.ACCESS_FINE_LOCATION);
        }
        if (ContextCompat.checkSelfPermission(this, Manifest.
                permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
            permissionList.add(Manifest.permission.READ_PHONE_STATE);
        }
        if (ContextCompat.checkSelfPermission(this, Manifest.
                permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
            permissionList.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
        }
        if (!permissionList.isEmpty()) {
            String[] permissions = permissionList.toArray(new String[permissionList.size()]);
            ActivityCompat.requestPermissions(this, permissions, 1);
        } else {

        }
    }


}
 
Example 14
Source File: SearchActivity.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
@Override
public void setBackgroundcolorfromSeting(List<Integer> colorlist) {
    StatusBarUtil.setColor(this, colorlist.get(0));
    toolbar_search.setBackgroundColor(colorlist.get(0));
}
 
Example 15
Source File: NoteinfoActivity.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
@Override
public void setBackgroundcolorfromSeting(List<Integer> colorlist) {
    StatusBarUtil.setColor(this, colorlist.get(0));
    maincolor=colorlist.get(0);
}
 
Example 16
Source File: ListActivity.java    From Memory-capsule with Apache License 2.0 4 votes vote down vote up
@Override
public void setBackgroundcolorfromSeting(List<Integer> colorlist) {
    StatusBarUtil.setColor(this, colorlist.get(0));
    toolbar_list.setBackgroundColor(colorlist.get(0));
    niceSpinner.setBackgroundColor(colorlist.get(0));
}
 
Example 17
Source File: BaseMvcActivity.java    From DanDanPlayForAndroid with MIT License 4 votes vote down vote up
@Override
protected void setStatusBar() {
    StatusBarUtil.setColor(this, getToolbarColor(), 0);
}
 
Example 18
Source File: BaseAppCompatActivity.java    From DanDanPlayForAndroid with MIT License 4 votes vote down vote up
/**
 * 设置状态栏样式
 */
protected void setStatusBar() {
    StatusBarUtil.setColor(this, getToolbarColor());
}
 
Example 19
Source File: ColorfulViewImpl.java    From MeiZiNews with MIT License 4 votes vote down vote up
protected void setStatusBarColor(Activity activity, int color , int statusBarAlpha) {
    StatusBarUtil.setColor(activity, color, statusBarAlpha);
}
 
Example 20
Source File: ColorfuImgListlViewImpl.java    From MeiZiNews with MIT License 4 votes vote down vote up
protected void setStatusBarColor(Activity activity, int color , int statusBarAlpha) {
    StatusBarUtil.setColor(activity, color, statusBarAlpha);
}