本文整理汇总了Java中it.gmariotti.cardslib.library.view.CardListView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java CardListView.setAdapter方法的具体用法?Java CardListView.setAdapter怎么用?Java CardListView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.gmariotti.cardslib.library.view.CardListView
的用法示例。
在下文中一共展示了CardListView.setAdapter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例2: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例3: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例4: initCard
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例5: initCard
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例6: initCard
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例7: onCreateView
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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;
}
示例8: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的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);
}
}
示例9: init
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
private void init() {
mAdapter = new MyCursorCardAdapter(getActivity());
mListView = (CardListView) getActivity().findViewById(R.id.carddemo_list_cursor);
if (mListView != null) {
mListView.setAdapter(mAdapter);
}
// Force start background query to load sessions
getLoaderManager().restartLoader(0, null, this);
}
示例10: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<50;i++){
CardExample card = new CardExample(getActivity(),"My title "+i,"Inner text "+i);
cards.add(card);
CardExample2 cardx = new CardExample2(this.getActivity());
cardx.title="Application example "+i;
cardx.secondaryTitle="A company inc..."+i;
cardx.rating=(float)(Math.random()*(5.0));
cardx.count=i;
cards.add(cardx);
MayKnowCard card2= new MayKnowCard(getActivity());
card2.setType(2); //Very important with different inner layout
card2.setSwipeable(true);
cards.add(card2);
}
// Provide a custom adapter.
// It is important to set the viewTypeCount
// You have to provide in your card the type value with {@link Card#setType(int)} method.
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
mCardArrayAdapter.setInnerViewTypeCount(3);
// An alternative is to write a own CardArrayAdapter
// MyCardArrayAdapter mCardArrayAdapter = new MyCardArrayAdapter(getActivity(),cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_base1);
if (listView!=null){
listView.setAdapter(mCardArrayAdapter);
}
}
示例11: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
private void initCards() {
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<200;i++){
CardExample card = new CardExample(getActivity(),"My title "+i,"Inner text "+i);
cards.add(card);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_base1);
if (listView!=null){
listView.setAdapter(mCardArrayAdapter);
}
}
示例12: initCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
private void initCards() {
//Init an array of Cards
ArrayList<Card> cards = new ArrayList<Card>();
for (int i=0;i<200;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.count=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);
}
CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(),cards);
CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_gplaycard);
if (listView!=null){
listView.setAdapter(mCardArrayAdapter);
}
}
示例13: onCreate
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_macros);
initToolbar();
initDrawer();
mListView = (CardListView) findViewById(R.id.listview);
mListEmptyTextView = (TextView) findViewById(R.id.listEmptyText);
mMacroList = MacroUtils.loadMacroList(mPrefs);
// if (mMacroList.size() >= MACRO_SIZE_WARN) {
// macroListLengthWarningDialog(mMacroList.size());
// }
mCards = new ArrayList<Card>();
for (MacroEntry macroEntry : mMacroList) {
mCards.add(macroEntryToCard(macroEntry));
}
mCardArrayAdapter = new CardArrayAdapter(this, mCards);
if (mListView != null) {
mListView.setAdapter(mCardArrayAdapter);
}
Drawable plus = new IconicsDrawable(this, FontAwesome.Icon.faw_plus).color(Color.DKGRAY).sizeDp(20);
FloatingActionButton addButton = (FloatingActionButton) findViewById(R.id.add);
addButton.setImageDrawable(plus);
addButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
addMacro();
}
});
}
示例14: setupCards
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
private void setupCards() {
for (GameDescription curGame : mTraining) {
mCards.add(new GameCard(this, curGame));
}
mCardArrayAdapter = new CardArrayAdapter(this, mCards);
mCardListView = (CardListView) findViewById(R.id.game_list);
mCardListView.setAdapter(mCardArrayAdapter);
View footerItem = getLayoutInflater()
.inflate(R.layout.list_item_training_footer, mCardListView, false);
mCardListView.addFooterView(footerItem);
mCardArrayAdapter.notifyDataSetChanged();
}
示例15: onCreateView
import it.gmariotti.cardslib.library.view.CardListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.todo, container, false);
Computer c0 = new Computer();
Computer c1 = new Computer("MacBook Pro", "Marcus Gabilheri", false, "Out of disk space");
Computer c2 = new Computer("Dell Dimension", "Old Person", true, "Too old");
Computer c3 = new Computer("MacBook", "Hali Deubler", false, "Windows installed");
Computer c4 = new Computer("MacBook Pro", "Ryan Dawkins", false, "Arch exploded");
Computer c5 = new Computer("Lenovo Y500", "Aaron Weaver", false, "No retinas");
ArrayList<Computer> computers = new ArrayList<Computer>(10);
computers.add(c0);
computers.add(c1);
computers.add(c2);
computers.add(c3);
computers.add(c4);
computers.add(c5);
mCcomputerList = (CardListView) view.findViewById(R.id.computers_list);
mCardsList = new ArrayList<Card>();
for(int i = 0; i < computers.size(); i++) {
// get current computer in list
Computer temp = computers.get(i);
//create card to display the computer
Card card = new Card(getActivity());
//create and add the header for the card from the owner name
CardHeader header = new CardHeader(getActivity());
card.addCardHeader(header);
header.setTitle(temp.getOwnerName());
//set the content of the card to the model name and problem with the computer
card.setTitle("Model:" + "\n " + temp.getModelName() + "\n\nProblem:" + "\n " + temp.getProblem());
card.setShadow(true);
// select drawable based on whether or not the computer is a desktop
CardThumbnail thumb = new CardThumbnail(getActivity());
if (temp.isDesktop()) {
thumb.setDrawableResource(R.drawable.ic_desktop);
} else {
thumb.setDrawableResource(R.drawable.ic_laptop);
}
card.addCardThumbnail(thumb);
mCardsList.add(card);
}
mCardAdapter = new CardArrayAdapter(getActivity(), mCardsList);
mCardAdapter.setEnableUndo(true);
mCcomputerList.setAdapter(mCardAdapter);
return view;
}