New issue
Advanced search Search tips

Issue 689801 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Expandable offline pages section in downloads home

Project Member Reported by shaktisahu@chromium.org, Feb 8 2017

Issue description

Project Member

Comment 1 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1b901526d84b86839e58b340a117eef6b40a7706

commit 1b901526d84b86839e58b340a117eef6b40a7706
Author: shaktisahu <shaktisahu@chromium.org>
Date: Thu Feb 23 02:57:54 2017

[Download Home] Displaying offline page bundle per day

This CL adds suggested offline pages to the DownloadHistoryAdapter.
The suggested pages are grouped into a bundle for each day and placed
at the bottom of each day's download history. The pages can be shown or
hidden through tapping an up/down arrow on the subsection header.

Key points of this CL:
1- To keep DateDividedAdapter unaware of offline suggestions,
DateDividedAdapter.ItemGroup was subclassed into a separate
DownloadItemGroup class which contains the special sorting function for
this purpose. Based on whether the offline pages section is expanded or
not, the offline items are filtered out before adding to the adapter.

2- For displaying the section header for the suggested offline pages,
a TimedItem is added to the adapter which is passed the required
information about the group it is associated to. OfflineGroupHeaderView
and OfflineGroupHeaderViewHolder classes represent the view portion
for the header. The section header is not selectable at the moment
which would be addressed in a future CL.

BUG= 689801 

Review-Url: https://codereview.chromium.org/2670083002
Cr-Commit-Position: refs/heads/master@{#452361}

[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/res/layout/download_item_view.xml
[add] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/res/layout/offline_download_header.xml
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/res/values-v17/styles.xml
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/download/ui/BackendItems.java
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryItemWrapper.java
[add] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemGroup.java
[add] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/src/org/chromium/chrome/browser/widget/DateDividedAdapter.java
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/1b901526d84b86839e58b340a117eef6b40a7706/chrome/android/java_sources.gni

Attached the screen video of selectable suggested page section header.
demo.mp4
18.4 MB Download
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba3f171d0f3e4300341ba8a719f4f98f61af0165

commit ba3f171d0f3e4300341ba8a719f4f98f61af0165
Author: shaktisahu <shaktisahu@chromium.org>
Date: Fri Mar 10 05:21:06 2017

Download Home : Suggested pages header selection

This CL enables user to select the suggested page section header.
Details:
- Long press enables selection mode. Tap during selection will toggle the
  selection, but doesn't expand/collapse the items.
- Selecting the header internally selects all the related items.
- If all the items are selected manually, the header gets selected automatically.
- Deselecting any item will deselect the corresponding header if previously selected.
- The badging at the top reflects the number of items currently selected excluding the headers.
- When selected, the chrome logo on the header turns into tick mark similar to rest of the items.
- In presence of search text, headers are not displayed (no grouping),
  but once the text is cleared out, the headers will be back in.
  TODO: Hide the date headers when there is an active search.

BUG= 689801 

Review-Url: https://codereview.chromium.org/2701253006
Cr-Commit-Position: refs/heads/master@{#456001}

[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java
[add] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadItemSelectionDelegate.java
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadManagerUi.java
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OfflineGroupHeaderView.java
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java/src/org/chromium/chrome/browser/widget/selection/SelectableItemView.java
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/java_sources.gni
[modify] https://crrev.com/ba3f171d0f3e4300341ba8a719f4f98f61af0165/chrome/android/javatests/src/org/chromium/chrome/browser/download/ui/StubbedProvider.java

Status: Fixed (was: Started)

Sign in to add a comment