当前位置: 首页>>代码示例>>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;未经允许,请勿转载。