Skip to content

Commit

Permalink
Merge pull request #5 from pratikksahu/1.0.7
Browse files Browse the repository at this point in the history
Compose and Gradle Bump
  • Loading branch information
pratikksahu authored Nov 8, 2024
2 parents e683776 + 82e9e60 commit 64e7443
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 159 deletions.
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.

1 change: 1 addition & 0 deletions .idea/gradle.xml

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

3 changes: 2 additions & 1 deletion .idea/misc.xml

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

10 changes: 5 additions & 5 deletions JetPDFVue/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {

android {
namespace = "com.pratikk.jetpdfvue"
compileSdk = 34
compileSdk = 35

defaultConfig {
minSdk = 21
Expand Down Expand Up @@ -51,15 +51,15 @@ android {
}
}
dependencies {
implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.activity:activity-compose:1.9.3")
implementation(platform("androidx.compose:compose-bom:2024.10.01"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation("androidx.compose.foundation:foundation-android:1.5.2")
implementation("androidx.compose.foundation:foundation-android:1.7.5")

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.core:core-ktx:1.15.0")

implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.compose.material3:material3-window-size-class")
Expand Down
16 changes: 9 additions & 7 deletions JetPDFVue/src/main/java/com/pratikk/jetpdfvue/CustomSlider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Slider
import androidx.compose.material3.SliderPositions
import androidx.compose.material3.SliderState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand Down Expand Up @@ -64,8 +64,8 @@ internal fun CustomSlider(
thumb: @Composable (thumbValue: Int) -> Unit = {
CustomSliderDefaults.Thumb(it.toString())
},
track: @Composable (sliderPositions: SliderPositions) -> Unit = { sliderPositions ->
CustomSliderDefaults.Track(sliderPositions = sliderPositions)
track: @Composable (sliderState: SliderState) -> Unit = { sliderState ->
CustomSliderDefaults.Track(sliderState = sliderState)
},
indicator: @Composable (indicatorValue: Int) -> Unit = { indicatorValue ->
CustomSliderDefaults.Indicator(indicatorValue = indicatorValue.toString())
Expand Down Expand Up @@ -294,9 +294,10 @@ object CustomSliderDefaults {
* @param height The height of the track.
* @param shape The shape of the track.
*/
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun Track(
sliderPositions: SliderPositions,
sliderState: SliderState,
modifier: Modifier = Modifier,
trackColor: Color = TrackColor,
progressColor: Color = PrimaryColor,
Expand All @@ -311,7 +312,7 @@ object CustomSliderDefaults {
Box(
modifier = Modifier
.progress(
sliderPositions = sliderPositions,
sliderState = sliderState,
height = height,
shape = shape
)
Expand Down Expand Up @@ -372,12 +373,13 @@ fun Modifier.track(
.heightIn(min = height)
.clip(shape)

@OptIn(ExperimentalMaterial3Api::class)
fun Modifier.progress(
sliderPositions: SliderPositions,
sliderState: SliderState,
height: Dp = TrackHeight,
shape: Shape = CircleShape
) =
fillMaxWidth(fraction = sliderPositions.activeRange.endInclusive - sliderPositions.activeRange.start)
fillMaxWidth(fraction = sliderState.valueRange.endInclusive - sliderState.valueRange.start)
.heightIn(min = height)
.clip(shape)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import com.pratikk.jetpdfvue.state.HorizontalVueReaderState
import com.pratikk.jetpdfvue.state.VuePageState
import com.pratikk.jetpdfvue.util.pinchToZoomAndDrag

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun HorizontalVueReader(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import com.pratikk.jetpdfvue.state.VerticalVueReaderState
import com.pratikk.jetpdfvue.state.VuePageState
import com.pratikk.jetpdfvue.util.pinchToZoomAndDrag

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun VerticalVueReader(
modifier: Modifier = Modifier,
Expand Down
7 changes: 5 additions & 2 deletions JetPDFVue/src/main/java/com/pratikk/jetpdfvue/VueSlider.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.pratikk.jetpdfvue

import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.SliderPositions
import androidx.compose.material3.SliderState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
Expand All @@ -12,6 +14,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import com.pratikk.jetpdfvue.state.HorizontalVueReaderState

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun VueHorizontalSlider(
modifier: Modifier = Modifier,
Expand All @@ -25,8 +28,8 @@ fun VueHorizontalSlider(
thumb: @Composable (thumbValue: Int) -> Unit = {
CustomSliderDefaults.Thumb(it.toString())
},
track: @Composable (sliderPositions: SliderPositions) -> Unit = { sliderPositions ->
CustomSliderDefaults.Track(sliderPositions = sliderPositions)
track: @Composable (sliderState: SliderState) -> Unit = { sliderState ->
CustomSliderDefaults.Track(sliderState = sliderState)
},
indicator: @Composable (indicatorValue: Int) -> Unit = { indicatorValue ->
CustomSliderDefaults.Indicator(indicatorValue = indicatorValue.toString())
Expand Down
20 changes: 10 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {

android {
namespace = "com.pratikk.jetpackpdf"
compileSdk = 34
compileSdk = 35

defaultConfig {
applicationId = "com.pratikk.jetpackpdf"
minSdk = 24
targetSdk = 34
targetSdk = 35
versionCode = 1
versionName = "1.0"

Expand All @@ -30,11 +30,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "17"
}
buildFeatures {
compose = true
Expand All @@ -52,10 +52,10 @@ android {

dependencies {
implementation(project(":JetPDFVue"))
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.09.01"))
implementation("androidx.core:core-ktx:1.15.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
implementation("androidx.activity:activity-compose:1.9.3")
implementation(platform("androidx.compose:compose-bom:2024.10.01"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
Expand All @@ -64,7 +64,7 @@ dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.09.01"))
androidTestImplementation(platform("androidx.compose:compose-bom:2023.10.01"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.CAMERA"/>

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.pratikk.jetpackpdf.horizontalSamples

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -42,7 +43,7 @@ fun HorizontalSampleA(
horizontalVueReaderState: HorizontalVueReaderState,
import:() -> Unit
) {
BoxWithConstraints(
Box(
modifier = modifier
) {
val scope = rememberCoroutineScope()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.pratikk.jetpackpdf.horizontalSamples

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand All @@ -16,6 +17,7 @@ import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.RotateLeft
import androidx.compose.material.icons.filled.RotateRight
import androidx.compose.material.icons.filled.Share
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand All @@ -30,13 +32,14 @@ import com.pratikk.jetpdfvue.HorizontalVueReader
import com.pratikk.jetpdfvue.VueHorizontalSlider
import com.pratikk.jetpdfvue.state.HorizontalVueReaderState

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun HorizontalSampleB(
modifier: Modifier = Modifier,
horizontalVueReaderState: HorizontalVueReaderState,
import: () -> Unit
) {
BoxWithConstraints(
Box(
modifier = modifier
) {
val background = Modifier.background(MaterialTheme.colorScheme.background.copy(alpha = 0.75f),MaterialTheme.shapes.small)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@ package com.pratikk.jetpackpdf.verticalSamples

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.ArrowDownward
import androidx.compose.material.icons.filled.ArrowForward
import androidx.compose.material.icons.filled.KeyboardArrowDown
import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material.icons.filled.RotateLeft
Expand All @@ -31,7 +25,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
Expand All @@ -40,9 +33,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import com.pratikk.jetpdfvue.HorizontalVueReader
import com.pratikk.jetpdfvue.VerticalVueReader
import com.pratikk.jetpdfvue.state.HorizontalVueReaderState
import com.pratikk.jetpdfvue.state.VerticalVueReaderState
import kotlinx.coroutines.launch

Expand All @@ -53,7 +44,7 @@ fun VerticalSampleA(
verticalVueReaderState: VerticalVueReaderState,
import:() -> Unit
){
BoxWithConstraints(
Box(
modifier = modifier
) {
val scope = rememberCoroutineScope()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript{
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.1")
classpath("com.android.tools.build:gradle:8.6.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
}
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sun Sep 24 19:21:09 IST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 64e7443

Please sign in to comment.