Skip to content

Commit

Permalink
Migrate to buildSrc kt deps
Browse files Browse the repository at this point in the history
  • Loading branch information
112RG committed Oct 18, 2023
1 parent 643aa5c commit d323a37
Show file tree
Hide file tree
Showing 23 changed files with 354 additions and 205 deletions.
6 changes: 6 additions & 0 deletions .idea/codeStyles/Project.xml

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

1 change: 1 addition & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

17 changes: 0 additions & 17 deletions .idea/deploymentTargetDropDown.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

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

11 changes: 11 additions & 0 deletions .idea/kotlinScripting.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

120 changes: 0 additions & 120 deletions app/build.gradle

This file was deleted.

62 changes: 62 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("dagger.hilt.android.plugin")
id("kotlin-parcelize")
kotlin("kapt")
}

android {
namespace = "net.deaftone.eurydice"
compileSdk = 34
defaultConfig {
applicationId = "net.deaftone.eurydice"
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
kotlinOptions {
jvmTarget = "18"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {
retrofit()
room()
hilt()
compose()
moshi()
activity()
navigation()
glide()
lifecycle()
implementation("com.squareup:javapoet:1.13.0")
implementation("com.google.dagger:hilt-android-gradle-plugin:2.45")
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
69 changes: 69 additions & 0 deletions app/src/main/java/net/deaftone/eurydice/ui/BottomSheet.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package net.deaftone.eurydice.ui

import androidx.compose.animation.*
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp

@Composable
fun BottomSheet(
peekHeight: Dp,
peekContent: @Composable () -> Unit,
content: @Composable () -> Unit,
// swipeableState: SwipeableState<Int> = rememberSwipeableState(initialValue = 0)
) {
BoxWithConstraints(Modifier.fillMaxSize()) {
val density = LocalDensity.current
val anchors = mapOf(
0f to 1,
with(density) { (maxHeight - peekHeight).toPx() } to 0
)
/* val peekContentAlpha = remember {
derivedStateOf {
if (swipeableState.progress.from == 0){
// at 0 or moving away from 0
if (swipeableState.progress.to == 0) 1f
else if (swipeableState.progress.fraction < 0.25f) 1f-swipeableState.progress.fraction*4
else 0f
} else {
// at 1 or moving away from 1
if (swipeableState.progress.to == 1) 0f
else if (swipeableState.progress.fraction > 0.75f) 1f-(1f-swipeableState.progress.fraction)*4
else 0f
}
}
}*/
/* Box(
modifier = Modifier
.graphicsLayer {
translationY = swipeableState.offset.value
}
.fillMaxSize()
.align(Alignment.BottomCenter)
.swipeable(
state = swipeableState,
anchors = anchors,
orientation = Orientation.Vertical
)
) {
*//**
* Order of composable matters.
* Reversed order would result in clickables in peekContent not working.
* Note that the composable will overlap. Check state before reacting to a click.
*//*
Box(Modifier.graphicsLayer { alpha = 1f-peekContentAlpha.value }){
content()
}
Box(Modifier.graphicsLayer { alpha = peekContentAlpha.value }) {
peekContent()
}
}*/
}
}
6 changes: 3 additions & 3 deletions app/src/main/java/net/deaftone/eurydice/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.IntOffset
import androidx.navigation.NavHostController
import androidx.navigation.compose.currentBackStackEntryAsState
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
import androidx.navigation.compose.rememberNavController
import dagger.hilt.android.AndroidEntryPoint
import net.deaftone.eurydice.R
import net.deaftone.eurydice.ui.navigation.BottomBar
Expand All @@ -44,7 +44,7 @@ class MainActivity : ComponentActivity() {
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
NavScreen(navController = rememberAnimatedNavController())
NavScreen(navController = rememberNavController())
}
}
}
Expand All @@ -66,7 +66,7 @@ fun MainActivityPreview() {

@OptIn(ExperimentalMaterial3Api::class, ExperimentalAnimationApi::class)
@Composable
fun NavScreen(navController: NavHostController = rememberAnimatedNavController()) {
fun NavScreen(navController: NavHostController = rememberNavController()) {
val hidden = listOf(
MainScreenRoutes.AlbumInfo
)
Expand Down
Loading

0 comments on commit d323a37

Please sign in to comment.