Java Code Examples for com.readystatesoftware.systembartint.SystemBarTintManager#setNavigationBarTintEnabled()
The following examples show how to use
com.readystatesoftware.systembartint.SystemBarTintManager#setNavigationBarTintEnabled() .
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: ColorActivity.java From SystemBarTint with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_color); mTintManager = new SystemBarTintManager(this); mTintManager.setStatusBarTintEnabled(true); mTintManager.setNavigationBarTintEnabled(true); mColorPicker = (ColorPicker) findViewById(R.id.color_picker); applySelectedColor(); mButton = (Button) findViewById(R.id.button); mButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { applySelectedColor(); } }); }
Example 2
Source File: MainActivity.java From TigerVideo with Apache License 2.0 | 6 votes |
@TargetApi(19) private void setTranslucentStatus(boolean on) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ Window win = getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if (on) { winParams.flags |= bits; } else { winParams.flags &= ~bits; } win.setAttributes(winParams); } SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintColor(getResources().getColor(R.color.colorPrimary)); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(false); }
Example 3
Source File: ThreeActivity.java From ImmersiveStatusBar with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_three); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { //透明状态栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); //透明导航栏 getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); SystemBarTintManager tintManager = new SystemBarTintManager(this); // 激活状态栏 tintManager.setStatusBarTintEnabled(true); // enable navigation bar tint 激活导航栏 tintManager.setNavigationBarTintEnabled(true); //设置系统栏设置颜色 //tintManager.setTintColor(R.color.red); //给状态栏设置颜色 tintManager.setStatusBarTintResource(R.color.mask_tags_1); //Apply the specified drawable or color resource to the system navigation bar. //给导航栏设置资源 tintManager.setNavigationBarTintResource(R.color.mask_tags_1); } }
Example 4
Source File: HomeActivity.java From bleYan with GNU General Public License v2.0 | 6 votes |
@TargetApi(19) public void setTranslucentStatus(Activity activity, boolean on) { if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { Window win = activity.getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if (on) { winParams.flags |= bits; } else { winParams.flags &= ~bits; } win.setAttributes(winParams); SystemBarTintManager tintManager = new SystemBarTintManager(activity); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(false); tintManager.setStatusBarTintColor(activity.getResources().getColor(R.color.colorPrimary)); //tintManager.setNavigationBarTintColor(activity.getResources().getColor(R.color.colorPrimary)); // tintManager.setStatusBarTintResource(R.color.colorPrimary); } }
Example 5
Source File: BaseActivity.java From Sky31Radio with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Timber.i("onCreate"); AVAnalytics.trackAppOpened(getIntent()); setContentView(provideContentViewId()); ButterKnife.inject(this); if(toolbar!=null){ setSupportActionBar(toolbar); } if(!TextUtils.isEmpty(NavUtils.getParentActivityName(this))){ getSupportActionBar().setDisplayHomeAsUpEnabled(true); } if(Build.VERSION.SDK_INT <= 19){ tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setStatusBarTintColor(getResources().getColor(R.color.primary_dark)); } }
Example 6
Source File: BaseActivity.java From NMSAlphabetAndroidApp with MIT License | 5 votes |
private void tintBars(){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setTranslucentStatusAndNavigationBar(); } tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintColor(ThemeUtil.getPrimaryColor(this)); }
Example 7
Source File: UiUtils.java From droidddle with Apache License 2.0 | 5 votes |
@SuppressLint("NewApi") public static void initSystemBarTint(Activity activity) { int color = ThemeUtil.getThemeColor(activity, R.attr.colorPrimaryDark); if (hasLollipop()) { // activity.getWindow().setNavigationBarColor(color); // activity.getWindow().setStatusBarColor(color); // activity.getWindow().setStatusBarColor(Color.TRANSPARENT); return; } int orientation = activity.getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_LANDSCAPE) { if (!activity.getResources().getBoolean(R.bool.enable_system_bar)) { return; } } // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(activity); // enable status bar tint tintManager.setStatusBarTintEnabled(true); // enable navigation bar tint tintManager.setNavigationBarTintEnabled(false); // set a custom tint color for all system bars tintManager.setTintColor(TINT_COLOR); // set a custom navigation bar resource ColorDrawable drawable = new ColorDrawable(color); tintManager.setNavigationBarTintDrawable(drawable); // set a custom status bar drawable tintManager.setStatusBarTintDrawable(drawable); }
Example 8
Source File: DefaultActivity.java From SystemBarTint with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_default); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); }
Example 9
Source File: BaseActivity.java From AppPlus with MIT License | 5 votes |
/** * 为Android 4.4以上设备使用沉浸时效果 */ @TargetApi(Build.VERSION_CODES.KITKAT) private void setTintLayout() { mBarTintManager = new SystemBarTintManager(this); mBarTintManager.setStatusBarTintEnabled(true); mBarTintManager.setNavigationBarTintEnabled(true); mBarTintManager.setTintColor(Utils.getThemePrimaryColor(this)); }
Example 10
Source File: BaseActivity.java From githot with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(provideContentViewId()); if (Build.VERSION.SDK_INT <= 19) { tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setStatusBarTintColor(getResources().getColor(R.color.primary_dark)); } }
Example 11
Source File: MainActivity.java From mCalendar with Apache License 2.0 | 5 votes |
private void changeStatusBarColor(){ if (Build.VERSION.SDK_INT > 18){ Window window = getWindow(); window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(false); tintManager.setTintColor(getResources().getColor(R.color.colorPrimaryDark)); } }
Example 12
Source File: AboutActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_about); // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_svg_back); if(getSupportActionBar() != null && upArrow != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } // get version code TextView tvVersion = findViewById(R.id.app_version); tvVersion.setText(String.format(getResources().getString(R.string.about_version_template), BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)); }
Example 13
Source File: NovelReviewListActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_novel_review_list); // fetch values aid = getIntent().getIntExtra("aid", 1); // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_svg_back); if(getSupportActionBar() != null && upArrow != null) { getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } // get views and set title // get views mLoadingLayout = findViewById(R.id.list_loading); mSwipeRefreshLayout = findViewById(R.id.swipe_refresh_layout); mRecyclerView = findViewById(R.id.review_item_list); mLoadingStatusTextView = findViewById(R.id.list_loading_status); mLoadingButton = findViewById(R.id.btn_loading); mRecyclerView.setHasFixedSize(false); // use a linear layout manager mLayoutManager = new LinearLayoutManager(this); mRecyclerView.setLayoutManager(mLayoutManager); // Listener mRecyclerView.addOnScrollListener(new MyOnScrollListener()); // set click event for retry and cancel loading mLoadingButton.setOnClickListener(v -> new AsyncReviewListLoader(this, mSwipeRefreshLayout, aid, reviewList).execute()); // retry loading mSwipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.myAccentColor)); mSwipeRefreshLayout.setOnRefreshListener(() -> { // reload all reviewList = new ReviewList(); mAdapter = null; new AsyncReviewListLoader(this, mSwipeRefreshLayout, aid, reviewList).execute(); }); // load initial content new AsyncReviewListLoader(this, mSwipeRefreshLayout, aid, reviewList).execute(); }
Example 14
Source File: MainActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_main); // have 3 styles initialApp(); // UIL setting if (ImageLoader.getInstance() == null || !ImageLoader.getInstance().isInited()) { GlobalConfig.initImageLoader(this); } // UMeng initialization UMConfigure.init(MyApp.getContext(), UMConfigure.DEVICE_TYPE_PHONE, null); // Update old save files ---------------- // set Toolbar Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); // getSupportActionBar().setDisplayShowHomeEnabled(true); // set Tool button mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_drawer); mNavigationDrawerFragment.setup(R.id.fragment_drawer, findViewById(R.id.drawer), mToolbar); // find search box mToolbar.setOnMenuItemClickListener(item -> { //Toast.makeText(MyApp.getContext(),"called button",Toast.LENGTH_SHORT).show(); if (item.getItemId() == R.id.action_search) { // start search activity startActivity(new Intent(MainActivity.this, SearchActivity.class)); overridePendingTransition(R.anim.fade_in, R.anim.hold); // fade in animation } return true; }); // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16) { //&& Build.VERSION.SDK_INT <= 21) { // Android API 22 has more effects on status bar, so ignore // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if (Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } }
Example 15
Source File: NovelReviewReplyListActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_novel_review_reply_list); // fetch values rid = getIntent().getIntExtra("rid", 1); reviewTitle = getIntent().getStringExtra("title"); // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_svg_back); if(getSupportActionBar() != null && upArrow != null) { getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } // get views and set title // get views mLoadingLayout = findViewById(R.id.list_loading); mSwipeRefreshLayout = findViewById(R.id.swipe_refresh_layout); mRecyclerView = findViewById(R.id.review_item_list); mLoadingStatusTextView = findViewById(R.id.list_loading_status); mLoadingButton = findViewById(R.id.btn_loading); etReplyText = findViewById(R.id.review_reply_edit_text); LinearLayout llReplyButton = findViewById(R.id.review_reply_send); mRecyclerView.setHasFixedSize(false); DividerItemDecoration horizontalDecoration = new DividerItemDecoration(mRecyclerView.getContext(), DividerItemDecoration.VERTICAL); Drawable horizontalDivider = ContextCompat.getDrawable(getApplication(), R.drawable.divider_horizontal); if (horizontalDivider != null) { horizontalDecoration.setDrawable(horizontalDivider); mRecyclerView.addItemDecoration(horizontalDecoration); } // use a linear layout manager mLayoutManager = new LinearLayoutManager(this); mRecyclerView.setLayoutManager(mLayoutManager); // Listener mRecyclerView.addOnScrollListener(new MyOnScrollListener()); // set click event for retry and cancel loading mLoadingButton.setOnClickListener(v -> new AsyncReviewReplyListLoader(this, mSwipeRefreshLayout, rid, reviewReplyList).execute()); // retry loading mSwipeRefreshLayout.setColorSchemeColors(getResources().getColor(R.color.myAccentColor)); mSwipeRefreshLayout.setOnRefreshListener(this::refreshReviewReplyList); llReplyButton.setOnClickListener(ignored -> { // FIXME: enable these Toast.makeText(getApplication(), getResources().getString(R.string.system_api_error), Toast.LENGTH_SHORT).show(); // String temp = etReplyText.getText().toString(); // String badWord = Wenku8API.searchBadWords(temp); // if (badWord != null) { // Toast.makeText(getApplication(), String.format(getResources().getString(R.string.system_containing_bad_word), badWord), Toast.LENGTH_SHORT).show(); // } else if (temp.length() < Wenku8API.MIN_REPLY_TEXT) { // Toast.makeText(getApplication(), getResources().getString(R.string.system_review_too_short), Toast.LENGTH_SHORT).show(); // } else { // // hide ime // InputMethodManager imm = (InputMethodManager) getSystemService(Activity.INPUT_METHOD_SERVICE); // View view = getCurrentFocus(); // if (view == null) view = new View(this); // if (imm != null) imm.hideSoftInputFromWindow(view.getWindowToken(), 0); // // // submit // new AsyncPublishReply(etReplyText, this, rid, temp).execute(); // } }); // load initial content new AsyncReviewReplyListLoader(this, mSwipeRefreshLayout, rid, reviewReplyList).execute(); }
Example 16
Source File: UserLoginActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_user_login); // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); if(getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_svg_back); if(upArrow != null) upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { //&& Build.VERSION.SDK_INT <= 21) { // Android API 22 has more effects on status bar, so ignore // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } // get views etUserName = findViewById(R.id.edit_username); etPassword = findViewById(R.id.edit_password); TextView tvLogin = findViewById(R.id.btn_login); TextView tvRegister = findViewById(R.id.btn_register); // listeners tvLogin.setOnClickListener(v -> { if(etUserName.getText().toString().length() == 0 || etUserName.getText().toString().length() > 30 || etPassword.getText().toString().length() == 0 || etPassword.getText().toString().length() > 30) { Toast.makeText(UserLoginActivity.this, getResources().getString(R.string.system_info_fill_not_complete), Toast.LENGTH_SHORT).show(); return; } // async login AsyncLoginTask alt = new AsyncLoginTask(); alt.execute(etUserName.getText().toString(), etPassword.getText().toString()); }); tvRegister.setOnClickListener(v -> new MaterialDialog.Builder(UserLoginActivity.this) .onPositive((dialog, which) -> { // show browser list Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(Wenku8API.REGISTER_URL)); String title = getResources().getString(R.string.system_choose_browser); Intent chooser = Intent.createChooser(intent, title); startActivity(chooser); }) .theme(Theme.LIGHT) .backgroundColorRes(R.color.dlgBackgroundColor) .contentColorRes(R.color.dlgContentColor) .positiveColorRes(R.color.dlgPositiveButtonColor) .negativeColorRes(R.color.dlgNegativeButtonColor) .content(R.string.dialog_content_verify_register) .contentGravity(GravityEnum.CENTER) .positiveText(R.string.dialog_positive_ok) .negativeText(R.string.dialog_negative_pass) .show()); }
Example 17
Source File: MenuBackgroundSelectorActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_menu_background_selector); // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_svg_back); if(getSupportActionBar() != null && upArrow != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setHomeAsUpIndicator(upArrow); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColor)); } // listeners findViewById(R.id.bg01).setOnClickListener(v -> { GlobalConfig.setToAllSetting(GlobalConfig.SettingItems.menu_bg_id, "1"); MenuBackgroundSelectorActivity.this.finish(); }); findViewById(R.id.bg02).setOnClickListener(v -> { GlobalConfig.setToAllSetting(GlobalConfig.SettingItems.menu_bg_id, "2"); MenuBackgroundSelectorActivity.this.finish(); }); findViewById(R.id.bg03).setOnClickListener(v -> { GlobalConfig.setToAllSetting(GlobalConfig.SettingItems.menu_bg_id, "3"); MenuBackgroundSelectorActivity.this.finish(); }); findViewById(R.id.bg04).setOnClickListener(v -> { GlobalConfig.setToAllSetting(GlobalConfig.SettingItems.menu_bg_id, "4"); MenuBackgroundSelectorActivity.this.finish(); }); findViewById(R.id.bg05).setOnClickListener(v -> { GlobalConfig.setToAllSetting(GlobalConfig.SettingItems.menu_bg_id, "5"); MenuBackgroundSelectorActivity.this.finish(); }); }
Example 18
Source File: Wenku8ReaderActivityV1.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.layout_reader_swipe_temp); // fetch values aid = getIntent().getIntExtra("aid", 1); volumeList = (VolumeList) getIntent().getSerializableExtra("volume"); cid = getIntent().getIntExtra("cid", 1); from = getIntent().getStringExtra("from"); forcejump = getIntent().getStringExtra("forcejump"); if(forcejump == null || forcejump.length() == 0) forcejump = "no"; // tempNavBarHeight = LightTool.getNavigationBarSize(this).y; // set indicator enable Toolbar mToolbar = findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); if(getSupportActionBar() != null) { getSupportActionBar().setTitle(volumeList.volumeName); final Drawable upArrow = getResources().getDrawable(R.drawable.ic_back); if (upArrow != null) upArrow.setColorFilter(getResources().getColor(R.color.default_white), PorterDuff.Mode.SRC_ATOP); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setHomeAsUpIndicator(upArrow); } if (Build.VERSION.SDK_INT >= 16 ) { // Android API 22 has more effects on status bar, so ignore // create our manager instance after the content view is set tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); } // find views mSliderHolder = findViewById(R.id.slider_holder); // UIL setting if(ImageLoader.getInstance() == null || !ImageLoader.getInstance().isInited()) { GlobalConfig.initImageLoader(this); } // async tasks ContentValues cv = Wenku8API.getNovelContent(aid, cid, GlobalConfig.getCurrentLang()); AsyncNovelContentTask ast = new AsyncNovelContentTask(); ast.execute(cv); }
Example 19
Source File: MainActivity.java From discreet-app-rate with Apache License 2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { Window win = getWindow(); WindowManager.LayoutParams winParams = win.getAttributes(); int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; winParams.flags |= bits; bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION; winParams.flags |= bits; win.setAttributes(winParams); SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable status bar tint tintManager.setStatusBarTintEnabled(true); // enable navigation bar tint tintManager.setNavigationBarTintEnabled(true); tintManager.setTintColor(Color.parseColor("#DDDDDD")); } manageViews(); settings = getSharedPreferences(PreferencesConstants.PREFS_NAME, 0); editor = settings.edit(); updateValueDisplay(); okButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { switch (actionSpinner.getSelectedItemPosition()) { case 0: getAppRate().checkAndShow(); break; case 1: getAppRate().reset(); break; case 2: getAppRate().forceShow(); break; case 3: getAppRate().neverShowAgain(); break; case 4: editor.putLong(PreferencesConstants.KEY_LAST_CRASH, System.currentTimeMillis()); editor.commit(); Toast.makeText(MainActivity.this, "App has crashed just now", Toast.LENGTH_LONG).show(); break; } updateValueDisplay(); } }); }
Example 20
Source File: SearchResultActivity.java From light-novel-library_Wenku8_Android with GNU General Public License v2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_search_result); // get arguments String searchKey = getIntent().getStringExtra("key"); // set indicator enable Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar_actionbar); setSupportActionBar(mToolbar); if(getSupportActionBar() != null ) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); } // change status bar color tint, and this require SDK16 if (Build.VERSION.SDK_INT >= 16 ) { //&& Build.VERSION.SDK_INT <= 21) { // Android API 22 has more effects on status bar, so ignore // create our manager instance after the content view is set SystemBarTintManager tintManager = new SystemBarTintManager(this); // enable all tint tintManager.setStatusBarTintEnabled(true); tintManager.setNavigationBarTintEnabled(true); tintManager.setTintAlpha(0.15f); tintManager.setNavigationBarAlpha(0.0f); // set all color tintManager.setTintColor(getResources().getColor(android.R.color.black)); // set Navigation bar color if(Build.VERSION.SDK_INT >= 21) getWindow().setNavigationBarColor(getResources().getColor(R.color.myNavigationColorWhite)); } // set action bat title TextView mTextView = (TextView) findViewById(R.id.search_result_title); if(mTextView != null) mTextView.setText(getResources().getString(R.string.title_search) + searchKey); // init values Bundle bundle = new Bundle(); bundle.putString("type", "search"); bundle.putString("key", searchKey); // UIL setting if(ImageLoader.getInstance() == null || !ImageLoader.getInstance().isInited()) { GlobalConfig.initImageLoader(this); } // This code will produce more than one activity in stack, so I jump to new SearchActivity to escape it. getSupportFragmentManager().beginTransaction() .replace(R.id.result_fragment, NovelItemListFragment.newInstance(bundle), "fragment") .setTransitionStyle(FragmentTransaction.TRANSIT_NONE) .commit(); }