本文整理匯總了Java中android.support.v7.widget.RecyclerView.getTag方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.getTag方法的具體用法?Java RecyclerView.getTag怎麽用?Java RecyclerView.getTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.getTag方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addTo
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static ItemClickSupport addTo(RecyclerView view) {
ItemClickSupport support = (ItemClickSupport) view.getTag(R.id.item_click_support);
if (support == null) {
support = new ItemClickSupport(view);
}
return support;
}
示例2: removeFrom
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static ItemClickSupport removeFrom(RecyclerView view) {
ItemClickSupport support = (ItemClickSupport) view.getTag(R.id.item_click_support);
if (support != null) {
support.detach(view);
}
return support;
}
示例3: addTo
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static RecyclerItemUtils addTo(RecyclerView view) {
RecyclerItemUtils support = (RecyclerItemUtils) view.getTag(R.id.item_click_support);
if (support == null) {
support = new RecyclerItemUtils(view);
}
return support;
}
示例4: setDataTwoWay
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
* (偽)雙向 databinding: 自動調用 {@link TwoWayListVM#getLoadTask()},
* 並自動觸發 {@link TwoWayListVM#setData(ObservableArrayList)}
* 然後自動更新 RecyclerView
*
* @param container
* @param vm
* @param datas
* @param <T>
*/
@BindingAdapter({"vm", "data"})
public static <T> void setDataTwoWay(final RecyclerView container, final ListVM<T> vm, List<T> datas){
if(vm == null){
return ;
}
setData(container, vm, datas);
if(vm instanceof TwoWayListVM) {
boolean isInited = container.getTag(R.id.db_inited) != null;
if (!isInited) {
container.setTag(R.id.db_inited, true);
final TwoWayListVM<T> _vm = ((TwoWayListVM<T>) vm);
loadData(container, _vm, null, null);
// 若 parent 可下拉刷新,設置回調
ViewParent parent = container.getParent();
if (parent != null && parent instanceof TwoWayListVM.Refreshable) {
final TwoWayListVM.Refreshable refreshable = (TwoWayListVM.Refreshable) parent;
((TwoWayListVM.Refreshable) parent).setOnRefresh(new TwoWayListVM.Refreshable.CallBack() {
@Override
public void onRefresh() {
loadData(container, _vm, null, refreshable);
}
@Override
public void onLoadMore() {
List<T> data = _vm.getData();
if (data.size() - 1 >= 0) {
loadData(container, _vm, data.get(data.size() - 1), refreshable);
}
}
});
}
}
}
}
示例5: addTo
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
static ItemClickSupport addTo(RecyclerView view) {
ItemClickSupport support = (ItemClickSupport) view.getTag(R.id.item_click_support);
if (support == null) {
support = new ItemClickSupport(view);
}
return support;
}
示例6: addTo
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static RecycleClick addTo(RecyclerView view) {
RecycleClick support = (RecycleClick) view.getTag(R.id.item_click_support);
if (support == null) {
support = new RecycleClick(view);
}
return support;
}
示例7: removeFrom
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static RecycleClick removeFrom(RecyclerView view) {
RecycleClick support = (RecycleClick) view.getTag(R.id.item_click_support);
if (support != null) {
support.detach(view);
}
return support;
}
示例8: addTo
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public static RecyclerItemUtils addTo(RecyclerView view) {
RecyclerItemUtils support = (RecyclerItemUtils) view.getTag(R.id.item_click_support);
if (support == null) {
support = new RecyclerItemUtils(view);
}
return support;
}