Add predictions row to taskbar all apps.
- We need to listen to DeviceProfile changes in case the number of columns changes in the grid. I made an interface/mixin separate from ActivityContext to avoid polutting the latter with too many things. I also applied this change to existing taskbar A-Z grid. - Added all apps visited count to onboarding preferences for only showing "All Apps" label in place of divider 20 times. Label is also tracked on taskbar side and should be kept in sync. Test: Manual Fix: 216843395 Bug: 174174514 Change-Id: I97aa91397c334123626caf18251f19e17c7104fb
This commit is contained in:
1 parent
8c3cb4e324
commit
099945b075
16 files changed
+224
-133
No files matched your search
@@ -44,6 +44,7 @@ import com.android.launcher3.util.DisplayController.Info;
|
||||
import com.android.launcher3.util.WindowBounds;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public class DeviceProfile {
|
||||
@@ -1223,6 +1224,35 @@ public class DeviceProfile {
|
||||
void onDeviceProfileChanged(DeviceProfile dp);
|
||||
}
|
||||
|
||||
/** Allows registering listeners for {@link DeviceProfile} changes. */
|
||||
public interface DeviceProfileListenable {
|
||||
|
||||
/** The current device profile. */
|
||||
DeviceProfile getDeviceProfile();
|
||||
|
||||
/** Registered {@link OnDeviceProfileChangeListener} instances. */
|
||||
List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners();
|
||||
|
||||
/** Notifies listeners of a {@link DeviceProfile} change. */
|
||||
default void dispatchDeviceProfileChanged() {
|
||||
DeviceProfile deviceProfile = getDeviceProfile();
|
||||
List<OnDeviceProfileChangeListener> listeners = getOnDeviceProfileChangeListeners();
|
||||
for (int i = listeners.size() - 1; i >= 0; i--) {
|
||||
listeners.get(i).onDeviceProfileChanged(deviceProfile);
|
||||
}
|
||||
}
|
||||
|
||||
/** Register listener for {@link DeviceProfile} changes. */
|
||||
default void addOnDeviceProfileChangeListener(OnDeviceProfileChangeListener listener) {
|
||||
getOnDeviceProfileChangeListeners().add(listener);
|
||||
}
|
||||
|
||||
/** Unregister listener for {@link DeviceProfile} changes. */
|
||||
default void removeOnDeviceProfileChangeListener(OnDeviceProfileChangeListener listener) {
|
||||
getOnDeviceProfileChangeListeners().remove(listener);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private Context mContext;
|
||||
private InvariantDeviceProfile mInv;
|
||||
|
||||
Reference in new issue
Block a user