Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
50779309
Commit
50779309
authored
Sep 21, 2021
by
paul
Committed by
Sebastian
Sep 22, 2021
Browse files
Options
Downloads
Patches
Plain Diff
added profile circle composable
parent
040edcb5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!7
Import upstream updates to UI
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/kotlin/org/briarproject/briar/desktop/paul/views/PrivateMessageView.kt
+19
-33
19 additions, 33 deletions
...iarproject/briar/desktop/paul/views/PrivateMessageView.kt
with
19 additions
and
33 deletions
src/main/kotlin/org/briarproject/briar/desktop/paul/views/PrivateMessageView.kt
+
19
−
33
View file @
50779309
...
@@ -61,11 +61,13 @@ import androidx.compose.ui.Alignment
...
@@ -61,11 +61,13 @@ import androidx.compose.ui.Alignment
import
androidx.compose.ui.Modifier
import
androidx.compose.ui.Modifier
import
androidx.compose.ui.draw.clip
import
androidx.compose.ui.draw.clip
import
androidx.compose.ui.graphics.Color
import
androidx.compose.ui.graphics.Color
import
androidx.compose.ui.graphics.ImageBitmap
import
androidx.compose.ui.graphics.SolidColor
import
androidx.compose.ui.graphics.SolidColor
import
androidx.compose.ui.graphics.drawscope.withTransform
import
androidx.compose.ui.graphics.drawscope.withTransform
import
androidx.compose.ui.graphics.imageFromResource
import
androidx.compose.ui.graphics.imageFromResource
import
androidx.compose.ui.text.TextStyle
import
androidx.compose.ui.text.TextStyle
import
androidx.compose.ui.text.input.TextFieldValue
import
androidx.compose.ui.text.input.TextFieldValue
import
androidx.compose.ui.unit.Dp
import
androidx.compose.ui.unit.IntSize
import
androidx.compose.ui.unit.IntSize
import
androidx.compose.ui.unit.dp
import
androidx.compose.ui.unit.dp
import
androidx.compose.ui.unit.sp
import
androidx.compose.ui.unit.sp
...
@@ -251,6 +253,19 @@ fun SearchTextField(searchValue: String, onValueChange: (String) -> Unit, onCont
...
@@ -251,6 +253,19 @@ fun SearchTextField(searchValue: String, onValueChange: (String) -> Unit, onCont
)
)
}
}
@Composable
fun
ProfileCircle
(
bitmap
:
ImageBitmap
,
size
:
Dp
)
{
Row
()
{
Image
(
bitmap
=
bitmap
,
"image"
,
modifier
=
Modifier
.
size
(
size
).
align
(
Alignment
.
CenterVertically
).
clip
(
CircleShape
).
border
(
2
.
dp
,
color
=
Color
.
White
,
CircleShape
)
)
}
}
@Composable
@Composable
fun
ContactCard
(
contact
:
Contact
,
selContact
:
Contact
,
onSel
:
(
Contact
)
->
Unit
,
drawDetails
:
Boolean
)
{
fun
ContactCard
(
contact
:
Contact
,
selContact
:
Contact
,
onSel
:
(
Contact
)
->
Unit
,
drawDetails
:
Boolean
)
{
var
bgColor
=
briarBlack
var
bgColor
=
briarBlack
...
@@ -264,13 +279,7 @@ fun ContactCard(contact: Contact, selContact: Contact, onSel: (Contact) -> Unit,
...
@@ -264,13 +279,7 @@ fun ContactCard(contact: Contact, selContact: Contact, onSel: (Contact) -> Unit,
)
{
)
{
Row
(
modifier
=
Modifier
.
align
(
Alignment
.
CenterVertically
).
padding
(
horizontal
=
16
.
dp
))
{
Row
(
modifier
=
Modifier
.
align
(
Alignment
.
CenterVertically
).
padding
(
horizontal
=
16
.
dp
))
{
// TODO Pull profile pictures
// TODO Pull profile pictures
Image
(
ProfileCircle
(
imageFromResource
(
"images/profile_images/p0.png"
),
36
.
dp
)
bitmap
=
imageFromResource
(
"images/profile_images/p0.png"
),
"image"
,
modifier
=
Modifier
.
size
(
36
.
dp
).
align
(
Alignment
.
CenterVertically
).
clip
(
CircleShape
).
border
(
2
.
dp
,
color
=
Color
.
White
,
CircleShape
)
)
// Draw notification badges
// Draw notification badges
if
(
drawDetails
)
{
if
(
drawDetails
)
{
androidx
.
compose
.
foundation
.
Canvas
(
androidx
.
compose
.
foundation
.
Canvas
(
...
@@ -549,16 +558,7 @@ fun MsgColumnHeader(
...
@@ -549,16 +558,7 @@ fun MsgColumnHeader(
)
{
)
{
Box
(
modifier
=
Modifier
.
fillMaxWidth
().
height
(
HEADER_SIZE
+
1
.
dp
))
{
Box
(
modifier
=
Modifier
.
fillMaxWidth
().
height
(
HEADER_SIZE
+
1
.
dp
))
{
Row
(
modifier
=
Modifier
.
align
(
Alignment
.
Center
))
{
Row
(
modifier
=
Modifier
.
align
(
Alignment
.
Center
))
{
Image
(
ProfileCircle
(
imageFromResource
(
"images/profile_images/p0.png"
),
36
.
dp
)
// TODO Fix profile picture resources
bitmap
=
imageFromResource
(
"images/profile_images/p0.png"
),
"sel_contact_prof"
,
modifier
=
Modifier
.
size
(
36
.
dp
).
align
(
Alignment
.
CenterVertically
).
clip
(
CircleShape
).
border
(
2
.
dp
,
color
=
Color
.
White
,
CircleShape
)
)
androidx
.
compose
.
foundation
.
Canvas
(
androidx
.
compose
.
foundation
.
Canvas
(
modifier
=
Modifier
.
align
(
Alignment
.
CenterVertically
),
modifier
=
Modifier
.
align
(
Alignment
.
CenterVertically
),
onDraw
=
{
onDraw
=
{
...
@@ -696,14 +696,7 @@ fun ContactDrawerMakeIntro(currContact: Contact, contacts: List<Contact>, setInf
...
@@ -696,14 +696,7 @@ fun ContactDrawerMakeIntro(currContact: Contact, contacts: List<Contact>, setInf
// Divider(color = divider, modifier = Modifier.fillMaxWidth().height(1.dp) )
// Divider(color = divider, modifier = Modifier.fillMaxWidth().height(1.dp) )
Row
(
Modifier
.
fillMaxWidth
().
padding
(
12
.
dp
),
horizontalArrangement
=
Arrangement
.
SpaceAround
)
{
Row
(
Modifier
.
fillMaxWidth
().
padding
(
12
.
dp
),
horizontalArrangement
=
Arrangement
.
SpaceAround
)
{
Column
(
Modifier
.
align
(
Alignment
.
CenterVertically
))
{
Column
(
Modifier
.
align
(
Alignment
.
CenterVertically
))
{
Image
(
ProfileCircle
(
imageFromResource
(
"images/profile_images/p0.png"
),
40
.
dp
)
// TODO Proper profile pic
bitmap
=
imageFromResource
(
"images/profile_images/p0.png"
),
"image"
,
modifier
=
Modifier
.
size
(
40
.
dp
).
align
(
Alignment
.
CenterHorizontally
).
clip
(
CircleShape
).
border
(
2
.
dp
,
color
=
Color
.
White
,
CircleShape
)
)
Text
(
Text
(
currContact
.
author
.
name
,
currContact
.
author
.
name
,
color
=
Color
.
White
,
color
=
Color
.
White
,
...
@@ -714,13 +707,7 @@ fun ContactDrawerMakeIntro(currContact: Contact, contacts: List<Contact>, setInf
...
@@ -714,13 +707,7 @@ fun ContactDrawerMakeIntro(currContact: Contact, contacts: List<Contact>, setInf
Icon
(
Icons
.
Filled
.
SwapHoriz
,
"swap"
,
tint
=
Color
.
White
,
modifier
=
Modifier
.
size
(
48
.
dp
))
Icon
(
Icons
.
Filled
.
SwapHoriz
,
"swap"
,
tint
=
Color
.
White
,
modifier
=
Modifier
.
size
(
48
.
dp
))
Column
(
Modifier
.
align
(
Alignment
.
CenterVertically
))
{
Column
(
Modifier
.
align
(
Alignment
.
CenterVertically
))
{
// TODO Profile pic again
// TODO Profile pic again
Image
(
ProfileCircle
(
imageFromResource
(
"images/profile_images/p0.png"
),
40
.
dp
)
bitmap
=
imageFromResource
(
"images/profile_images/p0.png"
),
"image"
,
modifier
=
Modifier
.
size
(
40
.
dp
).
align
(
Alignment
.
CenterHorizontally
).
clip
(
CircleShape
).
border
(
2
.
dp
,
color
=
Color
.
White
,
CircleShape
)
)
Text
(
Text
(
introContact
.
author
.
name
,
introContact
.
author
.
name
,
color
=
Color
.
White
,
color
=
Color
.
White
,
...
@@ -829,6 +816,5 @@ fun ChatState(id: ContactId): MutableState<UiState<Chat>> {
...
@@ -829,6 +816,5 @@ fun ChatState(id: ContactId): MutableState<UiState<Chat>> {
state
.
value
=
UiState
.
Success
(
chat
)
state
.
value
=
UiState
.
Success
(
chat
)
onDispose
{
}
onDispose
{
}
}
}
return
state
return
state
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment