mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
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:
@@ -34,6 +34,7 @@ import android.util.Log;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
|
||||
import com.android.launcher3.DeviceProfile.DeviceProfileListenable;
|
||||
import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.util.SystemUiController;
|
||||
@@ -44,11 +45,13 @@ import com.android.launcher3.views.ScrimView;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Launcher BaseActivity
|
||||
*/
|
||||
public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
public abstract class BaseActivity extends Activity implements ActivityContext,
|
||||
DeviceProfileListenable {
|
||||
|
||||
private static final String TAG = "BaseActivity";
|
||||
|
||||
@@ -142,6 +145,11 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
return mDeviceProfile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OnDeviceProfileChangeListener> getOnDeviceProfileChangeListeners() {
|
||||
return mDPChangeListeners;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns {@link StatsLogManager} for user event logging.
|
||||
*/
|
||||
@@ -261,20 +269,6 @@ public abstract class BaseActivity extends Activity implements ActivityContext {
|
||||
|
||||
protected void onActivityFlagsChanged(int changeBits) { }
|
||||
|
||||
public void addOnDeviceProfileChangeListener(OnDeviceProfileChangeListener listener) {
|
||||
mDPChangeListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeOnDeviceProfileChangeListener(OnDeviceProfileChangeListener listener) {
|
||||
mDPChangeListeners.remove(listener);
|
||||
}
|
||||
|
||||
protected void dispatchDeviceProfileChanged() {
|
||||
for (int i = mDPChangeListeners.size() - 1; i >= 0; i--) {
|
||||
mDPChangeListeners.get(i).onDeviceProfileChanged(mDeviceProfile);
|
||||
}
|
||||
}
|
||||
|
||||
public void addMultiWindowModeChangedListener(MultiWindowModeChangedListener listener) {
|
||||
mMultiWindowModeChangedListeners.add(listener);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user