Search in sources :

Example 1 with BottomNavigationView

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);
    }
}
Also used : BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView) Cursor(android.database.Cursor) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView)

Example 2 with BottomNavigationView

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;
            }
        });
    }
}
Also used : BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView) Aware_Client(com.aware.phone.Aware_Client) MenuItem(android.view.MenuItem) Intent(android.content.Intent)

Example 3 with BottomNavigationView

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;
        });
    }
}
Also used : BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView) SubscriptionInfo(android.telephony.SubscriptionInfo) Menu(android.view.Menu) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 4 with BottomNavigationView

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;
    });
}
Also used : BottomNavigationView(com.google.android.material.bottomnavigation.BottomNavigationView)

Aggregations

BottomNavigationView (com.google.android.material.bottomnavigation.BottomNavigationView)4 Intent (android.content.Intent)1 Cursor (android.database.Cursor)1 SubscriptionInfo (android.telephony.SubscriptionInfo)1 Menu (android.view.Menu)1 MenuItem (android.view.MenuItem)1 View (android.view.View)1 VisibleForTesting (androidx.annotation.VisibleForTesting)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 Aware_Client (com.aware.phone.Aware_Client)1