Skip to content

Commit

Permalink
πŸ†™ update deps and prepare for next release
Browse files Browse the repository at this point in the history
  • Loading branch information
theapache64 committed Jul 11, 2022
1 parent da70919 commit 5967f57
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 100 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
val kotlinVersion = "1.6.10"
val kotlinVersion = "1.7.0"
kotlin("jvm") version kotlinVersion
kotlin("kapt") version kotlinVersion
id("org.jetbrains.compose") version "1.0.1"
id("org.jetbrains.compose") version "1.2.0-alpha01-dev741"
}

val daggerVersion by extra("2.40.5")
val stackzyVersion by extra("1.2.4") // TODO : Change in App.kt also
val daggerVersion by extra("2.42")
val stackzyVersion by extra("1.2.5") // TODO : Change in App.kt also

group = "com.theapache64"
version = stackzyVersion
Expand Down
4 changes: 2 additions & 2 deletions data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "com.theapache64.stackzy"
version = "1.2.4"
version = "1.2.5"

repositories {
mavenCentral()
Expand All @@ -25,7 +25,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.31")

// Retrosheet : Turn Google Spreadsheet to JSON endpoint (for Android and JVM)
api("com.github.theapache64:retrosheet:2.0.0-beta03")
api("com.github.theapache64:retrosheet:2.0.0")

// Retrofit : A type-safe HTTP client for Android and Java.
val retrofitVersion = "2.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import java.net.URL
import java.util.zip.ZipInputStream
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.io.path.ExperimentalPathApi
import kotlin.math.floor
import kotlin.math.roundToInt

Expand Down Expand Up @@ -232,7 +231,6 @@ class AdbRepo @Inject constructor(
}
}

@ExperimentalPathApi
@Suppress("BlockingMethodInNonBlockingContext") // suppressing due to invalid IDE warning (bug)
suspend fun downloadAdb() = flow {

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/theapache64/stackzy/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fun main() {
// Parsing application arguments
val appArgs = AppArgs(
appName = "Stackzy",
version = "v1.2.4",
version = "v1.2.5",
versionCode = 20220201
)

Expand Down
92 changes: 31 additions & 61 deletions src/main/kotlin/com/theapache64/stackzy/ui/common/Selectable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.pointerMoveFilter
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.onPointerEvent
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
Expand All @@ -32,6 +34,7 @@ import kotlin.system.exitProcess
/**
* Once this applied, when you hover the mouse over the item, it's background color will be changed.
*/
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun Modifier.addHoverEffect(
onClicked: () -> Unit,
Expand All @@ -47,43 +50,30 @@ fun Modifier.addHoverEffect(
normalAlpha
}

return this
.background(normalColor.copy(alpha = backgroundAlpha), RoundedCornerShape(cornerRadius))
.clickable {
return this.background(normalColor.copy(alpha = backgroundAlpha), RoundedCornerShape(cornerRadius)).clickable {
onClicked()
}
.pointerMoveFilter(
onEnter = {
isHovered = true
false
},
onExit = {
isHovered = false
false
}
)
}.onPointerEvent(eventType = PointerEventType.Enter, onEvent = {
isHovered = true
}).onPointerEvent(eventType = PointerEventType.Exit, onEvent = {
isHovered = false
})
}

// Preview
fun main() = application {

Window(
onCloseRequest = {
exitProcess(0)
}
) {
Window(onCloseRequest = {
exitProcess(0)
}) {
StackzyTheme {
Selectable(
data = object : AlphabetCircle() {
override fun getTitle() = "WhatsApp"
override fun getSubtitle() = "v1.0.0"
override fun imageUrl() =
"https://play-lh.googleusercontent.com/X64En0aW6jkvDnd5kr16u-YuUsoJ1W2cBzJab3CQ5lObLeQ3T61DpB7AwIoZ7uqgCn4"
},
onSelected = {

}
)
Selectable(data = object : AlphabetCircle() {
override fun getTitle() = "WhatsApp"
override fun getSubtitle() = "v1.0.0"
override fun imageUrl() =
"https://play-lh.googleusercontent.com/X64En0aW6jkvDnd5kr16u-YuUsoJ1W2cBzJab3CQ5lObLeQ3T61DpB7AwIoZ7uqgCn4"
}, onSelected = {

})
}
}
}
Expand All @@ -98,37 +88,22 @@ fun main(args: Array<String>) = singleWindowApplication {
packageName = "com.something",
replacementPackage = null,
website = ""
),
null
), null
)
Selectable(
data = dummyLib,
onSelected = {
Selectable(data = dummyLib, onSelected = {

}
)
})
}
}

@Composable
fun <T : AlphabetCircle> Selectable(
data: T,
onSelected: (T) -> Unit,
modifier: Modifier = Modifier,
padding: Dp = 10.dp
data: T, onSelected: (T) -> Unit, modifier: Modifier = Modifier, padding: Dp = 10.dp
) {

Row(
modifier = modifier
.fillMaxWidth()
.addHoverEffect(
onClicked = {
onSelected(data)
}
)
.padding(padding),
verticalAlignment = Alignment.CenterVertically
) {
Row(modifier = modifier.fillMaxWidth().addHoverEffect(onClicked = {
onSelected(data)
}).padding(padding), verticalAlignment = Alignment.CenterVertically) {

if (data.imageUrl() == null) {
// Show only alphabet
Expand All @@ -146,14 +121,9 @@ fun <T : AlphabetCircle> Selectable(
AlphabetCircle(data)
},

modifier = Modifier.size(60.dp)
.clip(CircleShape)
.background(MaterialTheme.colors.primary) // outer blue
.padding(2.dp)
.clip(CircleShape)
.background(MaterialTheme.colors.secondary) // gap
.padding(4.dp)
.clip(CircleShape) // logo
modifier = Modifier.size(60.dp).clip(CircleShape).background(MaterialTheme.colors.primary) // outer blue
.padding(2.dp).clip(CircleShape).background(MaterialTheme.colors.secondary) // gap
.padding(4.dp).clip(CircleShape) // logo
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.theapache64.stackzy.ui.feature.appdetail
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
Expand Down Expand Up @@ -45,7 +45,7 @@ fun Libraries(
} else {

LazyVerticalGrid(
cells = GridCells.Fixed(4)
columns = GridCells.Fixed(4)
) {
items(
items = report.libraryWrappers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.theapache64.stackzy.ui.feature.applist

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.items
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -116,7 +117,7 @@ fun SelectAppScreen(
if (apps.isNotEmpty()) {
// Grid
LazyVerticalGrid(
cells = GridCells.Fixed(3),
columns = GridCells.Fixed(3),
) {
items(items = apps) { app ->
Column {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.theapache64.stackzy.ui.feature.libdetail

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -52,7 +52,7 @@ fun LibraryDetailScreen(

if (libraries.isNotEmpty()) {
LazyVerticalGrid(
cells = GridCells.Fixed(4)
columns = GridCells.Fixed(4)
) {
items(libraries) { library ->
Column {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.theapache64.stackzy.ui.feature.liblist

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.GridCells
import androidx.compose.foundation.lazy.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.lazy.items
import androidx.compose.material.Icon
import androidx.compose.material.OutlinedTextField
Expand Down Expand Up @@ -87,7 +88,7 @@ fun LibraryListScreen(

if (libraries.isNotEmpty()) {
LazyVerticalGrid(
cells = GridCells.Fixed(4)
columns = GridCells.Fixed(4)
) {
items(libraries) { library ->
Column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.compose.material.icons.outlined.Password
import androidx.compose.material.icons.outlined.Visibility
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusOrder
Expand Down Expand Up @@ -91,6 +92,8 @@ fun LogInScreen(
}
}


@OptIn(ExperimentalComposeUiApi::class)
@Composable
private fun Form(
username: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.input.pointer.pointerMoveFilter
import androidx.compose.ui.input.pointer.PointerEventType
import androidx.compose.ui.input.pointer.onPointerEvent
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.theapache64.stackzy.ui.common.Badge
Expand Down Expand Up @@ -130,7 +132,7 @@ fun PathwayScreen(
}
}


@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun PathwayCard(
modifier: Modifier = Modifier,
Expand All @@ -142,16 +144,19 @@ fun PathwayCard(
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = modifier.pointerMoveFilter(
onMove = {
onMouseEnter()
false
},
onExit = {
onMouseLeave()
false
}
)
modifier = modifier
.onPointerEvent(
eventType = PointerEventType.Enter,
onEvent = {
onMouseEnter()
},
)
.onPointerEvent(
eventType = PointerEventType.Exit,
onEvent = {
onMouseLeave()
}
)
) {
/*Icon*/
Image(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.theapache64.stackzy.ui.feature.splash

import androidx.compose.desktop.ui.tooling.preview.Preview
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
Expand All @@ -21,7 +19,6 @@ import com.theapache64.stackzy.ui.common.Logo
/**
* Renders SplashScreen
*/
@ExperimentalFoundationApi
@Composable
fun SplashScreen(
splashViewModel: SplashViewModel,
Expand Down Expand Up @@ -57,7 +54,7 @@ fun SplashScreen(
.align(Alignment.Center)
)

if (isSyncFinished.not()) {
if (!isSyncFinished) {

// Loading text
LoadingText(
Expand Down

0 comments on commit 5967f57

Please sign in to comment.