Loading quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +1 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import androidx.annotation.Nullable; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.R; import com.android.launcher3.Utilities; Loading @@ -51,7 +50,7 @@ import java.util.List; import java.util.stream.Collectors; @TargetApi(Build.VERSION_CODES.P) public class PredictionRowView<T extends Context & ActivityContext & DeviceProfileListenable> public class PredictionRowView<T extends Context & ActivityContext> extends LinearLayout implements OnDeviceProfileChangeListener, FloatingHeaderRow { private final T mActivityContext; Loading quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +2 −4 Original line number Diff line number Diff line Loading @@ -19,18 +19,16 @@ import android.content.Context; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.util.Themes; import com.android.launcher3.views.AppLauncher; import com.android.launcher3.views.ActivityContext; import java.util.ArrayList; import java.util.List; // TODO(b/218912746): Share more behavior to avoid all apps context depending directly on taskbar. /** Base for common behavior between taskbar window contexts. */ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements AppLauncher, DeviceProfileListenable { public abstract class BaseTaskbarContext extends ContextThemeWrapper implements ActivityContext { protected final LayoutInflater mLayoutInflater; private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>(); Loading quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +3 −4 Original line number Diff line number Diff line Loading @@ -20,12 +20,11 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP import android.content.Context; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; /** * Definition for AllApps state Loading @@ -40,7 +39,7 @@ public class AllAppsState extends LauncherState { } @Override public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable> public <DEVICE_PROFILE_CONTEXT extends Context & ActivityContext> int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) { return isToState ? context.getDeviceProfile().allAppsOpenDuration Loading Loading @@ -78,7 +77,7 @@ public class AllAppsState extends LauncherState { } @Override protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable> protected <DEVICE_PROFILE_CONTEXT extends Context & ActivityContext> float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) { if (context.getDeviceProfile().isTablet) { return context.getDeviceProfile().bottomSheetDepth; Loading src/com/android/launcher3/BaseActivity.java +2 −4 Original line number Diff line number Diff line Loading @@ -30,14 +30,13 @@ import android.window.OnBackInvokedDispatcher; 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.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.SystemUiController; import com.android.launcher3.util.ViewCache; import com.android.launcher3.views.AppLauncher; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.ScrimView; import java.io.PrintWriter; Loading @@ -48,8 +47,7 @@ import java.util.List; /** * Launcher BaseActivity */ public abstract class BaseActivity extends Activity implements AppLauncher, DeviceProfileListenable { public abstract class BaseActivity extends Activity implements ActivityContext { private static final String TAG = "BaseActivity"; Loading src/com/android/launcher3/DeviceProfile.java +0 −30 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.WindowBounds; import java.io.PrintWriter; import java.util.List; import java.util.Locale; @SuppressLint("NewApi") Loading Loading @@ -1631,35 +1630,6 @@ 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); } } /** * Handler that deals with ItemInfo of the views for the DeviceProfile */ Loading Loading
quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +1 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import androidx.annotation.Nullable; import com.android.launcher3.BubbleTextView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.R; import com.android.launcher3.Utilities; Loading @@ -51,7 +50,7 @@ import java.util.List; import java.util.stream.Collectors; @TargetApi(Build.VERSION_CODES.P) public class PredictionRowView<T extends Context & ActivityContext & DeviceProfileListenable> public class PredictionRowView<T extends Context & ActivityContext> extends LinearLayout implements OnDeviceProfileChangeListener, FloatingHeaderRow { private final T mActivityContext; Loading
quickstep/src/com/android/launcher3/taskbar/BaseTaskbarContext.java +2 −4 Original line number Diff line number Diff line Loading @@ -19,18 +19,16 @@ import android.content.Context; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.DeviceProfile.OnDeviceProfileChangeListener; import com.android.launcher3.util.Themes; import com.android.launcher3.views.AppLauncher; import com.android.launcher3.views.ActivityContext; import java.util.ArrayList; import java.util.List; // TODO(b/218912746): Share more behavior to avoid all apps context depending directly on taskbar. /** Base for common behavior between taskbar window contexts. */ public abstract class BaseTaskbarContext extends ContextThemeWrapper implements AppLauncher, DeviceProfileListenable { public abstract class BaseTaskbarContext extends ContextThemeWrapper implements ActivityContext { protected final LayoutInflater mLayoutInflater; private final List<OnDeviceProfileChangeListener> mDPChangeListeners = new ArrayList<>(); Loading
quickstep/src/com/android/launcher3/uioverrides/states/AllAppsState.java +3 −4 Original line number Diff line number Diff line Loading @@ -20,12 +20,11 @@ import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_ALLAP import android.content.Context; import com.android.launcher3.DeviceProfile; import com.android.launcher3.DeviceProfile.DeviceProfileListenable; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ActivityContext; /** * Definition for AllApps state Loading @@ -40,7 +39,7 @@ public class AllAppsState extends LauncherState { } @Override public <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfileListenable> public <DEVICE_PROFILE_CONTEXT extends Context & ActivityContext> int getTransitionDuration(DEVICE_PROFILE_CONTEXT context, boolean isToState) { return isToState ? context.getDeviceProfile().allAppsOpenDuration Loading Loading @@ -78,7 +77,7 @@ public class AllAppsState extends LauncherState { } @Override protected <DEVICE_PROFILE_CONTEXT extends Context & DeviceProfile.DeviceProfileListenable> protected <DEVICE_PROFILE_CONTEXT extends Context & ActivityContext> float getDepthUnchecked(DEVICE_PROFILE_CONTEXT context) { if (context.getDeviceProfile().isTablet) { return context.getDeviceProfile().bottomSheetDepth; Loading
src/com/android/launcher3/BaseActivity.java +2 −4 Original line number Diff line number Diff line Loading @@ -30,14 +30,13 @@ import android.window.OnBackInvokedDispatcher; 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.testing.TestLogging; import com.android.launcher3.testing.shared.TestProtocol; import com.android.launcher3.util.SystemUiController; import com.android.launcher3.util.ViewCache; import com.android.launcher3.views.AppLauncher; import com.android.launcher3.views.ActivityContext; import com.android.launcher3.views.ScrimView; import java.io.PrintWriter; Loading @@ -48,8 +47,7 @@ import java.util.List; /** * Launcher BaseActivity */ public abstract class BaseActivity extends Activity implements AppLauncher, DeviceProfileListenable { public abstract class BaseActivity extends Activity implements ActivityContext { private static final String TAG = "BaseActivity"; Loading
src/com/android/launcher3/DeviceProfile.java +0 −30 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ import com.android.launcher3.util.DisplayController.Info; import com.android.launcher3.util.WindowBounds; import java.io.PrintWriter; import java.util.List; import java.util.Locale; @SuppressLint("NewApi") Loading Loading @@ -1631,35 +1630,6 @@ 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); } } /** * Handler that deals with ItemInfo of the views for the DeviceProfile */ Loading