本文整理匯總了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;
}
示例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;
}
示例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);
}
示例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);
}
示例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)));
}
示例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;
}
示例7: add
import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void add(Renderable item, int position) {
items.add(position, item);
notifyItemInserted(position);
}
示例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));
}
示例9: getItemViewType
import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
@Override public int getItemViewType(int position) {
return ((Renderable) items.get(position)).getRenderableResourceId(position);
}
示例10: add
import com.github.ppamorim.recyclerrenderers.interfaces.Renderable; //導入依賴的package包/類
public void add(Renderable item, int position) {
items.add(position, (T) item);
notifyItemInserted(position);
}