From b82d75a6c46c0c338308d80ed92ae923a4e74513 Mon Sep 17 00:00:00 2001 From: daycode Date: Sun, 30 Apr 2017 21:57:15 +0200 Subject: [PATCH 1/2] design the edit profile view --- .../tusky/EditProfileActivity.java | 17 ++- .../main/res/drawable/ic_add_a_photo_32dp.xml | 4 + app/src/main/res/drawable/ic_check_32dp.xml | 4 + .../main/res/layout/activity_edit_profile.xml | 137 ++++++++++-------- .../main/res/menu/edit_profile_toolbar.xml | 2 +- app/src/main/res/values/strings.xml | 1 + 6 files changed, 93 insertions(+), 72 deletions(-) create mode 100644 app/src/main/res/drawable/ic_add_a_photo_32dp.xml create mode 100644 app/src/main/res/drawable/ic_check_32dp.xml diff --git a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java index f0313f94..313adfca 100644 --- a/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.java @@ -38,6 +38,7 @@ import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; +import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ProgressBar; @@ -73,14 +74,14 @@ public class EditProfileActivity extends BaseActivity { HEADER } - @BindView(R.id.edit_profile_display_name) EditText displayNameEditText; - @BindView(R.id.edit_profile_note) EditText noteEditText; - @BindView(R.id.edit_profile_avatar) Button avatarButton; - @BindView(R.id.edit_profile_avatar_preview) ImageView avatarPreview; - @BindView(R.id.edit_profile_avatar_progress) ProgressBar avatarProgress; - @BindView(R.id.edit_profile_header) Button headerButton; + @BindView(R.id.edit_profile_header) ImageButton headerButton; @BindView(R.id.edit_profile_header_preview) ImageView headerPreview; @BindView(R.id.edit_profile_header_progress) ProgressBar headerProgress; + @BindView(R.id.edit_profile_avatar) ImageButton avatarButton; + @BindView(R.id.edit_profile_avatar_preview) ImageView avatarPreview; + @BindView(R.id.edit_profile_avatar_progress) ProgressBar avatarProgress; + @BindView(R.id.edit_profile_display_name) EditText displayNameEditText; + @BindView(R.id.edit_profile_note) EditText noteEditText; @BindView(R.id.edit_profile_save_progress) ProgressBar saveProgress; private String priorDisplayName; @@ -100,7 +101,7 @@ public class EditProfileActivity extends BaseActivity { setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { - actionBar.setTitle(null); + actionBar.setTitle(getString(R.string.title_edit_profile)); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(true); } @@ -121,6 +122,8 @@ public class EditProfileActivity extends BaseActivity { headerBase64 = null; } + + avatarButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/app/src/main/res/drawable/ic_add_a_photo_32dp.xml b/app/src/main/res/drawable/ic_add_a_photo_32dp.xml new file mode 100644 index 00000000..172c5ace --- /dev/null +++ b/app/src/main/res/drawable/ic_add_a_photo_32dp.xml @@ -0,0 +1,4 @@ + + + diff --git a/app/src/main/res/drawable/ic_check_32dp.xml b/app/src/main/res/drawable/ic_check_32dp.xml new file mode 100644 index 00000000..d6672246 --- /dev/null +++ b/app/src/main/res/drawable/ic_check_32dp.xml @@ -0,0 +1,4 @@ + + + diff --git a/app/src/main/res/layout/activity_edit_profile.xml b/app/src/main/res/layout/activity_edit_profile.xml index 4f224a72..3ca28224 100644 --- a/app/src/main/res/layout/activity_edit_profile.xml +++ b/app/src/main/res/layout/activity_edit_profile.xml @@ -1,5 +1,7 @@ - - + android:text="@string/label_header" + android:labelFor="@+id/edit_profile_header" + android:visibility="gone"/> - + - - + + + android:id="@+id/edit_profile_header_progress" + android:layout_centerInParent="true" + android:indeterminate="true" + android:visibility="gone" /> -