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 HelperUtil { | |
public static HelperUtilBase getInstance(Context context) { | |
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) { | |
return new HelperUtilL(context); | |
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { | |
return new HelperUtilKK(context); | |
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | |
return new HelperUtilJB(context); |
//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 |
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.
This class provides a simple animator which applies a slide in/out from/to the left animation to item views in the RecyclerView
This code is cloned from DefaultItemAnimator
provided by Google, customizing the part highlighted as "Custom implementation".
Example:
mRecyclerView.setItemAnimator(new SlideInOutLeftDefaultItemAnimator(mRecyclerView));
You can use this class to realize a simple sectioned RecyclerView.Adapter
without changing your code.
The RecyclerView
should use a LinearLayoutManager
.
You can use this code also with the TwoWayView
with the ListLayoutManager
(https://github.com/lucasr/twoway-view)
This is a porting of the class SimpleSectionedListAdapter
provided by Google
Example:
public class MyRecyclerViewAdapter extends RecyclerView.Adapter<MyRecyclerView.MyViewHolder>{ | |
public static class MyViewHolder extends RecyclerView.ViewHolder { | |
public MyViewHolder(View view) { | |
super(view); | |
} | |
} |
Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); | |
//Title and subtitle | |
toolbar.setTitle("MY toolbar"); | |
toolbar.setSubtitle("Subtitle"); | |
//Menu | |
toolbar.inflateMenu(R.menu.toolbar_menu); | |
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() { |
<service android:name=".ListenerServiceFromWear"> | |
<intent-filter> | |
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> | |
</intent-filter> | |
</service> |
public class GridActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.grid); | |
final GridViewPager mGridPager = (GridViewPager) findViewById(R.id.pager); | |
mGridPager.setAdapter(new SampleGridPagerAdapter(this, getFragmentManager())); | |
} |
<service android:name=".ListenerServiceFromWear"> | |
<intent-filter> | |
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> | |
</intent-filter> | |
</service> |