shlist

share and manage lists between multiple people
Log | Files | Refs

commit 60b3537f02cccf26a5819cf9714cbafe8d296942
parent 9e498ad7c8f3083d77c9ed60433ca128334c4f4b
Author: David Engel <drengel88@gmail.com>
Date:   Sun, 24 May 2015 03:04:57 -0600

android: decent looking testing ui

Diffstat:
Mkd/app/src/main/java/kd/shared_lists/HomeScreen.java | 14+++-----------
Mkd/app/src/main/res/layout/layout_home_screen.xml | 23++++++++++++++++++++---
2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/kd/app/src/main/java/kd/shared_lists/HomeScreen.java b/kd/app/src/main/java/kd/shared_lists/HomeScreen.java @@ -39,28 +39,20 @@ public class HomeScreen extends ActionBarActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layout_home_screen); - Button sendMsgButton = new Button(this); - numbertv = new EditText(this); - numbertv.setText("4039235990"); - nametv = new EditText(this); - nametv.setText("puffdaddy"); + Button sendMsgButton = (Button) findViewById(R.id.sendMsgButton); + numbertv = (EditText) findViewById(R.id.number); + nametv = (EditText) findViewById(R.id.name); sendMsgButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new sendMessageTask().execute("foobar", "joobar"); } }); - LinearLayout rl = (LinearLayout) findViewById(R.id.mainlayout); - sendMsgButton.setText("Send Message"); - rl.addView(sendMsgButton); - rl.addView(numbertv); - rl.addView(nametv); } private void testNet() { ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); - tv = (TextView) findViewById(R.id.hellotext); if (networkInfo != null && networkInfo.isConnected()) { tv.setText("Connected"); } else { diff --git a/kd/app/src/main/res/layout/layout_home_screen.xml b/kd/app/src/main/res/layout/layout_home_screen.xml @@ -3,9 +3,26 @@ android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" - android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".HomeScreen"> + android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".HomeScreen" + android:orientation="vertical"> - <TextView android:id="@+id/hellotext" android:text="@string/hello_world" android:layout_width="wrap_content" - android:layout_height="wrap_content" /> + <EditText + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:id="@+id/number" + android:layout_gravity="center_horizontal" /> + + <EditText + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:id="@+id/name" + android:layout_gravity="center_horizontal" /> + + <Button + android:layout_width="209dp" + android:layout_height="wrap_content" + android:text="Send Message" + android:id="@+id/sendMsgButton" + android:layout_gravity="center_horizontal" /> </LinearLayout>