Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADS: Downloads screen migration #2610

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class DownloadsAdapter @Inject constructor(
RecyclerView.ViewHolder(binding.root) {

fun bind(item: Header) {
binding.downloadsHeaderTextView.text = item.text
binding.downloadsHeaderTextView.primaryText = item.text
}
}

Expand Down Expand Up @@ -131,7 +131,7 @@ class DownloadsAdapter @Inject constructor(
else -> context.getString(R.string.downloadsStateInProgress)
}
twoListItem.setSecondaryText(subtitle)
twoListItem.setLeadingIcon(R.drawable.ic_file)
twoListItem.setLeadingIcon(R.drawable.ic_document_24)

twoListItem.setClickListener {
if (item.downloadItem.contentLength > 0) {
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/res/drawable/ic_document_24.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
~ Copyright (c) 2022 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16,22L8,22c-2.21,0 -4,-1.79 -4,-4L4,6c0,-2.21 1.79,-4 4,-4h4.343c1.061,0 2.078,0.421 2.829,1.172l3.656,3.656c0.75,0.75 1.172,1.768 1.172,2.829L20,18c0,2.21 -1.79,4 -4,4zM6,18c0,1.105 0.895,2 2,2h8c1.105,0 2,-0.895 2,-2v-8h-2c-2.21,0 -4,-1.79 -4,-4L12,4L8,4c-1.105,0 -2,0.895 -2,2v12zM14,4.828L14,6c0,1.105 0.895,2 2,2h1.172L14,4.828z"
android:fillColor="?attr/daxColorPrimaryIcon"
android:fillType="evenOdd"/>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_download_image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<item android:drawable="@drawable/list_item_image_circular_background"/>
<item
android:bottom="10dp"
android:drawable="@drawable/ic_file"
android:drawable="@drawable/ic_document_24"
android:left="@dimen/keyline_3"
android:right="@dimen/keyline_3"
android:top="10dp"/>
Expand Down
26 changes: 0 additions & 26 deletions app/src/main/res/drawable/ic_file.xml

This file was deleted.

26 changes: 17 additions & 9 deletions app/src/main/res/layout/view_item_downloads_empty.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@
~ limitations under the License.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/downloads_empty_text_view"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingStart="24dp"
android:paddingTop="48dp"
android:paddingEnd="24dp"
android:textColor="?attr/secondaryTextColor"
android:textAppearance="@style/TextAppearance.DuckDuckGo.Body1"
android:text="@string/downloadsActivityNoItemsDescription" />
android:paddingStart="@dimen/keyline_4"
android:paddingTop="@dimen/keyline_5"
android:paddingEnd="@dimen/keyline_4"
android:paddingBottom="@dimen/keyline_5">

<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/downloads_empty_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/downloadsActivityNoItemsDescription"
app:textType="secondary"
app:typography="body2" />

</FrameLayout>
7 changes: 2 additions & 5 deletions app/src/main/res/layout/view_item_downloads_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
~ limitations under the License.
-->

<com.duckduckgo.mobile.android.ui.view.text.SectionHeaderTextView
<com.duckduckgo.mobile.android.ui.view.listitem.SectionHeaderListItem
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/downloads_header_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
tools:text="TODAY"/>
android:layout_height="wrap_content" />