Skip to content

Commit

Permalink
Small design fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniebeler committed Jan 29, 2025
1 parent ee8dd7b commit 8aefe70
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import coil.compose.AsyncImage
import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi
import com.bumptech.glide.integration.compose.GlideImage
import com.daniebeler.pfpixelix.R
import com.daniebeler.pfpixelix.domain.model.Post
import com.daniebeler.pfpixelix.utils.BlurHashDecoder
import com.daniebeler.pfpixelix.utils.Navigate
Expand Down Expand Up @@ -138,7 +141,7 @@ fun CustomPost(
.align(Alignment.TopEnd)
) {
Icon(
imageVector = Icons.Filled.Collections,
imageVector = ImageVector.vectorResource(R.drawable.stack),
tint = Color.White,
contentDescription = null,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.ArrowUpward
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.daniebeler.pfpixelix.R
import kotlinx.coroutines.launch

@Composable
Expand All @@ -37,8 +41,9 @@ fun ToTopButton(listState: LazyListState) {
coroutineScope.launch {
listState.animateScrollToItem(0, 0)
}
}) {
Icon(Icons.Outlined.ArrowUpward, contentDescription = "")
},
containerColor = MaterialTheme.colorScheme.surfaceContainer) {
Icon(ImageVector.vectorResource(R.drawable.chevron_up_outline), contentDescription = "")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ArrowBackIos
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.outlined.Email
import androidx.compose.material.icons.outlined.QuestionMark
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.CenterAlignedTopAppBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
Expand All @@ -51,14 +53,13 @@ fun CollectionsComposable(
openUrl: (url: String) -> Unit
) {
val lazyListState = rememberLazyListState()
var showAddCollectionDialog = remember {
val showAddCollectionDialog = remember {
mutableStateOf(false)
}

if (addNewButton || collectionsState.collections.isNotEmpty()) {
Column {
HorizontalDivider(Modifier.padding(12.dp))

Spacer(Modifier.height(12.dp))
Text(
text = stringResource(R.string.collections),
fontWeight = FontWeight.Bold,
Expand Down Expand Up @@ -87,7 +88,7 @@ fun CollectionsComposable(
)

Spacer(modifier = Modifier.height(8.dp))
Text(text = it.title)
Text(text = it.title, fontSize = 14.sp)
}
}
if (collectionsState.isLoading) {
Expand Down Expand Up @@ -118,14 +119,14 @@ fun CollectionsComposable(
contentAlignment = Alignment.Center
) {
Icon(
imageVector = Icons.Outlined.Add,
imageVector = ImageVector.vectorResource(R.drawable.add_outline),
contentDescription = "add collection",
Modifier.size(32.dp)
)
}

Spacer(modifier = Modifier.height(8.dp))
Text(text = stringResource(R.string.new_))
Text(text = stringResource(R.string.new_), fontSize = 14.sp)
}
}
}
Expand Down Expand Up @@ -162,5 +163,4 @@ fun CollectionsComposable(
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,6 @@ fun OwnProfileComposable(
)
}
}
}, navigationIcon = {
IconButton(onClick = {
showBottomSheet = 2
}) {
Icon(
imageVector = Icons.Outlined.SwitchAccount,
contentDescription = "account switch dropdown",
Modifier.size(24.dp)
)
}
}, actions = {
if (viewModel.ownDomain.isNotEmpty()) {
DomainSoftwareComposable(
Expand Down Expand Up @@ -213,7 +203,6 @@ fun OwnProfileComposable(
}

}
//ToTopButton(listState = lazyGridState)

InfiniteListHandler(lazyListState = lazyGridState) {
viewModel.getPostsPaginated()
Expand Down
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/chevron_up_outline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="512"
android:viewportHeight="512">

<path
android:fillColor="#00000000"
android:pathData="M112,328l144,-144 144,144"
android:strokeWidth="48"
android:strokeColor="?attr/colorOnBackground"
android:strokeLineCap="round"
android:strokeLineJoin="round" />

</vector>
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/stack.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="512"
android:viewportHeight="512">

<path
android:fillColor="?attr/colorOnBackground"
android:pathData="M408,480H184a72,72 0,0 1,-72 -72V184a72,72 0,0 1,72 -72h224a72,72 0,0 1,72 72v224a72,72 0,0 1,-72 72z" />

<path
android:fillColor="?attr/colorOnBackground"
android:pathData="M160,80h235.88A72.12,72.12 0,0 0,328 32H104a72,72 0,0 0,-72 72v224a72.12,72.12 0,0 0,48 67.88V160a80,80 0,0 1,80 -80z" />

</vector>

0 comments on commit 8aefe70

Please sign in to comment.