當前位置: 首頁>>代碼示例>>Java>>正文


Java Renderable類代碼示例

本文整理匯總了Java中com.github.ppamorim.recyclerrenderers.interfaces.Renderable的典型用法代碼示例。如果您正苦於以下問題:Java Renderable類的具體用法?Java Renderable怎麽用?Java Renderable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Renderable類屬於com.github.ppamorim.recyclerrenderers.interfaces包,在下文中一共展示了Renderable類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: MultiRendererAdapter

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public MultiRendererAdapter(ArrayList<Renderable> items, RendererBuilder builder,
    LayoutInflater layoutInflater) {

  if (items == null) {
    throw new IllegalArgumentException("Data must not be null");
  }
  if (items instanceof Renderable) {
    throw new IllegalArgumentException("Items need to be a extends of Renderable");
  }
  this.items = items;

  if (builder == null) {
    throw new IllegalArgumentException("Builder must not be null");
  }
  this.builder = builder;

  if (layoutInflater == null) {
    throw new IllegalArgumentException("LayoutInflater must not be null");
  }
  this.layoutInflater = layoutInflater;

}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:23,代碼來源:MultiRendererAdapter.java

示例2: RendererAdapter

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public RendererAdapter(ArrayList<T> items, RendererBuilder builder,
    LayoutInflater layoutInflater) {

  if (items == null) {
    throw new IllegalArgumentException("Data must not be null");
  }
  if (items instanceof Renderable) {
    throw new IllegalArgumentException("Items need to be a extends of Renderable");
  }
  this.items = items;

  if (builder == null) {
    throw new IllegalArgumentException("Builder must not be null");
  }
  this.builder = builder;

  if (layoutInflater == null) {
    throw new IllegalArgumentException("LayoutInflater must not be null");
  }
  this.layoutInflater = layoutInflater;

}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:23,代碼來源:RendererAdapter.java

示例3: configRecyclerView

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void configRecyclerView() {

    ArrayList<Renderable> texts = new ArrayList<>();
    for (int i = 0; i < 100; i++) {
      texts.add(new Item(new StringBuilder("test ").append(i).toString()));
    }

    recyclerView.setHasFixedSize(true);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(new RendererAdapter(
        texts,
        new RendererBuilder(new Factory()),
        LayoutInflater.from(this)));
    recyclerView.setScrollViewCallbacks(onObservableScrollViewCallbacks);
  }
 
開發者ID:ppamorim,項目名稱:Dragger,代碼行數:19,代碼來源:ListActivity.java

示例4: configRecyclerView

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void configRecyclerView() {

    ArrayList<Renderable> texts = new ArrayList<>();
    for (int i = 0; i < 100; i++) {
      texts.add(new Item(new StringBuilder("test ").append(i).toString()));
    }

    recyclerView.setHasFixedSize(true);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(layoutManager);
    recyclerView.setAdapter(
        new RendererAdapter(
            texts,
            new RendererBuilder(new Factory()),
            LayoutInflater.from(this)));
    recyclerView.setScrollViewCallbacks(observableScrollViewCallbacks);
  }
 
開發者ID:ppamorim,項目名稱:Dragger,代碼行數:20,代碼來源:ActivityListActivity.java

示例5: onPostCreate

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
@Override protected void onPostCreate(Bundle savedInstanceState) {
  super.onPostCreate(savedInstanceState);
  String[] items = getResources().getStringArray(R.array.home);
  ArrayList<Renderable> renderables = new ArrayList<>(items.length);
  for (String text : items) {
    renderables.add(new Home(text));
  }
  observableRecyclerView.setHasFixedSize(true);
  observableRecyclerView.setItemAnimator(new DefaultItemAnimator());
  GridLayoutManager layoutManager = new GridLayoutManager(this, 2);
  layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
  observableRecyclerView.setLayoutManager(layoutManager);
  observableRecyclerView.setAdapter(
      new RendererAdapter(renderables,
          new RendererBuilder(new Factory()),
          LayoutInflater.from(this)));
}
 
開發者ID:ppamorim,項目名稱:Dragger,代碼行數:18,代碼來源:BaseActivity.java

示例6: generateObjects

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public static ArrayList<Renderable> generateObjects() {
  ArrayList<Renderable> renderables = new ArrayList<>();
  renderables.add(new Hardware(
      "http://www.legitreviews.com/wp-content/uploads/2014/03/intel-devils-canyon-cpu.jpg",
      "Intel", "4790K"));
  renderables.add(new Hardware(
      "http://static8.kabum.com.br/produtos/fotos/50118/50118_index_g.jpg", "AMD", "FX5950"));
  renderables.addAll(generateConsoles());
  return renderables;
}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:11,代碼來源:ViewUtil.java

示例7: add

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void add(Renderable item, int position) {
  items.add(position, item);
  notifyItemInserted(position);
}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:5,代碼來源:MultiRendererAdapter.java

示例8: onBindViewHolder

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
@Override public void onBindViewHolder(RenderViewHolder holder, int position) {
  holder.onBindView((Renderable) items.get(position));
  holder.setItem((Renderable) items.get(position));
}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:5,代碼來源:RendererAdapter.java

示例9: getItemViewType

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
@Override public int getItemViewType(int position) {
  return ((Renderable) items.get(position)).getRenderableResourceId(position);
}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:4,代碼來源:RendererAdapter.java

示例10: add

import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void add(Renderable item, int position) {
  items.add(position, (T) item);
  notifyItemInserted(position);
}
 
開發者ID:ppamorim,項目名稱:RecyclerRenderers,代碼行數:5,代碼來源:RendererAdapter.java


注:本文中的com.github.ppamorim.recyclerrenderers.interfaces.Renderable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。