Skip to content

Commit

Permalink
- Some visual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DesarrolloAntonio committed Apr 8, 2024
1 parent 84d5524 commit c88789e
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 59 deletions.
15 changes: 1 addition & 14 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradle.properties
Expand Up @@ -25,7 +25,7 @@ android.nonTransitiveRClass=true
compileSdkVersion=34
minSdkVersion=21
targetSdkVersion=34
versionCode=27
versionName=1.18.2
versionCode=29
versionName=1.18.4
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
Expand Up @@ -23,7 +23,10 @@ fun ComposeSetup(
ShioriTheme(
darkTheme = isDarkTheme
) {
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
content()
}
}
Expand Down
Expand Up @@ -22,6 +22,7 @@ class MainActivity : ComponentActivity() {
@OptIn(ExperimentalFoundationApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

//val context = this.updateLocale(Locale("iw"))
setContent {
ComposeSetup(themeManager = themeManager) {
Expand Down
Expand Up @@ -44,6 +44,7 @@ fun Navigation(
feedViewModel = feedViewModel,
goToLogin = {
loginViewModel.clearState()
feedViewModel.resetData()
navController.navigate(NavItem.LoginNavItem.route) {
popUpTo(NavItem.HomeNavItem.route) { inclusive = true }
}
Expand Down
Expand Up @@ -10,7 +10,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.material.icons.filled.Done
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.Icon
Expand All @@ -20,7 +19,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.desarrollodroide.model.Tag

Expand Down
Expand Up @@ -2,6 +2,7 @@ package com.desarrollodroide.pagekeeper.ui.feed

import android.media.MediaScannerConnection
import android.util.Log
import androidx.compose.foundation.background
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand All @@ -11,6 +12,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Error
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.MutableState
Expand All @@ -19,6 +21,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalContext
Expand Down Expand Up @@ -209,8 +212,7 @@ private fun FeedContent(
Column {
Box(
modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.fillMaxSize()
.nestedScroll(rememberNestedScrollInteropConnection()),
) {
DockedSearchBarWithCategories(
Expand Down
Expand Up @@ -23,9 +23,11 @@ import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.rounded.Search
import androidx.compose.material.icons.rounded.Star
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.MutableState
Expand Down Expand Up @@ -107,34 +109,45 @@ fun DockedSearchBarWithCategories(
onCategoriesSelectedChanged = actions.onCategoriesSelectedChanged
)
}
items(filteredBookmarks) {
BookmarkItem(
bookmark = it,
serverURL = serverURL,
xSessionId = xSessionId,
token = token,
isLegacyApi = isLegacyApi,
viewType = viewType,
actions = BookmarkActions(
onClickEdit = { actions.onEditBookmark(it) },
onClickDelete = { actions.onDeleteBookmark(it) },
onClickShare = { actions.onShareBookmark(it) },
onClickBookmark = { actions.onBookmarkSelect(it) },
onClickEpub = { actions.onBookmarkEpub(it) },
onClickSync = { actions.onClickSync(it) },
onClickCategory = { category ->
it.tags.firstOrNull() { it.name == category.name }?.apply {
if (selectedTags.value.contains(category)) {
selectedTags.value = selectedTags.value - category
} else {
selectedTags.value = selectedTags.value + category
itemsIndexed(filteredBookmarks) { index, bookmark ->
Column {
BookmarkItem(
bookmark = bookmark,
serverURL = serverURL,
xSessionId = xSessionId,
token = token,
isLegacyApi = isLegacyApi,
viewType = viewType,
actions = BookmarkActions(
onClickEdit = { actions.onEditBookmark(bookmark) },
onClickDelete = { actions.onDeleteBookmark(bookmark) },
onClickShare = { actions.onShareBookmark(bookmark) },
onClickBookmark = { actions.onBookmarkSelect(bookmark) },
onClickEpub = { actions.onBookmarkEpub(bookmark) },
onClickSync = { actions.onClickSync(bookmark) },
onClickCategory = { category ->
bookmark.tags.firstOrNull() { it.name == category.name }?.apply {
if (selectedTags.value.contains(category)) {
selectedTags.value = selectedTags.value - category
} else {
selectedTags.value = selectedTags.value + category
}
}
}
}),
)
}),
)
if (index < filteredBookmarks.lastIndex) {
HorizontalDivider(
modifier = Modifier
.height(1.dp)
.padding(horizontal = 6.dp,),
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.1f)
)
}
}
}
}


PullRefreshIndicator(
modifier = Modifier.align(alignment = Alignment.TopCenter),
refreshing = isRefreshing,
Expand Down
Expand Up @@ -39,17 +39,18 @@ fun BookmarkItem(
) {
Box(modifier = Modifier
.padding(horizontal = 6.dp,)
.padding(bottom = if (viewType == BookmarkViewType.FULL) 16.dp else 6.dp)
.padding(bottom = if (viewType == BookmarkViewType.FULL) 0.dp else 6.dp)
) {
Card(
Box(
modifier = Modifier
.fillMaxWidth()
.clickable { actions.onClickBookmark(bookmark) },
elevation = if (viewType == BookmarkViewType.FULL) {
CardDefaults.cardElevation(defaultElevation = 4.dp)
} else {
CardDefaults.cardElevation(defaultElevation = 0.dp)
}, shape = RoundedCornerShape(8.dp)
// elevation = if (viewType == BookmarkViewType.FULL) {
// CardDefaults.cardElevation(defaultElevation = 4.dp)
// } else {
// CardDefaults.cardElevation(defaultElevation = 0.dp)
// },
// shape = RoundedCornerShape(8.dp)
) {
when (viewType) {
BookmarkViewType.FULL -> FullBookmarkView(
Expand Down
Expand Up @@ -28,7 +28,7 @@ fun ClickableCategoriesView(
modifier = Modifier
.padding(5.dp)
.clip(RoundedCornerShape(18.dp))
.background(MaterialTheme.colorScheme.surface.copy(alpha = 0.85f))
.background(MaterialTheme.colorScheme.secondaryContainer)
.clickable { onClickCategory(category) }
.padding(vertical = 8.dp, horizontal = 16.dp),
text = category.name
Expand Down
Expand Up @@ -37,8 +37,9 @@ fun FullBookmarkView(
token = token,
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp)
.clip(
RoundedCornerShape(bottomStart = 8.dp, bottomEnd = 8.dp)
RoundedCornerShape(12.dp)
),
contentScale = ContentScale.FillWidth,
loadAsThumbnail = false
Expand Down
Expand Up @@ -64,10 +64,14 @@ fun HomeScreen(
onFinish()
}

NavHost(navController, startDestination = NavItem.HomeNavItem.route) {
NavHost(
navController = navController,
startDestination = NavItem.HomeNavItem.route
) {
composable(NavItem.HomeNavItem.route) {
val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior()
Scaffold(
containerColor = MaterialTheme.colorScheme.onPrimary,
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
topBar = {
AnimatedVisibility (showTopBar) {
Expand Down Expand Up @@ -209,6 +213,13 @@ fun TopBar(
tint = MaterialTheme.colorScheme.secondary
)
}
}
},
colors = TopAppBarDefaults.smallTopAppBarColors(
containerColor = MaterialTheme.colorScheme.onPrimary, // Sets the background color of the TopAppBar
titleContentColor = MaterialTheme.colorScheme.primary, // Optional: Set the title color if needed
navigationIconContentColor = MaterialTheme.colorScheme.primary, // Optional: Set the navigation icon color if needed
actionIconContentColor = MaterialTheme.colorScheme.primary // Optional: Set the action icons color if needed
)
)

}
Expand Up @@ -34,6 +34,11 @@ class LoginViewModel(
// var password = mutableStateOf("Test")
// var serverUrl = mutableStateOf("http://192.168.1.12:8080/")

// Synology
// var userName = mutableStateOf("Test")
// var password = mutableStateOf("Test")
// var serverUrl = mutableStateOf("https://shiori.mobiledeveloper.synology.me")

var serverUrl = mutableStateOf("")
var userName = mutableStateOf("")
var password = mutableStateOf("")
Expand Down
Expand Up @@ -33,7 +33,7 @@ val md_theme_light_outlineVariant = Color(0xFFD1C5B4)
val md_theme_light_scrim = Color(0xFF000000)

val md_theme_dark_primary = Color(0xFFF7BD48)
val md_theme_dark_onPrimary = Color(0xFF412D00)
val md_theme_dark_onPrimary = Color(0xFF1B160E)
val md_theme_dark_primaryContainer = Color(0xFF5E4200)
val md_theme_dark_onPrimaryContainer = Color(0xFFFFDEA7)
val md_theme_dark_secondary = Color(0xFFFFB866)
Expand Down
Expand Up @@ -94,8 +94,8 @@ fun ShioriTheme(
if (!view.isInEditMode) {
SideEffect {
val window = (view.context as Activity).window
window.statusBarColor = colorScheme.primary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
window.statusBarColor = colorScheme.onPrimary.toArgb()
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
}
}

Expand Down

0 comments on commit c88789e

Please sign in to comment.