當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewCompat.jumpDrawablesToCurrentState方法代碼示例

本文整理匯總了Java中android.support.v4.view.ViewCompat.jumpDrawablesToCurrentState方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewCompat.jumpDrawablesToCurrentState方法的具體用法?Java ViewCompat.jumpDrawablesToCurrentState怎麽用?Java ViewCompat.jumpDrawablesToCurrentState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.ViewCompat的用法示例。


在下文中一共展示了ViewCompat.jumpDrawablesToCurrentState方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateMenuView

import android.support.v4.view.ViewCompat; //導入方法依賴的package包/類
public void updateMenuView(boolean cleared) {
    ViewGroup parent = this.mMenuView;
    if (parent != null) {
        int childIndex = 0;
        if (this.mMenu != null) {
            this.mMenu.flagActionItems();
            ArrayList<MenuItemImpl> visibleItems = this.mMenu.getVisibleItems();
            int itemCount = visibleItems.size();
            for (int i = 0; i < itemCount; i++) {
                MenuItemImpl item = (MenuItemImpl) visibleItems.get(i);
                if (shouldIncludeItem(childIndex, item)) {
                    View convertView = parent.getChildAt(childIndex);
                    MenuItemImpl oldItem = convertView instanceof ItemView ? ((ItemView) convertView).getItemData() : null;
                    View itemView = getItemView(item, convertView, parent);
                    if (item != oldItem) {
                        itemView.setPressed(false);
                        ViewCompat.jumpDrawablesToCurrentState(itemView);
                    }
                    if (itemView != convertView) {
                        addItemView(itemView, childIndex);
                    }
                    childIndex++;
                }
            }
        }
        while (childIndex < parent.getChildCount()) {
            if (!filterLeftoverView(parent, childIndex)) {
                childIndex++;
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:33,代碼來源:BaseMenuPresenter.java

示例2: onBindViewHolder

import android.support.v4.view.ViewCompat; //導入方法依賴的package包/類
@Override
public void onBindViewHolder(final BookmarkViewHolder holder, int position) {
    ViewCompat.jumpDrawablesToCurrentState(holder.itemView);

    final HistoryItem web = mBookmarks.get(position);
    holder.txtTitle.setText(web.getTitle());
    if (web.isFolder()) {
        holder.favicon.setImageBitmap(mFolderBitmap);
    } else if (web.getBitmap() == null) {
        holder.favicon.setImageBitmap(mWebpageBitmap);
        holder.favicon.setTag(web.getUrl().hashCode());

        final String url = web.getUrl();

        Subscription oldSubscription = mFaviconFetchSubscriptions.get(url);
        SubscriptionUtils.safeUnsubscribe(oldSubscription);

        final Subscription faviconSubscription = mFaviconModel.faviconForUrl(url, web.getTitle())
            .subscribeOn(Schedulers.io())
            .observeOn(Schedulers.main())
            .subscribe(new SingleOnSubscribe<Bitmap>() {
                @Override
                public void onItem(@Nullable Bitmap item) {
                    mFaviconFetchSubscriptions.remove(url);
                    Object tag = holder.favicon.getTag();
                    if (tag != null && tag.equals(url.hashCode())) {
                        holder.favicon.setImageBitmap(item);
                    }

                    web.setBitmap(item);
                }
            });

        mFaviconFetchSubscriptions.put(url, faviconSubscription);
    } else {
        holder.favicon.setImageBitmap(web.getBitmap());
    }

}
 
開發者ID:XndroidDev,項目名稱:Xndroid,代碼行數:40,代碼來源:BookmarksFragment.java


注:本文中的android.support.v4.view.ViewCompat.jumpDrawablesToCurrentState方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。