mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Revert "Refactors Search results into separate RV for Toast."
This reverts commit 6729f0b950.
Reason for revert: This change caused b/230648542.
Please see https://b.corp.google.com/issues/230648542#comment5 for the video after reverting this change.
Bug: 206905515
Bug: 230648542
Change-Id: I85f063c56cad137c05b810204244bba7e8f94ee7
This commit is contained in:
@@ -33,7 +33,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Insettable;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.allapps.BaseAllAppsContainerView.AdapterHolder;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.uioverrides.plugins.PluginManagerWrapper;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
@@ -91,8 +90,8 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
protected ViewGroup mTabLayout;
|
||||
private AllAppsRecyclerView mMainRV;
|
||||
private AllAppsRecyclerView mWorkRV;
|
||||
private SearchRecyclerView mSearchRV;
|
||||
private AllAppsRecyclerView mCurrentRV;
|
||||
private ViewGroup mParent;
|
||||
public boolean mHeaderCollapsed;
|
||||
protected int mSnappedScrolledY;
|
||||
private int mTranslationY;
|
||||
@@ -101,6 +100,7 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
|
||||
protected boolean mTabsHidden;
|
||||
protected int mMaxTranslation;
|
||||
private boolean mMainRVActive = true;
|
||||
|
||||
private boolean mCollapsed = false;
|
||||
|
||||
@@ -232,8 +232,7 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
return super.getFocusedChild();
|
||||
}
|
||||
|
||||
void setup(AllAppsRecyclerView mainRV, AllAppsRecyclerView workRV, SearchRecyclerView searchRV,
|
||||
int activeRV, boolean tabsHidden) {
|
||||
void setup(AllAppsRecyclerView mainRV, AllAppsRecyclerView workRV, boolean tabsHidden) {
|
||||
for (FloatingHeaderRow row : mAllRows) {
|
||||
row.setup(this, mAllRows, tabsHidden);
|
||||
}
|
||||
@@ -243,8 +242,8 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
mTabLayout.setVisibility(tabsHidden ? View.GONE : View.VISIBLE);
|
||||
mMainRV = setupRV(mMainRV, mainRV);
|
||||
mWorkRV = setupRV(mWorkRV, workRV);
|
||||
mSearchRV = (SearchRecyclerView) setupRV(mSearchRV, searchRV);
|
||||
setActiveRV(activeRV);
|
||||
mParent = (ViewGroup) mMainRV.getParent();
|
||||
setMainActive(mMainRVActive || mWorkRV == null);
|
||||
reset(false);
|
||||
}
|
||||
|
||||
@@ -268,10 +267,9 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
}
|
||||
}
|
||||
|
||||
public void setActiveRV(int rvType) {
|
||||
mCurrentRV =
|
||||
rvType == AdapterHolder.MAIN ? mMainRV
|
||||
: rvType == AdapterHolder.WORK ? mWorkRV : mSearchRV;
|
||||
public void setMainActive(boolean active) {
|
||||
mCurrentRV = active ? mMainRV : mWorkRV;
|
||||
mMainRVActive = active;
|
||||
}
|
||||
|
||||
public int getMaxTranslation() {
|
||||
@@ -334,15 +332,10 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
mHeaderClip.top = clipTop;
|
||||
// clipping on a draw might cause additional redraw
|
||||
setClipBounds(mHeaderClip);
|
||||
if (mMainRV != null) {
|
||||
mMainRV.setClipBounds(mRVClip);
|
||||
}
|
||||
mMainRV.setClipBounds(mRVClip);
|
||||
if (mWorkRV != null) {
|
||||
mWorkRV.setClipBounds(mRVClip);
|
||||
}
|
||||
if (mSearchRV != null) {
|
||||
mSearchRV.setClipBounds(mRVClip);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,8 +402,8 @@ public class FloatingHeaderView extends LinearLayout implements
|
||||
}
|
||||
|
||||
private void calcOffset(Point p) {
|
||||
p.x = getLeft() - mCurrentRV.getLeft() - ((ViewGroup) mCurrentRV.getParent()).getLeft();
|
||||
p.y = getTop() - mCurrentRV.getTop() - ((ViewGroup) mCurrentRV.getParent()).getTop();
|
||||
p.x = getLeft() - mCurrentRV.getLeft() - mParent.getLeft();
|
||||
p.y = getTop() - mCurrentRV.getTop() - mParent.getTop();
|
||||
}
|
||||
|
||||
public boolean hasVisibleContent() {
|
||||
|
||||
Reference in New Issue
Block a user