Drafts and scheduled posts (#217)
closes #100 closes #59 * enable saving as draft (scheduled) * add scheduled posts list * fix NoSuchMethodError * editable drafts/scheduled posts * ui for drafts * use instants between 9999-01-01 and 9999-12-31 * use save and draft strings * map scheduled status params to status * implement scheduling posts * improve save/discard draft dialog * persist scheduled date in state * add unsent posts button to toolbar * clean up imports
This commit is contained in:
@@ -229,94 +229,153 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="?colorBackgroundLightest"
|
||||
android:elevation="2dp"
|
||||
android:outlineProvider="bounds"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:layoutDirection="locale">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_media"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/add_media"
|
||||
android:tooltipText="@string/add_media"
|
||||
android:src="@drawable/ic_fluent_image_24_regular"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_poll"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/add_poll"
|
||||
android:tooltipText="@string/add_poll"
|
||||
android:src="@drawable/ic_fluent_poll_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_emoji"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/emoji"
|
||||
android:tooltipText="@string/emoji"
|
||||
android:src="@drawable/ic_fluent_emoji_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_spoiler"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/content_warning"
|
||||
android:tooltipText="@string/content_warning"
|
||||
android:src="@drawable/ic_fluent_chat_warning_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_visibility"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/post_visibility"
|
||||
android:tooltipText="@string/post_visibility"
|
||||
android:src="@drawable/ic_fluent_earth_24_regular"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="0px"
|
||||
android:layout_height="1px"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/char_counter"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/schedule_draft_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="500"/>
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="48dp"
|
||||
android:paddingTop="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/schedule_draft_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/sk_compose_draft" />
|
||||
<Button
|
||||
android:id="@+id/scheduled_time_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:textSize="14sp"
|
||||
android:minHeight="48dp"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:background="@drawable/bg_text_button"
|
||||
android:fontFamily="sans-serif"
|
||||
android:drawableStart="@drawable/ic_fluent_clock_20_regular"
|
||||
android:drawablePadding="8dp"
|
||||
android:drawableTint="?android:textColorSecondary"
|
||||
tools:text="Dec 12, 2021, 12:42 PM"/>
|
||||
<ImageButton
|
||||
android:id="@+id/schedule_draft_dismiss"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="-4dp"
|
||||
android:src="@drawable/ic_fluent_dismiss_20_filled"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:padding="4dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_media"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/add_media"
|
||||
android:tooltipText="@string/add_media"
|
||||
android:src="@drawable/ic_fluent_image_24_regular"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_poll"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/add_poll"
|
||||
android:tooltipText="@string/add_poll"
|
||||
android:src="@drawable/ic_fluent_poll_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_emoji"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/emoji"
|
||||
android:tooltipText="@string/emoji"
|
||||
android:src="@drawable/ic_fluent_emoji_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_spoiler"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/content_warning"
|
||||
android:tooltipText="@string/content_warning"
|
||||
android:src="@drawable/ic_fluent_chat_warning_24_selector"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_visibility"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/post_visibility"
|
||||
android:tooltipText="@string/post_visibility"
|
||||
android:src="@drawable/ic_fluent_earth_24_regular"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/btn_schedule"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:padding="0px"
|
||||
android:tint="@color/compose_button"
|
||||
android:tintMode="src_in"
|
||||
android:contentDescription="@string/sk_draft_or_schedule"
|
||||
android:tooltipText="@string/sk_draft_or_schedule"
|
||||
android:src="@drawable/ic_fluent_clock_24_selector"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="0px"
|
||||
android:layout_height="1px"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/char_counter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/m3_body_large"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="500"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</org.joinmastodon.android.ui.views.SizeListenerLinearLayout>
|
||||
Reference in New Issue
Block a user