feat(instance-info): add options menu

This commit is contained in:
FineFindus
2023-05-22 20:21:11 +02:00
parent 936a86acd7
commit 0b08072dfc
7 changed files with 60 additions and 122 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="M4,4.5v15A2.5,2.5 0,0 0,6.5 22h13.25a0.75,0.75 0,0 0,0 -1.5L6.5,20.5a1,1 0,0 1,-1 -1h14.25a0.75,0.75 0,0 0,0.75 -0.75L20.5,4.5A2.5,2.5 0,0 0,18 2L6.5,2A2.5,2.5 0,0 0,4 4.5ZM11.5,11.75v-5a0.75,0.75 0,0 1,1.5 0v5a0.75,0.75 0,0 1,-1.5 0ZM13.25,14.5a1,1 0,1 1,-2 0,1 1,0 0,1 2,0Z"
android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -6,6 +6,7 @@
android:layout_height="match_parent">
<ScrollView
android:id="@id/scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@@ -96,90 +97,6 @@
android:layout_below="@id/border_top"
android:background="?colorBackgroundLightest"
android:paddingTop="4dp" />
<org.joinmastodon.android.ui.views.AutoOrientationLinearLayout
android:id="@+id/profile_counters"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/metadata"
android:background="?colorBackgroundLightest"
android:paddingHorizontal="8dp"
android:paddingTop="8dp">
<LinearLayout
android:id="@+id/posts_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="36dp"
android:orientation="horizontal">
<Button
android:id="@+id/timeline_btn"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
android:background="@drawable/bg_inline_button"
android:elevation="0dp"
android:ellipsize="middle"
android:fontFamily="sans-serif-medium"
android:maxWidth="140dp"
android:singleLine="true"
android:stateListAnimator="@null"
android:text="View local timeline"
android:textColor="?android:textColorPrimary"
android:textSize="16sp" />
<Button
android:id="@+id/timeline_pin_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="8dp"
android:backgroundTint="?colorBackgroundLightest"
android:contentDescription="@string/mo_personal_note_confirm"
android:drawableStart="@drawable/ic_fluent_pin_24_regular"
android:paddingHorizontal="8dp" />
</LinearLayout>
<Button
android:id="@+id/rules_btn"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
android:background="@drawable/bg_inline_button"
android:elevation="0dp"
android:ellipsize="middle"
android:fontFamily="sans-serif-medium"
android:maxWidth="140dp"
android:singleLine="true"
android:stateListAnimator="@null"
android:text="@string/instance_rules_title"
android:textColor="?android:textColorPrimary"
android:textSize="16sp" />
<Button
android:id="@+id/servers_btn"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:layout_weight="0"
android:background="@drawable/bg_inline_button"
android:elevation="0dp"
android:ellipsize="middle"
android:fontFamily="sans-serif-medium"
android:maxWidth="140dp"
android:singleLine="true"
android:stateListAnimator="@null"
android:text="Moderated servers"
android:textColor="?android:textColorPrimary"
android:textSize="16sp" />
</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>
</RelativeLayout>
</ScrollView>

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_filled"/>
</menu>

View File

@@ -57,4 +57,7 @@
<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_info_open_timeline">Local timeline</string>
<string name="mo_instance_info_moderated_servers">Moderated servers</string>
</resources>