mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Making sure the new convo screen is scrollable
This commit is contained in:
parent
f721c73a15
commit
0dce7b781c
@ -9,11 +9,16 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.primarySurface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.platform.rememberNestedScrollInteropConnection
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.fragment.app.Fragment
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
@ -48,14 +53,39 @@ class NewConversationHomeFragment : Fragment() {
|
||||
@Composable
|
||||
fun NewConversationScreen() {
|
||||
Column(modifier = Modifier.background(MaterialTheme.colors.primarySurface)) {
|
||||
AppBar(stringResource(R.string.dialog_new_conversation_title), onClose = { delegate.onDialogClosePressed() })
|
||||
ItemButton(textId = R.string.messageNew, icon = R.drawable.ic_message) { delegate.onNewMessageSelected() }
|
||||
AppBar(
|
||||
stringResource(R.string.dialog_new_conversation_title),
|
||||
onClose = { delegate.onDialogClosePressed() })
|
||||
|
||||
// this component is scrollable from here, but is inside a bottom sheet
|
||||
// so we need to cater for nested scrollingÒ
|
||||
Surface(
|
||||
// this component is scrollable
|
||||
modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection())
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
ItemButton(
|
||||
textId = R.string.messageNew,
|
||||
icon = R.drawable.ic_message
|
||||
) { delegate.onNewMessageSelected() }
|
||||
Divider(startIndent = LocalDimensions.current.dividerIndent)
|
||||
ItemButton(textId = R.string.activity_create_group_title, icon = R.drawable.ic_group) { delegate.onCreateGroupSelected() }
|
||||
ItemButton(
|
||||
textId = R.string.activity_create_group_title,
|
||||
icon = R.drawable.ic_group
|
||||
) { delegate.onCreateGroupSelected() }
|
||||
Divider(startIndent = LocalDimensions.current.dividerIndent)
|
||||
ItemButton(textId = R.string.dialog_join_community_title, icon = R.drawable.ic_globe) { delegate.onJoinCommunitySelected() }
|
||||
ItemButton(
|
||||
textId = R.string.dialog_join_community_title,
|
||||
icon = R.drawable.ic_globe
|
||||
) { delegate.onJoinCommunitySelected() }
|
||||
Divider(startIndent = LocalDimensions.current.dividerIndent)
|
||||
ItemButton(textId = R.string.activity_settings_invite_button_title, icon = R.drawable.ic_invite_friend, contentDescription = R.string.AccessibilityId_invite_friend_button) { delegate.onInviteFriend() }
|
||||
ItemButton(
|
||||
textId = R.string.activity_settings_invite_button_title,
|
||||
icon = R.drawable.ic_invite_friend,
|
||||
contentDescription = R.string.AccessibilityId_invite_friend_button
|
||||
) { delegate.onInviteFriend() }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(horizontal = LocalDimensions.current.marginMedium)
|
||||
@ -72,7 +102,12 @@ class NewConversationHomeFragment : Fragment() {
|
||||
style = MaterialTheme.typography.small
|
||||
)
|
||||
Spacer(modifier = Modifier.height(LocalDimensions.current.itemSpacingSmall))
|
||||
QrImage(string = TextSecurePreferences.getLocalNumber(requireContext())!!, Modifier.contentDescription(R.string.AccessibilityId_qr_code))
|
||||
QrImage(
|
||||
string = TextSecurePreferences.getLocalNumber(requireContext())!!,
|
||||
Modifier.contentDescription(R.string.AccessibilityId_qr_code)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user