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:
sk22
2022-12-29 16:53:18 +01:00
committed by GitHub
parent 40d44269fc
commit 9547be89e1
25 changed files with 789 additions and 138 deletions

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
<path android:pathData="M10 2c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zm0 1c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM9.5 5c0.245 0 0.45 0.177 0.492 0.41L10 5.5V10h2.5c0.276 0 0.5 0.224 0.5 0.5 0 0.245-0.177 0.45-0.41 0.492L12.5 11h-3c-0.245 0-0.45-0.177-0.492-0.41L9 10.5v-5C9 5.224 9.224 5 9.5 5z" 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="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M15.25 13.5h-4c-0.414 0-0.75-0.336-0.75-0.75v-6C10.5 6.336 10.836 6 11.25 6S12 6.336 12 6.75V12h3.25c0.414 0 0.75 0.336 0.75 0.75s-0.336 0.75-0.75 0.75zM12 2C6.478 2 2 6.478 2 12s4.478 10 10 10 10-4.478 10-10S17.522 2 12 2z" 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="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333zM11.25 6c0.38 0 0.694 0.282 0.743 0.648L12 6.75V12h3.25c0.414 0 0.75 0.336 0.75 0.75 0 0.38-0.282 0.694-0.648 0.743L15.25 13.5h-4c-0.38 0-0.694-0.282-0.743-0.648L10.5 12.75v-6C10.5 6.336 10.836 6 11.25 6z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!--~ Copyright (c) 2022. ~ Microsoft Corporation. All rights reserved.-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_fluent_clock_24_filled" android:state_activated="true"/>
<item android:drawable="@drawable/ic_fluent_clock_24_filled" android:state_checked="true"/>
<item android:drawable="@drawable/ic_fluent_clock_24_filled" android:state_selected="true"/>
<item android:drawable="@drawable/ic_fluent_clock_24_regular"/>
</selector>

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20">
<path android:pathData="M13.245 2.817L3.64 12.423 3.522 12.55c-0.185 0.22-0.322 0.48-0.398 0.76l-1.106 4.055-0.015 0.08c-0.038 0.34 0.282 0.628 0.63 0.534l4.054-1.106 0.165-0.053c0.271-0.1 0.518-0.257 0.723-0.462l9.606-9.606 0.13-0.14c0.955-1.093 0.911-2.754-0.13-3.796-1.087-1.087-2.849-1.087-3.936 0zM4.346 13.13l8.039-8.038 2.521 2.52-8.038 8.04-0.098 0.085-0.107 0.072c-0.075 0.044-0.155 0.077-0.239 0.1l-3.212 0.876 0.877-3.211 0.042-0.123c0.05-0.12 0.123-0.229 0.215-0.321zm12.128-9.606l0.11 0.12c0.584 0.7 0.547 1.744-0.11 2.402l-0.861 0.86-2.521-2.521 0.86-0.86 0.12-0.11c0.7-0.585 1.744-0.548 2.402 0.11zM11.648 3H2.5C2.224 3 2 3.224 2 3.5S2.224 4 2.5 4h8.148l1-1zm-3 3H2.5C2.224 6 2 6.223 2 6.5 2 6.776 2.224 7 2.5 7h5.148l1-1zm-4 4l1-1H2.5C2.224 9 2 9.223 2 9.5 2 9.776 2.224 10 2.5 10h2.148z" 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="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M20.878 2.826l0.153 0.144 0.145 0.153c1.25 1.405 1.203 3.56-0.145 4.908L9.063 19.999c-0.277 0.277-0.621 0.477-1 0.58l-5.115 1.395c-0.56 0.153-1.073-0.361-0.92-0.921l1.394-5.116c0.103-0.377 0.303-0.722 0.58-0.999L15.97 2.97c1.348-1.348 3.503-1.396 4.908-0.144zM15.001 6.06l-9.938 9.938c-0.092 0.092-0.16 0.207-0.193 0.333l-1.05 3.85 3.85-1.05c0.125-0.035 0.24-0.101 0.332-0.194L17.94 9l-2.939-2.94zM6.526 11l-1.5 1.5H2.75C2.337 12.5 2 12.165 2 11.75 2 11.336 2.337 11 2.75 11h3.775zm4-4l-1.5 1.5H2.75C2.337 8.5 2 8.165 2 7.75 2 7.336 2.337 7 2.75 7h7.775zm6.505-2.97L16.061 5 19 7.94l0.97-0.97c0.812-0.812 0.812-2.128 0-2.94-0.811-0.811-2.127-0.811-2.939 0zM14.526 3l-1.5 1.5H2.75C2.337 4.5 2 4.165 2 3.75 2 3.336 2.337 3 2.75 3h11.775z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>