(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public class SimpleListLayout extends TwoWayLayoutManager { | |
public SimpleListLayout(Context context, Orientation orientation) { | |
super(context, orientation); | |
} | |
@Override | |
protected void measureChild(View child, Direction direction) { | |
measureChildWithMargins(child, 0, 0); | |
} |
ItemClickSupport itemClick = ItemClickSupport.addTo(recyclerView); | |
itemclick.setOnItemClickListener(new OnItemClickListener() { | |
@Override | |
public void onItemClick(RecyclerView p, View c, int pos, long id) { | |
... | |
} | |
}); | |
itemClick.setOnItemLongClickListener(new OnItemLongClickListener() { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle" | |
android:dither="true"> | |
<corners android:radius="2dp"/> | |
<solid android:color="#ccc" /> |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle" | |
android:dither="true"> | |
<corners android:radius="2dp"/> | |
<solid android:color="#dbdbdb" /> | |
</shape> | |
</item> |
<?xml version="1.0" encoding="utf-8"?> | |
<set xmlns:android="http://schemas.android.com/apk/res/android" | |
android:interpolator="@android:anim/accelerate_interpolator" > | |
<alpha | |
android:fromAlpha="0" | |
android:toAlpha="1" | |
android:duration="2000" > | |
</alpha> |
// Compose a single request to send to the server: | |
HttpClient client = new DefaultHttpClient(); | |
HttpPost post = new HttpPost("http://www.myserver.com/apis/users/" + userId + "/profile"); | |
List<NameValuePair> bodyParams = new ArrayList<NameValuePair>(); | |
pairs.add(new NameValuePair("first_name", firstName)); | |
pairs.add(new NameValuePair("last_name", firstName)); | |
pairs.add(new NameValuePair("street1", firstName)); | |
pairs.add(new NameValuePair("street2", firstName)); | |
pairs.add(new NameValuePair("zip", firstName)); |
Basic card layout with drawables and styles. | |
Missing icons: ic_action_remove, ic_action_accept and ic_action_cancel (all can be found in the standard android icon pack) | |
Example screenshot: https://pbs.twimg.com/media/BmTdvKhIYAAkrPa.png |
Tried to follow the naming conventions as mentioned in | |
http://android-developers.blogspot.com/2013/08/actionbarcompat-and-io-2013-app-source.html | |
res/values/styles.xml | |
<resources> | |
<style name="Theme.Styled" parent="@style/Theme.AppCompat.Light"> | |
<item name="actionBarStyle">@style/Widget.Styled.ActionBar</item> | |
</style> |
package com.mdaisuke.sample; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.View; | |
import android.widget.Button; |