use of com.google.android.material.bottomnavigation.BottomNavigationView in project aware-client by denzilferreira.
the class Aware_Join_Study method onResume.
@Override
protected void onResume() {
super.onResume();
if (active_plugins == null)
return;
Cursor qry = Aware.getStudy(this, study_url);
if (qry != null && qry.moveToFirst()) {
pluginsInstalled = true;
llPluginsRequired.setVisibility(View.GONE);
if (pluginsInstalled) {
btnAction.setAlpha(1f);
btnAction.setEnabled(true);
} else {
btnAction.setEnabled(false);
btnAction.setAlpha(.3f);
}
if (Aware.isStudy(getApplicationContext())) {
btnQuit.setVisibility(View.VISIBLE);
btnAction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
btnAction.setText("OK");
} else {
btnQuit.setVisibility(View.GONE);
}
qry.close();
}
if (Aware.getSetting(this, Aware_Preferences.INTERFACE_LOCKED).equals("true")) {
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.aware_bottombar);
bottomNavigationView.setVisibility(View.GONE);
}
}
use of com.google.android.material.bottomnavigation.BottomNavigationView in project aware-client by denzilferreira.
the class Aware_Activity method onPostCreate.
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
}
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.aware_bottombar);
if (bottomNavigationView != null) {
bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch(item.getItemId()) {
case // Sensors
R.id.aware_sensors:
Intent sensors_ui = new Intent(getApplicationContext(), Aware_Client.class);
startActivity(sensors_ui);
break;
case // Plugins
R.id.aware_plugins:
Intent pluginsManager = new Intent(getApplicationContext(), Plugins_Manager.class);
startActivity(pluginsManager);
break;
case // Stream
R.id.aware_stream:
Intent stream_ui = new Intent(getApplicationContext(), Stream_UI.class);
startActivity(stream_ui);
break;
}
return true;
}
});
}
}
use of com.google.android.material.bottomnavigation.BottomNavigationView in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MobileNetworkActivity method updateBottomNavigationView.
@VisibleForTesting
void updateBottomNavigationView() {
final BottomNavigationView navigation = findViewById(R.id.bottom_nav);
if (CollectionUtils.size(mSubscriptionInfos) <= 1) {
navigation.setVisibility(View.GONE);
} else {
final Menu menu = navigation.getMenu();
menu.clear();
for (int i = 0, size = mSubscriptionInfos.size(); i < size; i++) {
final SubscriptionInfo subscriptionInfo = mSubscriptionInfos.get(i);
menu.add(0, subscriptionInfo.getSubscriptionId(), i, subscriptionInfo.getDisplayName()).setIcon(R.drawable.ic_settings_sim);
}
navigation.setOnNavigationItemSelectedListener(item -> {
switchFragment(new MobileNetworkSettings(), item.getItemId());
getActionBar().setTitle(item.getTitle());
return true;
});
}
}
use of com.google.android.material.bottomnavigation.BottomNavigationView in project SeriesGuide by UweTrottmann.
the class BaseTopActivity method setupBottomNavigation.
public void setupBottomNavigation(@IdRes int selectedItemId) {
BottomNavigationView bottomNav = findViewById(R.id.bottomNavigation);
bottomNav.setSelectedItemId(selectedItemId);
bottomNav.setOnNavigationItemSelectedListener(item -> {
onNavItemClick(item.getItemId());
// Do not change selected item.
return false;
});
}
Aggregations