Add following/followers lists

closes #25
This commit is contained in:
Grishka
2022-05-02 05:45:51 +03:00
parent 7b26649521
commit 02a1f2ef8c
16 changed files with 786 additions and 85 deletions

View File

@@ -75,80 +75,95 @@
tools:src="#0f0" />
<LinearLayout
android:id="@+id/following_btn"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentEnd="true"
android:id="@+id/profile_counters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/cover"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:padding="4dp"
android:orientation="vertical"
android:gravity="center_horizontal">
<TextView
android:id="@+id/following_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
tools:text="123"/>
<TextView
android:id="@+id/following_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_small"
tools:text="following"/>
</LinearLayout>
android:layout_toEndOf="@id/avatar_border"
android:gravity="end">
<LinearLayout
android:id="@+id/followers_btn"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_toStartOf="@id/following_btn"
android:layout_below="@id/cover"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:padding="4dp"
android:orientation="vertical"
android:gravity="center_horizontal">
<TextView
android:id="@+id/followers_count"
<LinearLayout
android:id="@+id/posts_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
tools:text="123"/>
<TextView
android:id="@+id/followers_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_small"
tools:text="following"/>
</LinearLayout>
android:layout_height="56dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:gravity="center_horizontal"
android:orientation="vertical"
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"
android:singleLine="true"
android:ellipsize="end"
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"
android:singleLine="true"
android:ellipsize="middle"
tools:text="posts" />
</LinearLayout>
<LinearLayout
android:id="@+id/posts_btn"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_below="@id/cover"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:layout_toStartOf="@id/followers_btn"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="4dp">
<TextView
android:id="@+id/posts_count"
<LinearLayout
android:id="@+id/following_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
tools:text="123" />
android:layout_height="56dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="16dp"
android:padding="4dp"
android:orientation="vertical"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center_horizontal">
<TextView
android:id="@+id/following_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
android:singleLine="true"
android:ellipsize="end"
tools:text="123"/>
<TextView
android:id="@+id/following_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_small"
android:singleLine="true"
android:ellipsize="middle"
tools:text="following"/>
</LinearLayout>
<TextView
android:id="@+id/posts_label"
<LinearLayout
android:id="@+id/followers_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_small"
tools:text="following" />
android:layout_height="56dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:padding="4dp"
android:orientation="vertical"
android:background="?android:selectableItemBackgroundBorderless"
android:gravity="center_horizontal">
<TextView
android:id="@+id/followers_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_large"
android:singleLine="true"
android:ellipsize="end"
tools:text="123"/>
<TextView
android:id="@+id/followers_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/m3_title_small"
android:singleLine="true"
android:ellipsize="middle"
tools:text="followers"/>
</LinearLayout>
</LinearLayout>
<FrameLayout
@@ -156,7 +171,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@id/following_btn"
android:layout_below="@id/profile_counters"
android:padding="16dp"
android:clipToPadding="false">
<org.joinmastodon.android.ui.views.ProgressBarButton

View File

@@ -0,0 +1,62 @@
<?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:layout_width="match_parent"
android:layout_height="62dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:clipToPadding="false">
<ImageView
android:id="@+id/avatar"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_marginEnd="10dp"
android:importantForAccessibility="no"
tools:src="#0f0"/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="8dp"
tools:text="Follow"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_toEndOf="@id/avatar"
android:layout_toStartOf="@id/button"
android:singleLine="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:textAppearance="@style/m3_title_medium"
tools:text="User"/>
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_below="@id/name"
android:layout_toEndOf="@id/avatar"
android:layout_toStartOf="@id/button"
android:singleLine="true"
android:ellipsize="end"
android:gravity="center_vertical"
android:textAppearance="@style/m3_title_small"
tools:text="\@user@server"/>
<View
android:id="@+id/menu_anchor"
android:layout_width="1px"
android:layout_height="1px"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="-16dp"/>
</RelativeLayout>

View File

@@ -11,14 +11,14 @@
<string name="ok">OK</string>
<string name="preparing_auth">Preparing for authentication…</string>
<string name="finishing_auth">Finishing authentication…</string>
<string name="user_boosted">%s boosted</string>
<string name="user_boosted">%s reblogged</string>
<string name="in_reply_to">In reply to %s</string>
<string name="notifications">Notifications</string>
<string name="user_followed_you">followed you</string>
<string name="user_sent_follow_request">sent you a follow request</string>
<string name="user_favorited">favorited your toot</string>
<string name="notification_boosted">boosted your toot</string>
<string name="notification_boosted">reblogged your post</string>
<string name="poll_ended">poll ended</string>
<string name="time_seconds">%ds</string>
@@ -227,7 +227,7 @@
<string name="skip">Skip</string>
<string name="notification_type_follow">New followers</string>
<string name="notification_type_favorite">Favorites</string>
<string name="notification_type_reblog">Boosts</string>
<string name="notification_type_reblog">Reblogs</string>
<string name="notification_type_mention">Mentions</string>
<string name="notification_type_poll">Polls</string>
<string name="choose_account">Choose account</string>
@@ -290,8 +290,8 @@
<string name="unfollowed_user">Unfollowed %s</string>
<string name="followed_user">You\'re now following %s</string>
<string name="open_in_browser">Open in browser</string>
<string name="hide_boosts_from_user">Hide boosts from %s</string>
<string name="show_boosts_from_user">Show boosts from %s</string>
<string name="hide_boosts_from_user">Hide reblogs from %s</string>
<string name="show_boosts_from_user">Show reblogs from %s</string>
<string name="signup_reason">why do you want to join?</string>
<string name="signup_reason_note">This will help us review your application.</string>
<string name="clear">Clear</string>
@@ -320,4 +320,22 @@
<string name="manually_approves_followers">Manually approves followers</string>
<string name="current_account">Current account</string>
<string name="log_out_account">Log Out %s</string>
<!-- translators: %,d is a valid placeholder, it formats the number with locale-dependent grouping separators -->
<plurals name="x_followers">
<item quantity="one">%,d follower</item>
<item quantity="other">%,d followers</item>
</plurals>
<plurals name="x_following">
<item quantity="one">%,d following</item>
<item quantity="other">%,d following</item>
</plurals>
<plurals name="x_favorites">
<item quantity="one">%,d favorite</item>
<item quantity="other">%,d favorites</item>
</plurals>
<plurals name="x_reblogs">
<item quantity="one">%,d reblog</item>
<item quantity="other">%,d reblogs</item>
</plurals>
</resources>