Skip to content

Instantly share code, notes, and snippets.

Avatar

Maciej Ciemięga MaciejCiemiega

  • Poland
View GitHub Profile
@MaciejCiemiega
MaciejCiemiega / DataMapParcelableUtils .java
Last active Aug 29, 2015
DataMapParcelableUtils allows to put/get Parcelable objects to/from wearable DataMap (I'm not recommending this method)
View DataMapParcelableUtils .java
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 Aug 29, 2015
Sending class with DataApi using DataMap
View MyObject.java
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 Aug 29, 2015
WearablePreferenceTheme - smaller fonts on PreferenceActivity on Wearable
View gist:5b2d3c12a970aad1ab50
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 Aug 29, 2015
WearableListView NullpointerException...
View WearableListViewActivity.java
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 {
You can’t perform that action at this time.