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 @@
<RelativeLayout
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:background="@drawable/group_card_item_border"
......@@ -17,8 +18,8 @@
android:id="@+id/favicon"
android:layout_width="16dp"
android:layout_height="16dp"
android:src="@drawable/ic_globe_24dp"
android:importantForAccessibility="no"/>
android:importantForAccessibility="no"
app:srcCompat="@drawable/ic_globe_24dp"/>
<TextView
android:id="@+id/domain"
......
......@@ -24,9 +24,7 @@ public class CardPaginator {
* @param dateAndDomain The date and domain for the items in the card.
*/
public void loadMore(Pair<Date, String> dateAndDomain) {
assert mPageCountForCard.containsKey(dateAndDomain);
int currentPages = mPageCountForCard.get(dateAndDomain);
mPageCountForCard.put(dateAndDomain, currentPages + 1);
mPageCountForCard.put(dateAndDomain, getCurrentPageCount(dateAndDomain) + 1);
}
/**
......@@ -44,9 +42,7 @@ public class CardPaginator {
* @return The number of items being shown on the card.
*/
public int getItemCountForCard(Pair<Date, String> dateAndDomain) {
return mPageCountForCard.containsKey(dateAndDomain)
? mPageCountForCard.get(dateAndDomain) * ITEM_COUNT_PER_PAGE
: 0;
return getCurrentPageCount(dateAndDomain) * ITEM_COUNT_PER_PAGE;
}
/**
......@@ -63,4 +59,10 @@ public class CardPaginator {
public void reset() {
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