Java Code Examples for androidx.appcompat.app.actionbar#setElevation()
The following examples show how to use
androidx.appcompat.app.actionbar#setElevation() .
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: AppInformationActivity.java From DeviceConnect-Android with MIT License | 6 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_linking_app_information); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setElevation(0); } TextView tv = findViewById(R.id.activity_detail_version); if (tv != null) { tv.setText(getVersionName(this)); } }
Example 2
Source File: MainActivity.java From microMathematics with GNU General Public License v3.0 | 5 votes |
private void initGUI() { // Action bar (v7 compatibility library): use Toolbar mToolbar = findViewById(R.id.toolbar); setSupportActionBar(mToolbar); final ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setElevation(5.0f); } // activate toolbar separator, if necessary { final int sepColor = CompatUtils.getThemeColorAttr(this, R.attr.colorToolBarSeparator); if (sepColor != Color.TRANSPARENT && findViewById(R.id.toolbar_separator) != null) { findViewById(R.id.toolbar_separator).setVisibility(View.VISIBLE); } } // Action bar drawer mDrawerLayout = findViewById(R.id.main_drawer_layout); navigationView = findViewById(R.id.navigation_view); if (navigationView != null) { prepareNavigationView(); } // ActionBarDrawerToggle ties together the the proper interactions // between the sliding drawer and the action bar app icon mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, mToolbar, R.string.drawer_open, R.string.drawer_open) { public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); } }; CompatUtils.setDrawerListener(mDrawerLayout, mDrawerToggle); }
Example 3
Source File: LinkingInductionActivity.java From DeviceConnect-Android with MIT License | 5 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_linking_induction); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setElevation(0); } Button linkingBtn = findViewById(R.id.fragment_linking_app); if (linkingBtn != null) { linkingBtn.setOnClickListener((v) -> { LinkingUtil.startLinkingApp(getApplicationContext()); }); } Button googleBtn = findViewById(R.id.fragment_linking_setting_google_play_btn); if (googleBtn != null) { googleBtn.setOnClickListener((v) -> { LinkingUtil.startGooglePlay(getApplicationContext()); }); } Button updateBtn = findViewById(R.id.fragment_linking_setting_update_btn); if (updateBtn != null) { updateBtn.setOnClickListener((v) -> { LinkingUtil.startGooglePlay(getApplicationContext()); }); } }
Example 4
Source File: LinkingDeviceActivity.java From DeviceConnect-Android with MIT License | 5 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_linking_device); mUtil = PreferenceUtil.getInstance(getApplicationContext()); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(getString(R.string.activity_device_title)); actionBar.setElevation(0); } Intent intent = getIntent(); if (intent != null) { Bundle args = intent.getExtras(); if (args != null) { mDevice = getLinkingDeviceByAddress(args.getString(EXTRA_ADDRESS)); if (mDevice != null) { setupUI(); } } } if (mDevice == null) { finish(); } }
Example 5
Source File: SettingActivity.java From DeviceConnect-Android with MIT License | 5 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_linking_setting); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setElevation(0); } pageTitle[0] = getString(R.string.activity_setting_tab_paring); pageTitle[1] = getString(R.string.activity_setting_tab_beacon); mFragments[0] = LinkingDeviceListFragment.newInstance(); mFragments[1] = LinkingBeaconListFragment.newInstance(); TabLayout tabLayout = findViewById(R.id.activity_setting_tabs); ViewPager viewPager = findViewById(R.id.activity_setting_view_pager); if (viewPager != null) { viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager())); if (tabLayout != null) { tabLayout.setupWithViewPager(viewPager); } } checkArguments(getIntent()); if (LinkingUtil.getVersionCode(this) < LinkingUtil.LINKING_APP_VERSION) { openUpdateDialog(); } }
Example 6
Source File: MainActivity.java From onpc with GNU General Public License v3.0 | 4 votes |
private void initGUI() { setContentView(orientation == android.content.res.Configuration.ORIENTATION_PORTRAIT ? R.layout.activity_main_port : R.layout.activity_main_land); if (configuration.isKeepScreenOn()) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } toolbar = findViewById(R.id.toolbar); toolbar.setTitle(R.string.app_short_name); setSupportActionBar(toolbar); final ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(R.string.app_short_name); actionBar.setElevation(5.0f); } // Create the adapter that will return a fragment for each of the three // primary sections of the activity. pagerAdapter = new MainPagerAdapter(this, getSupportFragmentManager(), configuration); // Set up the ViewPager with the sections adapter. viewPager = findViewById(R.id.view_pager); viewPager.setAdapter(pagerAdapter); final TabLayout tabLayout = findViewById(R.id.tab_layout); tabLayout.setupWithViewPager(viewPager); // Navigation drawer navigationDrawer = new MainNavigationDrawer(this, versionName); // ActionBarDrawerToggle ties together the the proper interactions // between the sliding drawer and the action bar app icon mDrawerToggle = new ActionBarDrawerToggle(this, navigationDrawer.getDrawerLayout(), toolbar, R.string.drawer_open, R.string.drawer_open) { public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); navigationDrawer.updateNavigationContent(stateHolder.getState()); } }; Utils.setDrawerListener(navigationDrawer.getDrawerLayout(), mDrawerToggle); }
Example 7
Source File: LinkingBeaconActivity.java From DeviceConnect-Android with MIT License | 4 votes |
@Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_linking_beacon); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(getString(R.string.activity_beacon_title)); actionBar.setElevation(0); } Intent intent = getIntent(); if (intent != null) { Bundle args = intent.getExtras(); if (args != null) { int extraId = args.getInt(EXTRA_ID); int vendorId = args.getInt(VENDOR_ID); LinkingApplication app = (LinkingApplication) getApplication(); LinkingBeaconManager mgr = app.getLinkingBeaconManager(); mLinkingBeacon = mgr.findBeacon(extraId, vendorId); } } if (BuildConfig.DEBUG) { Log.i(TAG, "LinkingBeaconActivity#onCreate"); Log.i(TAG, "Beacon: " + mLinkingBeacon); } Button clearBtn = (Button) findViewById(R.id.activity_beacon_clear_btn); if (clearBtn != null) { clearBtn.setOnClickListener((v) -> { clearTextView(); }); } setBeaconData(); if (mLinkingBeacon == null) { finish(); } }