Fixing tab width and panner not aligned with the all-apps icons

Bug: 234008165
Test: Verified on device
Change-Id: Ibec3eed4aef730439d79b086d6ae23b63b66361e
This commit is contained in:
Sunny Goyal
2022-07-11 15:39:32 -07:00
parent 46f79bda0c
commit eab51677ae
3 changed files with 46 additions and 8 deletions
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.allapps;
import static com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.getTabWidth;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
@@ -85,14 +87,10 @@ public class WorkEduCard extends FrameLayout implements
}
@Override
public void onAnimationRepeat(Animation animation) {
}
public void onAnimationRepeat(Animation animation) { }
@Override
public void onAnimationStart(Animation animation) {
}
public void onAnimationStart(Animation animation) { }
private void removeCard() {
if (mPosition == -1) {
@@ -105,8 +103,14 @@ public class WorkEduCard extends FrameLayout implements
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int size = MeasureSpec.getSize(widthMeasureSpec);
findViewById(R.id.wrapper).getLayoutParams().width = getTabWidth(getContext(), size);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
public void setPosition(int position) {
mPosition = position;
}
}