|
|
@ -61,6 +61,7 @@ import androidx.appcompat.app.AlertDialog;
|
|
|
|
import androidx.appcompat.widget.PopupMenu;
|
|
|
|
import androidx.appcompat.widget.PopupMenu;
|
|
|
|
import androidx.constraintlayout.widget.Group;
|
|
|
|
import androidx.constraintlayout.widget.Group;
|
|
|
|
import androidx.core.app.NotificationCompat;
|
|
|
|
import androidx.core.app.NotificationCompat;
|
|
|
|
|
|
|
|
import androidx.core.util.Consumer;
|
|
|
|
import androidx.core.widget.NestedScrollView;
|
|
|
|
import androidx.core.widget.NestedScrollView;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
@ -74,6 +75,10 @@ import androidx.preference.PreferenceManager;
|
|
|
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
|
|
import androidx.recyclerview.widget.DividerItemDecoration;
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
|
|
import androidx.window.java.layout.WindowInfoTrackerCallbackAdapter;
|
|
|
|
|
|
|
|
import androidx.window.layout.DisplayFeature;
|
|
|
|
|
|
|
|
import androidx.window.layout.WindowInfoTracker;
|
|
|
|
|
|
|
|
import androidx.window.layout.WindowLayoutInfo;
|
|
|
|
|
|
|
|
|
|
|
|
import com.google.android.material.snackbar.Snackbar;
|
|
|
|
import com.google.android.material.snackbar.Snackbar;
|
|
|
|
|
|
|
|
|
|
|
@ -103,6 +108,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
private boolean nav_options;
|
|
|
|
private boolean nav_options;
|
|
|
|
private int colorDrawerScrim;
|
|
|
|
private int colorDrawerScrim;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private WindowInfoTrackerCallbackAdapter infoTracker;
|
|
|
|
private int layoutId;
|
|
|
|
private int layoutId;
|
|
|
|
private View view;
|
|
|
|
private View view;
|
|
|
|
|
|
|
|
|
|
|
@ -218,6 +224,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
if (nav_expanded && nav_pinned && !canExpandAndPin())
|
|
|
|
if (nav_expanded && nav_pinned && !canExpandAndPin())
|
|
|
|
nav_pinned = false;
|
|
|
|
nav_pinned = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
infoTracker = new WindowInfoTrackerCallbackAdapter(WindowInfoTracker.getOrCreate(this));
|
|
|
|
|
|
|
|
|
|
|
|
Configuration config = getResources().getConfiguration();
|
|
|
|
Configuration config = getResources().getConfiguration();
|
|
|
|
boolean portrait2 = prefs.getBoolean("portrait2", false);
|
|
|
|
boolean portrait2 = prefs.getBoolean("portrait2", false);
|
|
|
|
boolean portrait2c = prefs.getBoolean("portrait2c", false);
|
|
|
|
boolean portrait2c = prefs.getBoolean("portrait2c", false);
|
|
|
@ -1022,6 +1030,18 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
setIntent(intent);
|
|
|
|
setIntent(intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onStart() {
|
|
|
|
|
|
|
|
super.onStart();
|
|
|
|
|
|
|
|
infoTracker.addWindowLayoutInfoListener(this, Runnable::run, layoutStateChangeCallback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
protected void onStop() {
|
|
|
|
|
|
|
|
super.onStop();
|
|
|
|
|
|
|
|
infoTracker.removeWindowLayoutInfoListener(layoutStateChangeCallback);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onResume() {
|
|
|
|
protected void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
super.onResume();
|
|
|
@ -2234,4 +2254,14 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
|
|
|
|
.create();
|
|
|
|
.create();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final Consumer<WindowLayoutInfo> layoutStateChangeCallback = new Consumer<WindowLayoutInfo>() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void accept(WindowLayoutInfo info) {
|
|
|
|
|
|
|
|
List<DisplayFeature> features = info.getDisplayFeatures();
|
|
|
|
|
|
|
|
Log.i("Display features=" + features.size());
|
|
|
|
|
|
|
|
for (DisplayFeature feature : features)
|
|
|
|
|
|
|
|
EntityLog.log(ActivityView.this, "Display feature bounds=" + feature.getBounds());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|