Add work toggle to work apps paused message

This also fixes scrolling issues in landscape

Bug: 186857875
Bug: 161929312
Bug: 189983516
Bug: 190567199
screenshot: https://screenshot.googleplex.com/BCjcyJFqJo6W4Tr
Test: local
Change-Id: I7bcf23cc4be2fca936eba41342731789eb8f3292
This commit is contained in:
Samuel Fufa
2021-06-14 18:27:44 -05:00
parent b8cec440cc
commit dfc274364e
9 changed files with 172 additions and 61 deletions

View File

@@ -21,7 +21,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.LinearLayout;
import android.widget.FrameLayout;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
@@ -29,7 +29,7 @@ import com.android.launcher3.R;
/**
* Work profile toggle switch shown at the bottom of AllApps work tab
*/
public class WorkEduCard extends LinearLayout implements View.OnClickListener,
public class WorkEduCard extends FrameLayout implements View.OnClickListener,
Animation.AnimationListener {
private final Launcher mLauncher;
@@ -52,11 +52,24 @@ public class WorkEduCard extends LinearLayout implements View.OnClickListener,
mDismissAnim.setAnimationListener(this);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
mDismissAnim.reset();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
mDismissAnim.cancel();
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
findViewById(R.id.action_btn).setOnClickListener(this);
MarginLayoutParams lp = ((MarginLayoutParams) findViewById(R.id.wrapper).getLayoutParams());
lp.width = mLauncher.getAppsView().getActiveRecyclerView().getTabWidth();
}
@Override