Skip to content

Commit

Permalink
Add compose bottom-sheet handle.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Feb 6, 2023
1 parent a41aed2 commit f477a4d
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.unit.dp
import org.signal.core.ui.theme.SignalTheme
import org.thoughtcrime.securesms.components.FixedRoundedCornerBottomSheetDialogFragment
import org.thoughtcrime.securesms.util.DynamicTheme
Expand All @@ -29,4 +38,29 @@ abstract class ComposeBottomSheetDialogFragment : FixedRoundedCornerBottomSheetD

@Composable
abstract fun SheetContent()

/**
* BottomSheet Handle, according to our design specs.
* This can be placed in a column with the other page content like so:
*
* ```
* Column(modifier = Modifier
* .fillMaxWidth()
* .wrapContentSize(Alignment.Center)
* ) {
* Handle()
* Text("Hello!")
* }
* ```
*/
@Composable
fun Handle() {
Box(
modifier = Modifier
.size(width = 48.dp, height = 22.dp)
.padding(vertical = 10.dp)
.clip(RoundedCornerShape(1000.dp))
.background(MaterialTheme.colorScheme.outline)
)
}
}

0 comments on commit f477a4d

Please sign in to comment.