aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorratabb <ratabilabagi@gmail.com>2021-10-30 07:19:35 +0000
committerratabb <ratabilabagi@gmail.com>2021-10-30 07:19:35 +0000
commitb1d8ad5c760746b604b5ee69cebf5b1214986f9b (patch)
tree6ab807e603d094115c14dfba0907508536c948e9 /app/src/main/res
parentefd5f618892a088fc9bc14530bbc1b80d0d9b561 (diff)
downloadinfinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar.gz
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar.bz2
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar.lz
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar.xz
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.tar.zst
infinity-for-reddit-b1d8ad5c760746b604b5ee69cebf5b1214986f9b.zip
feat: add Edit Profile
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/drawable/ic_dot_outline.xml9
-rw-r--r--app/src/main/res/layout/activity_edit_profile.xml169
-rw-r--r--app/src/main/res/menu/edit_profile_activity.xml11
-rw-r--r--app/src/main/res/menu/view_user_detail_activity.xml5
-rw-r--r--app/src/main/res/values/strings.xml25
5 files changed, 219 insertions, 0 deletions
diff --git a/app/src/main/res/drawable/ic_dot_outline.xml b/app/src/main/res/drawable/ic_dot_outline.xml
new file mode 100644
index 00000000..dd9c5588
--- /dev/null
+++ b/app/src/main/res/drawable/ic_dot_outline.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="oval"
+ android:tint="?attr/colorOnPrimary">
+ <size
+ android:width="24dp"
+ android:height="24dp" />
+ <solid android:color="#7F000000" />
+</shape>
diff --git a/app/src/main/res/layout/activity_edit_profile.xml b/app/src/main/res/layout/activity_edit_profile.xml
new file mode 100644
index 00000000..6f472c9b
--- /dev/null
+++ b/app/src/main/res/layout/activity_edit_profile.xml
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout 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:id="@+id/root_layout_view_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context=".activities.EditProfileActivity">
+
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout_view_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_view_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/actionBarSize"
+ app:navigationIcon="?attr/homeAsUpIndicator"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:title="@string/action_edit_profile" />
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:id="@+id/content_view_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <FrameLayout
+ android:id="@+id/frame_layout_view_banner_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp">
+
+ <ImageView
+ android:id="@+id/image_view_banner_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="180dp"
+ android:contentDescription="@null"
+ android:scaleType="centerCrop"
+ tools:src="@tools:sample/backgrounds/scenic" />
+
+ <ImageView
+ android:id="@+id/image_view_change_banner_edit_profile_activity"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_gravity="end|bottom"
+ android:layout_margin="4dp"
+ android:background="@drawable/ic_dot_outline"
+ android:contentDescription="@null"
+ android:padding="4dp"
+ app:srcCompat="@drawable/ic_outline_add_a_photo_day_night_24dp" />
+ </FrameLayout>
+
+ <FrameLayout
+ android:id="@+id/frame_layout_view_avatar_edit_profile_activity"
+ android:layout_width="74dp"
+ android:layout_height="74dp"
+ android:layout_marginStart="24dp"
+ android:layout_marginTop="143dp"
+ android:elevation="4dp">
+
+ <ImageView
+ android:id="@+id/image_view_avatar_edit_profile_activity"
+ android:layout_width="74dp"
+ android:layout_height="74dp"
+ android:contentDescription="@null"
+ tools:src="@tools:sample/avatars" />
+
+ <ImageView
+ android:id="@+id/image_view_change_avatar_edit_profile_activity"
+ android:layout_width="32dp"
+ android:layout_height="32dp"
+ android:layout_gravity="end|bottom"
+ android:layout_margin="4dp"
+ android:background="@drawable/ic_dot_outline"
+ android:contentDescription="@null"
+ android:padding="4dp"
+ app:srcCompat="@drawable/ic_outline_add_a_photo_day_night_24dp" />
+ </FrameLayout>
+ </FrameLayout>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_margin="8dp"
+ android:background="?dividerVertical" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"
+ android:orientation="vertical"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:text="@string/display_name_text"
+ android:textSize="?attr/font_18" />
+
+ <EditText
+ android:id="@+id/edit_text_display_name_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="top"
+ android:hint="@string/display_name_hint"
+ android:importantForAutofill="no"
+ android:inputType="textCapSentences"
+ android:lines="1"
+ android:maxLength="30"
+ android:maxLines="1"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:paddingBottom="16dp" />
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/display_name_description" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"
+ android:orientation="vertical"
+ android:padding="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fontFamily="?attr/font_family"
+ android:text="@string/about_you_text"
+ android:textSize="?attr/font_18" />
+
+ <EditText
+ android:id="@+id/edit_text_about_you_edit_profile_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="top"
+ android:hint="@string/about_you_hint"
+ android:importantForAutofill="no"
+ android:inputType="textCapSentences|textMultiLine"
+ android:lines="4"
+ android:maxLength="200"
+ android:maxLines="4"
+ android:paddingStart="16dp"
+ android:paddingEnd="16dp"
+ android:paddingBottom="16dp" />
+
+ </LinearLayout>
+ </LinearLayout>
+ </ScrollView>
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/menu/edit_profile_activity.xml b/app/src/main/res/menu/edit_profile_activity.xml
new file mode 100644
index 00000000..fe96ba20
--- /dev/null
+++ b/app/src/main/res/menu/edit_profile_activity.xml
@@ -0,0 +1,11 @@
+<menu 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"
+ tools:application="ml.docilealligator.infinityforreddit.activities.EditProfileActivity">
+ <item
+ android:id="@+id/action_save_edit_profile_activity"
+ android:orderInCategory="1"
+ android:title="@string/action_save"
+ android:icon="@drawable/ic_save_to_database_24dp"
+ app:showAsAction="ifRoom" />
+</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/view_user_detail_activity.xml b/app/src/main/res/menu/view_user_detail_activity.xml
index 437c6e23..ec9128e4 100644
--- a/app/src/main/res/menu/view_user_detail_activity.xml
+++ b/app/src/main/res/menu/view_user_detail_activity.xml
@@ -59,4 +59,9 @@
android:id="@+id/action_block_user_view_user_detail_activity"
android:orderInCategory="10"
android:title="@string/action_block_user" />
+
+ <item
+ android:id="@+id/action_edit_profile_view_user_detail_activity"
+ android:orderInCategory="11"
+ android:title="@string/action_edit_profile" />
</menu>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6a5890c7..3b8753e8 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1215,4 +1215,29 @@
<string name="app_lock_timeout_12_hours">12 hours</string>
<string name="app_lock_timeout_24_hours">24 hours</string>
+ <!--EditProfileService Notification-->
+ <string name="submit_change_avatar">Submit Change Avatar</string>
+ <string name="submit_change_banner">Submit Change Banner</string>
+ <string name="submit_save_profile">Submit Save Profile</string>
+
+ <!--EditProfileActivity-->
+ <string name="action_edit_profile">Edit Profile</string>
+ <string name="remove_avatar">Remove Avatar</string>
+ <string name="remove_banner">Remove Banner</string>
+ <string name="display_name_text">Display Name</string>
+ <string name="display_name_hint">Show on your profile page</string>
+ <string name="display_name_description">This will be displayed to viewer of your profile page and does not change your username</string>
+ <string name="about_you_text">About You</string>
+ <string name="about_you_hint">A little description of your self</string>
+ <string name="message_remove_avatar_success">Success remove Avatar</string>
+ <string name="message_remove_avatar_failed_fmt">Failed remove Avatar %s</string>
+ <string name="message_remove_banner_success">Success remove Banner</string>
+ <string name="message_remove_banner_failed_fmt">Failed remove Banner %s</string>
+ <string name="message_change_avatar_success">Success changing Avatar</string>
+ <string name="message_change_avatar_failed_fmt">Failed changing Avatar %s</string>
+ <string name="message_change_banner_success">Success changing Banner</string>
+ <string name="message_change_banner_failed_fmt">Failed changing Banner %s</string>
+ <string name="message_save_profile_success">Success save profile</string>
+ <string name="message_save_profile_failed_fmt">Failed save profile %s</string>
+
</resources>