本文整理汇总了Java中it.gmariotti.cardslib.library.internal.CardHeader.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java CardHeader.setTitle方法的具体用法?Java CardHeader.setTitle怎么用?Java CardHeader.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.gmariotti.cardslib.library.internal.CardHeader
的用法示例。
在下文中一共展示了CardHeader.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init_simple_card
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This method builds a simple card
*/
private void init_simple_card() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Set the card inner text
card.setTitle(getString(R.string.demo_card_basetitle));
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_card_id);
cardView.setCard(card);
}
示例2: init_card_inner_layout
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This method builds a simple card with a custom inner layout
*/
private void init_card_inner_layout() {
//Create a Card
Card card = new Card(getActivity(),R.layout.carddemo_example_inner_content);
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Set the card inner text
card.setTitle(getString(R.string.demo_card_basetitle));
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_card_inner);
cardView.setCard(card);
}
示例3: init_card_without_shadow
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This method builds a card without shadow
*/
private void init_card_without_shadow() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Hidden shadow
card.setShadow(false);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_no);
cardView.setCard(card);
}
示例4: init_card_custom_shadow_layout
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This methods builds a card with a custom shadow layout (compound view)
* <b>WARNING</b>
* See https://github.com/gabrielemariotti/cardslib/tree/master/SHADOW.md for more information.
* You can quickly modify your shadow with your style and drawable files without modifying shadow layout.
*/
private void init_card_custom_shadow_layout() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_shadow_layout);
cardView.setCard(card);
}
示例5: init_standard_header_without_buttons
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This method builds a standard header without buttons
*/
private void init_standard_header_without_buttons() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
card.addCardHeader(header);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_header_std);
cardView.setCard(card);
}
示例6: init
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
private void init(){
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(mTitleHeader);
addCardHeader(header);
CardThumbnail thumb = new CardThumbnail(getActivity());
thumb.setDrawableResource(R.drawable.ic_launcher);
addCardThumbnail(thumb);
//Add ClickListener
setOnClickListener(new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getContext(), "Click Listener card=" + mTitleHeader, Toast.LENGTH_LONG).show();
}
});
//Set the card inner text
setTitle(mTitleMain);
}
示例7: init
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
private void init() {
CardHeader header = new CardHeader(getContext());
header.setButtonOverflowVisible(true);
header.setTitle("Google Maps");
header.setPopupMenu(R.menu.popupmain, new CardHeader.OnClickCardHeaderPopupMenuListener() {
@Override
public void onMenuItemClick(BaseCard card, MenuItem item) {
Toast.makeText(getContext(), item.getTitle(), Toast.LENGTH_SHORT).show();
}
});
addCardHeader(header);
GoogleNowBirthThumb thumbnail = new GoogleNowBirthThumb(getContext());
thumbnail.setDrawableResource(R.drawable.carddemo_ic_gmaps_large);
addCardThumbnail(thumbnail);
}
示例8: init
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
private void init() {
//Add Header
CardHeader header = new MayKnowCardHeader(getContext(), R.layout.carddemo_mayknow_inner_header);
header.setTitle(getContext().getString(R.string.may_know_card_title));
addCardHeader(header);
setShadow(false);
//Add Thumbnail
CardThumbnail thumbnail = new CardThumbnail(getContext());
thumbnail.setUrlResource("https://plus.google.com/s2/photos/profile/114432517923423045208?sz=72");
thumbnail.setErrorResource(R.drawable.ic_error_loadingsmall);
addCardThumbnail(thumbnail);
OnCardClickListener clickListener = new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
//Do something
}
};
addPartialOnClickListener(Card.CLICK_LISTENER_CONTENT_VIEW,clickListener);
}
示例9: createAddCard
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
private void createAddCard() {
//Create new header and set the title
CardHeader addLocationHeader = new CardHeader(this);
addLocationHeader.setTitle("Add New Location");
//Create new card instance
Card addLocation = new Card(this);
//Set thumbnail and drawable resource
CardThumbnail addLocationThumb = new CardThumbnail(this);
addLocationThumb.setDrawableResource(R.drawable.plus);
//Set color
addLocation.setBackgroundResourceId(R.color.darkred);
//Add header
addLocation.addCardHeader(addLocationHeader);
//Add thumbnail
addLocation.addCardThumbnail(addLocationThumb);
//Set clickable
addLocation.setClickable(true);
//Add to arraylist
cards.add(addLocation);
//Set onClick listener
addLocation.setOnClickListener(new Card.OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
//Set intent to AddLocation screen
Intent intent = new Intent(MainActivity.this, AddLocationActivity.class);
startActivity(intent);
}
});
}
示例10: createViewCard
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
private void createViewCard() {
//Create new header and set the title
CardHeader addLocationHeader = new CardHeader(this);
addLocationHeader.setTitle("View Current Database");
//Create new card instance
Card addLocation = new Card(this);
//Set thumbnail and drawable resource
//CardThumbnail addLocationThumb = new CardThumbnail(this);
//addLocationThumb.setDrawableResource(R.drawable.hacker);
//Set color
addLocation.setBackgroundResourceId(R.color.darkorange);
//Add header
addLocation.addCardHeader(addLocationHeader);
//Add thumbnail
//addLocation.addCardThumbnail(addLocationThumb);
//Set clickable
addLocation.setClickable(true);
//Add to arraylist
cards.add(addLocation);
//Set onClick listener
addLocation.setOnClickListener(new Card.OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
//Set intent to AddLocation screen
Intent intent = new Intent(MainActivity.this, ViewLocationsActivity.class);
startActivity(intent);
}
});
}
示例11: initCardHeader
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
@Override
protected CardHeader initCardHeader()
{
CardHeader header=new CardHeader(getContext(), R.layout.card_general_info_inner_header);
header.setTitle(title);
return header;
}
示例12: init
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* Initialize Card using custom header and Note data.
*/
public void init() {
this.setCheckable(true);
if (mNote != null && !mNote.getTitle().equals("")) {
CardHeader header = new SealnoteCardHeader(getContext());
header.setTitle(mNote.getTitle());
addCardHeader(header);
}
}
示例13: MostWantedVotingCard
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
public MostWantedVotingCard(Context context, ParseObject command) {
super(context, R.layout.voting_card);
this.command = command;
CardHeader header = new CardHeader(context);
header.setTitle(command.getString("title"));
addCardHeader(header);
}
示例14: onCreate
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的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);
}
示例15: init_standard_header_with_expandcollapse_button
import it.gmariotti.cardslib.library.internal.CardHeader; //导入方法依赖的package包/类
/**
* This method builds a standard header with base expand/collapse
*/
private void init_standard_header_with_expandcollapse_button() {
//Create a Card
Card card = new Card(getActivity());
//Create a CardHeader
CardHeader header = new CardHeader(getActivity());
//Set the header title
header.setTitle(getString(R.string.demo_header_basetitle));
//Set visible the expand/collapse button
header.setButtonExpandVisible(true);
//Add Header to card
card.addCardHeader(header);
//This provides a simple (and useless) expand area
CardExpand expand = new CardExpand(getActivity());
//Set inner title in Expand Area
expand.setTitle(getString(R.string.demo_expand_customtitle3));
card.addCardExpand(expand);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand1);
cardView.setCard(card);
}