Commit 0ca4900d authored by Shakti Sahu's avatar Shakti Sahu Committed by Commit Bot

Content Indexing : Fixed two issues

This CL contains :
1 - Fixed InflateException on Kitkat when it is unable to handle vector drawables.
2 - Fixed an issue with tablets where clicking on 'See more' results in crash.

Bug: 1042459, 1042424
Change-Id: I6981d794e1a44cfbc19da1f990113d54e67dc60d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006075Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Shakti Sahu <shaktisahu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732697}
parent 74723175
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<RelativeLayout <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android" 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_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/group_card_item_border" android:background="@drawable/group_card_item_border"
...@@ -17,8 +18,8 @@ ...@@ -17,8 +18,8 @@
android:id="@+id/favicon" android:id="@+id/favicon"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:src="@drawable/ic_globe_24dp" android:importantForAccessibility="no"
android:importantForAccessibility="no"/> app:srcCompat="@drawable/ic_globe_24dp"/>
<TextView <TextView
android:id="@+id/domain" android:id="@+id/domain"
......
...@@ -24,9 +24,7 @@ public class CardPaginator { ...@@ -24,9 +24,7 @@ public class CardPaginator {
* @param dateAndDomain The date and domain for the items in the card. * @param dateAndDomain The date and domain for the items in the card.
*/ */
public void loadMore(Pair<Date, String> dateAndDomain) { public void loadMore(Pair<Date, String> dateAndDomain) {
assert mPageCountForCard.containsKey(dateAndDomain); mPageCountForCard.put(dateAndDomain, getCurrentPageCount(dateAndDomain) + 1);
int currentPages = mPageCountForCard.get(dateAndDomain);
mPageCountForCard.put(dateAndDomain, currentPages + 1);
} }
/** /**
...@@ -44,9 +42,7 @@ public class CardPaginator { ...@@ -44,9 +42,7 @@ public class CardPaginator {
* @return The number of items being shown on the card. * @return The number of items being shown on the card.
*/ */
public int getItemCountForCard(Pair<Date, String> dateAndDomain) { public int getItemCountForCard(Pair<Date, String> dateAndDomain) {
return mPageCountForCard.containsKey(dateAndDomain) return getCurrentPageCount(dateAndDomain) * ITEM_COUNT_PER_PAGE;
? mPageCountForCard.get(dateAndDomain) * ITEM_COUNT_PER_PAGE
: 0;
} }
/** /**
...@@ -63,4 +59,10 @@ public class CardPaginator { ...@@ -63,4 +59,10 @@ public class CardPaginator {
public void reset() { public void reset() {
mPageCountForCard.clear(); mPageCountForCard.clear();
} }
/** @return The number of pages currently being displayed. Default is 1.*/
private int getCurrentPageCount(Pair<Date, String> dateAndDomain) {
return mPageCountForCard.containsKey(dateAndDomain) ? mPageCountForCard.get(dateAndDomain)
: 1;
}
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment