Fix conflicts
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<com.android.launcher3.taskbar.allapps.TaskbarAllAppsSlideInView
|
||||
<View
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<FrameLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -58,133 +58,8 @@
|
||||
android:text="@string/home_gesture_tutorial_title"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/gesture_tutorial_menu_back_button">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/gesture_tutorial_home_step_shape"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.GestureTutorial.MenuButton.Home"
|
||||
android:id="@+id/gesture_tutorial_menu_home_button_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/home_gesture_tutorial_title"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/gesture_tutorial_menu_back_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
|
||||
android:layout_marginEnd="@dimen/gesture_tutorial_menu_button_spacing"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@drawable/gesture_tutorial_menu_back_button_background"
|
||||
android:clipToOutline="true"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/guideline"
|
||||
app:layout_constraintStart_toEndOf="@id/gesture_tutorial_menu_home_button"
|
||||
app:layout_constraintEnd_toStartOf="@id/gesture_tutorial_menu_overview_button">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/gesture_tutorial_back_step_shape"
|
||||
android:layout_marginBottom="@dimen/gesture_tutorial_menu_back_shape_bottom_margin"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.GestureTutorial.MenuButton.Back"
|
||||
android:id="@+id/gesture_tutorial_menu_back_button_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/back_gesture_tutorial_title"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/gesture_tutorial_menu_overview_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/gesture_tutorial_menu_button_height"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:background="@drawable/gesture_tutorial_menu_overview_button_background"
|
||||
android:clipToOutline="true"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/guideline"
|
||||
app:layout_constraintStart_toEndOf="@id/gesture_tutorial_menu_back_button"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/gesture_tutorial_overview_step_shape"
|
||||
android:scaleType="fitXY"
|
||||
android:adjustViewBounds="true"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
<TextView
|
||||
style="@style/TextAppearance.GestureTutorial.MenuButton.Overview"
|
||||
android:id="@+id/gesture_tutorial_menu_overview_button_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/overview_gesture_tutorial_title"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
|
||||
app:layout_constraintGuide_end="@dimen/gesture_tutorial_menu_done_button_spacing"/>
|
||||
|
||||
<Button
|
||||
style="@style/TextAppearance.GestureTutorial.ButtonLabel"
|
||||
android:id="@+id/gesture_tutorial_menu_done_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginVertical="16dp"
|
||||
android:text="@string/gesture_tutorial_action_button_label"
|
||||
android:background="@drawable/gesture_tutorial_action_button_background"
|
||||
android:backgroundTint="?androidprv:attr/materialColorPrimary"
|
||||
android:stateListAnimator="@null"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -173,12 +173,6 @@ public class DepthController extends BaseDepthController implements StateHandler
|
||||
mLauncher.getDragLayer().getViewTreeObserver().addOnDrawListener(mOnDrawListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onInvalidSurface() {
|
||||
// Lets wait for surface to become valid again
|
||||
mLauncher.getDragLayer().getViewTreeObserver().addOnDrawListener(mOnDrawListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
|
||||
mIgnoreStateChangesDuringMultiWindowAnimation = true;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package com.android.launcher3.taskbar
|
||||
|
||||
import android.inputmethodservice.InputMethodService.ENABLE_HIDE_IME_CAPTION_BAR
|
||||
import android.graphics.Insets
|
||||
import android.graphics.Region
|
||||
import android.os.Binder
|
||||
|
||||
@@ -154,63 +154,6 @@ public class TaskbarManager {
|
||||
}
|
||||
};
|
||||
|
||||
private final ActivityLifecycleCallbacksAdapter mLifecycleCallbacks = new ActivityLifecycleCallbacksAdapter() {
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
if (mActivity != activity)
|
||||
return;
|
||||
if (mActivity != null) {
|
||||
mActivity.removeOnDeviceProfileChangeListener(
|
||||
mDebugActivityDeviceProfileChanged);
|
||||
Log.d(TASKBAR_NOT_DESTROYED_TAG,
|
||||
"unregistering activity lifecycle callbacks from "
|
||||
+ "onActivityDestroyed.");
|
||||
mActivity.unregisterActivityLifecycleCallbacks(this);
|
||||
}
|
||||
mActivity = null;
|
||||
debugWhyTaskbarNotDestroyed("clearActivity");
|
||||
if (mTaskbarActivityContext != null) {
|
||||
mTaskbarActivityContext.setUIController(TaskbarUIController.DEFAULT);
|
||||
}
|
||||
mUnfoldProgressProvider.setSourceProvider(null);
|
||||
}
|
||||
};
|
||||
|
||||
UnfoldTransitionProgressProvider.TransitionProgressListener mUnfoldTransitionProgressListener = new UnfoldTransitionProgressProvider.TransitionProgressListener() {
|
||||
@Override
|
||||
public void onTransitionStarted() {
|
||||
Log.d(TASKBAR_NOT_DESTROYED_TAG,
|
||||
"fold/unfold transition started getting called.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionProgress(float progress) {
|
||||
Log.d(TASKBAR_NOT_DESTROYED_TAG,
|
||||
"fold/unfold transition progress : " + progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionFinishing() {
|
||||
Log.d(TASKBAR_NOT_DESTROYED_TAG,
|
||||
"fold/unfold transition finishing getting called.");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionFinished() {
|
||||
Log.d(TASKBAR_NOT_DESTROYED_TAG,
|
||||
"fold/unfold transition finished getting called.");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
private final SharedPreferences.OnSharedPreferenceChangeListener
|
||||
mTaskbarPinningPreferenceChangeListener = (sharedPreferences, key) -> {
|
||||
if (TASKBAR_PINNING_KEY.equals(key)) {
|
||||
recreateTaskbar();
|
||||
}
|
||||
};
|
||||
|
||||
private final ActivityLifecycleCallbacksAdapter mLifecycleCallbacks =
|
||||
new ActivityLifecycleCallbacksAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -93,6 +93,7 @@ import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.OnBackPressedHandler;
|
||||
import com.android.launcher3.QuickstepAccessibilityDelegate;
|
||||
import com.android.launcher3.QuickstepTransitionManager;
|
||||
import com.android.launcher3.R;
|
||||
@@ -759,14 +760,13 @@ public class QuickstepLauncher extends Launcher {
|
||||
|
||||
@Override
|
||||
public void onBackStarted(@NonNull BackEvent backEvent) {
|
||||
if (mActiveOnBackAnimationCallback != null) {
|
||||
mActiveOnBackAnimationCallback.onBackCancelled();
|
||||
if (mActiveOnBackPressedHandler != null) {
|
||||
mActiveOnBackPressedHandler.onBackCancelled();
|
||||
}
|
||||
mActiveOnBackAnimationCallback = getOnBackAnimationCallback();
|
||||
mActiveOnBackAnimationCallback.onBackStarted(backEvent);
|
||||
mActiveOnBackPressedHandler = getOnBackPressedHandler();
|
||||
mActiveOnBackPressedHandler.onBackStarted();
|
||||
}
|
||||
|
||||
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
@Override
|
||||
public void onBackInvoked() {
|
||||
// Recreate mActiveOnBackPressedHandler if necessary to avoid NPE
|
||||
@@ -775,11 +775,11 @@ public class QuickstepLauncher extends Launcher {
|
||||
// called on ACTION_DOWN before onBackInvoked() is called in ACTION_UP.
|
||||
// 2. Launcher#onBackPressed() will call onBackInvoked() without calling
|
||||
// onBackInvoked() beforehand.
|
||||
if (mActiveOnBackAnimationCallback == null) {
|
||||
mActiveOnBackAnimationCallback = getOnBackAnimationCallback();
|
||||
if (mActiveOnBackPressedHandler == null) {
|
||||
mActiveOnBackPressedHandler = getOnBackPressedHandler();
|
||||
}
|
||||
mActiveOnBackAnimationCallback.onBackInvoked();
|
||||
mActiveOnBackAnimationCallback = null;
|
||||
mActiveOnBackPressedHandler.onBackInvoked();
|
||||
mActiveOnBackPressedHandler = null;
|
||||
TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onBackInvoked");
|
||||
}
|
||||
@Override
|
||||
@@ -797,8 +797,8 @@ public class QuickstepLauncher extends Launcher {
|
||||
&& mActiveOnBackPressedHandler == null) {
|
||||
return;
|
||||
}
|
||||
mActiveOnBackAnimationCallback.onBackCancelled();
|
||||
mActiveOnBackAnimationCallback = null;
|
||||
mActiveOnBackPressedHandler.onBackCancelled();
|
||||
mActiveOnBackPressedHandler = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -178,10 +178,6 @@ public class TouchInteractionService extends Service {
|
||||
mTis = new WeakReference<>(tis);
|
||||
}
|
||||
|
||||
private TISBinder(TouchInteractionService tis) {
|
||||
mTis = new WeakReference<>(tis);
|
||||
}
|
||||
|
||||
@BinderThread
|
||||
public void onInitialize(Bundle bundle) {
|
||||
ISystemUiProxy proxy = ISystemUiProxy.Stub.asInterface(
|
||||
|
||||
@@ -293,48 +293,4 @@ public class LauncherUnfoldAnimationController implements OnDeviceProfileChangeL
|
||||
mHasRun = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Class to track the current status of the external transition provider (the events are coming
|
||||
* from the SystemUI side through IPC), it allows to check if the transition has already
|
||||
* finished or currently running on the SystemUI side since last unfold.
|
||||
*/
|
||||
private static class TransitionStatusProvider implements TransitionProgressListener {
|
||||
|
||||
private boolean mHasRun = false;
|
||||
|
||||
@Override
|
||||
public void onTransitionStarted() {
|
||||
markAsRun();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionProgress(float progress) {
|
||||
markAsRun();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransitionFinished() {
|
||||
markAsRun();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the device is folded, so we can reset the status of the animation
|
||||
*/
|
||||
public void onFolded() {
|
||||
mHasRun = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there was an animation already (or it is currently running) after
|
||||
* unfolding the device
|
||||
*/
|
||||
public boolean hasRun() {
|
||||
return mHasRun;
|
||||
}
|
||||
|
||||
private void markAsRun() {
|
||||
mHasRun = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,11 @@ public final class DigitalWellBeingToast {
|
||||
}
|
||||
final long appUsageLimitTimeMs = usageLimit != null ? usageLimit.getTotalUsageLimit() : -1;
|
||||
final long appRemainingTimeMs = usageLimit != null ? usageLimit.getUsageRemaining() : -1;
|
||||
|
||||
mTaskView.post(() -> {
|
||||
if (appUsageLimitTimeMs < 0 || appRemainingTimeMs < 0) {
|
||||
setNoLimit();
|
||||
} else {
|
||||
setLimit(appUsageLimitTimeMs, appRemainingTimeMs);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.lang.annotation.RetentionPolicy;
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
public abstract class AbstractFloatingView extends LinearLayout implements TouchController,
|
||||
OnBackAnimationCallback {
|
||||
OnBackPressedHandler {
|
||||
|
||||
@IntDef(flag = true, value = {
|
||||
TYPE_COMPOSE_VIEW,
|
||||
@@ -141,8 +141,6 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
public static final int TYPE_TASKBAR_OVERLAYS =
|
||||
TYPE_TASKBAR_ALL_APPS | TYPE_TASKBAR_EDUCATION_DIALOG;
|
||||
|
||||
public static final int TYPE_ALL_EXCEPT_ON_BOARD_POPUP = TYPE_ALL & ~TYPE_ON_BOARD_POPUP;
|
||||
|
||||
protected boolean mIsOpen;
|
||||
|
||||
public AbstractFloatingView(Context context, AttributeSet attrs) {
|
||||
|
||||
@@ -181,7 +181,6 @@ public abstract class BaseDraggingActivity extends BaseActivity
|
||||
super.onDestroy();
|
||||
WallpaperManagerCompat.INSTANCE.get(this).removeOnChangeListener(this);
|
||||
DisplayController.INSTANCE.get(this).removeChangeListener(this);
|
||||
WallpaperColorHints.get(this).unregisterOnColorsChangedListener(this);
|
||||
}
|
||||
|
||||
public void runOnceOnStart(Runnable action) {
|
||||
|
||||
@@ -207,7 +207,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
public BubbleTextView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs, defStyle);
|
||||
mActivity = ActivityContext.lookupContext(context);
|
||||
FastBitmapDrawable.setFlagHoverEnabled(ENABLE_CURSOR_HOVER_STATES.get());
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs,
|
||||
R.styleable.BubbleTextView, defStyle, 0);
|
||||
@@ -411,16 +410,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
return mDisplay == DISPLAY_WORKSPACE || mDisplay == DISPLAY_FOLDER || mDisplay == DISPLAY_TASKBAR;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only if actual text can be displayed in two line, the {@code true} value will
|
||||
* be effective.
|
||||
*/
|
||||
protected boolean shouldUseTwoLine() {
|
||||
return (FeatureFlags.ENABLE_TWOLINE_ALLAPPS.get() && mDisplay == DISPLAY_ALL_APPS)
|
||||
|| (FeatureFlags.ENABLE_TWOLINE_DEVICESEARCH.get()
|
||||
&& mDisplay == DISPLAY_SEARCH_RESULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Only if actual text can be displayed in two line, the {@code true} value will be effective.
|
||||
*/
|
||||
|
||||
@@ -2888,7 +2888,6 @@ public class CellLayout extends ViewGroup {
|
||||
} else {
|
||||
throw new RuntimeException("Position exceeds the bound of this CellLayout");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1318,17 +1318,6 @@ public class DeviceProfile {
|
||||
allAppsLeftRightPadding *= marginMultiplier;
|
||||
}
|
||||
|
||||
private void setupAllAppsStyle(Context context) {
|
||||
TypedArray allAppsStyle = context.obtainStyledAttributes(
|
||||
inv.allAppsStyle != INVALID_RESOURCE_HANDLE ? inv.allAppsStyle
|
||||
: R.style.AllAppsStyleDefault,
|
||||
R.styleable.AllAppsStyle);
|
||||
|
||||
allAppsLeftRightPadding = allAppsStyle.getDimensionPixelSize(
|
||||
R.styleable.AllAppsStyle_horizontalPadding, 0);
|
||||
allAppsStyle.recycle();
|
||||
}
|
||||
|
||||
private void setupAllAppsStyle(Context context) {
|
||||
TypedArray allAppsStyle = context.obtainStyledAttributes(
|
||||
inv.allAppsStyle != INVALID_RESOURCE_HANDLE ? inv.allAppsStyle
|
||||
|
||||
@@ -24,6 +24,8 @@ import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUN
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.appwidget.AppWidgetHostView;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
@@ -31,6 +33,7 @@ import android.content.res.TypedArray;
|
||||
import android.content.res.XmlResourceParser;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.PointF;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
@@ -131,6 +131,7 @@ import android.window.BackEvent;
|
||||
import android.window.OnBackAnimationCallback;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
@@ -636,8 +637,7 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
* previous 3 don't.
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
protected OnBackAnimationCallback getOnBackAnimationCallback() {
|
||||
protected OnBackPressedHandler getOnBackPressedHandler() {
|
||||
// #1 auto cancel action mode handler
|
||||
if (isInAutoCancelActionMode()) {
|
||||
return this::finishAutoCancelActionMode;
|
||||
@@ -655,16 +655,17 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
}
|
||||
|
||||
// #4 state handler
|
||||
return new OnBackAnimationCallback() {
|
||||
return new OnBackPressedHandler() {
|
||||
@Override
|
||||
public void onBackInvoked() {
|
||||
onStateBack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackProgressed(@NonNull BackEvent backEvent) {
|
||||
public void onBackProgressed(
|
||||
@FloatRange(from = 0.0, to = 1.0) float backProgress) {
|
||||
mStateManager.getState().onBackProgressed(
|
||||
Launcher.this, backEvent.getProgress());
|
||||
Launcher.this, backProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2201,7 +2202,7 @@ public class Launcher extends StatefulActivity<LauncherState>
|
||||
@Override
|
||||
@TargetApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
|
||||
public void onBackPressed() {
|
||||
getOnBackAnimationCallback().onBackInvoked();
|
||||
getOnBackPressedHandler().onBackInvoked();
|
||||
}
|
||||
|
||||
protected void onStateBack() {
|
||||
|
||||
@@ -751,8 +751,7 @@ public final class Utilities {
|
||||
} else {
|
||||
return Process.myUserHandle().equals(info.user)
|
||||
? new ColorDrawable(Color.TRANSPARENT)
|
||||
: context.getDrawable(isIconThemed
|
||||
? R.drawable.ic_work_app_badge_themed : R.drawable.ic_work_app_badge);
|
||||
: context.getDrawable(R.drawable.ic_work_app_badge);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -800,14 +800,6 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns if the given screenId is already in the Workspace
|
||||
*/
|
||||
public boolean containsScreenId(int screenId) {
|
||||
return this.mWorkspaceScreens.containsKey(screenId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the given screenId is already in the Workspace
|
||||
*/
|
||||
|
||||
@@ -47,6 +47,7 @@ import android.util.AttributeSet;
|
||||
import android.util.FloatProperty;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
@@ -17,6 +17,7 @@ package com.android.launcher3.allapps;
|
||||
|
||||
import static com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.getTabWidth;
|
||||
|
||||
import android.animation.LayoutTransition;
|
||||
import android.content.Context;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.Rect;
|
||||
@@ -103,7 +104,9 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
|
||||
setInsets(mActivityContext.getDeviceProfile().getInsets());
|
||||
mTextView.setText(R.string.work_apps_pause_btn_text);
|
||||
|
||||
getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
if (Utilities.ATLEAST_U) {
|
||||
getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,10 +196,6 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
|
||||
return mImeInsets;
|
||||
}
|
||||
|
||||
public Rect getImeInsets() {
|
||||
return mImeInsets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTranslationStart() {
|
||||
setFlag(FLAG_TRANSLATION_ONGOING);
|
||||
|
||||
@@ -50,6 +50,7 @@ import androidx.annotation.VisibleForTesting;
|
||||
import androidx.core.util.Pair;
|
||||
|
||||
import com.android.launcher3.InvariantDeviceProfile;
|
||||
import com.android.launcher3.LauncherFiles;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.icons.ComponentWithLabel.ComponentCachingLogic;
|
||||
import com.android.launcher3.icons.cache.BaseIconCache;
|
||||
|
||||
@@ -593,12 +593,7 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
default StatsLogger withCardinality(int cardinality) {
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Sets the input type of the log message.
|
||||
*/
|
||||
default StatsLogger withInputType(int inputType) {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the input type of the log message.
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.LauncherActivityInfo;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.database.CursorWrapper;
|
||||
import android.os.UserHandle;
|
||||
|
||||
@@ -166,7 +166,6 @@ public abstract class ArrowPopup<T extends Context & ActivityContext>
|
||||
|
||||
int smallerRadius = resources.getDimensionPixelSize(R.dimen.popup_smaller_radius);
|
||||
mRoundedTop = new GradientDrawable();
|
||||
int popupPrimaryColor = Themes.getAttrColor(context, R.attr.popupColorPrimary);
|
||||
mRoundedTop.setColor(popupPrimaryColor);
|
||||
mRoundedTop.setCornerRadii(new float[] { mOutlineRadius, mOutlineRadius, mOutlineRadius,
|
||||
mOutlineRadius, smallerRadius, smallerRadius, smallerRadius, smallerRadius });
|
||||
|
||||
@@ -225,57 +225,6 @@ public abstract class AbstractSlideInView<T extends Context & ActivityContext>
|
||||
return mOpenCloseAnimation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when a {@link #mOpenCloseAnimation} is being set up.
|
||||
* <p>
|
||||
* Subclasses can override this method to modify the animation before it's used
|
||||
* to create a
|
||||
* {@link AnimatorPlaybackController}.
|
||||
*/
|
||||
protected void onOpenCloseAnimationPending(PendingAnimation animation) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up a {@link #mOpenCloseAnimation} for opening with a given duration.
|
||||
*
|
||||
* @see #setUpOpenCloseAnimation(float, float, long)
|
||||
*/
|
||||
protected final AnimatorPlaybackController setUpOpenAnimation(long duration) {
|
||||
return setUpOpenCloseAnimation(
|
||||
TRANSLATION_SHIFT_CLOSED, TRANSLATION_SHIFT_OPENED, duration);
|
||||
}
|
||||
|
||||
private AnimatorPlaybackController setUpCloseAnimation(long duration) {
|
||||
return setUpOpenCloseAnimation(
|
||||
TRANSLATION_SHIFT_OPENED, TRANSLATION_SHIFT_CLOSED, duration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new {@link #mOpenCloseAnimation}.
|
||||
*
|
||||
* @param fromTranslationShift translation shift to animate from.
|
||||
* @param toTranslationShift translation shift to animate to.
|
||||
* @param duration animation duration.
|
||||
* @return {@link #mOpenCloseAnimation}
|
||||
*/
|
||||
private AnimatorPlaybackController setUpOpenCloseAnimation(
|
||||
float fromTranslationShift, float toTranslationShift, long duration) {
|
||||
mFromTranslationShift = fromTranslationShift;
|
||||
mToTranslationShift = toTranslationShift;
|
||||
|
||||
PendingAnimation animation = new PendingAnimation(duration);
|
||||
animation.addEndListener(b -> {
|
||||
mSwipeDetector.finishedScrolling();
|
||||
announceAccessibilityChanges();
|
||||
});
|
||||
|
||||
animation.addFloat(
|
||||
this, TRANSLATION_SHIFT, fromTranslationShift, toTranslationShift, LINEAR);
|
||||
onOpenCloseAnimationPending(animation);
|
||||
|
||||
mOpenCloseAnimation = animation.createPlaybackController();
|
||||
return mOpenCloseAnimation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invoked when a {@link #mOpenCloseAnimation} is being set up.
|
||||
|
||||
Reference in New Issue
Block a user