* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful,
+ * This program is distributed in the hd that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
+import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
+import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.view.MenuItem;
import android.view.View;
@Override
protected void onCreate(Bundle savedInstanceState) {
+ requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
+
super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
setContentView(R.layout.preview_image_activity);
// Navigation Drawer
// ActionBar
ActionBar actionBar = getSupportActionBar();
actionBar.setIcon(DisplayUtils.getSeasonalIconId());
- actionBar.setDisplayHomeAsUpEnabled(true);
+ updateActionBarTitleAndHomeButton(null);
actionBar.hide();
+
// Make sure we're running on Honeycomb or higher to use FullScreen and
// Immersive Mode
if (isHoneycombOrHigher()) {
mFullScreenAnchorView = getWindow().getDecorView();
// to keep our UI controls visibility in line with system bars
// visibility
- mFullScreenAnchorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
+ mFullScreenAnchorView.setOnSystemUiVisibilityChangeListener
+ (new View.OnSystemUiVisibilityChangeListener() {
@SuppressLint("InlinedApi")
@Override
public void onSystemUiVisibilityChange(int flags) {
ActionBar actionBar = getSupportActionBar();
if (visible) {
actionBar.show();
+ mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
} else {
actionBar.hide();
+ mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}
}
});
switch(item.getItemId()){
case android.R.id.home:
- backToDisplayActivity();
+ if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
+ mDrawerLayout.closeDrawer(GravityCompat.START);
+ } else {
+ backToDisplayActivity();
+ }
returnValue = true;
break;
default:
} else {
OCFile currentFile = mPreviewImagePagerAdapter.getFileAt(position);
getSupportActionBar().setTitle(currentFile.getFileName());
+ mDrawerToggle.setDrawerIndicatorEnabled(false);
if (!currentFile.isDown()) {
if (!mPreviewImagePagerAdapter.pendingErrorAt(position)) {
requestForDownload(currentFile);
ActionBar actionBar = getSupportActionBar();
if (!actionBar.isShowing()) {
actionBar.show();
+ mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
} else {
actionBar.hide();
+ mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}
}
return false;
}
+
+ @Override
+ public void allFilesOption(){
+ backToDisplayActivity();
+ super.allFilesOption();
+ }
}