allow opening other photos with the Gallery

This commit is contained in:
tibbi
2016-06-14 11:24:57 +02:00
parent a6e4e949e0
commit d6a8683941
6 changed files with 146 additions and 15 deletions

View File

@ -5,6 +5,9 @@ import android.content.Context;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.view.View;
import android.view.Window;
import android.widget.Toast;
public class Utils {
@ -28,4 +31,25 @@ public class Utils {
public static boolean hasStoragePermission(Context cxt) {
return ContextCompat.checkSelfPermission(cxt, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
}
public static void showSystemUI(ActionBar actionbar, Window window) {
if (actionbar != null)
actionbar.show();
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
public static void hideSystemUI(ActionBar actionbar, Window window) {
if (actionbar != null)
actionbar.hide();
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LOW_PROFILE |
View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE);
}
}