feat: add tilt to swipe pages for home screen rearrangement and fix app drawer gap (#7500)
* feat and fix : Add Tilt to swipe pages setting Replace the multi-level Motion controls with a single Home screen toggle named “Tilt to swipe pages,” positioned below Infinite scrolling. Update the description to explain that tilting the phone moves between pages while rearranging apps or widgets, and make the pan controller use the toggle directly while retaining the existing preference key for compatibility. Fix for "[BUG] Large empty gap between app drawer search bar and app grid when app suggestions are disabled #7490" * EDITS : Coderabbit suggested edits for PR #7500 * Coderabbit suggested changes (2) #7500 * Update gradle-daemon-jvm.properties * Remove unrelated Gradle toolchain changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add docstrings for pan-to-move and all apps header changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add a tilt sensitivity control --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
d180feb55f
commit
ce82ac1248
9 files changed
+299
-7
No files matched your search
@@ -844,12 +844,14 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
updateSearchResultsVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up header rows and hides the header shell when neither tabs nor visible row content
|
||||
* requires it, keeping adapter top padding consistent with that visibility.
|
||||
*/
|
||||
void setupHeader() {
|
||||
mAdditionalHeaderRows.forEach(row -> mHeader.onPluginDisconnected(row));
|
||||
|
||||
boolean hideSearchBar = isAppDrawerSearchBarHidden();
|
||||
// Keep personal/work tabs visible when search is off; only hide the empty header shell.
|
||||
mHeader.setVisibility((hideSearchBar && !mUsingTabs) ? View.GONE : View.VISIBLE);
|
||||
boolean tabsHidden = !mUsingTabs;
|
||||
mHeader.setup(
|
||||
mAH.get(AdapterHolder.MAIN).mRecyclerView,
|
||||
@@ -858,7 +860,11 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
getCurrentPage(),
|
||||
tabsHidden);
|
||||
|
||||
int padding = (hideSearchBar && !mUsingTabs) ? 0 : mHeader.getMaxTranslation();
|
||||
// Keep personal/work tabs or visible rows active; hide the empty header shell.
|
||||
boolean hasHeaderContent = mUsingTabs || (!hideSearchBar && mHeader.hasVisibleContent());
|
||||
mHeader.setVisibility(hasHeaderContent ? View.VISIBLE : View.GONE);
|
||||
|
||||
int padding = hasHeaderContent ? mHeader.getMaxTranslation() : 0;
|
||||
mAH.forEach(adapterHolder -> {
|
||||
adapterHolder.mPadding.top = padding;
|
||||
adapterHolder.applyPadding();
|
||||
@@ -1442,6 +1448,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows search results without the header, or restores the header only when tabs or visible
|
||||
* header rows provide content.
|
||||
*/
|
||||
protected void updateSearchResultsVisibility() {
|
||||
if (isSearching()) {
|
||||
getSearchRecyclerView().setVisibility(VISIBLE);
|
||||
@@ -1450,9 +1460,10 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
} else {
|
||||
getSearchRecyclerView().setVisibility(GONE);
|
||||
getAppsRecyclerViewContainer().setVisibility(VISIBLE);
|
||||
// Keep the empty header shell hidden when search is off and there are no tabs.
|
||||
mHeader.setVisibility(
|
||||
(isAppDrawerSearchBarHidden() && !mUsingTabs) ? View.GONE : View.VISIBLE);
|
||||
// Keep personal/work tabs or visible rows active; hide the empty header shell.
|
||||
boolean hasHeaderContent = mUsingTabs
|
||||
|| (!isAppDrawerSearchBarHidden() && mHeader.hasVisibleContent());
|
||||
mHeader.setVisibility(hasHeaderContent ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
if (mHeader.isSetUp()) {
|
||||
mHeader.setActiveRV(getCurrentPage());
|
||||
|
||||
Reference in new issue
Block a user