Profile editing
This commit is contained in:
14
mastodon/src/main/res/drawable/bg_button_secondary.xml
Normal file
14
mastodon/src/main/res/drawable/bg_button_secondary.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<ripple android:color="@color/highlight_over_dark">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/gray_600"/>
|
||||
<corners android:radius="10dp"/>
|
||||
<padding android:left="16dp" android:right="16dp" android:top="8dp" android:bottom="8dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_focused="true">
|
||||
<layer-list>
|
||||
<item android:gravity="bottom">
|
||||
<shape>
|
||||
<size android:height="1dp"/>
|
||||
<solid android:color="@color/primary_700"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
</item>
|
||||
</selector>
|
||||
12
mastodon/src/main/res/drawable/edit_avatar_overlay.xml
Normal file
12
mastodon/src/main/res/drawable/edit_avatar_overlay.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:tint="@color/gray_800">
|
||||
<solid android:color="#CC000000"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@drawable/ic_fluent_image_edit_24_regular"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:gravity="center"/>
|
||||
</layer-list>
|
||||
11
mastodon/src/main/res/drawable/edit_text_border.xml
Normal file
11
mastodon/src/main/res/drawable/edit_text_border.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/gray_200"/>
|
||||
<stroke android:color="@color/gray_400" android:width="1dp"/>
|
||||
<corners android:radius="4dp"/>
|
||||
<padding android:left="8dp" android:top="8dp" android:right="8dp" android:bottom="8dp"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 1.5c-4.694 0-8.5 3.806-8.5 8.5s3.806 8.5 8.5 8.5 8.5-3.806 8.5-8.5-3.806-8.5-8.5-8.5zM12 7c0.414 0 0.75 0.336 0.75 0.75v3.5h3.5c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75h-3.5v3.5c0 0.414-0.336 0.75-0.75 0.75s-0.75-0.336-0.75-0.75v-3.5h-3.5C7.336 12.75 7 12.414 7 12s0.336-0.75 0.75-0.75h3.5v-3.5C11.25 7.336 11.586 7 12 7z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M20.998 6.25c0-1.795-1.454-3.25-3.25-3.25H6.25C4.455 3 3 4.455 3 6.25v11.499c0 1.795 1.455 3.25 3.25 3.25h4.914l0.356-1.424 0.02-0.076H6.25c-0.204 0-0.4-0.035-0.582-0.1l5.807-5.685 0.083-0.07c0.291-0.213 0.7-0.19 0.966 0.07l2.079 2.036 1.06-1.06-2.09-2.048-0.128-0.116c-0.878-0.738-2.187-0.7-3.02 0.116l-5.822 5.7C4.536 18.157 4.5 17.957 4.5 17.75V6.25c0-0.966 0.783-1.75 1.75-1.75h11.499c0.966 0 1.75 0.784 1.75 1.75v4.983c0.478-0.19 0.993-0.264 1.5-0.22V6.25zm-3.495 2.502c0-1.244-1.008-2.252-2.252-2.252-1.244 0-2.252 1.008-2.252 2.252 0 1.243 1.008 2.252 2.252 2.252 1.244 0 2.252-1.009 2.252-2.252zm-3.004 0C14.499 8.336 14.836 8 15.251 8s0.752 0.336 0.752 0.752c0 0.415-0.337 0.752-0.752 0.752s-0.752-0.337-0.752-0.752zm4.6 3.917l-5.902 5.901c-0.345 0.345-0.589 0.776-0.707 1.248l-0.457 1.83c-0.2 0.797 0.522 1.518 1.318 1.319l1.83-0.458c0.472-0.118 0.904-0.362 1.248-0.706L22.33 15.9c0.892-0.893 0.892-2.34 0-3.232-0.893-0.893-2.34-0.893-3.233 0z" android:fillColor="@color/gray_25"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,3 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M15.5 17c0.828 0 1.5 0.672 1.5 1.5S16.328 20 15.5 20 14 19.328 14 18.5s0.672-1.5 1.5-1.5zm-7 0c0.828 0 1.5 0.672 1.5 1.5S9.328 20 8.5 20 7 19.328 7 18.5 7.672 17 8.5 17zm7-7c0.828 0 1.5 0.672 1.5 1.5S16.328 13 15.5 13 14 12.328 14 11.5s0.672-1.5 1.5-1.5zm-7 0c0.828 0 1.5 0.672 1.5 1.5S9.328 13 8.5 13 7 12.328 7 11.5 7.672 10 8.5 10zm7-7C16.328 3 17 3.672 17 4.5S16.328 6 15.5 6 14 5.328 14 4.5 14.672 3 15.5 3zm-7 0C9.328 3 10 3.672 10 4.5S9.328 6 8.5 6 7 5.328 7 4.5 7.672 3 8.5 3z" android:fillColor="@color/fluent_default_icon_tint"/>
|
||||
</vector>
|
||||
@@ -45,6 +45,7 @@
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="-38dp"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="#0f0" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -101,25 +102,27 @@
|
||||
android:id="@+id/posts_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="56dp"
|
||||
android:layout_toStartOf="@id/followers_btn"
|
||||
android:layout_below="@id/cover"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:padding="4dp"
|
||||
android:layout_toStartOf="@id/followers_btn"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal">
|
||||
android:padding="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/posts_count"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_large"
|
||||
tools:text="123"/>
|
||||
tools:text="123" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/posts_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_title_small"
|
||||
tools:text="following"/>
|
||||
tools:text="following" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
@@ -137,11 +140,11 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/avatar"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/profile_action_btn"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_toStartOf="@id/profile_action_btn"
|
||||
android:textAppearance="@style/m3_headline_small"
|
||||
tools:text="Eugen"/>
|
||||
tools:text="Eugen" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
@@ -165,6 +168,36 @@
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
tools:text="Founder, CEO and lead developer @Mastodon, Germany." />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/avatar"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_toStartOf="@id/profile_action_btn"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:background="@drawable/edit_text_border"
|
||||
android:inputType="textPersonName|textCapWords"
|
||||
android:visibility="gone"
|
||||
tools:text="Eugen" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/bio_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/username"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:background="@null"
|
||||
android:padding="0px"
|
||||
android:inputType="textMultiLine|textCapSentences"
|
||||
android:visibility="gone"
|
||||
tools:text="Founder, CEO and lead developer @Mastodon, Germany." />
|
||||
|
||||
</RelativeLayout>
|
||||
<org.joinmastodon.android.ui.tabs.TabLayout
|
||||
android:id="@+id/tabbar"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/gray_50"
|
||||
android:elevation="3dp"
|
||||
android:elevation="2dp"
|
||||
android:outlineProvider="background"
|
||||
android:padding="16dp">
|
||||
|
||||
|
||||
16
mastodon/src/main/res/layout/item_profile_about_add_row.xml
Normal file
16
mastodon/src/main/res/layout/item_profile_about_add_row.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:elevation="2dp"
|
||||
android:outlineProvider="background">
|
||||
|
||||
<View
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/gray_900"
|
||||
android:background="@drawable/ic_fluent_add_circle_24_regular"/>
|
||||
|
||||
</FrameLayout>
|
||||
47
mastodon/src/main/res/layout/item_profile_about_editable.xml
Normal file
47
mastodon/src/main/res/layout/item_profile_about_editable.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/gray_50"
|
||||
android:elevation="2dp"
|
||||
android:outlineProvider="background"
|
||||
android:padding="16dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toStartOf="@id/dragger_thingy"
|
||||
android:textAppearance="@style/m3_label_medium"
|
||||
android:background="@drawable/bg_profile_field_edit_text"
|
||||
android:hint="@string/field_label"
|
||||
android:minHeight="16dp"
|
||||
android:inputType="textCapSentences"
|
||||
tools:text="Field title"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_toStartOf="@id/dragger_thingy"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:background="@drawable/bg_profile_field_edit_text"
|
||||
android:hint="@string/field_content"
|
||||
android:inputType="textCapSentences"
|
||||
tools:text="Field value"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/dragger_thingy"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="-16dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignBottom="@id/value"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_fluent_re_order_dots_vertical_24_regular"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -15,8 +15,13 @@
|
||||
<color name="gray_50">#F9FAFB</color>
|
||||
<color name="gray_100">#F2F4F7</color>
|
||||
<color name="gray_200">#E4E7EC</color>
|
||||
<color name="gray_800">#282C37</color>
|
||||
<color name="gray_400">#98A2B3</color>
|
||||
<color name="gray_500">#667085</color>
|
||||
<color name="gray_600">#475467</color>
|
||||
<color name="gray_800">#282C37</color>
|
||||
<color name="gray_900">#101828</color>
|
||||
|
||||
<color name="primary_700">#2B90D9</color>
|
||||
|
||||
<color name="gray_800_alpha50">#80282C37</color>
|
||||
<color name="light_ui_action_button">#606984</color>
|
||||
|
||||
@@ -67,4 +67,9 @@
|
||||
<item quantity="other">%,d posts</item>
|
||||
</plurals>
|
||||
<string name="profile_joined">Joined</string>
|
||||
<string name="done">Done</string>
|
||||
<string name="loading">Loading…</string>
|
||||
<string name="field_label">Label</string>
|
||||
<string name="field_content">Content</string>
|
||||
<string name="saving">Saving…</string>
|
||||
</resources>
|
||||
@@ -44,6 +44,10 @@
|
||||
<item name="android:minWidth">0px</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Mastodon.Button.Secondary">
|
||||
<item name="android:background">@drawable/bg_button_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Mastodon.Dialog.Alert" parent="android:Theme.Material.Light.Dialog.Alert">
|
||||
<item name="android:windowTitleStyle">@style/alert_title</item>
|
||||
<item name="android:dialogPreferredPadding">24dp</item>
|
||||
|
||||
Reference in New Issue
Block a user