本文整理汇总了Java中org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem类的典型用法代码示例。如果您正苦于以下问题:Java TimedItem类的具体用法?Java TimedItem怎么用?Java TimedItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimedItem类属于org.chromium.chrome.browser.widget.DateDividedAdapter包,在下文中一共展示了TimedItem类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: filter
import org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem; //导入依赖的package包/类
/**
* Filters out items that match the query and are displayed in this list for the current filter.
* @param filterType Filter to use.
* @param query The text to match.
* @param filteredItems List for appending items that match the filter.
*/
public void filter(int filterType, String query, List<TimedItem> filteredItems) {
if (TextUtils.isEmpty(query)) {
filter(filterType, filteredItems);
return;
}
for (DownloadHistoryItemWrapper item : this) {
query = query.toLowerCase(Locale.getDefault());
Locale locale = Locale.getDefault();
if (item.isVisibleToUser(filterType)
&& (item.getDisplayHostname().toLowerCase(locale).contains(query)
|| item.getDisplayFileName().toLowerCase(locale).contains(query))) {
filteredItems.add(item);
}
}
}
示例2: isSuggestedOfflinePage
import org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem; //导入依赖的package包/类
private boolean isSuggestedOfflinePage(TimedItem timedItem) {
if (timedItem instanceof OfflinePageItemWrapper) {
return ((OfflinePageItemWrapper) timedItem).isSuggested();
}
return false;
}
示例3: compareItem
import org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem; //导入依赖的package包/类
@Override
public int compareItem(TimedItem lhs, TimedItem rhs) {
int lhsOrder = order(lhs);
int rhsOrder = order(rhs);
if (lhsOrder != rhsOrder) {
return lhsOrder < rhsOrder ? -1 : 1;
}
return super.compareItem(lhs, rhs);
}
示例4: order
import org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem; //导入依赖的package包/类
/**
* A sorting helper function based on the item type. The items in the list view are placed from
* the top in the following order: download items, suggested pages header, suggested pages.
* @param timedItem The item to be displayed.
* @return An integer based on the item type which is to be used for sorting.
*/
private int order(TimedItem timedItem) {
if (isSuggestedOfflinePage(timedItem)) {
return 2;
} else if (timedItem instanceof SubsectionHeader) {
return 1;
} else {
return 0;
}
}
示例5: toggleSelectionForItem
import org.chromium.chrome.browser.widget.DateDividedAdapter.TimedItem; //导入依赖的package包/类
@Override
protected boolean toggleSelectionForItem(TimedItem item) {
return mSelectionDelegate.toggleSelectionForSubsection(mHeader);
}