feat: activate anonymous reply by tapping user picture instead of bottom button
Replace the bottom bar AnonymousPostButton with a tap-on-avatar activation scheme. Tapping the user picture enables anonymous mode and shows the incognito icon in its place. Tapping the incognito icon toggles back to normal mode. https://claude.ai/code/session_013MaeT2T9Bg4HaVe2ACNADy
This commit is contained in:
+27
-11
@@ -26,7 +26,9 @@ import android.net.Uri
|
|||||||
import android.os.Parcelable
|
import android.os.Parcelable
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.horizontalScroll
|
import androidx.compose.foundation.horizontalScroll
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@@ -79,7 +81,6 @@ import com.vitorpamplona.amethyst.ui.navigation.navs.Nav
|
|||||||
import com.vitorpamplona.amethyst.ui.navigation.topbars.PostingTopBar
|
import com.vitorpamplona.amethyst.ui.navigation.topbars.PostingTopBar
|
||||||
import com.vitorpamplona.amethyst.ui.note.BaseUserPicture
|
import com.vitorpamplona.amethyst.ui.note.BaseUserPicture
|
||||||
import com.vitorpamplona.amethyst.ui.note.NoteCompose
|
import com.vitorpamplona.amethyst.ui.note.NoteCompose
|
||||||
import com.vitorpamplona.amethyst.ui.note.creators.anonymous.AnonymousPostButton
|
|
||||||
import com.vitorpamplona.amethyst.ui.note.creators.contentWarning.ContentSensitivityExplainer
|
import com.vitorpamplona.amethyst.ui.note.creators.contentWarning.ContentSensitivityExplainer
|
||||||
import com.vitorpamplona.amethyst.ui.note.creators.contentWarning.MarkAsSensitiveButton
|
import com.vitorpamplona.amethyst.ui.note.creators.contentWarning.MarkAsSensitiveButton
|
||||||
import com.vitorpamplona.amethyst.ui.note.creators.emojiSuggestions.ShowEmojiSuggestionList
|
import com.vitorpamplona.amethyst.ui.note.creators.emojiSuggestions.ShowEmojiSuggestionList
|
||||||
@@ -110,6 +111,7 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.settings.SettingsRow
|
|||||||
import com.vitorpamplona.amethyst.ui.stringRes
|
import com.vitorpamplona.amethyst.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size10dp
|
import com.vitorpamplona.amethyst.ui.theme.Size10dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size19Modifier
|
import com.vitorpamplona.amethyst.ui.theme.Size19Modifier
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.Size35Modifier
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
import com.vitorpamplona.amethyst.ui.theme.Size35dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer
|
import com.vitorpamplona.amethyst.ui.theme.StdVertSpacer
|
||||||
import com.vitorpamplona.amethyst.ui.theme.SuggestionListDefaultHeightPage
|
import com.vitorpamplona.amethyst.ui.theme.SuggestionListDefaultHeightPage
|
||||||
@@ -303,12 +305,30 @@ private fun NewPostScreenBody(
|
|||||||
Row(
|
Row(
|
||||||
modifier = Modifier.padding(vertical = Size10dp),
|
modifier = Modifier.padding(vertical = Size10dp),
|
||||||
) {
|
) {
|
||||||
if (!postViewModel.wantsAnonymousPost) {
|
if (postViewModel.wantsAnonymousPost) {
|
||||||
BaseUserPicture(
|
IconButton(
|
||||||
accountViewModel.userProfile(),
|
onClick = { postViewModel.wantsAnonymousPost = false },
|
||||||
Size35dp,
|
) {
|
||||||
accountViewModel = accountViewModel,
|
Icon(
|
||||||
)
|
painter = painterRes(resourceId = R.drawable.incognito, 1),
|
||||||
|
contentDescription = stringRes(R.string.post_anonymously),
|
||||||
|
modifier = Size35Modifier,
|
||||||
|
tint = MaterialTheme.colorScheme.onBackground,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Box(
|
||||||
|
modifier =
|
||||||
|
Modifier.clickable {
|
||||||
|
postViewModel.wantsAnonymousPost = true
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
BaseUserPicture(
|
||||||
|
accountViewModel.userProfile(),
|
||||||
|
Size35dp,
|
||||||
|
accountViewModel = accountViewModel,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MessageField(
|
MessageField(
|
||||||
R.string.what_s_on_your_mind,
|
R.string.what_s_on_your_mind,
|
||||||
@@ -624,10 +644,6 @@ private fun BottomRowActions(postViewModel: ShortNotePostViewModel) {
|
|||||||
postViewModel.wantsInvoice = !postViewModel.wantsInvoice
|
postViewModel.wantsInvoice = !postViewModel.wantsInvoice
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AnonymousPostButton(postViewModel.wantsAnonymousPost) {
|
|
||||||
postViewModel.wantsAnonymousPost = !postViewModel.wantsAnonymousPost
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user