Skip to content

Instantly share code, notes, and snippets.

@gabrielemariotti
gabrielemariotti / DismissCardWithSwipeAnimation
Created February 20, 2014 08:16
Cardslib: A code snippet to dismiss a Card in a listView with a Swipe Animation clicking a button.
public class ListBaseFragment extends BaseFragment {
CardListView listView;
CardArrayAdapter mCardArrayAdapter;
int mAnimationTime=1;
private int mDismissAnimationRefCount = 0;
private List<PendingDismissData> mPendingDismisses = new ArrayList<PendingDismissData>();
private int mDownPosition;
@Override
@gabrielemariotti
gabrielemariotti / mobile-AndroidManifest.xml
Last active August 29, 2015 14:04
Android Wear: small gist to start an Activity on the mobile handheld from the Android Wear device using the Teleport library. (https://github.com/Mariuxtheone/Teleport)
<service android:name=".ListenerServiceFromWear">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
@gabrielemariotti
gabrielemariotti / README.md
Last active August 29, 2015 14:05
Code for Taylor Ling's UI ANIMATION IN PHOTOSHOP – TUTORIAL #1
@gabrielemariotti
gabrielemariotti / MaterialLargeImageCard.java
Created September 2, 2014 17:41
A simple gist to build a MaterialCard with cardslib v2.
//Create a Card, set the title over the image and set the thumbnail
MaterialLargeImageCard card = new MaterialLargeImageCard(getActivity());
card.setTextOverImage("Italian Beaches");
card.setDrawableCardThumbnail(R.drawable.sea);
//Set the title and subtitle in the card
card.setTitle("This is my favorite local beach");
card.setSubTitle("A wonderful place");
// Set supplemental actions
@gabrielemariotti
gabrielemariotti / build.gradle
Created October 25, 2014 17:14
Gist for cardslib 2.0.0.RC1
repositories {
mavenCentral()
//snapshot for rc1
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
//Core card library
compile 'com.github.gabrielemariotti.cards:cardslib-core:2.0.0-RC1-SNAPSHOT'
@gabrielemariotti
gabrielemariotti / gist:10716d3a7c0089f3c034
Created January 14, 2015 23:51
How to customize the MaterialLargeImageCard with a own class (requires cardslib 2.1.+)
//Create a Card, set the title over the image and set the thumbnail
CustomMaterialLargeImageCard card = (CustomMaterialLargeImageCard)
CustomMaterialLargeImageCard.with(getActivity())
.setTextOverImage("Italian Beaches "+i)
.setTitle("This is my favorite local beach "+i)
.setSubTitle("A wonderful place")
.useDrawableId(R.drawable.sea)
.setupSupplementalActions(R.layout.carddemo_native_material_supplemental_actions_large, actions)
//It is important to use this build method
.build(new CustomMaterialLargeImageCard(getActivity()));
@gabrielemariotti
gabrielemariotti / build.gradle
Last active December 24, 2015 05:19
Gradle configuration for Card library
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
@gabrielemariotti
gabrielemariotti / ListFragment.java
Last active January 1, 2016 07:29
Cardslib: Simple (raw and ugly) layouts for CardListView.It provides all custom layout for your list and your cards.
public class ListFragment extends Fragment {
//DAO datasource;
//List<Joke> values;
public ListFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.test_fragment_list, container, false);
@gabrielemariotti
gabrielemariotti / ExpandWholeCard
Created March 10, 2014 19:13
Cardslib: an example to expand cards clicking the whole card in a ListView.
public class ExpandWholeCardFragment extends BaseFragment {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
initCard();
}
@gabrielemariotti
gabrielemariotti / Readme.md
Last active December 22, 2016 14:54
UndoBar with Material Design

These layouts provide a simple undo bar with Material Design.

This gist does not contain any Android L API.

undobar with action undobar mobile
Screen Screen