Show reblog/favourite confirmations as menus not dialogs (#3418)
* Show reblog/favourite confirmations as menus not dialogs The previous code used dialogs and displayed the text of the status when reblogging or favouriting. This didn't work when the post just contained images, and other material from the status (content warning, polls) was not shown either. Fix this by displaying a popup menu instead. The status remains visible so the user can clearly see what they're acting on. In addition, this lays the groundwork for supporting a long-press menu in the future to allow the user to reblog/favourite from a different account. Fixes https://github.com/tuskyapp/Tusky/issues/3308 * Revert the change that puts the menu immediately over the icon Although this behavious is consistent with how the option menu works, I decided that the risk of someone inadvertently double-tapping in the same location, and the first tap opens the menu and the second tap confirms the action was too great. So now the menu appears either above or below the icon depending on space, and the user has to tap in two slightly different spaces. This is also consistent with the previous behaviour, where it's highly unlikely that the confirm button on the dialog would have been directly under the user's finger if they double-tapped.
This commit is contained in:
parent
61720c3472
commit
c36b243745
5 changed files with 68 additions and 36 deletions
11
app/src/main/res/menu/status_favourite.xml
Normal file
11
app/src/main/res/menu/status_favourite.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_action_favourite"
|
||||
android:icon="@drawable/ic_favourite_24dp"
|
||||
android:title="@string/action_favourite" />
|
||||
<item
|
||||
android:id="@+id/menu_action_unfavourite"
|
||||
android:icon="@drawable/ic_favourite_24dp"
|
||||
android:title="@string/action_unfavourite" />
|
||||
</menu>
|
||||
11
app/src/main/res/menu/status_reblog.xml
Normal file
11
app/src/main/res/menu/status_reblog.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@+id/menu_action_reblog"
|
||||
android:icon="@drawable/ic_reblog_24dp"
|
||||
android:title="@string/action_reblog" />
|
||||
<item
|
||||
android:id="@+id/menu_action_unreblog"
|
||||
android:icon="@drawable/ic_reblog_24dp"
|
||||
android:title="@string/action_unreblog" />
|
||||
</menu>
|
||||
Loading…
Add table
Add a link
Reference in a new issue