X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/b7dfc0aa41f54869799a54619ed68f9152ed37a1..00482b6dcb1e98da39df54374f7098b51d66bee5:/src/com/owncloud/android/ui/preview/PreviewImageActivity.java diff --git a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java index c5977a86..2b0d96ce 100644 --- a/src/com/owncloud/android/ui/preview/PreviewImageActivity.java +++ b/src/com/owncloud/android/ui/preview/PreviewImageActivity.java @@ -8,7 +8,7 @@ * 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. @@ -31,7 +31,9 @@ import android.os.Bundle; 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; @@ -90,9 +92,10 @@ public class PreviewImageActivity extends FileActivity implements @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 @@ -101,10 +104,9 @@ public class PreviewImageActivity extends FileActivity implements // ActionBar ActionBar actionBar = getSupportActionBar(); actionBar.setIcon(DisplayUtils.getSeasonalIconId()); - actionBar.setDisplayHomeAsUpEnabled(true); + updateActionBarTitleAndHomeButton(null); actionBar.hide(); - updateActionBarTitleAndHomeButton(); // Make sure we're running on Honeycomb or higher to use FullScreen and // Immersive Mode @@ -122,8 +124,10 @@ public class PreviewImageActivity extends FileActivity implements ActionBar actionBar = getSupportActionBar(); if (visible) { actionBar.show(); + mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); } else { actionBar.hide(); + mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); } } }); @@ -322,7 +326,11 @@ public class PreviewImageActivity extends FileActivity implements switch(item.getItemId()){ case android.R.id.home: - backToDisplayActivity(); + if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) { + mDrawerLayout.closeDrawer(GravityCompat.START); + } else { + backToDisplayActivity(); + } returnValue = true; break; default: @@ -511,9 +519,11 @@ public class PreviewImageActivity extends FileActivity implements ActionBar actionBar = getSupportActionBar(); if (!actionBar.isShowing()) { actionBar.show(); + mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); } else { actionBar.hide(); + mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); }