diff --git a/gfx/add_person.png b/gfx/add_person.png new file mode 100644 index 0000000..6e2ffc8 Binary files /dev/null and b/gfx/add_person.png differ diff --git a/gfx/add_person.xcf b/gfx/add_person.xcf new file mode 100644 index 0000000..7e24011 Binary files /dev/null and b/gfx/add_person.xcf differ diff --git a/meteroid/meteroid-meteroid.apk b/meteroid/meteroid-meteroid.apk index 1b93625..b4a9c98 100644 Binary files a/meteroid/meteroid-meteroid.apk and b/meteroid/meteroid-meteroid.apk differ diff --git a/meteroid/src/main/AndroidManifest.xml b/meteroid/src/main/AndroidManifest.xml index 1e54863..824d3e3 100644 --- a/meteroid/src/main/AndroidManifest.xml +++ b/meteroid/src/main/AndroidManifest.xml @@ -1,15 +1,15 @@ + package="de.chaosdorf.meteroid" + android:versionCode="4" + android:versionName="1.3"> + android:targetSdkVersion="18"/> - - + + - - + + + android:label="@string/set_hostname_label"/> + android:label="@string/pick_username_label"/> + android:label="@string/buy_drink_label"/> + android:label="@string/add_user_label"/> diff --git a/meteroid/src/main/java/de/chaosdorf/meteroid/AddUserActivity.java b/meteroid/src/main/java/de/chaosdorf/meteroid/AddUserActivity.java index 992f579..710d145 100644 --- a/meteroid/src/main/java/de/chaosdorf/meteroid/AddUserActivity.java +++ b/meteroid/src/main/java/de/chaosdorf/meteroid/AddUserActivity.java @@ -6,7 +6,7 @@ import android.os.Bundle; import android.preference.PreferenceManager; import android.view.View; -import android.widget.Button; +import android.widget.ImageButton; import android.widget.TextView; import java.util.Date; @@ -28,13 +28,24 @@ protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); activity = this; setContentView(R.layout.activity_add_user); - Button addButton = (Button) findViewById(R.id.button_add_user); final TextView usernameText = (TextView) findViewById(R.id.username); final TextView emailText = (TextView) findViewById(R.id.email); final TextView balanceText = (TextView) findViewById(R.id.balance); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + final ImageButton backButton = (ImageButton) findViewById(R.id.button_back); + backButton.setOnClickListener(new View.OnClickListener() + { + public void onClick(View view) + { + Intent intent = new Intent(activity, PickUsername.class); + startActivity(intent); + finish(); + } + }); + + final ImageButton addButton = (ImageButton) findViewById(R.id.button_add_user); addButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/meteroid/src/main/java/de/chaosdorf/meteroid/BuyDrink.java b/meteroid/src/main/java/de/chaosdorf/meteroid/BuyDrink.java index 3e0b025..404ccb7 100644 --- a/meteroid/src/main/java/de/chaosdorf/meteroid/BuyDrink.java +++ b/meteroid/src/main/java/de/chaosdorf/meteroid/BuyDrink.java @@ -63,6 +63,7 @@ protected void onCreate(Bundle savedInstanceState) { public void onClick(View view) { + Utility.resetUsername(activity); Intent intent = new Intent(activity, PickUsername.class); startActivity(intent); finish(); diff --git a/meteroid/src/main/java/de/chaosdorf/meteroid/PickUsername.java b/meteroid/src/main/java/de/chaosdorf/meteroid/PickUsername.java index a3b73dd..628455e 100644 --- a/meteroid/src/main/java/de/chaosdorf/meteroid/PickUsername.java +++ b/meteroid/src/main/java/de/chaosdorf/meteroid/PickUsername.java @@ -212,6 +212,11 @@ public View getView(int position, View convertView, ViewGroup parent) icon.setContentDescription(user.getName()); label.setText(user.getName()); + if (user.getId() == NEW_USER_ID) + { + icon.setImageDrawable(getResources().getDrawable(R.drawable.add_person)); + } + return view; } } diff --git a/meteroid/src/main/res/drawable-hdpi/navigation_back.png b/meteroid/src/main/res/drawable-hdpi/button_back.png similarity index 100% rename from meteroid/src/main/res/drawable-hdpi/navigation_back.png rename to meteroid/src/main/res/drawable-hdpi/button_back.png diff --git a/meteroid/src/main/res/drawable-hdpi/navigation_reload.png b/meteroid/src/main/res/drawable-hdpi/button_reload.png similarity index 100% rename from meteroid/src/main/res/drawable-hdpi/navigation_reload.png rename to meteroid/src/main/res/drawable-hdpi/button_reload.png diff --git a/meteroid/src/main/res/drawable-hdpi/button_save.png b/meteroid/src/main/res/drawable-hdpi/button_save.png new file mode 100644 index 0000000..306d55a Binary files /dev/null and b/meteroid/src/main/res/drawable-hdpi/button_save.png differ diff --git a/meteroid/src/main/res/drawable-mdpi/navigation_back.png b/meteroid/src/main/res/drawable-mdpi/button_back.png similarity index 100% rename from meteroid/src/main/res/drawable-mdpi/navigation_back.png rename to meteroid/src/main/res/drawable-mdpi/button_back.png diff --git a/meteroid/src/main/res/drawable-mdpi/navigation_reload.png b/meteroid/src/main/res/drawable-mdpi/button_reload.png similarity index 100% rename from meteroid/src/main/res/drawable-mdpi/navigation_reload.png rename to meteroid/src/main/res/drawable-mdpi/button_reload.png diff --git a/meteroid/src/main/res/drawable-mdpi/button_save.png b/meteroid/src/main/res/drawable-mdpi/button_save.png new file mode 100644 index 0000000..ad07695 Binary files /dev/null and b/meteroid/src/main/res/drawable-mdpi/button_save.png differ diff --git a/meteroid/src/main/res/drawable-xhdpi/navigation_back.png b/meteroid/src/main/res/drawable-xhdpi/button_back.png similarity index 100% rename from meteroid/src/main/res/drawable-xhdpi/navigation_back.png rename to meteroid/src/main/res/drawable-xhdpi/button_back.png diff --git a/meteroid/src/main/res/drawable-xhdpi/navigation_reload.png b/meteroid/src/main/res/drawable-xhdpi/button_reload.png similarity index 100% rename from meteroid/src/main/res/drawable-xhdpi/navigation_reload.png rename to meteroid/src/main/res/drawable-xhdpi/button_reload.png diff --git a/meteroid/src/main/res/drawable-xhdpi/button_save.png b/meteroid/src/main/res/drawable-xhdpi/button_save.png new file mode 100644 index 0000000..2720602 Binary files /dev/null and b/meteroid/src/main/res/drawable-xhdpi/button_save.png differ diff --git a/meteroid/src/main/res/drawable/add_person.png b/meteroid/src/main/res/drawable/add_person.png new file mode 100644 index 0000000..6e2ffc8 Binary files /dev/null and b/meteroid/src/main/res/drawable/add_person.png differ diff --git a/meteroid/src/main/res/drawable/navigation_back.png b/meteroid/src/main/res/drawable/button_back.png similarity index 100% rename from meteroid/src/main/res/drawable/navigation_back.png rename to meteroid/src/main/res/drawable/button_back.png diff --git a/meteroid/src/main/res/drawable/navigation_reload.png b/meteroid/src/main/res/drawable/button_reload.png similarity index 100% rename from meteroid/src/main/res/drawable/navigation_reload.png rename to meteroid/src/main/res/drawable/button_reload.png diff --git a/meteroid/src/main/res/drawable/button_save.png b/meteroid/src/main/res/drawable/button_save.png new file mode 100644 index 0000000..2720602 Binary files /dev/null and b/meteroid/src/main/res/drawable/button_save.png differ diff --git a/meteroid/src/main/res/layout/activity_add_user.xml b/meteroid/src/main/res/layout/activity_add_user.xml index db11731..3f31f8c 100644 --- a/meteroid/src/main/res/layout/activity_add_user.xml +++ b/meteroid/src/main/res/layout/activity_add_user.xml @@ -1,21 +1,15 @@ - - + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="vertical" + 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=".AddUserActivity"> + android:phoneNumber="false"/> + android:inputType="textEmailAddress"/> + android:numeric="decimal"/> -