It is a simple gist to realize the UI ANIMATION IN PHOTOSHOP – TUTORIAL #1 provided by Taylor Ling .
Due to shadow and Z-animation, this code can work only on L-devices.
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 |
<service android:name=".ListenerServiceFromWear"> | |
<intent-filter> | |
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> | |
</intent-filter> | |
</service> |
It is a simple gist to realize the UI ANIMATION IN PHOTOSHOP – TUTORIAL #1 provided by Taylor Ling .
Due to shadow and Z-animation, this code can work only on L-devices.
//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 |
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' |
//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())); |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.5.+' | |
} | |
} | |
apply plugin: 'android' |
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); |
public class ExpandWholeCardFragment extends BaseFragment { | |
@Override | |
public void onActivityCreated(Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
initCard(); | |
} |