Implement media tab (#430)
This commit is contained in:
parent
a934582025
commit
dc1a60cc12
18 changed files with 597 additions and 189 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="false" android:color="?android:attr/textColorTertiary"/>
|
||||
<item android:state_selected="true" android:color="?attr/colorAccent"/>
|
||||
<item android:state_pressed="false" android:color="?android:attr/textColorPrimary"/>
|
||||
<item android:state_pressed="true" android:color="?android:attr/textColorTertiary"/>
|
||||
</selector>
|
|
@ -40,7 +40,7 @@
|
|||
android:scaleType="centerCrop"
|
||||
app:layout_collapseMode="pin" />
|
||||
|
||||
<RelativeLayout
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:id="@+id/account_header_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -54,71 +54,67 @@
|
|||
android:id="@+id/account_avatar"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_toLeftOf="@+id/follow_btn"
|
||||
android:layout_toStartOf="@+id/follow_btn"
|
||||
android:src="@drawable/avatar_default"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shadow="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/follow_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="6dp" />
|
||||
android:layout_marginTop="6dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/account_follows_you"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/follow_btn"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/follows_you"
|
||||
android:textColor="?android:textColorPrimary" />
|
||||
android:textColor="?android:textColorPrimary"
|
||||
app:layout_constraintEnd_toEndOf="@id/follow_btn"
|
||||
app:layout_constraintTop_toBottomOf="@id/follow_btn" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/account_display_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/account_avatar"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="normal|bold"
|
||||
app:layout_constraintTop_toBottomOf="@id/account_avatar"
|
||||
tools:text="Tusky Mastodon Client" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/account_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/account_display_name"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
app:layout_constraintTop_toBottomOf="@id/account_display_name"
|
||||
tools:text="\@Tusky" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/account_locked"
|
||||
android:layout_width="16sp"
|
||||
android:layout_height="16sp"
|
||||
android:layout_alignBottom="@id/account_username"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_toEndOf="@id/account_username"
|
||||
android:layout_toRightOf="@id/account_username"
|
||||
android:contentDescription="@string/description_account_locked"
|
||||
android:tint="?android:textColorSecondary"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@drawable/reblog_disabled_light" />
|
||||
app:layout_constraintBottom_toBottomOf="@id/account_username"
|
||||
app:layout_constraintLeft_toRightOf="@id/account_username"
|
||||
app:srcCompat="@drawable/reblog_disabled_light"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/account_note"
|
||||
|
@ -128,9 +124,46 @@
|
|||
android:paddingBottom="16dp"
|
||||
android:paddingTop="10dp"
|
||||
android:textColor="?android:textColorTertiary"
|
||||
app:layout_constraintTop_toBottomOf="@id/account_username"
|
||||
tools:text="This is a test description" />
|
||||
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/followers_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/account_note"
|
||||
tools:text="3000 Followers"
|
||||
android:background="@android:color/transparent"
|
||||
android:textColor="@color/account_tab_font_color"
|
||||
app:layout_constraintHorizontal_bias="0"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/following_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/followers_tv"
|
||||
app:layout_constraintEnd_toStartOf="@id/statuses_btn"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintStart_toEndOf="@id/followers_tv"
|
||||
app:layout_constraintTop_toTopOf="@id/followers_tv"
|
||||
tools:text="500 Following"
|
||||
android:textColor="@color/account_tab_font_color" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/statuses_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@id/following_tv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/followers_tv"
|
||||
tools:text="3000 Posts"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
android:textColor="@color/account_tab_font_color"/>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -158,12 +191,8 @@
|
|||
android:id="@+id/tab_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabBackground="?android:colorBackground"
|
||||
app:tabGravity="fill">
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
android:background="?android:colorBackground"
|
||||
app:tabSelectedTextColor="?attr/colorAccent" >
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -1,26 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<android.support.v7.widget.AppCompatTextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@color/account_tab_font_color"
|
||||
android:textStyle="normal|bold" />
|
||||
android:textStyle="normal|bold"
|
||||
tools:text="Followers"
|
||||
android:singleLine="true"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="12sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
app:autoSizeStepGranularity="2sp"
|
||||
android:textAlignment="center"
|
||||
android:ellipsize="middle"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/total"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/title"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textColor="@color/account_tab_font_color"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
tools:text="2,412"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
|
@ -218,6 +218,7 @@
|
|||
|
||||
<string name="follows_you">Подписан(а) на вас</string>
|
||||
<string name="pref_title_alway_show_sensitive_media">Всегда показывать NSFW-контент</string>
|
||||
<string name="title_media">Медиа</string>
|
||||
<string name="replying_to">Ответ @%s</string>
|
||||
|
||||
|
||||
|
|
4
app/src/main/res/values-small/integer.xml
Normal file
4
app/src/main/res/values-small/integer.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="profile_media_column_count">2</integer>
|
||||
</resources>
|
4
app/src/main/res/values/integers.xml
Normal file
4
app/src/main/res/values/integers.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<integer name="profile_media_column_count">3</integer>
|
||||
</resources>
|
|
@ -33,6 +33,9 @@
|
|||
<string name="title_follow_requests">Follow Requests</string>
|
||||
<string name="title_edit_profile">Edit your profile</string>
|
||||
<string name="title_saved_toot">Drafts</string>
|
||||
<string name="title_x_followers"><b>%d</b> Followers</string>
|
||||
<string name="title_x_following"><b>%d</b> Following</string>
|
||||
<string name="title_x_statuses"><b>%d</b> Posts</string>
|
||||
|
||||
<string name="status_username_format">\@%s</string>
|
||||
<string name="status_boosted_format">%s boosted</string>
|
||||
|
@ -232,6 +235,7 @@
|
|||
|
||||
<string name="follows_you">Follows you</string>
|
||||
<string name="pref_title_alway_show_sensitive_media">Always show all nsfw content</string>
|
||||
<string name="title_media">Media</string>
|
||||
<string name="replying_to">Replying to @%s</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue