Skip to content

Instantly share code, notes, and snippets.

View MaciejCiemiega's full-sized avatar

Maciej Ciemięga MaciejCiemiega

View GitHub Profile
@MaciejCiemiega
MaciejCiemiega / DataMapParcelableUtils .java
Last active August 29, 2015 14:06
DataMapParcelableUtils allows to put/get Parcelable objects to/from wearable DataMap (I'm not recommending this method)
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.wearable.DataMap;
/**
* <p>Allows to put and get {@link Parcelable} objects into {@link DataMap}</p>
* <b>USAGE:</b>
* <p>
* <b>Store object in DataMap:</b><br/>
@MaciejCiemiega
MaciejCiemiega / MyObject.java
Last active August 29, 2015 14:06
Sending class with DataApi using DataMap
import java.util.ArrayList;
import java.util.List;
import com.google.android.gms.wearable.DataMap;
public class MyObject {
public final long itemId;
public final long sortOrder;
public final String priceString;
@MaciejCiemiega
MaciejCiemiega / gist:5b2d3c12a970aad1ab50
Last active August 29, 2015 14:03
WearablePreferenceTheme - smaller fonts on PreferenceActivity on Wearable
define styles:
<style name="WearableTextAppearanceLarge" parent="@android:style/TextAppearance.Large">
<item name="android:textSize">20sp</item>
</style>
<style name="WearableTextAppearanceSmall" parent="@android:style/TextAppearance.Small">
<item name="android:textSize">12sp</item>
</style>
and theme:
@MaciejCiemiega
MaciejCiemiega / WearableListViewActivity.java
Last active August 29, 2015 14:03
WearableListView NullpointerException...
import android.app.Activity;
import android.os.Bundle;
import android.support.wearable.view.WearableListView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
public class WearableListViewActivity extends Activity {