design the edit profile view

This commit is contained in:
daycode 2017-04-30 21:57:15 +02:00
parent 251090df18
commit b82d75a6c4
6 changed files with 93 additions and 72 deletions

View File

@ -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) {

View File

@ -0,0 +1,4 @@
<vector android:height="32dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M3,4L3,1h2v3h3v2L5,6v3L3,9L3,6L0,6L0,4h3zM6,10L6,7h3L9,4h7l1.83,2L21,6c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2L5,22c-1.1,0 -2,-0.9 -2,-2L3,10h3zM13,19c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5 -5,2.24 -5,5 2.24,5 5,5zM9.8,14c0,1.77 1.43,3.2 3.2,3.2s3.2,-1.43 3.2,-3.2 -1.43,-3.2 -3.2,-3.2 -3.2,1.43 -3.2,3.2z"/>
</vector>

View File

@ -0,0 +1,4 @@
<vector android:height="32dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="32dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
</vector>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -14,49 +16,65 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
android:background="?attr/toolbar_background_color"
android:elevation="4dp" />
<EditText
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/edit_profile_display_name"
android:hint="@string/hint_display_name"
android:maxLength="30"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
android:text="@string/label_header"
android:labelFor="@+id/edit_profile_header"
android:visibility="gone"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/edit_profile_note"
android:hint="@string/hint_note"
android:maxLength="160"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp" />
<ImageButton
android:layout_width="match_parent"
android:layout_height="125dp"
android:id="@id/edit_profile_header"
app:srcCompat="@drawable/ic_add_a_photo_32dp"
android:text="@string/action_photo_pick"
android:textColor="@color/text_color_primary_dark" />
<LinearLayout
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp">
<TextView
<ImageView
android:layout_width="wrap_content"
android:layout_height="125dp"
android:id="@+id/edit_profile_header_preview"
android:contentDescription="@null"
android:visibility="gone" />
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_avatar"
android:labelFor="@+id/edit_profile_avatar"
android:layout_marginRight="8dp" />
android:id="@+id/edit_profile_header_progress"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="gone" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@id/edit_profile_avatar"
android:text="@string/action_photo_pick"
android:textColor="@color/text_color_primary_dark" />
</RelativeLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_avatar"
android:labelFor="@+id/edit_profile_avatar"
android:layout_marginLeft="16dp"
android:visibility="gone"/>
<ImageButton
android:layout_width="80dp"
android:layout_height="80dp"
android:id="@id/edit_profile_avatar"
app:srcCompat="@drawable/ic_add_a_photo_32dp"
android:text="@string/action_photo_pick"
android:textColor="@color/text_color_primary_dark"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="-40dp"
android:elevation="10dp"/>
<RelativeLayout
android:layout_width="wrap_content"
@ -80,49 +98,40 @@
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
<android.support.design.widget.TextInputLayout
android:id="@+id/layout_edit_profile_display_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp">
android:layout_marginTop="15dp">
<TextView
android:layout_width="wrap_content"
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_header"
android:labelFor="@+id/edit_profile_header"
android:layout_marginRight="8dp" />
android:id="@+id/edit_profile_display_name"
android:hint="@string/hint_display_name"
android:maxLength="30"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@id/edit_profile_header"
android:text="@string/action_photo_pick"
android:textColor="@color/text_color_primary_dark" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
<android.support.design.widget.TextInputLayout
android:id="@+id/layout_edit_profile_note"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dp">
android:layout_marginTop="15dp">
<ImageView
android:layout_width="167.2dp"
android:layout_height="80dp"
android:id="@+id/edit_profile_header_preview"
android:contentDescription="@null"
android:visibility="gone" />
<ProgressBar
android:layout_width="wrap_content"
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/edit_profile_header_progress"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="gone" />
android:id="@+id/edit_profile_note"
android:hint="@string/hint_note"
android:maxLength="160"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp" />
</RelativeLayout>
</android.support.design.widget.TextInputLayout>
</LinearLayout>

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_save"
android:icon="@drawable/ic_check_in_box_24dp"
android:icon="@drawable/ic_check_32dp"
android:title="@string/action_save"
app:showAsAction="always" />
</menu>

View File

@ -32,6 +32,7 @@
<string name="title_mutes">Muted users</string>
<string name="title_blocks">Blocked users</string>
<string name="title_follow_requests">Follow Requests</string>
<string name="title_edit_profile">Edit your profile</string>
<string name="status_username_format">\@%s</string>
<string name="status_boosted_format">%s boosted</string>