design the edit profile view
This commit is contained in:
parent
251090df18
commit
b82d75a6c4
6 changed files with 93 additions and 72 deletions
|
@ -38,6 +38,7 @@ import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
|
|
||||||
|
@ -73,14 +74,14 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
HEADER
|
HEADER
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindView(R.id.edit_profile_display_name) EditText displayNameEditText;
|
@BindView(R.id.edit_profile_header) ImageButton headerButton;
|
||||||
@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_preview) ImageView headerPreview;
|
@BindView(R.id.edit_profile_header_preview) ImageView headerPreview;
|
||||||
@BindView(R.id.edit_profile_header_progress) ProgressBar headerProgress;
|
@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;
|
@BindView(R.id.edit_profile_save_progress) ProgressBar saveProgress;
|
||||||
|
|
||||||
private String priorDisplayName;
|
private String priorDisplayName;
|
||||||
|
@ -100,7 +101,7 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setTitle(null);
|
actionBar.setTitle(getString(R.string.title_edit_profile));
|
||||||
actionBar.setDisplayHomeAsUpEnabled(true);
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
actionBar.setDisplayShowHomeEnabled(true);
|
actionBar.setDisplayShowHomeEnabled(true);
|
||||||
}
|
}
|
||||||
|
@ -121,6 +122,8 @@ public class EditProfileActivity extends BaseActivity {
|
||||||
headerBase64 = null;
|
headerBase64 = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
avatarButton.setOnClickListener(new View.OnClickListener() {
|
avatarButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
4
app/src/main/res/drawable/ic_add_a_photo_32dp.xml
Normal file
4
app/src/main/res/drawable/ic_add_a_photo_32dp.xml
Normal 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>
|
4
app/src/main/res/drawable/ic_check_32dp.xml
Normal file
4
app/src/main/res/drawable/ic_check_32dp.xml
Normal 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>
|
|
@ -1,5 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -14,49 +16,65 @@
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="@android:color/transparent"
|
android:background="?attr/toolbar_background_color"
|
||||||
android:elevation="4dp" />
|
android:elevation="4dp" />
|
||||||
|
|
||||||
<EditText
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/edit_profile_display_name"
|
android:text="@string/label_header"
|
||||||
android:hint="@string/hint_display_name"
|
android:labelFor="@+id/edit_profile_header"
|
||||||
android:maxLength="30"
|
android:visibility="gone"/>
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_marginEnd="16dp" />
|
|
||||||
|
|
||||||
<EditText
|
<ImageButton
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="125dp"
|
||||||
android:id="@+id/edit_profile_note"
|
android:id="@id/edit_profile_header"
|
||||||
android:hint="@string/hint_note"
|
app:srcCompat="@drawable/ic_add_a_photo_32dp"
|
||||||
android:maxLength="160"
|
android:text="@string/action_photo_pick"
|
||||||
android:layout_marginStart="16dp"
|
android:textColor="@color/text_color_primary_dark" />
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_marginBottom="16dp" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="16dp">
|
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_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/label_avatar"
|
android:id="@+id/edit_profile_header_progress"
|
||||||
android:labelFor="@+id/edit_profile_avatar"
|
android:layout_centerInParent="true"
|
||||||
android:layout_marginRight="8dp" />
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
<Button
|
</RelativeLayout>
|
||||||
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" />
|
|
||||||
|
|
||||||
</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
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -80,49 +98,40 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/layout_edit_profile_display_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:layout_marginTop="15dp">
|
||||||
android:paddingLeft="16dp">
|
|
||||||
|
|
||||||
<TextView
|
<EditText
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/label_header"
|
android:id="@+id/edit_profile_display_name"
|
||||||
android:labelFor="@+id/edit_profile_header"
|
android:hint="@string/hint_display_name"
|
||||||
android:layout_marginRight="8dp" />
|
android:maxLength="30"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp" />
|
||||||
|
|
||||||
<Button
|
</android.support.design.widget.TextInputLayout>
|
||||||
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" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/layout_edit_profile_note"
|
||||||
<RelativeLayout
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="16dp">
|
android:layout_marginTop="15dp">
|
||||||
|
|
||||||
<ImageView
|
<EditText
|
||||||
android:layout_width="167.2dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="80dp"
|
|
||||||
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:layout_height="wrap_content"
|
||||||
android:id="@+id/edit_profile_header_progress"
|
android:id="@+id/edit_profile_note"
|
||||||
android:layout_centerInParent="true"
|
android:hint="@string/hint_note"
|
||||||
android:indeterminate="true"
|
android:maxLength="160"
|
||||||
android:visibility="gone" />
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="16dp" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_save"
|
android:id="@+id/action_save"
|
||||||
android:icon="@drawable/ic_check_in_box_24dp"
|
android:icon="@drawable/ic_check_32dp"
|
||||||
android:title="@string/action_save"
|
android:title="@string/action_save"
|
||||||
app:showAsAction="always" />
|
app:showAsAction="always" />
|
||||||
</menu>
|
</menu>
|
|
@ -32,6 +32,7 @@
|
||||||
<string name="title_mutes">Muted users</string>
|
<string name="title_mutes">Muted users</string>
|
||||||
<string name="title_blocks">Blocked users</string>
|
<string name="title_blocks">Blocked users</string>
|
||||||
<string name="title_follow_requests">Follow Requests</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_username_format">\@%s</string>
|
||||||
<string name="status_boosted_format">%s boosted</string>
|
<string name="status_boosted_format">%s boosted</string>
|
||||||
|
|
Loading…
Add table
Reference in a new issue