add option to allow multiple poll choices

This commit is contained in:
sk
2022-12-08 20:53:34 +01:00
parent 6fd58c9682
commit 5b28468efd
5 changed files with 75 additions and 0 deletions

View File

@@ -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 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 7zM3 6.25C3 4.455 4.455 3 6.25 3h11.5C19.545 3 21 4.455 21 6.25v11.5c0 1.795-1.455 3.25-3.25 3.25H6.25C4.455 21 3 19.545 3 17.75V6.25zM6.25 4.5C5.284 4.5 4.5 5.284 4.5 6.25v11.5c0 0.966 0.784 1.75 1.75 1.75h11.5c0.966 0 1.75-0.784 1.75-1.75V6.25c0-0.966-0.784-1.75-1.75-1.75H6.25z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -15,6 +15,7 @@
android:outlineProvider="background"
android:elevation="2dp">
<ImageView
android:id="@+id/icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_margin="16dp"

View File

@@ -129,6 +129,7 @@
android:outlineProvider="background"
android:elevation="2dp">
<ImageView
android:id="@+id/add_poll_option_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_margin="16dp"
@@ -145,6 +146,39 @@
android:textAppearance="@style/m3_label_large"
android:textColor="?android:textColorPrimary"
tools:text="Duration: 7 days"/>
<LinearLayout
android:id="@+id/poll_allow_multiple"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:layoutDirection="locale"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:background="?android:selectableItemBackground">
<CheckBox
android:id="@+id/poll_allow_multiple_checkbox"
android:clickable="false"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_marginEnd="24dp"
android:duplicateParentState="true"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="16sp"
android:singleLine="true"
android:text="@string/poll_allow_multiple" />
</LinearLayout>
</LinearLayout>
<org.joinmastodon.android.ui.views.ComposeMediaLayout

View File

@@ -397,4 +397,5 @@
<string name="login_title">Welcome Back</string>
<string name="login_subtitle">Log in with the server where you created your account.</string>
<string name="server_url">Server URL</string>
<string name="poll_allow_multiple">Allow multiple choices</string>
</resources>