Snap for 7501202 from 17afc8d2fd to sc-v2-release

Change-Id: Ibd37b2332ba724cbece04e6a49bb86e69127a027
This commit is contained in:
Android Build Coastguard Worker
2021-06-29 01:13:04 +00:00
4 changed files with 29 additions and 13 deletions
@@ -21,6 +21,7 @@ import static com.android.launcher3.LauncherState.FLAG_HIDE_BACK_BUTTON;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.quickstep.SysUINavigationMode.Mode.TWO_BUTTONS;
import static com.android.quickstep.util.NavigationModeFeatureFlag.LIVE_TILE;
@@ -30,6 +31,7 @@ import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.app.ActivityOptions;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.ServiceConnection;
@@ -56,6 +58,7 @@ import com.android.launcher3.taskbar.TaskbarManager;
import com.android.launcher3.taskbar.TaskbarStateHandler;
import com.android.launcher3.uioverrides.RecentsViewStateController;
import com.android.launcher3.util.ActivityOptionsWrapper;
import com.android.launcher3.util.DisplayController;
import com.android.launcher3.util.IntSet;
import com.android.launcher3.util.ObjectWrapper;
import com.android.launcher3.util.UiThreadHelper;
@@ -474,4 +477,15 @@ public abstract class BaseQuickstepLauncher extends Launcher
public void setHintUserWillBeActive() {
addActivityFlags(ACTIVITY_STATE_USER_WILL_BE_ACTIVE);
}
@Override
public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
super.onDisplayInfoChanged(context, info, flags);
// When changing screens with live tile active, finish the recents animation to close
// overview as it should be an interim state
if ((flags & CHANGE_ACTIVE_SCREEN) != 0 && LIVE_TILE.get()) {
RecentsView recentsView = getOverviewPanel();
recentsView.finishRecentsAnimation(/* toRecents= */ true, null);
}
}
}
+5 -9
View File
@@ -14,18 +14,14 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:enterFadeDuration="500">
android:enterFadeDuration="100">
<item
android:id="@+id/unselected"
android:state_selected="false">
<ripple android:color="@color/all_apps_tab_background_selected">
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
<solid android:color="@color/all_apps_tabs_background" />
</shape>
</item>
</ripple>
<shape android:shape="rectangle">
<corners android:radius="@dimen/all_apps_header_pill_corner_radius" />
<solid android:color="@color/all_apps_tabs_background" />
</shape>
</item>
<item
@@ -454,8 +454,8 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
*/
public int getTabWidth() {
DeviceProfile grid = BaseDraggingActivity.fromContext(getContext()).getDeviceProfile();
int totalWidth = (grid.availableWidthPx - getPaddingLeft() - getPaddingRight());
int totalWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
int iconPadding = totalWidth / grid.numShownAllAppsColumns - grid.allAppsIconSizePx;
return totalWidth - iconPadding;
return totalWidth - iconPadding - grid.allAppsIconDrawablePaddingPx;
}
}
@@ -154,6 +154,14 @@ public class FloatingHeaderView extends LinearLayout implements
PluginManagerWrapper.INSTANCE.get(getContext()).removePluginListener(this);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mMainRV != null) {
mTabLayout.getLayoutParams().width = mMainRV.getTabWidth();
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
private void recreateAllRowsArray() {
int pluginCount = mPluginRows.size();
if (pluginCount == 0) {
@@ -224,8 +232,6 @@ public class FloatingHeaderView extends LinearLayout implements
mTabsHidden = tabsHidden;
mTabLayout.setVisibility(tabsHidden ? View.GONE : View.VISIBLE);
mTabLayout.getLayoutParams().width =
mAH[AllAppsContainerView.AdapterHolder.MAIN].recyclerView.getTabWidth();
mMainRV = setupRV(mMainRV, mAH[AllAppsContainerView.AdapterHolder.MAIN].recyclerView);
mWorkRV = setupRV(mWorkRV, mAH[AllAppsContainerView.AdapterHolder.WORK].recyclerView);
mParent = (ViewGroup) mMainRV.getParent();