当前位置: 首页>>代码示例>>Java>>正文


Java BR类代码示例

本文整理汇总了Java中com.android.databinding.library.baseAdapters.BR的典型用法代码示例。如果您正苦于以下问题:Java BR类的具体用法?Java BR怎么用?Java BR使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BR类属于com.android.databinding.library.baseAdapters包,在下文中一共展示了BR类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setSelected

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void setSelected(int index) {
    final RadioElementModel checkedModel = checked.get();
    final int oldCheckedIndex = data.indexOf(checkedModel);

    if (oldCheckedIndex == index) {
        checked.notifyPropertyChanged(BR.checked);
    } else {
        if (oldCheckedIndex >= 0) {
            checkedModel.getChecked().set(false);
            notifyItemChanged(oldCheckedIndex);
        }

        checked.set(data.get(index));
        notifyItemChanged(index);
    }
}
 
开发者ID:Appolica,项目名称:Flubber,代码行数:17,代码来源:RadioRVAdapter.java

示例2: setRule

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void setRule(List<AutoPlaylistRule> rules, int index) {
    if (rules.equals(mRules) && index == mIndex) {
        return;
    }

    mRules = rules;
    mIndex = index;
    mFactory = new AutoPlaylistRule.Factory(rules.get(index));
    mEnumeratedRule = RuleEnumeration.from(mFactory.getField(), mFactory.getMatch());

    if (mFilterAdapter != null) {
        mFilterAdapter.onTypeChanged();
    }

    setupValueAdapter();

    // Setup everything but the value spinner (since the adapter has to be made asynchronously)
    notifyPropertyChanged(BR.selectedType);
    notifyPropertyChanged(BR.selectedFilter);
    notifyPropertyChanged(BR.valueSpinnerVisibility);
    notifyPropertyChanged(BR.valueTextVisibility);
    notifyPropertyChanged(BR.valueText);
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:24,代码来源:RuleViewModel.java

示例3: setupSongAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupSongAdapter() {
    mValueSubscription = mMusicStore.getSongs()
            .take(1)
            .subscribe(songs -> {
                mValueAdapter = new ValueAdapter<Song>(songs) {
                    @Override
                    public long getItemId(Song item) {
                        return item.getSongId();
                    }

                    @Override
                    public String getItemName(Song item) {
                        return item.getSongName();
                    }
                };
                notifyPropertyChanged(BR.valueAdapter);
                notifyPropertyChanged(BR.selectedValue);
            }, throwable -> {
                Timber.e(throwable, "setupSongAdapter: Failed to setup song adapter");
            });
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:22,代码来源:RuleViewModel.java

示例4: setupArtistAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupArtistAdapter() {
    mValueSubscription = mMusicStore.getArtists()
            .take(1)
            .subscribe(artists -> {
                mValueAdapter = new ValueAdapter<Artist>(artists) {
                    @Override
                    public long getItemId(Artist item) {
                        return item.getArtistId();
                    }

                    @Override
                    public String getItemName(Artist item) {
                        return item.getArtistName();
                    }
                };
                notifyPropertyChanged(BR.valueAdapter);
                notifyPropertyChanged(BR.selectedValue);
            }, throwable -> {
                Timber.e(throwable, "setupArtistAdapter: Failed to setup artist adapter");
            });
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:22,代码来源:RuleViewModel.java

示例5: setupAlbumAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupAlbumAdapter() {
    mValueSubscription = mMusicStore.getAlbums()
            .take(1)
            .subscribe(albums -> {
                mValueAdapter = new ValueAdapter<Album>(albums) {
                    @Override
                    public long getItemId(Album item) {
                        return item.getAlbumId();
                    }

                    @Override
                    public String getItemName(Album item) {
                        return item.getAlbumName();
                    }
                };
                notifyPropertyChanged(BR.valueAdapter);
                notifyPropertyChanged(BR.selectedValue);
            }, throwable -> {
                Timber.e(throwable, "setupAlbumAdapter: Failed to setup album adapter");
            });
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:22,代码来源:RuleViewModel.java

示例6: setupGenreAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupGenreAdapter() {
    mValueSubscription = mMusicStore.getGenres()
            .take(1)
            .subscribe(genres -> {
                mValueAdapter = new ValueAdapter<Genre>(genres) {
                    @Override
                    public long getItemId(Genre item) {
                        return item.getGenreId();
                    }

                    @Override
                    public String getItemName(Genre item) {
                        return item.getGenreName();
                    }
                };
                notifyPropertyChanged(BR.valueAdapter);
                notifyPropertyChanged(BR.selectedValue);
            }, throwable -> {
                Timber.e(throwable, "setupGenreAdapter: Failed to setup genre adapter");
            });
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:22,代码来源:RuleViewModel.java

示例7: setupPlaylistAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupPlaylistAdapter() {
    mValueSubscription = mPlaylistStore.getPlaylists()
            .take(1)
            .subscribe(playlists -> {
                mValueAdapter = new ValueAdapter<Playlist>(playlists) {
                    @Override
                    public long getItemId(Playlist item) {
                        return item.getPlaylistId();
                    }

                    @Override
                    public String getItemName(Playlist item) {
                        return item.getPlaylistName();
                    }
                };
                notifyPropertyChanged(BR.valueAdapter);
                notifyPropertyChanged(BR.selectedValue);
            }, throwable -> {
                Timber.e(throwable, "setupPlaylistAdapter: Failed to setup playlist adapter");
            });
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:22,代码来源:RuleViewModel.java

示例8: setHue

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void setHue(float hue) {
    float[] hsv = {hue, this.saturation, this.value};
    this.color = android.graphics.Color.HSVToColor(this.alpha, hsv);
    updateValues(false);
    this.hue = Math.min(Math.max(0f, hue), 359.9f);

    // For each HSV and RGB property, a change in the property changes both the property itself
    // and the resultant color
    notifyPropertyChanged(BR.hue);
    notifyPropertyChanged(BR.color);
}
 
开发者ID:google,项目名称:spline,代码行数:12,代码来源:Color.java

示例9: setSaturation

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void setSaturation(float saturation) {
    float[] hsv = {this.hue, saturation, this.value};
    this.color = android.graphics.Color.HSVToColor(this.alpha, hsv);
    updateValues(false);
    // Clamp the saturation value
    this.saturation = Math.min(Math.max(0f, saturation), 1.0f);

    notifyPropertyChanged(BR.saturation);
    notifyPropertyChanged(BR.color);
}
 
开发者ID:google,项目名称:spline,代码行数:11,代码来源:Color.java

示例10: setValue

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void setValue(float value) {
    float[] hsv = {this.hue, this.saturation, value};
    this.color = android.graphics.Color.HSVToColor(this.alpha, hsv);
    updateValues(false);
    // Clamp the value
    this.value = Math.min(Math.max(0f, value), 1.0f);

    notifyPropertyChanged(BR.value);
    notifyPropertyChanged(BR.color);
}
 
开发者ID:google,项目名称:spline,代码行数:11,代码来源:Color.java

示例11: initView

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
@Override
public void initView(Bundle savedInstanceState) {
    getBinding().setAct(this);
    getBinding().setVm(new InfoViewModel());
    getBinding().getVm().mImageCacheSize = GlideCacheUtil.getInstance().getCacheSize(this);
    getBinding().getVm().notifyPropertyChanged(BR.imageCacheSize);
}
 
开发者ID:wheat7,项目名称:Cashew,代码行数:8,代码来源:InfoActivity.java

示例12: onClearCacheClick

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
/**
 * Clear cache click
 */
public void onClearCacheClick() {
    GlideCacheUtil.getInstance().clearImageAllCache(this);
    Toast.makeText(this, "清除了" + getBinding().getVm().mImageCacheSize + "的缓存", Toast.LENGTH_LONG).show();
    getBinding().getVm().mImageCacheSize = GlideCacheUtil.getInstance().getCacheSize(this);
    getBinding().getVm().notifyPropertyChanged(BR.imageCacheSize);
}
 
开发者ID:wheat7,项目名称:Cashew,代码行数:10,代码来源:InfoActivity.java

示例13: initViews

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
@Override
protected void initViews() {
    mActDbBannerBinding = DataBindingUtil.setContentView(this, R.layout.act_db_banner);
    mOptimumRecyclerView = mActDbBannerBinding.optimumRv;

    mOptimumRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mOptimumRecyclerView.addItemDecoration(DividerUtil.getDefalutDivider(AppContext.getInstance()));

    SparseIntArray sparseIntArray = new SparseIntArray();
    sparseIntArray.put(1, R.layout.item_db_banner);
    sparseIntArray.put(2, R.layout.item_databind_text);
    mAdapter = new BaseMixtureDBAdapter<String>(this, sparseIntArray) {
        @Override
        public int getItemViewType(int position) {
            if (position == 0) {
                return 1;
            }
            return 2;
        }
    };
    mAdapter.setDecorator(new BaseDataDBAdapter.Decorator() {
        @Override
        public void decorator(BaseBindViewHolder holder, int position, int viewType) {
            holder.getBinding().setVariable(BR.onSliderClick, BannerActivity.this);
        }
    });
    mOptimumRecyclerView.setAdapter(mAdapter);

    mOptimumRecyclerView.getRecyclerView().setOverScrollMode(OVER_SCROLL_NEVER);
    mOptimumRecyclerView.setRefreshListener(this);
    mOptimumRecyclerView.getPtrLayout().disableWhenHorizontalMove(true);
    getData();
}
 
开发者ID:chenzj-king,项目名称:RvHelper,代码行数:34,代码来源:BannerActivity.java

示例14: onClickStatusChange

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
public void onClickStatusChange(@SuppressWarnings("unused") View view) {
    pageNavigator.showStatusSelectDialog(status, selectedStatus -> {
        this.status = selectedStatus;
        notifyPropertyChanged(BR.status);
        updateStatus();
    });
}
 
开发者ID:konifar,项目名称:annict-android,代码行数:8,代码来源:WorkItemViewModel.java

示例15: setupValueAdapter

import com.android.databinding.library.baseAdapters.BR; //导入依赖的package包/类
private void setupValueAdapter() {
    if (mValueSubscription != null) {
        mValueSubscription.unsubscribe();
    }

    if (getValueSpinnerVisibility() != View.VISIBLE) {
        return;
    }

    mValueAdapter = null;
    switch (mFactory.getType()) {
        case AutoPlaylistRule.SONG:
            setupSongAdapter();
            break;
        case AutoPlaylistRule.ARTIST:
            setupArtistAdapter();
            break;
        case AutoPlaylistRule.ALBUM:
            setupAlbumAdapter();
            break;
        case AutoPlaylistRule.GENRE:
            setupGenreAdapter();
            break;
        case AutoPlaylistRule.PLAYLIST:
            setupPlaylistAdapter();
            break;
    }

    notifyPropertyChanged(BR.valueAdapter);
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:31,代码来源:RuleViewModel.java


注:本文中的com.android.databinding.library.baseAdapters.BR类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。