Loading res/layout/search_container_all_apps.xml +1 −2 Original line number Diff line number Diff line Loading @@ -34,5 +34,4 @@ android:singleLine="true" android:textColor="?android:attr/textColorSecondary" android:textColorHint="@drawable/all_apps_search_hint" android:textSize="16sp" android:translationY="24dp" /> No newline at end of file android:textSize="16sp" /> No newline at end of file src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java +9 −11 Original line number Diff line number Diff line Loading @@ -62,9 +62,8 @@ public class AppsSearchContainerLayout extends ExtendedEditText private AlphabeticalAppsList mApps; private AllAppsContainerView mAppsView; // This value was used to position the QSB. We store it here for translationY animations. private final float mFixedTranslationY; private final float mMarginTopAdjusting; // The amount of pixels to shift down and overlap with the rest of the content. private final int mContentOverlap; public AppsSearchContainerLayout(Context context) { this(context, null); Loading @@ -82,11 +81,10 @@ public class AppsSearchContainerLayout extends ExtendedEditText mSearchQueryBuilder = new SpannableStringBuilder(); Selection.setSelection(mSearchQueryBuilder, 0); mFixedTranslationY = getTranslationY(); mMarginTopAdjusting = mFixedTranslationY - getPaddingTop(); setHint(prefixTextWithIcon(getContext(), R.drawable.ic_allapps_search, getHint())); mContentOverlap = getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_field_height) / 2; } @Override Loading Loading @@ -128,6 +126,8 @@ public class AppsSearchContainerLayout extends ExtendedEditText int expectedLeft = parent.getPaddingLeft() + (availableWidth - myWidth) / 2; int shift = expectedLeft - left; setTranslationX(shift); offsetTopAndBottom(mContentOverlap); } @Override Loading Loading @@ -196,7 +196,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText @Override public void setInsets(Rect insets) { MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams(); mlp.topMargin = Math.round(Math.max(-mFixedTranslationY, insets.top - mMarginTopAdjusting)); mlp.topMargin = insets.top; requestLayout(); } Loading @@ -205,9 +205,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { return 0; } else { int topMargin = Math.round(Math.max( -mFixedTranslationY, insets.top - mMarginTopAdjusting)); return insets.bottom + topMargin + mFixedTranslationY; return insets.bottom + insets.top; } } Loading src/com/android/launcher3/states/RotationHelper.java +8 −4 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ */ package com.android.launcher3.states; import static android.Manifest.permission.WRITE_SECURE_SETTINGS; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE; import static com.android.launcher3.config.FeatureFlags.FLAG_ENABLE_FIXED_ROTATION_TRANSFORM; Loading @@ -37,7 +39,6 @@ import android.view.Surface; import android.view.WindowManager; import com.android.launcher3.Launcher; import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; Loading Loading @@ -142,9 +143,12 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { if (setValueFromPrefs) { mForcedRotation = isForcedRotation; } UI_HELPER_EXECUTOR.execute( () -> Settings.Global.putInt(mContentResolver, FIXED_ROTATION_TRANSFORM_SETTING_NAME, mForcedRotation ? 1 : 0)); UI_HELPER_EXECUTOR.execute(() -> { if (mLauncher.checkSelfPermission(WRITE_SECURE_SETTINGS) == PERMISSION_GRANTED) { Settings.Global.putInt(mContentResolver, FIXED_ROTATION_TRANSFORM_SETTING_NAME, mForcedRotation ? 1 : 0); } }); for (ForcedRotationChangedListener listener : mForcedRotationChangedListeners) { listener.onForcedRotationChanged(mForcedRotation); } Loading Loading
res/layout/search_container_all_apps.xml +1 −2 Original line number Diff line number Diff line Loading @@ -34,5 +34,4 @@ android:singleLine="true" android:textColor="?android:attr/textColorSecondary" android:textColorHint="@drawable/all_apps_search_hint" android:textSize="16sp" android:translationY="24dp" /> No newline at end of file android:textSize="16sp" /> No newline at end of file
src/com/android/launcher3/allapps/search/AppsSearchContainerLayout.java +9 −11 Original line number Diff line number Diff line Loading @@ -62,9 +62,8 @@ public class AppsSearchContainerLayout extends ExtendedEditText private AlphabeticalAppsList mApps; private AllAppsContainerView mAppsView; // This value was used to position the QSB. We store it here for translationY animations. private final float mFixedTranslationY; private final float mMarginTopAdjusting; // The amount of pixels to shift down and overlap with the rest of the content. private final int mContentOverlap; public AppsSearchContainerLayout(Context context) { this(context, null); Loading @@ -82,11 +81,10 @@ public class AppsSearchContainerLayout extends ExtendedEditText mSearchQueryBuilder = new SpannableStringBuilder(); Selection.setSelection(mSearchQueryBuilder, 0); mFixedTranslationY = getTranslationY(); mMarginTopAdjusting = mFixedTranslationY - getPaddingTop(); setHint(prefixTextWithIcon(getContext(), R.drawable.ic_allapps_search, getHint())); mContentOverlap = getResources().getDimensionPixelSize(R.dimen.all_apps_search_bar_field_height) / 2; } @Override Loading Loading @@ -128,6 +126,8 @@ public class AppsSearchContainerLayout extends ExtendedEditText int expectedLeft = parent.getPaddingLeft() + (availableWidth - myWidth) / 2; int shift = expectedLeft - left; setTranslationX(shift); offsetTopAndBottom(mContentOverlap); } @Override Loading Loading @@ -196,7 +196,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText @Override public void setInsets(Rect insets) { MarginLayoutParams mlp = (MarginLayoutParams) getLayoutParams(); mlp.topMargin = Math.round(Math.max(-mFixedTranslationY, insets.top - mMarginTopAdjusting)); mlp.topMargin = insets.top; requestLayout(); } Loading @@ -205,9 +205,7 @@ public class AppsSearchContainerLayout extends ExtendedEditText if (mLauncher.getDeviceProfile().isVerticalBarLayout()) { return 0; } else { int topMargin = Math.round(Math.max( -mFixedTranslationY, insets.top - mMarginTopAdjusting)); return insets.bottom + topMargin + mFixedTranslationY; return insets.bottom + insets.top; } } Loading
src/com/android/launcher3/states/RotationHelper.java +8 −4 Original line number Diff line number Diff line Loading @@ -15,10 +15,12 @@ */ package com.android.launcher3.states; import static android.Manifest.permission.WRITE_SECURE_SETTINGS; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LOCKED; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.util.DisplayMetrics.DENSITY_DEVICE_STABLE; import static com.android.launcher3.config.FeatureFlags.FLAG_ENABLE_FIXED_ROTATION_TRANSFORM; Loading @@ -37,7 +39,6 @@ import android.view.Surface; import android.view.WindowManager; import com.android.launcher3.Launcher; import com.android.launcher3.PagedView; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; Loading Loading @@ -142,9 +143,12 @@ public class RotationHelper implements OnSharedPreferenceChangeListener { if (setValueFromPrefs) { mForcedRotation = isForcedRotation; } UI_HELPER_EXECUTOR.execute( () -> Settings.Global.putInt(mContentResolver, FIXED_ROTATION_TRANSFORM_SETTING_NAME, mForcedRotation ? 1 : 0)); UI_HELPER_EXECUTOR.execute(() -> { if (mLauncher.checkSelfPermission(WRITE_SECURE_SETTINGS) == PERMISSION_GRANTED) { Settings.Global.putInt(mContentResolver, FIXED_ROTATION_TRANSFORM_SETTING_NAME, mForcedRotation ? 1 : 0); } }); for (ForcedRotationChangedListener listener : mForcedRotationChangedListeners) { listener.onForcedRotationChanged(mForcedRotation); } Loading