diff --git a/MasterPassword/Java/masterpassword-android/AndroidManifest.xml b/MasterPassword/Java/masterpassword-android/AndroidManifest.xml index c18ea87d..ed61be4b 100644 --- a/MasterPassword/Java/masterpassword-android/AndroidManifest.xml +++ b/MasterPassword/Java/masterpassword-android/AndroidManifest.xml @@ -2,11 +2,11 @@ - - + diff --git a/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/BuildConfig.java b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/BuildConfig.java new file mode 100644 index 00000000..595b3987 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/BuildConfig.java @@ -0,0 +1,8 @@ +/*___Generated_by_IDEA___*/ + +package com.lyndir.lhunath.masterpassword; + +/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ +public final class BuildConfig { + public final static boolean DEBUG = Boolean.parseBoolean(null); +} \ No newline at end of file diff --git a/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/Manifest.java b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/Manifest.java new file mode 100644 index 00000000..fbdd3240 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/Manifest.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package com.lyndir.lhunath.masterpassword; + +/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ +public final class Manifest { +} \ No newline at end of file diff --git a/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/R.java b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/R.java new file mode 100644 index 00000000..6caa0b2e --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/gen/com/lyndir/lhunath/masterpassword/R.java @@ -0,0 +1,7 @@ +/*___Generated_by_IDEA___*/ + +package com.lyndir.lhunath.masterpassword; + +/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ +public final class R { +} \ No newline at end of file diff --git a/MasterPassword/Java/masterpassword-android/pom.xml b/MasterPassword/Java/masterpassword-android/pom.xml index f89ab833..490c6480 100644 --- a/MasterPassword/Java/masterpassword-android/pom.xml +++ b/MasterPassword/Java/masterpassword-android/pom.xml @@ -44,6 +44,12 @@ GIT-SNAPSHOT + + com.jakewharton + butterknife + 5.1.2 + + ch.qos.logback logback-classic diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-hdpi/icon.png b/MasterPassword/Java/masterpassword-android/res/drawable-hdpi/icon.png deleted file mode 100644 index a8006785..00000000 Binary files a/MasterPassword/Java/masterpassword-android/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-ldpi/icon.png b/MasterPassword/Java/masterpassword-android/res/drawable-ldpi/icon.png deleted file mode 100644 index 27b5d112..00000000 Binary files a/MasterPassword/Java/masterpassword-android/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-0.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-0.png new file mode 100644 index 00000000..6df3b1c1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-0.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-1.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-1.png new file mode 100644 index 00000000..242619c0 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-1.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-10.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-10.png new file mode 100644 index 00000000..35f80e5c Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-10.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-11.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-11.png new file mode 100644 index 00000000..4562f3a6 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-11.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-12.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-12.png new file mode 100644 index 00000000..bb3a3b11 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-12.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-13.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-13.png new file mode 100644 index 00000000..4541ab58 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-13.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-14.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-14.png new file mode 100644 index 00000000..080b1d12 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-14.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-15.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-15.png new file mode 100644 index 00000000..bddce79c Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-15.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-16.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-16.png new file mode 100644 index 00000000..8b318240 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-16.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-17.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-17.png new file mode 100644 index 00000000..7abd6f8d Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-17.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-18.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-18.png new file mode 100644 index 00000000..d3b2380d Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-18.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-2.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-2.png new file mode 100644 index 00000000..e130c614 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-2.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-3.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-3.png new file mode 100644 index 00000000..c28868a3 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-3.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-4.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-4.png new file mode 100644 index 00000000..9c5b7ed1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-4.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-5.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-5.png new file mode 100644 index 00000000..61773fbd Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-5.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-6.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-6.png new file mode 100644 index 00000000..de110435 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-6.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-7.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-7.png new file mode 100644 index 00000000..47164fd7 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-7.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-8.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-8.png new file mode 100644 index 00000000..e6593d21 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-8.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-9.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-9.png new file mode 100644 index 00000000..b9b7656a Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-9.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-add.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-add.png new file mode 100644 index 00000000..be68d16e Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/avatar-add.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/background.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/background.png new file mode 100644 index 00000000..dad596a0 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/background.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/icon.png b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/icon.png index b5d1c380..97d4cbc2 100644 Binary files a/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/icon.png and b/MasterPassword/Java/masterpassword-android/res/drawable-mdpi/icon.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar0.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar0.png new file mode 100644 index 00000000..306ca9b5 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar0.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar1.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar1.png new file mode 100644 index 00000000..e6b92536 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar1.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar10.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar10.png new file mode 100644 index 00000000..a59c61b1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar10.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar11.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar11.png new file mode 100644 index 00000000..0372e8c7 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar11.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar12.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar12.png new file mode 100644 index 00000000..36903d25 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar12.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar13.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar13.png new file mode 100644 index 00000000..6b71b615 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar13.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar14.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar14.png new file mode 100644 index 00000000..42b41be4 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar14.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar15.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar15.png new file mode 100644 index 00000000..a50ec0c4 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar15.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar16.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar16.png new file mode 100644 index 00000000..a468c6b0 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar16.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar17.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar17.png new file mode 100644 index 00000000..57d5cba1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar17.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar18.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar18.png new file mode 100644 index 00000000..f24242a1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar18.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar2.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar2.png new file mode 100644 index 00000000..46bc4f5c Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar2.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar3.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar3.png new file mode 100644 index 00000000..7f7ff918 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar3.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar4.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar4.png new file mode 100644 index 00000000..4c59a0d1 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar4.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar5.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar5.png new file mode 100644 index 00000000..bd6efe2c Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar5.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar6.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar6.png new file mode 100644 index 00000000..b759e9ff Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar6.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar7.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar7.png new file mode 100644 index 00000000..8810bb21 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar7.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar8.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar8.png new file mode 100644 index 00000000..7e38a4bc Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar8.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar9.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar9.png new file mode 100644 index 00000000..d05b86b8 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avatar9.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avataradd.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avataradd.png new file mode 100644 index 00000000..3e91b6dc Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/avataradd.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/background.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/background.png new file mode 100644 index 00000000..7bcaa643 Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/background.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/icon.png b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/icon.png new file mode 100644 index 00000000..14e49c6b Binary files /dev/null and b/MasterPassword/Java/masterpassword-android/res/drawable-xhdpi/icon.png differ diff --git a/MasterPassword/Java/masterpassword-android/res/drawable/divider20.xml b/MasterPassword/Java/masterpassword-android/res/drawable/divider20.xml new file mode 100644 index 00000000..c48ea6c5 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/res/drawable/divider20.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/MasterPassword/Java/masterpassword-android/res/layout/activity_users.xml b/MasterPassword/Java/masterpassword-android/res/layout/activity_users.xml new file mode 100644 index 00000000..91922ec3 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/res/layout/activity_users.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/MasterPassword/Java/masterpassword-android/res/layout/main.xml b/MasterPassword/Java/masterpassword-android/res/layout/main.xml deleted file mode 100644 index 3a5f117d..00000000 --- a/MasterPassword/Java/masterpassword-android/res/layout/main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/MasterPassword/Java/masterpassword-android/res/layout/view_user_avatar.xml b/MasterPassword/Java/masterpassword-android/res/layout/view_user_avatar.xml new file mode 100644 index 00000000..ff8cdea4 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/res/layout/view_user_avatar.xml @@ -0,0 +1,9 @@ + + + diff --git a/MasterPassword/Java/masterpassword-android/res/values/strings.xml b/MasterPassword/Java/masterpassword-android/res/values/strings.xml index 7578731e..83a098b8 100644 --- a/MasterPassword/Java/masterpassword-android/res/values/strings.xml +++ b/MasterPassword/Java/masterpassword-android/res/values/strings.xml @@ -2,4 +2,5 @@ Hello masterpassword-android! masterpassword-android + User Avatar diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/HelloAndroidActivity.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/HelloAndroidActivity.java deleted file mode 100644 index 0e587773..00000000 --- a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/HelloAndroidActivity.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.lyndir.lhunath.masterpassword; - -import android.app.Activity; -import android.os.Bundle; -import android.util.Log; - -public class HelloAndroidActivity extends Activity { - - private static String TAG = "masterpassword-android"; - - /** - * Called when the activity is first created. - * @param savedInstanceState If the activity is being re-initialized after - * previously being shut down then this Bundle contains the data it most - * recently supplied in onSaveInstanceState(Bundle). Note: Otherwise it is null. - */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - Log.i(TAG, "onCreate"); - setContentView(R.layout.main); - } - -} - diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/UsersActivity.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/UsersActivity.java new file mode 100644 index 00000000..e304e2cc --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/UsersActivity.java @@ -0,0 +1,34 @@ +package com.lyndir.lhunath.masterpassword; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.LinearLayout; +import butterknife.ButterKnife; +import butterknife.InjectView; +import com.lyndir.lhunath.masterpassword.model.Avatar; +import com.lyndir.lhunath.masterpassword.model.User; +import com.lyndir.lhunath.masterpassword.view.AvatarView; + + +public class UsersActivity extends Activity { + + @InjectView(R.id.users) + LinearLayout users; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate( savedInstanceState ); + setContentView( R.layout.activity_users ); + ButterKnife.inject( this ); + } + + @Override + protected void onResume() { + super.onResume(); + + AvatarView avatarView = new AvatarView( this ); + avatarView.setUser( new User( "Maarten Billemont", Avatar.EIGHT ) ); + users.addView( avatarView ); + } +} + diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/Avatar.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/Avatar.java new file mode 100644 index 00000000..88dd5369 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/Avatar.java @@ -0,0 +1,39 @@ +package com.lyndir.lhunath.masterpassword.model; + +import com.lyndir.lhunath.masterpassword.R; + + +/** + * @author lhunath, 2014-08-20 + */ +public enum Avatar { + ZERO( R.drawable.avatar0 ), + ONE( R.drawable.avatar1 ), + TWO( R.drawable.avatar2 ), + THREE( R.drawable.avatar3 ), + FOUR( R.drawable.avatar4 ), + FIVE( R.drawable.avatar5 ), + SIX( R.drawable.avatar6 ), + SEVEN( R.drawable.avatar7 ), + EIGHT( R.drawable.avatar8 ), + NINE( R.drawable.avatar9 ), + TEN( R.drawable.avatar10 ), + ELEVEN( R.drawable.avatar11 ), + TWELVE( R.drawable.avatar12 ), + THIRTEEN( R.drawable.avatar13 ), + FOURTEEN( R.drawable.avatar14 ), + FIFTEEN( R.drawable.avatar15 ), + SIXTEEN( R.drawable.avatar16 ), + SEVENTEEN( R.drawable.avatar17 ), + EIGHTEEN( R.drawable.avatar18 ); + + private final int imageResource; + + Avatar(final int imageResource) { + this.imageResource = imageResource; + } + + public int getImageResource() { + return imageResource; + } +} diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/User.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/User.java new file mode 100644 index 00000000..da702360 --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/model/User.java @@ -0,0 +1,23 @@ +package com.lyndir.lhunath.masterpassword.model; + +/** + * @author lhunath, 2014-08-20 + */ +public class User { + + private String name; + private Avatar avatar; + + public User(final String name, final Avatar avatar) { + this.name = name; + this.avatar = avatar; + } + + public String getName() { + return name; + } + + public Avatar getAvatar() { + return avatar; + } +} diff --git a/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/view/AvatarView.java b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/view/AvatarView.java new file mode 100644 index 00000000..b42337ef --- /dev/null +++ b/MasterPassword/Java/masterpassword-android/src/main/java/com/lyndir/lhunath/masterpassword/view/AvatarView.java @@ -0,0 +1,30 @@ +package com.lyndir.lhunath.masterpassword.view; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.TextView; +import butterknife.ButterKnife; +import com.lyndir.lhunath.masterpassword.R; +import com.lyndir.lhunath.masterpassword.model.User; + + +/** + * @author lhunath, 2014-08-20 + */ +public class AvatarView extends FrameLayout { + + private final TextView userName; + + public AvatarView(final Context context) { + super( context ); + + addView( userName = (TextView) LayoutInflater.from( context ).inflate( R.layout.view_user_avatar, this, false ) ); + } + + public void setUser(User user) { + userName.setText( user.getName() ); + userName.setCompoundDrawables( null, getResources().getDrawable( user.getAvatar().getImageResource() ), null, null ); + } +} diff --git a/MasterPassword/Java/pom.xml b/MasterPassword/Java/pom.xml index 048e14a1..08b32a63 100644 --- a/MasterPassword/Java/pom.xml +++ b/MasterPassword/Java/pom.xml @@ -22,9 +22,17 @@ masterpassword-algorithm masterpassword-cli masterpassword-gui - + + + mod:android + + masterpassword-android + + + +