本文整理汇总了Java中it.gmariotti.cardslib.library.internal.CardArrayAdapter类的典型用法代码示例。如果您正苦于以下问题:Java CardArrayAdapter类的具体用法?Java CardArrayAdapter怎么用?Java CardArrayAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CardArrayAdapter类属于it.gmariotti.cardslib.library.internal包,在下文中一共展示了CardArrayAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUi
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
@Override
public void updateUi(Inventory inventory) {
if (inventory == null)
return;
Iterator<Map.Entry<String, SkuDetails>> iter = inventory.getSkuMap().entrySet().iterator();
List<Card> cards = new ArrayList<Card>();
while (iter.hasNext()) {
SkuDetails skuDetails = iter.next().getValue();
cards.add(initCard(skuDetails, false));
}
CardArrayAdapter adapter = new CardArrayAdapter(getActivity(), cards);
cardListView.setAdapter(adapter);
}
示例2: SectionedCardAdapter
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
*
* @param context context
* @param sectionResourceId layout used by sections
* @param cardArrayAdapter cardArrayAdapter
*/
public SectionedCardAdapter(Context context, int sectionResourceId, CardArrayAdapter cardArrayAdapter) {
mLayoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mBaseAdapter = cardArrayAdapter;
mSectionResourceId = sectionResourceId;
mBaseAdapter.registerDataSetObserver(new DataSetObserver() {
@Override
public void onChanged() {
mValid = !mBaseAdapter.isEmpty();
notifyDataSetChanged();
}
@Override
public void onInvalidated() {
mValid = false;
notifyDataSetInvalidated();
}
});
}
示例3: initCards
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {
// Init an array of Cards
ArrayList<Card> cardsChart = new ArrayList<Card>();
Card card = init_chart_card();
cardsChart.add(card);
JsonObjResult tmp;
for (int i = 0; i < Application.listaPostow.size(); i++) {
tmp = Application.listaPostow.get(i);
card = init_info_card(tmp.getBrief(), tmp.getStatus(), i, tmp.getDue_date());
cardsChart.add(card);
}
CardArrayAdapter mCardArrayAdapterGrades = new CardArrayAdapter(getActivity(), cardsChart);
CardListView listView = (CardListView) getActivity().findViewById(R.id.card_list);
if (listView != null) {
listView.setAdapter(mCardArrayAdapterGrades);
}
}
示例4: initCards
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {
// Init an array of Cards
ArrayList<Card> cardsChart = new ArrayList<Card>();
Card card = init_info_card(tmp.getFull(), tmp.getStatus(), tmp.getDue_date());
cardsChart.add(card);
card = init_fulfilled_card();
cardsChart.add(card);
card = init_proof_card();
cardsChart.add(card);
card = init_chart_detail_card();
cardsChart.add(card);
/*for (int i = 0; i < 5; i++) {
card = init_chart_card();
cardsChart.add(card);
}*/
CardArrayAdapter mCardArrayAdapterGrades = new CardArrayAdapter(getActivity(), cardsChart);
CardListView listView = (CardListView) getActivity().findViewById(R.id.card_list);
if (listView != null) {
listView.setAdapter(mCardArrayAdapterGrades);
}
}
示例5: initCards
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<200;i++){
Card card = init_standard_header_with_expandcollapse_button_custom_area("Header "+i,i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_expand);
if (listView!=null){
listView.setAdapter(mCardArrayAdapter);
}
}
示例6: initCard
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* This method builds a simple card
*/
private void initCard() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
PicassoCard card = new PicassoCard(this.getActivity());
card.setTitle("A simple card loaded with Picasso " + i);
card.setSecondaryTitle("Simple text..." + i);
card.setCount(i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}
示例7: initCard
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* This method builds a simple card
*/
private void initCard() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
IonCard card = new IonCard(this.getActivity());
card.setTitle("A simple card loaded with Ion " + i);
card.setSecondaryTitle("Simple text..." + i);
card.setCount(i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}
示例8: initCard
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* This method builds a simple card
*/
private void initCard() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 200; i++) {
UniversalImageLoaderCard card = new UniversalImageLoaderCard(this.getActivity(),options);
card.setTitle("A simple card loaded with Universal-Image-Loader " + i);
card.setSecondaryTitle("Simple text..." + i);
card.setCount(i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_extra_list_picasso);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}
示例9: onCreateView
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.container = container;
View rootView = inflater.inflate(R.layout.fragment_reported_taxis, container, false);
ArrayList<Card> cards = new ArrayList<Card>();
cards.addAll(loadReportedTaxis());
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(rootView.getContext(), cards);
CardListView listView = (CardListView) rootView.findViewById(R.id.reported_list);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
dismissAnimation = (SwipeDismissAnimation) new SwipeDismissAnimation(getActivity()).setup(mCardArrayAdapter);
FloatingActionButton floatingActionButton = (FloatingActionButton) rootView.findViewById(R.id.reportFab);
floatingActionButton.attachToListView(listView);
// floatingActionButton.setOnClickListener();
return rootView;
}
示例10: getMessageUndo
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
@Override
public String getMessageUndo(CardArrayAdapter cardArrayAdapter, String[] itemIds, int[] itemPositions) {
if (cardArrayAdapter!=null && cardArrayAdapter.getContext()!=null) {
Resources res = cardArrayAdapter.getContext().getResources();
if (res!=null)
return res.getQuantityString(R.plurals.list_card_undo_items, itemPositions.length, itemPositions.length);
}
return null;
}
示例11: setAdapter
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* Set the adapter. You can provide a {@link CardArrayAdapter}, or a {@link it.gmariotti.cardslib.library.internal.CardCursorAdapter}
* or a generic adapter.
* Pay attention: your generic adapter has to call {@link CardArrayAdapter#getView} method
*
* @param adapter
*/
@Override
public void setAdapter(ListAdapter adapter) {
if (adapter instanceof CardArrayAdapter){
setAdapter((CardArrayAdapter)adapter);
}else if (adapter instanceof CardCursorAdapter){
setAdapter((CardCursorAdapter)adapter);
}else {
Log.w(TAG,"You are using a generic adapter. Pay attention: your adapter has to call cardArrayAdapter#getView method" );
super.setAdapter(adapter);
}
}
示例12: setExternalAdapter
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* You can use this method, if you are using external adapters.
* Pay attention. The generic adapter#getView() method has to call the cardArrayAdapter#getView() method to work.
*
* @param adapter {@link ListAdapter} generic adapter
* @param cardArrayAdapter {@link CardArrayAdapter} cardArrayAdapter
*/
public void setExternalAdapter(ListAdapter adapter, CardArrayAdapter cardArrayAdapter) {
setAdapter(adapter);
mAdapter=cardArrayAdapter;
mAdapter.setCardListView(this);
mAdapter.setRowLayoutId(list_card_layout_resourceID);
}
示例13: setupCardListView
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
/**
* Retrieves the cardListView
*/
private void setupCardListView() {
if (mBaseAdapter != null) {
if (mBaseAdapter instanceof CardArrayAdapter) {
mCardListView = ((CardArrayAdapter) mBaseAdapter).getCardListView();
}
}
if (mCardListView == null) {
throw new IllegalStateException("BaseDismissAnimation works with a CardListView");
}
}
示例14: initCards
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<100;i++){
GooglePlaySmallCard card = new GooglePlaySmallCard(this.getActivity());
card.setTitle("Application example " + i);
card.setSecondaryTitle("A company inc..." + i);
card.setRating((float) (Math.random() * (5.0)));
card.setId("" + i);
//Only for test, change some icons
if ((i > 10 && i < 15) || (i > 35 && i < 45)) {
card.setResourceIdThumbnail(R.drawable.ic_launcher);
}
card.init();
cards.add(card);
}
mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
//Enable undo controller!
mCardArrayAdapter.setEnableUndo(true);
//CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_gplaycard);
if (mListView!=null){
mListView.setAdapter(mCardArrayAdapter);
}
}
示例15: initCards
import it.gmariotti.cardslib.library.internal.CardArrayAdapter; //导入依赖的package包/类
private void initCards() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i = 0; i < 5; i++) {
ColorCard card = new ColorCard(this.getActivity());
card.setTitle("A simple colored card " + i);
card.setCount(i);
switch (i) {
case 0:
card.setBackgroundResourceId(R.drawable.demo_card_selector_color5);
break;
case 1:
card.setBackgroundResourceId(R.drawable.demo_card_selector_color4);
break;
case 2:
card.setBackgroundResourceId(R.drawable.demo_card_selector_color3);
break;
case 3:
card.setBackgroundResourceId(R.drawable.demo_card_selector_color2);
break;
case 4:
card.setBackgroundResourceId(R.drawable.demo_card_selector_color1);
break;
}
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_colors);
if (listView != null) {
listView.setAdapter(mCardArrayAdapter);
}
}