|
|
@ -22,6 +22,7 @@ package eu.faircode.email;
|
|
|
|
import static android.app.ActionBar.DISPLAY_SHOW_CUSTOM;
|
|
|
|
import static android.app.ActionBar.DISPLAY_SHOW_CUSTOM;
|
|
|
|
import static android.app.Activity.RESULT_OK;
|
|
|
|
import static android.app.Activity.RESULT_OK;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
import android.app.RecoverableSecurityException;
|
|
|
|
import android.app.RecoverableSecurityException;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.BroadcastReceiver;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Context;
|
|
|
@ -30,6 +31,7 @@ import android.content.Intent;
|
|
|
|
import android.content.IntentFilter;
|
|
|
|
import android.content.IntentFilter;
|
|
|
|
import android.content.IntentSender;
|
|
|
|
import android.content.IntentSender;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
|
|
|
|
import android.content.pm.ActivityInfo;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
import android.content.res.Configuration;
|
|
|
|
import android.content.res.Configuration;
|
|
|
|
import android.graphics.Rect;
|
|
|
|
import android.graphics.Rect;
|
|
|
@ -85,6 +87,8 @@ public class FragmentBase extends Fragment {
|
|
|
|
private int scrollToResid = 0;
|
|
|
|
private int scrollToResid = 0;
|
|
|
|
private int scrollToOffset = 0;
|
|
|
|
private int scrollToOffset = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Integer orientation = null;
|
|
|
|
|
|
|
|
|
|
|
|
private static final int REQUEST_ATTACHMENT = 51;
|
|
|
|
private static final int REQUEST_ATTACHMENT = 51;
|
|
|
|
private static final int REQUEST_ATTACHMENTS = 52;
|
|
|
|
private static final int REQUEST_ATTACHMENTS = 52;
|
|
|
|
private static final int REQUEST_RECOVERABLE_PERMISSION = 53;
|
|
|
|
private static final int REQUEST_RECOVERABLE_PERMISSION = 53;
|
|
|
@ -409,9 +413,22 @@ public class FragmentBase extends Fragment {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onDestroy() {
|
|
|
|
public void onDestroy() {
|
|
|
|
Log.i("Destroy " + this);
|
|
|
|
Log.i("Destroy " + this);
|
|
|
|
|
|
|
|
if (orientation != null) {
|
|
|
|
|
|
|
|
Activity activity = getActivity();
|
|
|
|
|
|
|
|
if (activity != null)
|
|
|
|
|
|
|
|
activity.setRequestedOrientation(orientation);
|
|
|
|
|
|
|
|
}
|
|
|
|
super.onDestroy();
|
|
|
|
super.onDestroy();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void lockOrientation() {
|
|
|
|
|
|
|
|
Activity activity = getActivity();
|
|
|
|
|
|
|
|
if (activity != null) {
|
|
|
|
|
|
|
|
orientation = activity.getRequestedOrientation();
|
|
|
|
|
|
|
|
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void setHasOptionsMenu(boolean hasMenu) {
|
|
|
|
public void setHasOptionsMenu(boolean hasMenu) {
|
|
|
|
super.setHasOptionsMenu(!isPane() && hasMenu);
|
|
|
|
super.setHasOptionsMenu(!isPane() && hasMenu);
|
|
|
|