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


Java CardGridArrayAdapter类代码示例

本文整理汇总了Java中it.gmariotti.cardslib.library.internal.CardGridArrayAdapter的典型用法代码示例。如果您正苦于以下问题:Java CardGridArrayAdapter类的具体用法?Java CardGridArrayAdapter怎么用?Java CardGridArrayAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CardGridArrayAdapter类属于it.gmariotti.cardslib.library.internal包,在下文中一共展示了CardGridArrayAdapter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initCards

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
private void initCards() {

        ArrayList<Card> cards = new ArrayList<Card>();
        for (int i=0;i<200;i++){
            GdriveGridCard card = new GdriveGridCard(getActivity());

            card.headerTitle="Folder "+i;
            card.init();
            cards.add(card);
        }

        CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(),cards);

        CardGridView gridView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base);
        if (gridView!=null){
            gridView.setAdapter(mCardArrayAdapter);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:19,代码来源:GridBaseFragment.java

示例2: onCreate

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //Set the layout
    setContentView(R.layout.activity_main);

    //Define the toolbar
    toolbar = (Toolbar) findViewById(R.id.toolbar);

    //Set supportActionBar and title
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle("Local Vicinity");

    //If network connection exists then download new files
    if (isNetworkAvailable() == true) {
        startDownloads();
    } else//If no connection display error message to the user
    {
        Toast.makeText(getApplicationContext(), "No network connection available, results may be incorrect",
                Toast.LENGTH_LONG).show();
    }

    //Create the 8 different category cards
    createMainCards();

    //Create the card for adding a location
    createAddCard();
    createViewCard();

    //Set the card grid array adapter
    CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(this, cards);

    //Bind the gridview to the adapter
    CardGridView gridView = (CardGridView) this.findViewById(R.id.myGrid);
    if (gridView != null) {
        gridView.setAdapter(mCardArrayAdapter);
    }
}
 
开发者ID:tflynn93,项目名称:LocalVicinity,代码行数:40,代码来源:MainActivity.java

示例3: setAdapter

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
/**
 * Forces to use a {@link CardGridArrayAdapter}
 *
 * @param adapter
 */
@Override
public void setAdapter(ListAdapter adapter) {
    if (adapter instanceof CardGridArrayAdapter){
        setAdapter((CardGridArrayAdapter)adapter);
    }else if (adapter instanceof CardGridCursorAdapter){
        setAdapter((CardGridCursorAdapter)adapter);
    }else{
        Log.w(TAG,"You are using a generic adapter. Pay attention: your adapter has to call cardGridArrayAdapter#getView method." );
        super.setAdapter(adapter);
    }
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:17,代码来源:CardGridView.java

示例4: setExternalAdapter

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的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 cardGridArrayAdapter    {@link it.gmariotti.cardslib.library.internal.CardGridArrayAdapter} cardGridArrayAdapter
 */
public void setExternalAdapter(ListAdapter adapter, CardGridArrayAdapter cardGridArrayAdapter) {

    setAdapter(adapter);

    mAdapter=cardGridArrayAdapter;
    mAdapter.setCardGridView(this);
    mAdapter.setRowLayoutId(list_card_layout_resourceID);
}
 
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:16,代码来源:CardGridView.java

示例5: onCreate

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
/**
 * Called when the activity is created. Setup the data
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.tasker);

    // Show the Up button in the action bar.
    setupActionBar();
    ArrayList<Card> cards = new ArrayList<Card>();

    for (TaskerCommand command : TaskerCommands.getTaskerCommands(this)) {
        cards.add(new TaskerCard(this, command));
    }
    if (cards.size() == 0) {

        Card card = new Card(this, R.layout.no_tasker_commands_inner);
        CardHeader header = new CardHeader(this);
        header.setTitle("No Tasker Commands");
        card.addCardHeader(header);
        cards.add(card);
    }
    CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(this, cards);
    final CardGridView listView = (CardGridView) findViewById(R.id.card_list_view);

    animCardArrayAdapter = new SwingBottomInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(listView);
    listView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
}
 
开发者ID:RSenApps,项目名称:Commandr-Android,代码行数:31,代码来源:TaskerActivity.java

示例6: onCreate

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.most_wanted);
    setupActionBar();
    AdView adView = (AdView) this.findViewById(R.id.adView);
    if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("ads", true)) {
        adView.setVisibility(View.VISIBLE);
        Bundle bundle = new Bundle();
        bundle.putString("color_bg", "4285f4");
        bundle.putString("color_bg_top", "4285f4");
        bundle.putString("color_border", "4285f4");
        bundle.putString("color_link", "EEEEEE");
        bundle.putString("color_text", "FFFFFF");
        bundle.putString("color_url", "EEEEEE");
        AdMobExtras extras = new AdMobExtras(bundle);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice("E9439BFF2245E1BC1DD0FDB28EA467F9").addTestDevice("49924C4BF3738C69A7497A524D092901").addNetworkExtras(extras).build();
        adView.loadAd(adRequest);
    } else {
        adView.setVisibility(View.GONE);
    }

    ArrayList<Card> cards = new ArrayList<Card>();
    for (MostWantedCommand command : MostWantedCommands.getCommands(this)) {
        cards.add(new MostWantedCard(this, command));
    }
    CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(this, cards);
    final CardGridView listView = (CardGridView) findViewById(R.id.card_list_view);
    ((FloatingActionButton)findViewById(R.id.vote)).attachToListView(listView);
    SwingBottomInAnimationAdapter animCardArrayAdapter = new SwingBottomInAnimationAdapter(mCardArrayAdapter);
    animCardArrayAdapter.setAbsListView(listView);
    listView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
    findViewById(R.id.vote).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            startActivity(new Intent(MostWantedCommandsActivity.this, VotingActivity.class));
        }
    });
}
 
开发者ID:RSenApps,项目名称:Commandr-Android,代码行数:40,代码来源:MostWantedCommandsActivity.java

示例7: updateGrid

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
public void updateGrid() {
    // the adapter will get the latest cards state
    mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);

    listView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base1);
    if (listView != null) {
        listView.setAdapter(mCardArrayAdapter);
    }
}
 
开发者ID:madjidtaha,项目名称:handy,代码行数:10,代码来源:GridGplayFragment.java

示例8: initCards

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
private void initCards() {

        ArrayList<Card> cards = new ArrayList<Card>();
        for (int i = 0; i < 200; i++) {

            GplayGridCard card = new GplayGridCard(getActivity());

            card.headerTitle = "App example " + i;
            card.secondaryTitle = "Some text here " + i;
            card.rating = (float) (Math.random() * (5.0));

            //Only for test, change some icons
            if ((i % 6 == 0)) {
                card.resourceIdThumbnail = R.drawable.ic_ic_dh_bat;
            } else if ((i % 6 == 1)) {
                card.resourceIdThumbnail = R.drawable.ic_ic_dh_net;
            } else if ((i % 6 == 2)) {
                card.resourceIdThumbnail = R.drawable.ic_tris;
            } else if ((i % 6 == 3)) {
                card.resourceIdThumbnail = R.drawable.ic_info;
            } else if ((i % 6 == 4)) {
                card.resourceIdThumbnail = R.drawable.ic_smile;
            }

            card.init();
            cards.add(card);
        }

        CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);

        CardGridView listView = (CardGridView) getActivity().findViewById(R.id.carddemo_grid_base1);
        if (listView != null) {
            listView.setAdapter(mCardArrayAdapter);
        }
    }
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:36,代码来源:GridGplayFragment.java

示例9: initCard

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
/**
 * This method builds a simple card
 */
private void initCard() {

    ArrayList<Card> cards = new ArrayList<Card>();
    for (int i = 0; i < 200; i++) {

        GplayGridCard card = new GplayGridCard(getActivity());

        card.headerTitle = "App example " + i;
        card.secondaryTitle = "Some text here " + i;
        card.rating = (float) (Math.random() * (5.0));

        //Only for test, change some icons
        if ((i % 6 == 0)) {
            card.resourceIdThumbnail = R.drawable.ic_ic_dh_bat;
        } else if ((i % 6 == 1)) {
            card.resourceIdThumbnail = R.drawable.ic_ic_dh_net;
        } else if ((i % 6 == 2)) {
            card.resourceIdThumbnail = R.drawable.ic_tris;
        } else if ((i % 6 == 3)) {
            card.resourceIdThumbnail = R.drawable.ic_info;
        } else if ((i % 6 == 4)) {
            card.resourceIdThumbnail = R.drawable.ic_smile;
        }

        card.init();
        cards.add(card);
    }

     mCardArrayAdapter = new CardGridArrayAdapter(getActivity(), cards);

    mListView = (CardGridView) getActivity().findViewById(R.id.carddemo_extras_grid_base1);
    if (mListView != null) {
        setAlphaAdapter();
    }
}
 
开发者ID:tajchert,项目名称:CEEHack,代码行数:39,代码来源:ListViewGridAnimationsFragment.java

示例10: onResume

import it.gmariotti.cardslib.library.internal.CardGridArrayAdapter; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    progress.setVisibility(View.VISIBLE);
    ParseQuery<ParseObject> query = ParseQuery.getQuery("VotingCommand");
    query.addDescendingOrder("votes");
    query.setLimit(1000);
    ((FloatingActionButton) findViewById(R.id.suggest)).hide();
    query.findInBackground(new FindCallback<ParseObject>() {
        @Override
        public void done(final List<ParseObject> parseObjects, ParseException e) {
            if (e == null) {
                ArrayList<Card> cards = new ArrayList<Card>();
                for (ParseObject command : parseObjects) {

                    cards.add(new MostWantedVotingCard(VotingActivity.this, command));

                }
                final CardGridArrayAdapter mCardArrayAdapter = new CardGridArrayAdapter(VotingActivity.this, cards);
                final CardGridView listView = (CardGridView) findViewById(R.id.card_list_view);

                final SwingBottomInAnimationAdapter animCardArrayAdapter = new SwingBottomInAnimationAdapter(mCardArrayAdapter);
                animCardArrayAdapter.setAbsListView(listView);
                listView.setExternalAdapter(animCardArrayAdapter, mCardArrayAdapter);
                progress.setVisibility(View.GONE);
                FloatingActionButton b = (FloatingActionButton) findViewById(R.id.suggest);
                b.show();
                b.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        new MaterialDialog.Builder(VotingActivity.this)
                                .title(getString(R.string.suggest_new))
                                .theme(Theme.LIGHT)  // the default is light, so you don't need this line
                                .customView(R.layout.suggest_command, true)
                                .positiveText(getString(R.string.submit))  // the default is 'OK'
                                .negativeText(R.string.cancel)  // leaving this line out will remove the negative button
                                .callback(new MaterialDialog.ButtonCallback() {
                                    @Override
                                    public void onPositive(MaterialDialog materialDialog) {
                                        String name = ((EditText) materialDialog.getCustomView().findViewById(R.id.name)).getText().toString();
                                        String detail = ((EditText) materialDialog.getCustomView().findViewById(R.id.detailSuggest)).getText().toString();
                                        ParseObject votingCommand = new ParseObject("VotingCommand");
                                        votingCommand.put("title", name);
                                        votingCommand.put("detail", detail);
                                        votingCommand.put("votes", 0);
                                        votingCommand.saveInBackground();
                                        mCardArrayAdapter.add(new MostWantedVotingCard(VotingActivity.this, votingCommand));
                                        animCardArrayAdapter.notifyDataSetChanged();
                                    }
                                })
                                .build()
                                .show();
                    }
                });

            }
        }
    });

}
 
开发者ID:RSenApps,项目名称:Commandr-Android,代码行数:61,代码来源:VotingActivity.java


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