This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
tools:context=".MyActivity"> | |
<Button | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependencies { | |
compile fileTree(dir: ‘libs’, include: [‘*.jar’]) | |
compile ‘com.android.support:support-v4:20.0+’ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<string name="notify">Notify Wearable</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main_activity); | |
Button wearButton = (Button)findViewById(R.id.wearButton); | |
wearButton.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toast toast = Toast.makeText(context, text, duration); | |
toast.show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextFragment textFragment = new TextFragment(); | |
Bundle bundle = new Bundle(); | |
bundle.putString("myText", "Hey ya!"); | |
textFragment.setArguments(bundle); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TextFragment extends Fragment { | |
private static final String ARG_TEXT = "arg_text"; | |
public static TextFragment newInstance(String text) { | |
TextFragment textFragment = new TextFragment(); | |
Bundle bundle = new Bundle(); | |
bundle.putString(ARG_TEXT, text); | |
textFragment.setArguments(bundle); | |
return textFragment; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TextFragment textFragment = TextFragment.newInstance("Hello there!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TuningAdapter extends ArrayAdapter<Tuning> { | |
private ArrayList<Tuning> tunings; | |
private Context context; | |
private int itemLayout; | |
public TuningAdapter(Context context, int itemLayout, ArrayList<Tuning> tunings) { | |
super(context, itemLayout, tunings); | |
this.context = context; | |
this.itemLayout = itemLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:weightSum="20"> | |
OlderNewer