Search in sources :

Example 1 with WifiFragment

use of com.inceptai.dobby.ui.WifiFragment in project dobby-android by InceptAi.

the class MainActivity method onNavigationItemSelected.

@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.
    int id = item.getItemId();
    if (id == R.id.nav_wifi_scan) {
        ListenableFuture<List<ScanResult>> scanFuture = networkLayer.wifiScan();
        Toast.makeText(this, "Starting wifi scan...", Toast.LENGTH_SHORT).show();
        WifiFragment fragment = (WifiFragment) setupFragment(WifiFragment.class, WifiFragment.FRAGMENT_TAG);
        fragment.setWifiScanFuture(scanFuture, threadpool.getExecutor());
    } else if (id == R.id.nav_debug) {
        DebugFragment fragment = (DebugFragment) setupFragment(DebugFragment.class, DebugFragment.FRAGMENT_TAG);
    } else if (id == R.id.nav_fake_data) {
        FakeDataFragment fragment = (FakeDataFragment) setupFragment(FakeDataFragment.class, FakeDataFragment.FRAGMENT_TAG);
    } else if (id == R.id.nav_manage) {
    } else if (id == R.id.nav_share) {
    } else if (id == R.id.nav_send) {
    } else if (id == R.id.about_wifi_expert) {
        showAboutAndPrivacyPolicy();
    } else if (id == R.id.feedback_wifi_expert) {
        showFeedbackForm();
    }
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    item.setChecked(false);
    return true;
}
Also used : DebugFragment(com.inceptai.dobby.ui.DebugFragment) ArrayList(java.util.ArrayList) List(java.util.List) FakeDataFragment(com.inceptai.dobby.ui.FakeDataFragment) WifiFragment(com.inceptai.dobby.ui.WifiFragment) DrawerLayout(android.support.v4.widget.DrawerLayout)

Aggregations

DrawerLayout (android.support.v4.widget.DrawerLayout)1 DebugFragment (com.inceptai.dobby.ui.DebugFragment)1 FakeDataFragment (com.inceptai.dobby.ui.FakeDataFragment)1 WifiFragment (com.inceptai.dobby.ui.WifiFragment)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1