Skip to content

Instantly share code, notes, and snippets.

Avatar

Tavon Gatling gatlingxyz

View GitHub Profile
@gatlingxyz
gatlingxyz / gist:21960b1c9a0ce45e5a79
Created Jun 28, 2014
How to use QuickReturnScrollView
View gist:21960b1c9a0ce45e5a79
<?xml version="1.0" encoding="utf-8"?>
<org.example.text.QuickReturnScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:gravity="center"
android:id="@+id/root_scroll"
android:layout_height="match_parent">
@gatlingxyz
gatlingxyz / gist:c034245484ee7c487df6
Created Jun 28, 2014
AsyncTask to add views to FakeListView
View gist:c034245484ee7c487df6
private class AddViewsToFakeListTask extends AsyncTask<Void, View, Void>{
private ListAdapter adapter;
private LinearLayout view;
public AddViewsToFakeListTask(LinearLayout view, ListAdapter adapter){
this.view = view;
this.adapter = adapter;
}
View gist:5d07d3cb7f8eef37f6a3
// this...
@Override
public void onMessageReceived(MessageEvent messageEvent) {
Log.v(TAG, "Message received on wear: " + messageEvent.getPath());
if(messageEvent.getPath().endsWith("connected")){
findViewById(R.id.progress).setVisibility(View.GONE); // Line #143
findViewById(R.id.on_off_layout).setVisibility(View.VISIBLE);
@gatlingxyz
gatlingxyz / gist:52fb21eb92181716b0ce
Created Jul 11, 2014
Unofficial Base WatchFace Activity
View gist:52fb21eb92181716b0ce
import android.app.Activity;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.view.Display;
/**
* A base activity for watch faces that have callbacks for the various screen states (dim, awake, and off)
* as well as a callback for when the watch face is removed.
* <p/>