|
@ -135,6 +135,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
protected void onPostCreate(Bundle savedInstanceState) { |
|
|
protected void onPostCreate(Bundle savedInstanceState) { |
|
|
super.onPostCreate(savedInstanceState); |
|
|
super.onPostCreate(savedInstanceState); |
|
|
drawerToggle.syncState(); |
|
|
drawerToggle.syncState(); |
|
|
|
|
|
syncState(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -159,6 +160,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
public void onConfigurationChanged(Configuration newConfig) { |
|
|
public void onConfigurationChanged(Configuration newConfig) { |
|
|
super.onConfigurationChanged(newConfig); |
|
|
super.onConfigurationChanged(newConfig); |
|
|
drawerToggle.onConfigurationChanged(newConfig); |
|
|
drawerToggle.onConfigurationChanged(newConfig); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -188,6 +190,14 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
finish(); |
|
|
finish(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void syncState() { |
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
|
|
|
|
|
boolean eula = prefs.getBoolean("eula", false); |
|
|
|
|
|
drawerToggle.setDrawerIndicatorEnabled(eula); |
|
|
|
|
|
getSupportActionBar().setDisplayHomeAsUpEnabled(eula); |
|
|
|
|
|
getSupportActionBar().setHomeButtonEnabled(eula); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
public boolean onOptionsItemSelected(MenuItem item) { |
|
|
if (drawerToggle.onOptionsItemSelected(item)) |
|
|
if (drawerToggle.onOptionsItemSelected(item)) |
|
@ -197,10 +207,10 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void init() { |
|
|
private void init() { |
|
|
|
|
|
syncState(); |
|
|
|
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
|
|
if (prefs.getBoolean("eula", false)) { |
|
|
if (prefs.getBoolean("eula", false)) { |
|
|
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); |
|
|
|
|
|
|
|
|
|
|
|
Bundle args = new Bundle(); |
|
|
Bundle args = new Bundle(); |
|
|
args.putLong("folder", -1); |
|
|
args.putLong("folder", -1); |
|
|
|
|
|
|
|
@ -225,8 +235,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); |
|
|
|
|
|
|
|
|
|
|
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); |
|
|
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); |
|
|
fragmentTransaction.replace(R.id.content_frame, new FragmentEula(), "eula"); |
|
|
fragmentTransaction.replace(R.id.content_frame, new FragmentEula(), "eula"); |
|
|
fragmentTransaction.commit(); |
|
|
fragmentTransaction.commit(); |
|
@ -234,7 +242,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void updateDrawer() { |
|
|
public void updateDrawer() { |
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
|
|
|
|
|
ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(this, R.layout.item_drawer); |
|
|
ArrayAdapterDrawer drawerArray = new ArrayAdapterDrawer(this, R.layout.item_drawer); |
|
|
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_unified)); |
|
|
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_unified)); |
|
|
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_folders)); |
|
|
drawerArray.add(new DrawerItem(ActivityView.this, R.string.menu_folders)); |
|
|