Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/upstream' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Goooler committed Feb 17, 2024
2 parents 4267efb + b17a5b7 commit cd04ddd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ allprojects {
}

plugins.withId('com.google.protobuf') {
def protocVersion = '3.25.2'
def protocVersion = '3.25.3'
protobuf {
// Configure the protoc executable
protoc {
Expand Down Expand Up @@ -332,8 +332,8 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.preference:preference-ktx:1.2.1"

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3'
implementation "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7"
implementation 'com.github.ChickenHook:RestrictionBypass:2.2'
implementation 'dev.rikka.tools.refine:runtime:4.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class PreferenceManager2 private constructor(private val context: Context) : Pre
val hideAppDrawerSearchBar = preference(
key = booleanPreferencesKey(name = "hide_app_drawer_search_bar"),
defaultValue = context.resources.getBoolean(R.bool.config_default_hide_app_drawer_search_bar),
onSet = { reloadHelper.reloadGrid() },
onSet = { reloadHelper.recreate() },
)

val showHiddenAppsInSearch = preference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ private void finishTouchTracking(MotionEvent ev) {
// starting the gesture. In that case, we need to clean-up an unfinished or un-started
// animation.
if (mActiveCallbacks != null && mInteractionHandler != null) {
if (mTaskAnimationManager.isRecentsAnimationRunning()) {
if (mTaskAnimationManager.isRecentsAnimationRunning()
&& !allowInterceptByParent()) {
// The animation started, but with no movement, in this case, there will be no
// animateToProgress so we have to manually finish here. In the case of
// ACTION_CANCEL, someone else may be doing something so finish synchronously.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
import com.android.launcher3.views.ScrimView;
import com.android.launcher3.views.SpringRelativeLayout;
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip;
import com.patrykmichalik.opto.core.PreferenceExtensionsKt;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -99,6 +100,7 @@

import app.lawnchair.allapps.LawnchairAlphabeticalAppsList;
import app.lawnchair.font.FontManager;
import app.lawnchair.preferences2.PreferenceManager2;
import app.lawnchair.theme.color.ColorTokens;
import app.lawnchair.ui.StretchRecyclerViewContainer;

Expand Down Expand Up @@ -192,6 +194,8 @@ public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
private boolean mForceBottomSheetVisible;
private int mTabsProtectionAlpha;

private final PreferenceManager2 pref2;

@Nullable
private AllAppsTransitionController mAllAppsTransitionController;

Expand All @@ -207,7 +211,7 @@ public ActivityAllAppsContainerView(Context context, AttributeSet attrs, int def
super(context, attrs, defStyleAttr);
mActivityContext = ActivityContext.lookupContext(context);
mAllAppsStore = new AllAppsStore<>(mActivityContext);

pref2 = PreferenceManager2.getInstance(mActivityContext);
mScrimColor = ColorTokens.AllAppsScrimColor.resolveColor(context);
mHeaderThreshold = getResources().getDimensionPixelSize(
R.dimen.dynamic_grid_cell_border_spacing);
Expand Down Expand Up @@ -723,7 +727,8 @@ public void getOutline(View view, Outline outline) {
}

void setupHeader() {
mHeader.setVisibility(View.VISIBLE);
var hideHeader = PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar());
mHeader.setVisibility(hideHeader ? View.GONE : View.VISIBLE);
boolean tabsHidden = !mUsingTabs;
mHeader.setup(
mAH.get(AdapterHolder.MAIN).mRecyclerView,
Expand Down Expand Up @@ -752,6 +757,7 @@ void setupHeader() {
}

protected void updateHeaderScroll(int scrolledOffset) {
if (PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar())) return;
float prog1 = Utilities.boundToRange((float) scrolledOffset / mHeaderThreshold, 0f, 1f);
int headerColor = getHeaderColor(prog1);
int tabsAlpha = mHeader.getPeripheralProtectionHeight() == 0 ? 0
Expand Down Expand Up @@ -857,7 +863,7 @@ public int getFloatingSearchBarRestingMarginEnd() {
}

private void layoutBelowSearchContainer(View v, boolean includeTabsMargin) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams) || PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar())) {
return;
}

Expand All @@ -874,7 +880,7 @@ private void layoutBelowSearchContainer(View v, boolean includeTabsMargin) {
}

private void alignParentTop(View v, boolean includeTabsMargin) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams) || PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar())) {
return;
}

Expand All @@ -887,7 +893,7 @@ private void alignParentTop(View v, boolean includeTabsMargin) {
}

private void removeCustomRules(View v) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams) || PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar())) {
return;
}

Expand All @@ -908,7 +914,7 @@ protected boolean isSearchSupported() {
}

private void layoutWithoutSearchContainer(View v, boolean includeTabsMargin) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams)) {
if (!(v.getLayoutParams() instanceof RelativeLayout.LayoutParams) || PreferenceExtensionsKt.firstBlocking(pref2.getHideAppDrawerSearchBar())) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion systemUILog/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ compileOnlyCommonJars()
dependencies {
compileOnly projects.systemUIPluginCore
compileOnly projects.systemUICommon
implementation 'com.google.errorprone:error_prone_annotations:2.24.1'
implementation 'com.google.errorprone:error_prone_annotations:2.25.0'
}

0 comments on commit cd04ddd

Please sign in to comment.