cn.ycbjie.ycstatusbarlib.bar.StateAppBar Java Examples

The following examples show how to use cn.ycbjie.ycstatusbarlib.bar.StateAppBar. 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 YCAudioPlayer with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    if (BaseConfig.INSTANCE.isNight()) {
        setTheme(getDarkTheme());
    }
    super.onCreate(savedInstanceState);
    setContentView(getContentView());
    ButterKnife.bind(this);
    //避免切换横竖屏
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    StateAppBar.setStatusBarColor(this,R.color.redTab);
    if (mPresenter != null){
        mPresenter.subscribe();
    }
    initView();
    initListener();
    if(!NetworkUtils.isConnected()){
        ToastUtils.showShort("请检查网络是否连接");
    }
    initData();
}
 
Example #2
Source File: NewArticleActivity.java    From YCCustomText with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new);
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.colorPrimary));
    toolbar = findViewById(R.id.toolbar);
    hte_content = findViewById(R.id.hte_content);
    htv_content = findViewById(R.id.htv_content);
    initToolBar();
    screenWidth = CommonUtil.getScreenWidth(this);
    screenHeight = CommonUtil.getScreenHeight(this);
    initListener();
    initHyper();
    //解决点击EditText弹出收起键盘时出现的黑屏闪现现象
    View rootView = hte_content.getRootView();
    rootView.setBackgroundColor(Color.WHITE);
    hte_content.postDelayed(new Runnable() {
        @Override
        public void run() {
            EditText lastFocusEdit = hte_content.getLastFocusEdit();
            lastFocusEdit.requestFocus();
            //打开软键盘显示
            //HyperLibUtils.openSoftInput(NewArticleActivity.this);
        }
    },300);
}
 
Example #3
Source File: TestClarityActivity.java    From YCVideoPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    videoPlayer = (VideoPlayer) findViewById(R.id.nice_video_player);
    mBtnTiny1 = (Button) findViewById(R.id.btn_tiny_1);
    mBtnTiny2 = (Button) findViewById(R.id.btn_tiny_2);


    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    VideoPlayerController controller = new VideoPlayerController(this);
    controller.setTitle("Beautiful China...");
    controller.setLength(117000);
    controller.setClarity(getClarites(), 0);
    Glide.with(this)
            .load("http://imgsrc.baidu.com/image/c0%3Dshijue%2C0%2C0%2C245%2C40/sign=304dee3ab299a9012f38537575fc600e/91529822720e0cf3f8b77cd50046f21fbe09aa5f.jpg")
            .placeholder(R.drawable.image_default)
            .into(controller.imageView());
    controller.setTopPadding(24);
    videoPlayer.continueFromLastPosition(false);
    videoPlayer.setController(controller);
}
 
Example #4
Source File: MainActivity.java    From YCAudioPlayer with Apache License 2.0 6 votes vote down vote up
@Override
public void initView() {
    //音频播放器需要让服务长期存在
    if (!checkServiceAlive()) {
        return;
    }
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initFragment();
    initTabLayout();
    initPlayServiceListener();
    parseIntent();
    AppToolUtils.requestMsgPermission(this);
    ServiceUtils.startService(AppLogService.class);
    String channel = getChannel(this.getApplicationContext());
    AppLogUtils.eTag("渠道"+channel);
}
 
Example #5
Source File: PreviewArticleActivity.java    From YCCustomText with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preview_article);
    StateAppBar.setStatusBarLightMode(this, Color.WHITE);
    htvContent = findViewById(R.id.htv_content);
    TextView tv_title = findViewById(R.id.tv_title);
    ImageView iv_image = findViewById(R.id.iv_image);
    TextView tv_name = findViewById(R.id.tv_name);
    TextView tv_time = findViewById(R.id.tv_time);
    initHyper();
    List<HyperEditData> hyperEditData = ModelStorage.getInstance().getHyperEditData();
    showDataSync(hyperEditData);
    Glide.with(getApplicationContext())
            .asBitmap()
            .load(R.drawable.shape_load_bg)
            .placeholder(R.drawable.img_load_fail)
            .error(R.drawable.img_load_fail)
            .into(iv_image);
    htvContent.setOnHyperTextListener(new OnHyperTextListener() {
        @Override
        public void onImageClick(View view, String imagePath) {

        }
    });




}
 
Example #6
Source File: DebugActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@SuppressLint("SetTextI18n")
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this,
            ContextCompat.getColor(this, R.color.redTab));
    toolbarTitle.setText("设置Debug模式");
}
 
Example #7
Source File: TestNormalActivity.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    videoPlayer = findViewById(R.id.video_player);
    //必须关键的4步,播放视频最简单的方式
    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    videoPlayer.setUp(ConstantVideo.VideoPlayerList[0], null);
    controller = new VideoPlayerController(this);
    controller.setTopPadding(24.0f);
    videoPlayer.continueFromLastPosition(false);
    videoPlayer.setController(controller);
}
 
Example #8
Source File: MainActivity.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    StateAppBar.setStatusBarLightMode(this, Color.WHITE);
    initView();
}
 
Example #9
Source File: TestSavePosActivity.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    videoPlayer = findViewById(R.id.video_player);
    //必须关键的4步,播放视频最简单的方式
    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    videoPlayer.setUp(ConstantVideo.VideoPlayerList[0], null);
    controller = new VideoPlayerController(this);
    controller.setTopPadding(24.0f);
    videoPlayer.continueFromLastPosition(true);
    videoPlayer.setController(controller);
}
 
Example #10
Source File: TestTinyActivity.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    videoPlayer = (VideoPlayer) findViewById(R.id.nice_video_player);
    mBtnTiny1 = (Button) findViewById(R.id.btn_tiny_1);
    mBtnTiny2 = (Button) findViewById(R.id.btn_tiny_2);


    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    videoPlayer.setUp(ConstantVideo.VideoPlayerList[0], null);
    VideoPlayerController controller = new VideoPlayerController(this);
    controller.setLoadingType(ConstantKeys.Loading.LOADING_RING);
    controller.setTitle("办公室小野开番外了,居然在办公室开澡堂!老板还点赞?");
    controller.setLength(98000);
    Glide.with(this)
            .load("http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-30-43.jpg")
            .placeholder(R.drawable.image_default)
            .into(controller.imageView());
    controller.setHideTime(2000);
    controller.setTopPadding(24);
    //设置横屏播放时,tv和audio图标是否显示
    controller.setTvAndAudioVisibility(true,true);
    controller.setOnVideoControlListener(new OnVideoControlListener() {
        @Override
        public void onVideoControlClick(int type) {
            switch (type){
                case ConstantKeys.VideoControl.TV:
                    //BaseToast.showRoundRectToast("投影tv电视");
                    break;
                case ConstantKeys.VideoControl.HOR_AUDIO:
                    //BaseToast.showRoundRectToast("切换音频");
                    break;
                default:
                    break;
            }
        }
    });
    videoPlayer.continueFromLastPosition(false);
    videoPlayer.setController(controller);
}
 
Example #11
Source File: EightActivity.java    From YCBanner with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_eight);
    StateAppBar.translucentStatusBar(this,true);
    mRecyclerView = findViewById(R.id.recyclerView);
    recyclerView2 = findViewById(R.id.recyclerView2);
    fl_container = findViewById(R.id.fl_container);
    initRecyclerView();
    initRecyclerView2();
}
 
Example #12
Source File: NightActivity.java    From YCBanner with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_night);
    StateAppBar.translucentStatusBar(this,true);
    mRecyclerView = findViewById(R.id.recyclerView);
    fl_container = findViewById(R.id.fl_container);
    recyclerView2 = findViewById(R.id.recyclerView2);
    recyclerView3 = findViewById(R.id.recyclerView3);
    initRecyclerView();
    initRecyclerView2();
    initRecyclerView3();
}
 
Example #13
Source File: AdvertActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    cdvTime.setVisibility(View.VISIBLE);
    llBottom.setVisibility(View.GONE);
    startLoading();
    getLocalSplash();
}
 
Example #14
Source File: WebViewActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initIntentData();
    initToolBar();
    initWebView();
}
 
Example #15
Source File: MusicInfoActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initToolBar();
    initIntentData();
    initViewData();
}
 
Example #16
Source File: OnlineMusicActivity.java    From YCAudioPlayer with Apache License 2.0 5 votes vote down vote up
@Override
public void initView() {
    if (!checkServiceAlive()) {
        return;
    }
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initIntentData();
    initToolBar();
    initRecyclerView();
}
 
Example #17
Source File: LocalZipFileActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initActionBar();
    initRecyclerView();
}
 
Example #18
Source File: LocalVideoActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initActionBar();
    initRecyclerView();
}
 
Example #19
Source File: MeSettingActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    initActionBar();
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
}
 
Example #20
Source File: LocalOfficeActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initActionBar();
    initRecyclerView();
}
 
Example #21
Source File: GuideActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    presenter.subscribe();
    StateAppBar.translucentStatusBar(this, true);
}
 
Example #22
Source File: SplashPagerActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    StateAppBar.translucentStatusBar(this, true);
}
 
Example #23
Source File: SplashAdActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    initTimer();
    initFlView();
}
 
Example #24
Source File: SplashMvActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    initTimer();
}
 
Example #25
Source File: TestFullActivity.java    From YCVideoPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.translucentStatusBar(this, true);
    videoPlayer = (VideoPlayer) findViewById(R.id.nice_video_player);
    mBtnTiny1 = (Button) findViewById(R.id.btn_tiny_1);
    mBtnTiny2 = (Button) findViewById(R.id.btn_tiny_2);

    videoPlayer.setPlayerType(ConstantKeys.IjkPlayerType.TYPE_IJK);
    videoPlayer.setUp(ConstantVideo.VideoPlayerList[0], null);
    VideoPlayerController controller = new VideoPlayerController(this);
    controller.setTitle("办公室小野开番外了,居然在办公室开澡堂!老板还点赞?");
    controller.setLength(98000);
    Glide.with(this)
            .load("http://tanzi27niu.cdsb.mobi/wps/wp-content/uploads/2017/05/2017-05-17_17-30-43.jpg")
            .placeholder(R.drawable.image_default)
            .into(controller.imageView());
    //设置中间播放按钮是否显示
    controller.setTopPadding(24.0f);
    controller.setTopVisibility(true);
    controller.setOnVideoControlListener(new OnVideoControlListener() {
        @Override
        public void onVideoControlClick(int type) {
            switch (type){
                case ConstantKeys.VideoControl.DOWNLOAD:
                    //BaseToast.showRoundRectToast("下载");
                    break;
                case ConstantKeys.VideoControl.SHARE:
                    //BaseToast.showRoundRectToast("分享");
                    break;
                case ConstantKeys.VideoControl.MENU:
                    //BaseToast.showRoundRectToast("更多");
                    break;
                case ConstantKeys.VideoControl.AUDIO:
                    //BaseToast.showRoundRectToast("下载");
                    break;
                default:
                    break;
            }
        }
    });
    videoPlayer.setController(controller);
    videoPlayer.continueFromLastPosition(false);
    videoPlayer.postDelayed(new Runnable() {
        @Override
        public void run() {
            videoPlayer.start();
        }
    },500);
}
 
Example #26
Source File: ArtistInfoActivity.java    From YCAudioPlayer with Apache License 2.0 4 votes vote down vote up
@Override
public void initView() {
    StateAppBar.setStatusBarColor(this, ContextCompat.getColor(this, R.color.redTab));
    initIntentData();
}