Merge pull request #200

Feat: Instance info
This commit is contained in:
LucasGGamerM
2023-05-23 20:08:36 -03:00
committed by GitHub
19 changed files with 957 additions and 12 deletions

View File

@@ -0,0 +1,9 @@
<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="M13.25,14.5C13.25,15.052 12.802,15.5 12.25,15.5C11.698,15.5 11.25,15.052 11.25,14.5C11.25,13.948 11.698,13.5 12.25,13.5C12.802,13.5 13.25,13.948 13.25,14.5ZM11.5,6.75L11.5,11.75C11.5,12.164 11.836,12.5 12.25,12.5C12.664,12.5 13,12.164 13,11.75V6.75C13,6.336 12.664,6 12.25,6C11.836,6 11.5,6.336 11.5,6.75ZM4,4.5C4,3.119 5.119,2 6.5,2H18C19.381,2 20.5,3.119 20.5,4.5V18.75C20.5,19.164 20.164,19.5 19.75,19.5H5.5C5.5,20.052 5.948,20.5 6.5,20.5H19.75C20.164,20.5 20.5,20.836 20.5,21.25C20.5,21.664 20.164,22 19.75,22H6.5C5.119,22 4,20.881 4,19.5V4.5ZM19,18V4.5C19,3.948 18.552,3.5 18,3.5H6.5C5.948,3.5 5.5,3.948 5.5,4.5V18H19Z"
android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="28dp" android:height="28dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M3.75 5C3.336 5 3 5.336 3 5.75V11c0 5.001 2.958 8.676 8.725 10.948 0.177 0.07 0.373 0.07 0.55 0 0.144-0.057 0.286-0.114 0.426-0.173-0.659-0.475-1.225-1.071-1.667-1.756C6.64 17.962 4.5 14.975 4.5 11V6.478c2.577-0.152 5.08-1.09 7.5-2.8 2.42 1.71 4.923 2.648 7.5 2.8v4.254c0.54 0.282 1.037 0.638 1.475 1.054C20.992 11.528 21 11.266 21 11V5.75C21 5.336 20.664 5 20.25 5c-2.663 0-5.258-0.944-7.8-2.85-0.267-0.2-0.633-0.2-0.9 0C9.008 4.056 6.413 5 3.75 5zM16.5 22c3.038 0 5.5-2.462 5.5-5.5S19.538 11 16.5 11 11 13.462 11 16.5s2.462 5.5 5.5 5.5zm-3.309-3.252c-0.436-0.64-0.691-1.415-0.691-2.248 0-2.21 1.79-4 4-4 0.834 0 1.608 0.255 2.248 0.691l-5.557 5.557zm1.06 1.06l5.558-5.556c0.436 0.64 0.691 1.414 0.691 2.248 0 2.21-1.79 4-4 4-0.834 0-1.607-0.255-2.248-0.691z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<me.grishka.appkit.views.RecursiveSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:id="@id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false">
<org.joinmastodon.android.ui.views.CoverImageView
android:id="@+id/cover"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="?profileHeaderBackground"
android:contentDescription="@string/profile_header"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/text_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/cover"
android:layout_alignParentStart="true"
android:orientation="vertical">
<TextView
android:id="@+id/uri"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp"
android:textAlignment="viewStart"
android:textAppearance="@style/m3_headline_small"
tools:text="floss.social" />
<org.joinmastodon.android.ui.views.UntouchableScrollView
android:id="@+id/text_scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadingEdgeLength="36dp"
android:requiresFadingEdge="vertical"
android:scrollbars="none">
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:textAppearance="@style/m3_body_large"
android:textSize="16sp" />
</org.joinmastodon.android.ui.views.UntouchableScrollView>
<Button
android:id="@+id/read_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:background="@drawable/bg_text_button"
android:importantForAccessibility="no"
android:paddingHorizontal="8dp"
android:text="@string/sk_expand"
android:textAllCaps="true"
android:textAppearance="@style/m3_label_medium"
android:textColor="?android:textColorSecondary"
android:visibility="gone" />
</LinearLayout>
<View
android:id="@+id/border_top"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_below="@id/text_wrap"
android:layout_marginTop="16dp"
android:background="?attr/colorPollVoted" />
<me.grishka.appkit.views.UsableRecyclerView
android:id="@+id/metadata"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/border_top"
android:background="?colorBackgroundLightest"
android:paddingTop="4dp" />
</RelativeLayout>
</ScrollView>
</me.grishka.appkit.views.RecursiveSwipeRefreshLayout>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingEnd="24dp"
android:paddingBottom="12dp"
android:paddingStart="12dp"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView android:id="@+id/instance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorPrimary"
android:ellipsize="marquee"
android:fadingEdge="horizontal" />
<TextView android:id="@+id/reason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/instance"
android:layout_alignStart="@id/instance"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="4" />
</RelativeLayout>
<ImageView
android:id="@+id/severity"
android:src="@drawable/ic_fluent_speaker_mute_28_regular"
android:contentDescription="@string/mo_severity_silence"
android:minHeight="32dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open_timeline" android:title="@string/mo_instance_info_open_timeline" android:icon="@drawable/ic_fluent_timeline_24_regular"/>
<item android:id="@+id/rules" android:title="@string/instance_rules_title" android:icon="@drawable/ic_fluent_task_list_ltr_24_regular"/>
<item android:id="@+id/moderated_servers" android:title="@string/mo_instance_info_moderated_servers" android:icon="@drawable/ic_fluent_book_exclamation_mark_24_regular"/>
</menu>

View File

@@ -3,4 +3,6 @@
<dimen name="text_max_height">220dp</dimen>
<dimen name="text_collapsed_height">145dp</dimen>
<dimen name="layout_max_width">450dp</dimen>
<dimen name="description_max_height">1000dp</dimen>
<dimen name="description_collapsed_height">445dp</dimen>
</resources>

View File

@@ -57,4 +57,16 @@
<string name="mo_mention_reblogger_automatically">Automatically mention account who reblogged the post in replies</string>
<string name="mo_confirm_unfollow_title">Unfollow Account</string>
<string name="mo_confirm_unfollow">Confirm to unfollow %s</string>
<string name="mo_instance_admin">Administered by</string>
<string name="mo_instance_contact">Contact</string>
<string name="mo_instance_users">Users</string>
<string name="mo_instance_status">Status</string>
<string name="mo_instance_registration">Registration</string>
<string name="mo_instance_registration_open">Open</string>
<string name="mo_instance_registration_approval">Approval required</string>
<string name="mo_instance_info_open_timeline">Local timeline</string>
<string name="mo_instance_info_moderated_servers">Moderated servers</string>
<string name="mo_severity_silence">Silenced</string>
<string name="mo_severity_suspend">Blocked</string>
</resources>