本文整理汇总了Java中com.pedrogomez.renderers.RVRendererAdapter类的典型用法代码示例。如果您正苦于以下问题:Java RVRendererAdapter类的具体用法?Java RVRendererAdapter怎么用?Java RVRendererAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RVRendererAdapter类属于com.pedrogomez.renderers包,在下文中一共展示了RVRendererAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mProjectsRV.setLayoutManager(layoutManager);
mAdapter = new RVRendererAdapter<>(getLayoutInflater(savedInstanceState),
new ProjectViewModelRendererBuilder(),
mViewModel.getProjectViewModelCollection());
mProjectsRV.setAdapter(mAdapter);
new RecyclerViewSwipeCommandBinding().bind(mProjectsRV, mViewModel.getConfirmDeletionCommand());
mViewModel.setListener(this);
}
示例2: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
//create and set the layoutmanager needed by recyclerview
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
news_rv.setLayoutManager(layoutManager);
mAdapter = new RVRendererAdapter<>(getLayoutInflater(savedInstanceState),
new NewsViewModelRendererBuilder(), mViewModel.getNewsViewModelCollection());
news_rv.setAdapter(mAdapter);
mViewModel.setListener(this);
mViewModel.initialize();
//bind the getGetNewsCommand to the recyclerView
new RecyclerViewCommandBinding().bind(news_rv, mViewModel.getGetNewsCommand());
new RecyclerViewDeltaCommandBinding().bind(news_rv, mViewModel.getNewsScrollingCommand());
}
示例3: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
if(getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
} else {
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
}
ical_rv.setLayoutManager(layoutManager);
mAdapter = new RVRendererAdapter<>(getLayoutInflater(savedInstanceState),
new ICalViewModelRendererBuilder(), mViewModel.getICalViewModelCollection());
ical_rv.setAdapter(mAdapter);
mViewModel.setListener(this);
mViewModel.initialize();
//bind the getGetICalCommand to the recyclerView
new RecyclerViewCommandBinding().bind(ical_rv, mViewModel.getGetICalCommand());
}
示例4: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mViewModel.setListener(this);
cart_rv.setLayoutManager(new LinearLayoutManager(getActivity()));
RVRendererAdapter<CartEntryViewModel> adapter = new RVRendererAdapter<>(
getLayoutInflater(savedInstanceState), new CartEntryViewModelRendererBuilder(),
mViewModel.getCartEntryViewModelCollection());
cart_rv.setAdapter(adapter);
total_price_tv.setText(Formatter.formatPrice(mViewModel.getTotalPrice()));
new ViewCommandBinding().bind(retry_button, mViewModel.getRetryCommand());
new ViewCommandBinding().bind(ok_button, mViewModel.getOkCommand());
mViewModel.initialize(getArguments());
}
示例5: onCreate
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
component().inject(this);
adapter = new RVRendererAdapter<User>(
LayoutInflater.from(this),
new UserRendererBuilder(this, mUserClickListener),
new ListAdapteeCollection<User>(new ArrayList<User>())
);
presenter = new UserListPresenter(this, getUsersInteractor);
presenter.setView(this);
presenter.initialize();
initializeRecyclerView();
}
示例6: initAdapter
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
/**
* Initialize RVRendererAdapter
*/
private void initAdapter() {
RandomVideoCollectionGenerator randomVideoCollectionGenerator =
new RandomVideoCollectionGenerator();
final AdapteeCollection<Video> videoCollection =
randomVideoCollectionGenerator.generateListAdapteeVideoCollection(VIDEO_COUNT);
RendererBuilder<Video> rendererBuilder = new RendererBuilder<Video>().withPrototype(
new RemovableVideoRenderer(new RemovableVideoRenderer.Listener() {
@Override public void onRemoveButtonTapped(Video video) {
ArrayList<Video> clonedList =
new ArrayList<>((Collection<? extends Video>) videoCollection);
clonedList.remove(video);
adapter.diffUpdate(clonedList);
}
})).bind(Video.class, RemovableVideoRenderer.class);
adapter = new RVRendererAdapter<>(rendererBuilder, videoCollection);
}
示例7: onCreate
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
animationSubscription = Observable.interval(1, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(Schedulers.newThread())
.subscribe(animationTimer = PublishSubject.create());
RendererBuilder<Item> rendererBuilder = new RendererBuilder<>(new CustomRenderer(animationTimer));
RVRendererAdapter adapter = new RVRendererAdapter<>(rendererBuilder);
myList.setAdapter(adapter);
List<Item> items = new ArrayList<>();
items.add(new Item("Madrid", 18, 10));
items.add(new Item("California", 10, 10));
items.add(new Item("Moscú", 20, 10));
items.add(new Item("Taiwan", 23, 10));
items.add(new Item("Tenerife", 17, 10));
items.add(new Item("Madrid", 18, 10));
items.add(new Item("California", 10, 10));
items.add(new Item("Moscú", 20, 10));
items.add(new Item("Taiwan", 23, 10));
items.add(new Item("Tenerife", 17, 10));
items.add(new Item("Madrid", 18, 10));
items.add(new Item("California", 10, 10));
items.add(new Item("Moscú", 20, 10));
items.add(new Item("Taiwan", 23, 10));
items.add(new Item("Tenerife", 17, 10));
adapter.addAll(items);
adapter.notifyDataSetChanged();
}
示例8: initRecyclerView
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
private void initRecyclerView(RVRendererAdapter chatAdapter) {
messageRecyclerView.setAdapter(chatAdapter);
LinearLayoutManager recyclerViewManager = new LinearLayoutManager(getActivity());
recyclerViewManager.setStackFromEnd(true);
messageRecyclerView.setLayoutManager(recyclerViewManager);
messageRecyclerView.setHasFixedSize(true);
}
示例9: initUi
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void initUi() {
adapter = new RVRendererAdapter<Message>(new MessageRenderBuilder(imageLoader));
SortedMessageCollection sortedMessageCollection = new SortedMessageCollection(adapter);
adapter.setCollection(sortedMessageCollection);
initRecyclerView(adapter);
hideKeyboard();
}
示例10: getMessages
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@NonNull
private LinkedList<Message> getMessages(RVRendererAdapter<Message> adapter) {
LinkedList<Message> messages = new LinkedList<Message>();
for (int i = 0, size = adapter.getItemCount(); i < size; i++) {
messages.add(adapter.getItem(i));
}
return messages;
}
示例11: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
mCartRecyclerView.setLayoutManager(layoutManager);
mAdapter = new RVRendererAdapter<>(getLayoutInflater(savedInstanceState),
new CartViewModelRendererBuilder(),
mViewModel.getCartViewModelCollection());
mCartRecyclerView.setAdapter(mAdapter);
mViewModel.setListener(this);
}
示例12: onActivityCreated
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mViewModel.setListener(this);
if(getArguments() != null) {
User user = (User) getArguments().getSerializable(getResources().getString(R.string.key_user));
mViewModel.setUser(user);
}
final LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
toolUsage_rv.setLayoutManager(layoutManager);
onLoadTools();
mAdapter = new RVRendererAdapter<>(getLayoutInflater(savedInstanceState),
new ToolUsageViewModelRendererBuilder(), mViewModel.getToolUsageViewModelCollection());
toolUsage_rv.setAdapter(mAdapter);
new SwipeableRecyclerViewCommandBinding().bind(toolUsage_rv,
mViewModel.getRemoveReservationCommand());
mSwipeRefreshLayout.setOnRefreshListener(mViewModel);
new ViewCommandBinding().bind(mAddButton, mViewModel.getAddCommand());
new SpinnerCommandBinding().bind(mToolSpinner, mViewModel.getToolChangedCommand());
}
示例13: CartSlidingUpPanel
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
public CartSlidingUpPanel(MainActivity activity, View view) {
mActivity = activity;
activity.inject(this);
ButterKnife.bind(this, view);
final Resources res = sliding_up_pl.getResources();
mPanelHeight = (int) res.getDimension(R.dimen.slidinguppanel_panel_height);
mPanelHeightDiff = mPanelHeight - (int) res.getDimension(
R.dimen.slidinguppanel_panel_height_opened);
mDragBgStrokeMargin = (int) res.getDimension(R.dimen.slidinguppanel_drag_bg_stroke_margin);
sliding_up_pl.setPanelSlideListener(new SlidingUpPanelLayout.SimplePanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
updatePanelHeaderSize(slideOffset);
}
});
final LinearLayoutManager layoutManager = new LinearLayoutManager(activity);
cart_rv.setLayoutManager(layoutManager);
mAdapter = new RVRendererAdapter<>(activity.getLayoutInflater(),
new CartEntryViewModelRendererBuilder(),
mViewModel.getCartEntryViewModelCollection());
cart_rv.setAdapter(mAdapter);
new SwipeableRecyclerViewCommandBinding().bind(cart_rv,
mViewModel.getRemoveCartEntryCommand());
new ViewCommandBinding().bind(checkout_button, mViewModel.getStartCheckoutCommand());
mViewModel.setListener(this);
mViewModel.initialize();
}
示例14: getAdapterMessages
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
private List<Message> getAdapterMessages(RecyclerView recyclerView) {
RVRendererAdapter<Message> adapter = (RVRendererAdapter<Message>) recyclerView.getAdapter();
return getMessages(adapter);
}
示例15: initializeAdapter
import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
private void initializeAdapter() {
RendererBuilder<SpeakerViewModel> rendererBuilder = new SpeakerRendererBuilder(presenter);
speakersCollection = new SpeakersAdapteeCollection();
speakersAdapter = new RVRendererAdapter<>(rendererBuilder, speakersCollection);
}