mirror of
https://github.com/nextcloud/android.git
synced 2024-12-20 16:02:01 +03:00
Clean up stuff
This commit is contained in:
parent
faf75674a6
commit
d5e9c15fc2
3 changed files with 16 additions and 17 deletions
|
@ -99,7 +99,7 @@
|
|||
</activity>
|
||||
<activity
|
||||
android:name=".ui.preview.PreviewImageActivity"
|
||||
android:theme="@style/Theme.ownCloud" />
|
||||
android:theme="@style/Theme.ownCloud.Overlay" />
|
||||
<activity
|
||||
android:name=".ui.preview.PreviewVideoActivity"
|
||||
android:label="@string/app_name"
|
||||
|
|
|
@ -120,16 +120,17 @@
|
|||
<!-- separat translucent action bar style -->
|
||||
<style name="Theme.ownCloud.Overlay" parent="style/Theme.ownCloud">
|
||||
<item name="android:actionBarStyle">@style/Theme.ownCloud.Overlay.ActionBar</item>
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
<item name="android:windowActionBarOverlay">true</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<!-- Support library compatibility -->
|
||||
<item name="actionBarStyle">@style/Theme.ownCloud.Overlay.ActionBar</item>
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
</style>
|
||||
|
||||
<!-- ACTION BAR STYLES -->
|
||||
<style name="Theme.ownCloud.Overlay.ActionBar" parent="@style/Widget.AppCompat.ActionBar">
|
||||
<item name="android:background">@color/owncloud_blue_transparent</item>
|
||||
<item name="android:windowActionBarOverlay">true</item>
|
||||
|
||||
<!-- Support library compatibility -->
|
||||
<item name="background">@color/owncloud_blue_transparent</item>
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
|
|
|
@ -33,7 +33,6 @@ import android.support.v4.widget.DrawerLayout;
|
|||
import android.support.v7.app.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import com.ortiz.touch.ExtendedViewPager;
|
||||
import com.owncloud.android.MainApp;
|
||||
|
@ -66,8 +65,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|||
public class PreviewImageActivity extends FileActivity implements
|
||||
FileFragment.ContainerActivity,
|
||||
ViewPager.OnPageChangeListener, OnRemoteOperationListener {
|
||||
|
||||
public static final int DIALOG_SHORT_WAIT = 0;
|
||||
|
||||
public static final String TAG = PreviewImageActivity.class.getSimpleName();
|
||||
|
||||
|
@ -75,8 +72,6 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
private static final String KEY_WAITING_FOR_BINDER = "WAITING_FOR_BINDER";
|
||||
private static final String KEY_SYSTEM_VISIBLE = "TRUE";
|
||||
|
||||
private static final int INITIAL_HIDE_DELAY = 0; // immediate hide
|
||||
|
||||
private ExtendedViewPager mViewPager;
|
||||
private PreviewImagePagerAdapter mPreviewImagePagerAdapter;
|
||||
private int mSavedPosition = 0;
|
||||
|
@ -90,17 +85,21 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
final ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
if (savedInstanceState != null && !savedInstanceState.getBoolean(KEY_SYSTEM_VISIBLE, true) &&
|
||||
actionBar != null) {
|
||||
actionBar.hide();
|
||||
}
|
||||
|
||||
setContentView(R.layout.preview_image_activity);
|
||||
|
||||
// Navigation Drawer
|
||||
setupDrawer();
|
||||
|
||||
// ActionBar
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
updateActionBarTitleAndHomeButton(null);
|
||||
|
||||
mFullScreenAnchorView = getWindow().getDecorView();
|
||||
|
@ -111,7 +110,6 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
@Override
|
||||
public void onSystemUiVisibilityChange(int flags) {
|
||||
boolean visible = (flags & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0;
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (visible) {
|
||||
actionBar.show();
|
||||
setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
|
||||
|
@ -124,9 +122,6 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
|
||||
if (savedInstanceState != null) {
|
||||
mRequestWaitingForBinder = savedInstanceState.getBoolean(KEY_WAITING_FOR_BINDER);
|
||||
if (!savedInstanceState.getBoolean(KEY_SYSTEM_VISIBLE, true)) {
|
||||
hideSystemUI(mFullScreenAnchorView);
|
||||
}
|
||||
} else {
|
||||
mRequestWaitingForBinder = false;
|
||||
}
|
||||
|
@ -424,7 +419,10 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
}
|
||||
|
||||
public boolean getSystemUIVisible() {
|
||||
return (mFullScreenAnchorView.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0;
|
||||
if (getSupportActionBar() != null) {
|
||||
return (getSupportActionBar().isShowing());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@SuppressLint("InlinedApi")
|
||||
|
@ -507,7 +505,7 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
anchorView.setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE // draw full window; Android >= 4.1
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN // draw full window; Android >= 4.1
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION // draw full window; Android >= 4.1
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION // draw full window; Android >= 4.
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue