Skip to content

Commit

Permalink
added backgroud and images to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanDesi committed Apr 26, 2015
1 parent cde9775 commit f0afc77
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ public class WearActivity extends Activity {
private GoogleApiClient apiClient;
private String remoteNodeId;
private EditText metTextHint;
private ImageButton mbtSpeak, mbtRight, mbtLeft, mbtWalk;
private Button mbtSpeak, mbtRight, mbtLeft, mbtWalk;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_activity);

metTextHint = (EditText) findViewById(R.id.etTextHint);
mbtSpeak = (ImageButton) findViewById(R.id.btSpeak);
mbtLeft = (ImageButton) findViewById(R.id.btLeftSpin);
mbtRight = (ImageButton) findViewById(R.id.btRightSpin);
mbtWalk = (ImageButton) findViewById(R.id.btWalk);
mbtSpeak = (Button) findViewById(R.id.btSpeak);
mbtLeft = (Button) findViewById(R.id.btLeftSpin);
mbtRight = (Button) findViewById(R.id.btRightSpin);
mbtWalk = (Button) findViewById(R.id.btWalk);

apiClient = apiClientFactory();
checkVoiceRecognition();
Expand Down
Binary file added wear/src/main/res/drawable-mdpi/darwinbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified wear/src/main/res/drawable-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 32 additions & 69 deletions wear/src/main/res/layout/main_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,87 +18,50 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:background="@drawable/darwinbg"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
xmlns:tools="http://schemas.android.com/tools"
>

<Button
android:id="@+id/btSpeak"
android:layout_height="wrap_content"
android:layout_height="28dp"
android:onClick="speak"
android:background="@drawable/punch"
android:layout_width="wrap_content"
android:layout_width="52dp"
tools:context=".VoiceRecognitionActivity"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp"
android:layout_row="3"
android:layout_column="1"
android:layout_gravity="center_horizontal|bottom" />

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="right|center_vertical">

<Button
android:layout_width="34dp"
android:layout_height="28dp"
android:background="@drawable/walk"
android:id="@+id/btWalk"
android:onClick="walkMove"
android:width="24dp"
android:height="24dp"
android:layout_row="1"
android:layout_column="1"
android:layout_gravity="center_horizontal|top"
android:layout_marginTop="27dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />

</RelativeLayout>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="left|center_vertical"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">

<Button
android:layout_width="41dp"
android:layout_height="34dp"
android:background="@drawable/left"
android:id="@+id/btLeftSpin"
android:onClick="leftSpinMove"
android:layout_row="2"
android:layout_column="0"
android:layout_gravity="left|center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:layout_marginStart="24dp" />

</RelativeLayout>
<Button
android:layout_width="34dp"
android:layout_height="32dp"
android:background="@drawable/walk"
android:id="@+id/btWalk"
android:onClick="walkMove"
android:width="24dp"
android:height="24dp"
android:layout_gravity="center"
android:layout_marginTop="27dp"
/>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignStart="@+id/btLeftSpin">
<Button
android:layout_width="32dp"
android:layout_height="32dp"
android:background="@drawable/right"
android:id="@+id/btRightSpin"
android:onClick="rightSpinMove"
android:layout_marginEnd="25dp"
android:layout_gravity="right|center_vertical" />

<Button
android:layout_width="36dp"
android:layout_height="33dp"
android:background="@drawable/right"
android:id="@+id/btRightSpin"
android:onClick="rightSpinMove"
android:layout_row="2"
android:layout_column="2"
android:layout_gravity="right|center_vertical"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="25dp" />
</RelativeLayout>
<Button
android:layout_width="41dp"
android:layout_height="34dp"
android:background="@drawable/left"
android:id="@+id/btLeftSpin"
android:onClick="leftSpinMove"
android:layout_marginStart="24dp"
android:layout_gravity="left|center_vertical" />


</FrameLayout>
Expand Down

0 comments on commit f0afc77

Please sign in to comment.