Commit Graph

14 Commits

Author SHA1 Message Date
Levi Bard 131ebabe85
Add support for v2/instance (#4062)
…with fallback to v1
2023-10-25 12:53:10 +02:00
mcclure b2511d782d
Dialog notifying user of failure when media upload fails (#3135)
* First attempt at user notifications of failure when media upload fails

* Drafts alert displays alert

* ktLint

* Fix defaced 46.json, add 47.json

* Mock draftsNeedUserAlert in MainActivityTest to prevent spurious failure

* Friendlier posts-failed message

* Create DraftsAlert object

* DraftsAlert works

* Not the cleanest, but DraftsAlert works with multiple accounts

* Use plural strings

* KtLint

* Clean up debug prints

* Simplify DraftsAlert per Conny suggestions

* Text change suggested by Conny

* ktLint again

* Back out test changes

* Fix MainActivityTest for new approach

* Tweak debug log

* Do not use GlobalScope for coroutines
2023-01-27 20:50:45 +01:00
Nik Clayton a5f479d79c
Fix saving changes to statuses when editing (#3103)
* Fix saving changes to statuses when editing

With the previous code backing out of a status editing operation where changes
had been made  (whether it was editing an existing status, a scheduled status,
or a draft) would prompt the user to save the changes as a new draft.

See https://github.com/tuskyapp/Tusky/issues/2704 and
https://github.com/tuskyapp/Tusky/issues/2705 for more detail.

The fix:

- Create an enum to represent the four different kinds of edits that can
  happen
  - Editing a new status (i.e., composing it for the first time)
  - Editing a posted status
  - Editing a draft
  - Editing a scheduled status

- Store this in ComposeOptions, and set it appropriately everywhere
  ComposeOptions is created.

- Check the edit kind when backing out of ComposeActivity, and use this to
  show one of three different dialogs as appropriate so the user can:
  - Save as new draft or discard changes
  - Continue editing or discard changes
  - Update existing draft or discard changes

Also fix ComposeViewModel.didChange(), which erroneously reported false if the
old text started with the new text (e.g., if the old text was "hello, world"
and it was edited to "hello", didChange() would not consider that to be a
change).

Fixes https://github.com/tuskyapp/Tusky/issues/2704,
https://github.com/tuskyapp/Tusky/issues/2705

* Use orEmpty extension function
2022-12-31 13:04:49 +01:00
Levi Bard a6b6a40ba6
Add post editing capability (#2828)
* Add post editing capability

* Don't try to reprocess already uploaded attachments.
Fixes editing posts with existing media

* Don't mark post edits as modified until editing occurs

* Disable UI for things that can't be edited when editing a post

* Finally convert SFragment to kotlin

* Use api endpoint for fetching status source for editing

* Apply review feedback
2022-12-08 10:18:12 +01:00
Nik Clayton 0d962c7cc1
Implement status() without rxjava (#2999)
* Implement status() without rxjava

* Use lambda param named `throwable`

* Update DraftsActivity.kt
2022-12-06 20:23:48 +01:00
Levi Bard 0041acf2d4
Add language dropdown to compose view (#2651)
* Add UI for selecting post language

* Apply selected language when sending status

* Save/restore post language with drafts

* Fall back to english if the configured language isn't found in the locale list (no-NB)

* Remove comment about no_NB

* Move language dropdown to top of compose view

* Preserve language when redrafting

* Set default language to target post's language when replying

* Add Tusky license header to new source file

* Tweak language dropdown button width
2022-08-31 18:53:57 +02:00
Martin Marconcini 8b026991e0
2616: Save Scheduled Time for Drafts. (#2624)
* 2616: Save Scheduled Time for Drafts.

Signed-off-by: Martin Marconcini <martin.marconcini.rodriguez@nl.abnamro.com>

* Revert 39.json schema to the original state before my changes.
2022-07-27 21:06:51 +02:00
Konrad Pozniak 43709532d6
fix unparsed html in "replying to" toggle (#2448) 2022-04-21 18:46:43 +02:00
Konrad Pozniak d9931e3d2c
Rename Toots to Posts (#2396)
* rename toots -> posts in strings

* extract tusky_compose_post_quicksetting_label string

* rename toot -> status in code
2022-03-20 20:21:42 +01:00
Konrad Pozniak 16ffcca748
add ktlint plugin to project and apply default code style (#2209)
* add ktlint plugin to project and apply default code style

* some manual adjustments, fix wildcard imports

* update CONTRIBUTING.md

* fix formatting
2021-06-28 21:13:24 +02:00
Konrad Pozniak f6dd131b95
migrate drafts to paging 3 (#2206)
* migrate drafts to paging 3

* migrate DraftHelper to coroutines
2021-06-24 21:23:29 +02:00
Konrad Pozniak 40b24cd242
migrate to RxJava3 (#2146)
* migrate to RxJava3

* remove unused import
2021-05-16 19:53:27 +02:00
Konrad Pozniak 6c37cc770c
remove SavedToots (#2141)
* remove SavedToots

* fix tests
2021-05-16 19:17:56 +02:00
Konrad Pozniak 940d6d395a
Drafts v2 (#2032)
* cleanup warnings, reorganize some code

* move ComposeAutoCompleteAdapter to compose package

* composeOptions doesn't need to be a class member

* add DraftsActivity and DraftsViewModel

* drafts

* remove unnecessary Unit in ComposeViewModel

* add schema/25.json

* fix db migration

* drafts

* cleanup code

* fix compose activity rotation bug

* fix media descriptions getting lost when restoring a draft

* improve deleting drafts

* fix ComposeActivityTest

* improve draft layout for almost empty drafts

* reformat code

* show toast when opening reply to deleted toot

* improve item_draft layout
2021-01-21 18:57:09 +01:00