本文整理汇总了Java中it.gmariotti.cardslib.library.internal.CardThumbnail类的典型用法代码示例。如果您正苦于以下问题:Java CardThumbnail类的具体用法?Java CardThumbnail怎么用?Java CardThumbnail使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CardThumbnail类属于it.gmariotti.cardslib.library.internal包,在下文中一共展示了CardThumbnail类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadBitmap
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
public void loadBitmap(CardThumbnail.CustomSource customSource, ImageView imageView) {
final String imageKey = customSource.getTag();
final Bitmap bitmap = getBitmapFromMemCache(imageKey);
if (bitmap != null){
if (!mCardThumbnail.applyBitmap(imageView,bitmap))
imageView.setImageBitmap(bitmap);
sendBroadcast();
}else{
if (cancelPotentialWork(customSource, imageView)) {
final BitmapWorkerCustomSourceTask task = new BitmapWorkerCustomSourceTask(imageView);
final AsyncDrawableCustomSource asyncDrawable =
new AsyncDrawableCustomSource(getResources(), null, task);
imageView.setImageDrawable(asyncDrawable);
task.execute(customSource);
}
}
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:19,代码来源:CardThumbnailView.java
示例2: cancelPotentialWork
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
public static boolean cancelPotentialWork(CardThumbnail.CustomSource customSource, ImageView imageView) {
final BitmapWorkerCustomSourceTask bitmapWorkerTask = getBitmapWorkerCustomSourceTask(imageView);
if (bitmapWorkerTask != null && bitmapWorkerTask.customSource != null) {
final CardThumbnail.CustomSource bitmapWorkerTaskCustomSource = bitmapWorkerTask.customSource;
if (bitmapWorkerTaskCustomSource.getTag() != null) {
if (!bitmapWorkerTaskCustomSource.getTag().equals(customSource.getTag())) {
// Cancel previous task
bitmapWorkerTask.cancel(true);
} else {
// The same work is already in progress
return false;
}
}
}
// No task associated with the ImageView, or an existing task was cancelled
return true;
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:19,代码来源:CardThumbnailView.java
示例3: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
private void init() {
//Add thumbnail
CardThumbnail cardThumbnail = new CardThumbnail(mContext);
if (resourceIdThumbnail == 0)
cardThumbnail.setDrawableResource(R.drawable.ic_std_launcher);
else {
cardThumbnail.setDrawableResource(resourceIdThumbnail);
}
addCardThumbnail(cardThumbnail);
setOnClickListener(new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(mContext, "Click Listener",Toast.LENGTH_SHORT).show();
}
});
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:23,代码来源:ListGplayCardCABFragment.java
示例4: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的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);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:25,代码来源:ChangeValueCardFragment.java
示例5: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
private void init() {
//Add a header
SuggestedCardHeader header = new SuggestedCardHeader(getContext());
addCardHeader(header);
//Set click listener
setOnClickListener(new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getContext(), "Click listener", Toast.LENGTH_LONG).show();
}
});
//Set swipe on
setSwipeable(true);
//Add thumbnail
CardThumbnail thumb = new SuggestedCardThumb(getContext());
thumb.setUrlResource("https://lh5.googleusercontent.com/-N8bz9q4Kz0I/AAAAAAAAAAI/AAAAAAAAAAs/Icl2bQMyK7c/s265-c-k-no/photo.jpg");
thumb.setErrorResource(R.drawable.ic_error_loadingorangesmall);
addCardThumbnail(thumb);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:24,代码来源:SuggestedCard.java
示例6: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的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);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:23,代码来源:MayKnowCard.java
示例7: crouton1
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
/**
* This method builds a simple card
*/
private void crouton1() {
LayoutInflater mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = mInflater.inflate(R.layout.carddemo_extras_crouton_card, null);
CardView cardView= (CardView)view.findViewById(R.id.carddemo_card_crouton_id);
Card card = new Card(getActivity());
card.setTitle("Crouton Card");
card.setBackgroundResourceId(R.color.demoextra_card_background_color2);
CardThumbnail thumb = new CardThumbnail(getActivity());
thumb.setDrawableResource(R.drawable.ic_action_bulb);
card.addCardThumbnail(thumb);
cardView.setCard(card);
final Crouton crouton;
crouton = Crouton.make(getActivity(), view);
crouton.show();
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:26,代码来源:CroutonFragment.java
示例8: cancelPotentialWork
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
public static boolean cancelPotentialWork(CardThumbnail.CustomSource customSource, ImageView imageView) {
final BitmapWorkerCustomSourceTask bitmapWorkerTask = getBitmapWorkerCustomSourceTask(imageView);
if (bitmapWorkerTask != null) {
final CardThumbnail.CustomSource bitmapWorkerTaskCustomSource = bitmapWorkerTask.customSource;
if (!bitmapWorkerTaskCustomSource.getTag().equals(customSource.getTag())) {
// Cancel previous task
bitmapWorkerTask.cancel(true);
} else {
// The same work is already in progress
return false;
}
}
// No task associated with the ImageView, or an existing task was cancelled
return true;
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:17,代码来源:CardThumbnailView.java
示例9: createAddCard
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的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);
}
});
}
开发者ID:tflynn93,项目名称:LocalVicinity,代码行数:38,代码来源:MainActivity.java
示例10: doInBackground
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
@Override
protected Bitmap doInBackground(CardThumbnail.CustomSource... params) {
customSource = params[0];
ImageView thumbnail = imageViewReference.get();
Bitmap bitmap = customSource.getBitmap();
if (bitmap!=null){
addBitmapToMemoryCache(customSource.getTag(), bitmap);
return bitmap;
}else{
return (Bitmap)null;
}
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:14,代码来源:CardThumbnailView.java
示例11: init_card_thumb_resourceId
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
/**
* This method builds a card with a thumbnail with a resource ID
*/
private void init_card_thumb_resourceId() {
//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));
//Add header to a card
card.addCardHeader(header);
//Create thumbnail
CardThumbnail thumb = new CardThumbnail(getActivity());
//Set ID resource
thumb.setDrawableResource(R.drawable.carddemo_ic_gmaps_large);
//Add thumbnail to a card
card.addCardThumbnail(thumb);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_id);
cardView.setCard(card);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:31,代码来源:ThumbnailFragment.java
示例12: init_card_thumb_resourceURL
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
/**
* This method builds a card with a thumbnail with a resource URL
*/
private void init_card_thumb_resourceURL() {
//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);
//Create thumbnail
CardThumbnail thumb = new CardThumbnail(getActivity());
//Set URL resource
thumb.setUrlResource("https://lh5.googleusercontent.com/-N8bz9q4Kz0I/AAAAAAAAAAI/AAAAAAAAAAs/Icl2bQMyK7c/s265-c-k-no/photo.jpg");
//Error Resource ID
thumb.setErrorResource(R.drawable.ic_error_loadingorangesmall);
//Add thumbnail to a card
card.addCardThumbnail(thumb);
//Set card in the cardView
CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_thumb_url);
cardView.setCard(card);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:33,代码来源:ThumbnailFragment.java
示例13: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
private void init() {
//Add Header
GoogleNowBirthHeaderNew header = new GoogleNowBirthHeaderNew(getContext(), R.layout.carddemo_googlenowbirth2_inner_header);
header.mName = "Gabriele Mariotti";
header.mSubName = "Birthday today";
header.setCustomOverflowAnimation(new SimpleBirthAnimation(getActivity(),this));
addCardHeader(header);
//Set clickListener
addPartialOnClickListener(Card.CLICK_LISTENER_CONTENT_VIEW,new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getContext(), "Click Listener card", Toast.LENGTH_LONG).show();
}
});
//Add Thumbnail
CardThumbnail thumbnail = new CardThumbnail(getContext());
float density = getContext().getResources().getDisplayMetrics().density;
int size= (int)(125*density);
thumbnail.setUrlResource("https://plus.google.com/s2/photos/profile/114432517923423045208?sz="+size);
thumbnail.setErrorResource(R.drawable.ic_ic_error_loading);
addCardThumbnail(thumbnail);
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:28,代码来源:OverflowAnimFragment.java
示例14: init
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
private void init() {
//Add thumbnail
CardThumbnail cardThumbnail = new CardThumbnail(mContext);
cardThumbnail.setDrawableResource(R.drawable.carddemo_ic_gmaps);
addCardThumbnail(cardThumbnail);
//Add ClickListener
setOnClickListener(new OnCardClickListener() {
@Override
public void onClick(Card card, View view) {
Toast.makeText(getContext(), "Click Listener card=", Toast.LENGTH_LONG).show();
}
});
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:16,代码来源:GooglePlaySmallCard.java
示例15: loadReportedTaxis
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
private List<ReportedTaxiCard> loadReportedTaxis() {
List<ReportedTaxiCard> reportedTaxis = new ArrayList<ReportedTaxiCard>();
for (int i = 0; i < 10; i++) {
ReportedTaxiCard reportedTaxiCard = new ReportedTaxiCard(getActivity());
// Create a CardHeader
CardHeader header = new CardHeader(getActivity());
header.setTitle("Angry bird: " + i);
header.setOtherButtonVisible(true);
header.setOtherButtonDrawable(R.drawable.card_menu_button_other_dismiss);
header.setOtherButtonClickListener(new CardHeader.OnClickCardHeaderOtherButtonListener() {
@Override
public void onButtonItemClick(Card card, View view) {
dismissAnimation.animateDismiss(card);
}
});
reportedTaxiCard.addCardHeader(header);
reportedTaxiCard.setTitle("Sample title");
CardThumbnail thumb = new CardThumbnail(getActivity());
thumb.setDrawableResource(R.drawable.default_taxi);
thumb.setErrorResource(R.drawable.ic_ic_error_loading);
reportedTaxiCard.addCardThumbnail(thumb);
reportedTaxis.add(reportedTaxiCard);
}
return reportedTaxis;
}
开发者ID:mSobhy90,项目名称:TaxiFareCalculator,代码行数:33,代码来源:ReportedTaxisFragment.java
示例16: onCreateView
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的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;
}
开发者ID:kylealanr,项目名称:IT_POS_Check_In,代码行数:55,代码来源:ToDo.java
示例17: crouton2
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
/**
* This method builds a simple card
*/
private void crouton2() {
LayoutInflater mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = mInflater.inflate(R.layout.carddemo_extras_crouton_card, null);
CardView cardView= (CardView)view.findViewById(R.id.carddemo_card_crouton_id);
Card card = new Card(getActivity());
card.setTitle("Crouton Card");
CardThumbnail thumb = new CardThumbnail(getActivity());
thumb.setDrawableResource(R.drawable.ic_action_halt);
card.addCardThumbnail(thumb);
cardView.setCard(card);
final Crouton crouton;
crouton = Crouton.make(getActivity(), view);
crouton.show();
}
开发者ID:tajchert,项目名称:CEEHack,代码行数:25,代码来源:CroutonFragment.java
示例18: addCardThumbnail
import it.gmariotti.cardslib.library.internal.CardThumbnail; //导入依赖的package包/类
/**
* Adds a {@link CardThumbnail}.
* It is important to set all thumbnail values before launch this method.
*
* @param cardThumbail thumbnail model
*/
public void addCardThumbnail(CardThumbnail cardThumbail ){
mCardThumbnail=cardThumbail;
buildUI();
}
开发者ID:Daniele-Comi,项目名称:System-Monitor,代码行数:11,代码来源:CardThumbnailView.java
注:本文中的it.gmariotti.cardslib.library.internal.CardThumbnail类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论