Skip to content

Commit eba36e7

Browse files
authored
Merge pull request #82 from aashishksahu/camera-crash
Fixed smooth scrolling and sorting
2 parents 2a81d80 + 34fcedb commit eba36e7

13 files changed

Lines changed: 349 additions & 103 deletions

File tree

.idea/deploymentTargetSelector.xml

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/other.xml

Lines changed: 260 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616

1717
minSdk 29
1818
targetSdk 34
19-
versionCode 34
20-
versionName "2.0.3"
19+
versionCode 35
20+
versionName "2.0.4"
2121

2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323
vectorDrawables {
@@ -69,27 +69,27 @@ dependencies {
6969
implementation 'androidx.preference:preference-ktx:1.2.1'
7070
implementation 'androidx.activity:activity-ktx:1.9.0'
7171
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
72-
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.1'
73-
implementation 'androidx.lifecycle:lifecycle-runtime-compose-android:2.8.1'
72+
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3'
73+
implementation 'androidx.lifecycle:lifecycle-runtime-compose-android:2.8.3'
7474
annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
7575
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
7676

7777
// Compose
78-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.1'
78+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.3'
7979
implementation 'androidx.activity:activity-compose:1.9.0'
80-
implementation platform('androidx.compose:compose-bom:2024.05.00')
80+
implementation platform('androidx.compose:compose-bom:2024.06.00')
8181
implementation 'androidx.compose.ui:ui'
8282
implementation 'androidx.compose.ui:ui-graphics'
8383
implementation 'androidx.compose.ui:ui-tooling-preview'
8484
implementation 'androidx.compose.material3:material3'
8585
debugImplementation 'androidx.compose.ui:ui-tooling'
86-
implementation "androidx.compose.runtime:runtime-livedata:1.6.7"
86+
implementation "androidx.compose.runtime:runtime-livedata:1.6.8"
8787
debugImplementation 'androidx.compose.ui:ui-test-manifest'
88-
androidTestImplementation platform('androidx.compose:compose-bom:2024.05.00')
88+
androidTestImplementation platform('androidx.compose:compose-bom:2024.06.00')
8989
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
9090

9191
// For Camera
92-
def camerax_version = "1.3.3"
92+
def camerax_version = "1.3.4"
9393
implementation "androidx.camera:camera-core:${camerax_version}"
9494
implementation "androidx.camera:camera-camera2:${camerax_version}"
9595
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
@@ -104,7 +104,7 @@ dependencies {
104104
implementation 'androidx.appcompat:appcompat:1.7.0'
105105
implementation 'com.google.android.material:material:1.12.0'
106106
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
107-
implementation "androidx.fragment:fragment-ktx:1.7.1"
107+
implementation "androidx.fragment:fragment-ktx:1.8.1"
108108
implementation "androidx.preference:preference-ktx:1.2.1"
109109

110110
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.14'

app/src/main/java/org/privacymatters/safespace/experimental/main/DataManager.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ object DataManager {
109109
Item(
110110
id = UUID.randomUUID(),
111111
name = content.name,
112-
size = Utils.getSize(content.length()),
112+
size = content.length(),
113113
isDir = content.isDirectory,
114114
itemCount = fileCount,
115-
lastModified = Utils.convertLongToDate(content.lastModified()),
115+
lastModified = content.lastModified(),
116116
isSelected = false
117117
)
118118
)
@@ -133,7 +133,7 @@ object DataManager {
133133
// name, date or size
134134
tempItemList = when (sortBy) {
135135
Constants.SIZE -> tempItemList.sortedWith(compareByDescending<Item> { it.isDir }
136-
.thenByDescending { it.size })
136+
.thenBy { it.size })
137137

138138
Constants.DATE -> tempItemList.sortedWith(compareByDescending<Item> { it.isDir }
139139
.thenBy { it.lastModified })
@@ -149,10 +149,10 @@ object DataManager {
149149
// name, date or size
150150
tempItemList = when (sortBy) {
151151
Constants.SIZE -> tempItemList.sortedWith(compareByDescending<Item> { it.isDir }
152-
.thenBy { it.size })
152+
.thenByDescending { it.size })
153153

154154
Constants.DATE -> tempItemList.sortedWith(compareByDescending<Item> { it.isDir }
155-
.thenBy { it.lastModified })
155+
.thenByDescending { it.lastModified })
156156

157157
else -> tempItemList.sortedWith(compareByDescending<Item> { it.isDir }
158158
.thenComparing { o1, o2 ->
@@ -164,9 +164,6 @@ object DataManager {
164164
}
165165

166166
privateItemList.value = tempItemList
167-
168-
// itemStateList.clear()
169-
// itemStateList.addAll(tempItemList)
170167
}
171168

172169
@Throws(SecurityException::class)

app/src/main/java/org/privacymatters/safespace/experimental/main/Item.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import java.util.UUID
55
data class Item(
66
val id : UUID,
77
val name: String,
8-
val size: String,
8+
val size: Long,
99
val isDir: Boolean,
1010
val itemCount: String,
11-
val lastModified: String,
11+
val lastModified: Long,
1212
val isSelected: Boolean,
1313
)

0 commit comments

Comments
 (0)