Skip to content

Commit

Permalink
Revert "Add an option to control recent apps showing"
Browse files Browse the repository at this point in the history
This reverts commit 171cbbe.
  • Loading branch information
Goooler committed Nov 30, 2023
1 parent 3144526 commit fc5c83d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 28 deletions.
2 changes: 0 additions & 2 deletions lawnchair/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,6 @@
<string name="hidden_apps_label">隐藏的应用</string>
<string name="show_enable_smart_hide">在输入全名时显示</string>
<string name="hide_hidden_apps_search">在搜索结果中隐藏</string>
<string name="recent_apps_label">最近应用</string>
<string name="show_recent_apps_in_drawer">在抽屉中显示最近应用</string>
<string name="pref_category_search">搜索</string>
<string name="show_app_search_bar">显示搜索栏</string>
<string name="pref_search_auto_show_keyboard">自动显示键盘</string>
Expand Down
1 change: 0 additions & 1 deletion lawnchair/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
<bool name="config_default_hide_app_drawer_search_bar">false</bool>
<bool name="config_default_show_hidden_apps_in_search">false</bool>
<bool name="config_default_enable_smart_hide">false</bool>
<bool name="config_default_show_recent_apps_in_drawer">false</bool>
<bool name="config_default_enable_font_selection">true</bool>
<bool name="config_default_enable_smartspace_calendar_selection">true</bool>
<bool name="config_default_dts2">true</bool>
Expand Down
3 changes: 0 additions & 3 deletions lawnchair/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,6 @@
<string name="show_enable_smart_hide">Show when Full Name is Typed</string>
<string name="hide_hidden_apps_search">Hide in Search Results</string>

<string name="recent_apps_label">Recent Apps</string>
<string name="show_recent_apps_in_drawer">Show recent apps in drawer</string>

<string name="pref_category_search">Search</string>
<string name="show_app_search_bar">Show Search Bar</string>
<string name="pref_search_auto_show_keyboard">Automatically Show Keyboard</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ class PreferenceManager2 private constructor(private val context: Context) : Pre
onSet = { reloadHelper.recreate() },
)

val showRecentAppsInDrawer = preference(
key = booleanPreferencesKey(name = "show_recent_apps_in_drawer"),
defaultValue = context.resources.getBoolean(R.bool.config_default_show_recent_apps_in_drawer),
onSet = { reloadHelper.recreate() },
)

val enableFontSelection = preference(
key = booleanPreferencesKey(name = "enable_font_selection"),
defaultValue = context.resources.getBoolean(R.bool.config_default_enable_font_selection),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ fun AppDrawerPreferences() {
}
}

PreferenceGroup(heading = stringResource(id = R.string.recent_apps_label)) {
val showRecentAppsInDrawer = prefs2.showRecentAppsInDrawer.getAdapter()
SwitchPreference(
label = stringResource(id = R.string.show_recent_apps_in_drawer),
adapter = showRecentAppsInDrawer,
)
}

val deviceSearchEnabled = false
PreferenceGroup(heading = stringResource(id = R.string.pref_category_search)) {
SwitchPreference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.touch.ItemLongClickListener;
import com.android.launcher3.views.ActivityContext;
import com.patrykmichalik.opto.core.PreferenceExtensionsKt;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import app.lawnchair.preferences2.PreferenceManager2;

@TargetApi(Build.VERSION_CODES.P)
public class PredictionRowView<T extends Context & ActivityContext>
extends LinearLayout implements OnDeviceProfileChangeListener, FloatingHeaderRow {
Expand All @@ -69,8 +66,6 @@ public class PredictionRowView<T extends Context & ActivityContext>
private boolean mPredictionsEnabled = false;
private OnLongClickListener mOnIconLongClickListener = ItemLongClickListener.INSTANCE_ALL_APPS;

private final PreferenceManager2 prefs2 = PreferenceManager2.getInstance(getContext());

public PredictionRowView(@NonNull Context context) {
this(context, null);
}
Expand Down Expand Up @@ -102,10 +97,9 @@ public void setup(FloatingHeaderView parent, FloatingHeaderRow[] rows, boolean t
}

private void updateVisibility() {
boolean enabled = mPredictionsEnabled && PreferenceExtensionsKt.firstBlocking(prefs2.getShowRecentAppsInDrawer());
setVisibility(enabled ? VISIBLE : GONE);
setVisibility(mPredictionsEnabled ? VISIBLE : GONE);
if (mActivityContext.getAppsView() != null) {
if (enabled) {
if (mPredictionsEnabled) {
mActivityContext.getAppsView().getAppsStore().registerIconContainer(this);
} else {
mActivityContext.getAppsView().getAppsStore().unregisterIconContainer(this);
Expand Down

0 comments on commit fc5c83d

Please sign in to comment.