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


Java RVRendererAdapter类代码示例

本文整理汇总了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);
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:18,代码来源:ProjectFragment.java

示例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());
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:21,代码来源:NewsFragment.java

示例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());
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:24,代码来源:ICalFragment.java

示例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());
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:19,代码来源:CheckoutFragment.java

示例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();
}
 
开发者ID:voghDev,项目名称:dagger2-clean-mvp-example,代码行数:19,代码来源:UserListActivity.java

示例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);
}
 
开发者ID:pedrovgs,项目名称:Renderers,代码行数:21,代码来源:RecyclerViewActivity.java

示例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();
}
 
开发者ID:FireZenk,项目名称:RecyclerViewSyncedAnimations,代码行数:36,代码来源:MainActivity.java

示例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);
}
 
开发者ID:tonilopezmr,项目名称:Game-of-Thrones,代码行数:10,代码来源:ChatFragment.java

示例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();
}
 
开发者ID:tonilopezmr,项目名称:Game-of-Thrones,代码行数:10,代码来源:ChatFragment.java

示例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;
}
 
开发者ID:tonilopezmr,项目名称:Game-of-Thrones,代码行数:9,代码来源:ChatActivityTest.java

示例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);
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:16,代码来源:CartChooserFragment.java

示例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());
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:29,代码来源:ReservationFragment.java

示例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();
}
 
开发者ID:FAU-Inf2,项目名称:fablab-android,代码行数:35,代码来源:CartSlidingUpPanel.java

示例14: getAdapterMessages

import com.pedrogomez.renderers.RVRendererAdapter; //导入依赖的package包/类
private List<Message> getAdapterMessages(RecyclerView recyclerView) {
  RVRendererAdapter<Message> adapter = (RVRendererAdapter<Message>) recyclerView.getAdapter();
  return getMessages(adapter);
}
 
开发者ID:tonilopezmr,项目名称:Game-of-Thrones,代码行数:5,代码来源:ChatActivityTest.java

示例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);
}
 
开发者ID:pinicius,项目名称:CAS2016,代码行数:6,代码来源:SpeakersFragment.java


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