diff options
author | Fup Duck <fupduck@sacknagel.com> | 2018-01-13 17:29:42 +0100 |
---|---|---|
committer | Fup Duck <fupduck@sacknagel.com> | 2018-01-13 17:29:42 +0100 |
commit | 1e6e2190befc6c83874152a97a550c765c121e14 (patch) | |
tree | df22a886556118900bf5e136fef3e422aaf68276 /app | |
parent | d9d7e4edefb4ea4337e891125ab569db6a4424a5 (diff) |
clean up MainActivity
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/MainActivity.java | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java index 24145864..41e496bb 100644 --- a/app/src/main/java/se/leap/bitmaskclient/MainActivity.java +++ b/app/src/main/java/se/leap/bitmaskclient/MainActivity.java @@ -1,47 +1,25 @@ package se.leap.bitmaskclient; -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; -import android.support.v7.app.ActionBar; +import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.support.v4.widget.DrawerLayout; import se.leap.bitmaskclient.drawer.NavigationDrawerFragment; -import se.leap.bitmaskclient.fragments.LogFragment; import se.leap.bitmaskclient.userstatus.SessionDialog; -import se.leap.bitmaskclient.userstatus.User; -import se.leap.bitmaskclient.userstatus.UserStatusFragment; - -import static se.leap.bitmaskclient.Constants.SHARED_PREFERENCES; public class MainActivity extends AppCompatActivity { private static Provider provider = new Provider(); private static FragmentManagerEnhanced fragmentManager; - private SharedPreferences preferences; /** * Fragment managing the behaviors, interactions and presentation of the navigation drawer. */ - private NavigationDrawerFragment mNavigationDrawerFragment; - - /** - * Used to store the last screen title. For use in {@link #restoreActionBar()}. - */ - private CharSequence mTitle; @Override protected void onCreate(Bundle savedInstanceState) { @@ -50,48 +28,17 @@ public class MainActivity extends AppCompatActivity { setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); - mNavigationDrawerFragment = (NavigationDrawerFragment) + NavigationDrawerFragment navigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById(R.id.navigation_drawer); - mTitle = getTitle(); fragmentManager = new FragmentManagerEnhanced(getSupportFragmentManager()); - preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE); // Set up the drawer. - mNavigationDrawerFragment.setUp( + navigationDrawerFragment.setUp( R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout)); } - /** - * A placeholder fragment containing a simple view. - */ - public static class PlaceholderFragment extends Fragment { - public PlaceholderFragment() { - } - - /** - * Returns a new instance of this fragment for the given section - * number. - */ - public static PlaceholderFragment newInstance() { - PlaceholderFragment fragment = new PlaceholderFragment(); - return fragment; - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_main, container, false); - return rootView; - } - - @Override - public void onAttach(Context context) { - super.onAttach(context); - } - } - public static void sessionDialog(Bundle resultData) { try { FragmentTransaction transaction = fragmentManager.removePreviousFragment(SessionDialog.TAG); |