Skip to content

Commit 02bdca2

Browse files
committed
major refactor to tasks and other changes
1 parent 5a4644d commit 02bdca2

File tree

159 files changed

+13278
-5091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+13278
-5091
lines changed

app/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ composeCompiler {
5050

5151
dependencies {
5252
implementation(libs.androidx.profileinstaller)
53+
implementation(libs.androidx.ui.tooling.preview.android)
5354
"baselineProfile"(project(":baselineprofile"))
5455
coreLibraryDesugaring(libs.desugar.jdk.libs)
5556

@@ -58,12 +59,15 @@ dependencies {
5859
implementation(libs.androidx.appcompat)
5960
implementation(libs.androidx.lifecycle.runtime.compose.android)
6061
implementation(libs.androidx.activity.compose)
62+
implementation(libs.androidx.datastore)
63+
implementation(libs.accompanist.systemuicontroller)
6164
implementation(libs.material)
6265

6366
implementation(platform(libs.androidx.compose.bom))
6467
implementation(libs.androidx.compose.foundation)
6568
implementation(libs.androidx.compose.material3)
6669
implementation(libs.androidx.compose.icons.extended)
70+
implementation(libs.androidx.palette.ktx)
6771

6872
implementation(libs.sora.editor)
6973
implementation(libs.sora.editor.language.java)
@@ -73,9 +77,9 @@ dependencies {
7377
implementation(libs.coil.gif)
7478
implementation(libs.coil.svg)
7579
implementation(libs.coil.video)
76-
80+
implementation(libs.zip4j)
7781
implementation(libs.gson)
78-
implementation(libs.androidx.datastore)
82+
implementation(libs.commons.net)
7983

8084
implementation(libs.cascade.compose)
8185
implementation(libs.compose.swipebox)

app/src/main/AndroidManifest.xml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
android:name="android.permission.QUERY_ALL_PACKAGES"
1010
tools:ignore="QueryAllPackagesPermission" />
1111
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" tools:node="remove"/>
12+
<uses-permission android:name="android.permission.INTERNET" />
13+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
1214

1315
<uses-feature
1416
android:glEsVersion="0x00020000"
@@ -23,6 +25,7 @@
2325
android:icon="@mipmap/ic_launcher"
2426
android:label="@string/app_name"
2527
android:supportsRtl="true"
28+
android:networkSecurityConfig="@xml/network_security_config"
2629
android:requestLegacyExternalStorage="true"
2730
android:theme="@style/Theme.FileExplorer"
2831
tools:targetApi="34" >
@@ -58,6 +61,26 @@
5861
</intent-filter>
5962
</activity>
6063

64+
<activity
65+
android:name=".screen.viewer.text.TextViewerActivity"
66+
android:exported="true"
67+
android:label="@string/text_viewer"
68+
android:theme="@style/Theme.FileExplorer"
69+
android:windowSoftInputMode="adjustResize"
70+
android:documentLaunchMode="intoExisting"
71+
android:autoRemoveFromRecents="true">
72+
<intent-filter>
73+
<action android:name="android.intent.action.VIEW" />
74+
75+
<category android:name="android.intent.category.DEFAULT" />
76+
<category android:name="android.intent.category.BROWSABLE" />
77+
78+
<data android:mimeType="text/*" />
79+
<data android:scheme="file" />
80+
<data android:scheme="content" />
81+
</intent-filter>
82+
</activity>
83+
6184
<activity
6285
android:name=".screen.viewer.image.ImageViewerActivity"
6386
android:exported="true"
@@ -77,9 +100,9 @@
77100
</activity>
78101

79102
<activity
80-
android:name=".screen.viewer.media.MediaViewerActivity"
103+
android:name=".screen.viewer.audio.AudioPlayerActivity"
81104
android:exported="true"
82-
android:label="@string/title_activity_media_viewer"
105+
android:label="@string/title_activity_audio_player"
83106
android:theme="@style/Theme.FileExplorer"
84107
android:windowSoftInputMode="adjustResize"
85108
android:documentLaunchMode="intoExisting"
@@ -88,21 +111,39 @@
88111
<action android:name="android.intent.action.VIEW" />
89112
<category android:name="android.intent.category.DEFAULT" />
90113
<category android:name="android.intent.category.BROWSABLE" />
91-
<data android:mimeType="video/*"/>
92114
<data android:mimeType="audio/*"/>
93115
<data android:scheme="file"/>
94116
<data android:scheme="content"/>
95117
</intent-filter>
96118
</activity>
97119

120+
<activity
121+
android:name=".screen.viewer.video.VideoPlayerActivity"
122+
android:exported="true"
123+
android:label="@string/title_activity_audio_player"
124+
android:theme="@style/Theme.FileExplorer"
125+
android:windowSoftInputMode="adjustResize"
126+
android:documentLaunchMode="intoExisting"
127+
android:autoRemoveFromRecents="true">
128+
<intent-filter>
129+
<action android:name="android.intent.action.VIEW" />
130+
131+
<category android:name="android.intent.category.DEFAULT" />
132+
<category android:name="android.intent.category.BROWSABLE" />
133+
134+
<data android:mimeType="video/*" />
135+
<data android:scheme="file" />
136+
<data android:scheme="content" />
137+
</intent-filter>
138+
</activity>
139+
98140
<activity
99141
android:name=".screen.main.MainActivity"
100142
android:exported="true"
101143
android:theme="@style/Theme.FileExplorer"
102144
android:windowSoftInputMode="adjustResize">
103145
<intent-filter>
104146
<action android:name="android.intent.action.MAIN" />
105-
106147
<category android:name="android.intent.category.LAUNCHER" />
107148
</intent-filter>
108149
</activity>

app/src/main/baseline-prof.txt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ HSPLandroidx/compose/animation/core/Animatable;-><init>(Ljava/lang/Object;Landro
11611161
HSPLandroidx/compose/animation/core/Animatable;-><init>(Ljava/lang/Object;Landroidx/compose/animation/core/TwoWayConverter;Ljava/lang/Object;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
11621162
HSPLandroidx/compose/animation/core/Animatable;->access$clampToBounds(Landroidx/compose/animation/core/Animatable;Ljava/lang/Object;)Ljava/lang/Object;
11631163
HSPLandroidx/compose/animation/core/Animatable;->access$endAnimation(Landroidx/compose/animation/core/Animatable;)V
1164-
HSPLandroidx/compose/animation/core/Animatable;->access$setTaskRunning(Landroidx/compose/animation/core/Animatable;Z)V
1164+
HSPLandroidx/compose/animation/core/Animatable;->access$setShowDialog(Landroidx/compose/animation/core/Animatable;Z)V
11651165
HSPLandroidx/compose/animation/core/Animatable;->access$setTargetValue(Landroidx/compose/animation/core/Animatable;Ljava/lang/Object;)V
11661166
HSPLandroidx/compose/animation/core/Animatable;->asState()Landroidx/compose/runtime/State;
11671167
HSPLandroidx/compose/animation/core/Animatable;->clampToBounds(Ljava/lang/Object;)Ljava/lang/Object;
@@ -1172,7 +1172,7 @@ HSPLandroidx/compose/animation/core/Animatable;->getTypeConverter()Landroidx/com
11721172
HSPLandroidx/compose/animation/core/Animatable;->getValue()Ljava/lang/Object;
11731173
HSPLandroidx/compose/animation/core/Animatable;->getVelocityVector()Landroidx/compose/animation/core/AnimationVector;
11741174
HSPLandroidx/compose/animation/core/Animatable;->runAnimation(Landroidx/compose/animation/core/Animation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
1175-
HSPLandroidx/compose/animation/core/Animatable;->setTaskRunning(Z)V
1175+
HSPLandroidx/compose/animation/core/Animatable;->setShowDialog(Z)V
11761176
HSPLandroidx/compose/animation/core/Animatable;->setTargetValue(Ljava/lang/Object;)V
11771177
Landroidx/compose/animation/core/Animatable$runAnimation$2;
11781178
HSPLandroidx/compose/animation/core/Animatable$runAnimation$2;-><init>(Landroidx/compose/animation/core/Animatable;Ljava/lang/Object;Landroidx/compose/animation/core/Animation;JLkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)V
@@ -1227,10 +1227,10 @@ HSPLandroidx/compose/animation/core/AnimationScope;->getLastFrameTimeNanos()J
12271227
HSPLandroidx/compose/animation/core/AnimationScope;->getStartTimeNanos()J
12281228
HSPLandroidx/compose/animation/core/AnimationScope;->getValue()Ljava/lang/Object;
12291229
HSPLandroidx/compose/animation/core/AnimationScope;->getVelocityVector()Landroidx/compose/animation/core/AnimationVector;
1230-
HSPLandroidx/compose/animation/core/AnimationScope;->isTaskRunning()Z
1230+
HSPLandroidx/compose/animation/core/AnimationScope;->getShowDialog()Z
12311231
HSPLandroidx/compose/animation/core/AnimationScope;->setFinishedTimeNanos$animation_core_release(J)V
12321232
HSPLandroidx/compose/animation/core/AnimationScope;->setLastFrameTimeNanos$animation_core_release(J)V
1233-
HSPLandroidx/compose/animation/core/AnimationScope;->setTaskRunning$animation_core_release(Z)V
1233+
HSPLandroidx/compose/animation/core/AnimationScope;->setShowDialog$animation_core_release(Z)V
12341234
HSPLandroidx/compose/animation/core/AnimationScope;->setValue$animation_core_release(Ljava/lang/Object;)V
12351235
HSPLandroidx/compose/animation/core/AnimationScope;->setVelocityVector$animation_core_release(Landroidx/compose/animation/core/AnimationVector;)V
12361236
Landroidx/compose/animation/core/AnimationSpec;
@@ -1257,10 +1257,10 @@ HSPLandroidx/compose/animation/core/AnimationState;->getLastFrameTimeNanos()J
12571257
HSPLandroidx/compose/animation/core/AnimationState;->getTypeConverter()Landroidx/compose/animation/core/TwoWayConverter;
12581258
HSPLandroidx/compose/animation/core/AnimationState;->getValue()Ljava/lang/Object;
12591259
HSPLandroidx/compose/animation/core/AnimationState;->getVelocityVector()Landroidx/compose/animation/core/AnimationVector;
1260-
HSPLandroidx/compose/animation/core/AnimationState;->isTaskRunning()Z
1260+
HSPLandroidx/compose/animation/core/AnimationState;->getShowDialog()Z
12611261
HSPLandroidx/compose/animation/core/AnimationState;->setFinishedTimeNanos$animation_core_release(J)V
12621262
HSPLandroidx/compose/animation/core/AnimationState;->setLastFrameTimeNanos$animation_core_release(J)V
1263-
HSPLandroidx/compose/animation/core/AnimationState;->setTaskRunning$animation_core_release(Z)V
1263+
HSPLandroidx/compose/animation/core/AnimationState;->setShowDialog$animation_core_release(Z)V
12641264
HSPLandroidx/compose/animation/core/AnimationState;->setValue$animation_core_release(Ljava/lang/Object;)V
12651265
HSPLandroidx/compose/animation/core/AnimationState;->setVelocityVector$animation_core_release(Landroidx/compose/animation/core/AnimationVector;)V
12661266
Landroidx/compose/animation/core/AnimationStateKt;
@@ -1411,17 +1411,17 @@ HSPLandroidx/compose/animation/core/InfiniteTransition;->access$setStartTimeNano
14111411
PLandroidx/compose/animation/core/InfiniteTransition;->access$setStartTimeNanos$p(Landroidx/compose/animation/core/InfiniteTransition;J)V
14121412
HSPLandroidx/compose/animation/core/InfiniteTransition;->addAnimation$animation_core_release(Landroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;)V
14131413
PLandroidx/compose/animation/core/InfiniteTransition;->addAnimation$animation_core_release(Landroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;)V
1414-
HSPLandroidx/compose/animation/core/InfiniteTransition;->isTaskRunning()Z
1415-
PLandroidx/compose/animation/core/InfiniteTransition;->isTaskRunning()Z
1414+
HSPLandroidx/compose/animation/core/InfiniteTransition;->getShowDialog()Z
1415+
PLandroidx/compose/animation/core/InfiniteTransition;->getShowDialog()Z
14161416
HSPLandroidx/compose/animation/core/InfiniteTransition;->onFrame(J)V
14171417
PLandroidx/compose/animation/core/InfiniteTransition;->onFrame(J)V
14181418
PLandroidx/compose/animation/core/InfiniteTransition;->removeAnimation$animation_core_release(Landroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;)V
14191419
HSPLandroidx/compose/animation/core/InfiniteTransition;->run$animation_core_release(Landroidx/compose/runtime/Composer;I)V
14201420
PLandroidx/compose/animation/core/InfiniteTransition;->run$animation_core_release(Landroidx/compose/runtime/Composer;I)V
14211421
HSPLandroidx/compose/animation/core/InfiniteTransition;->setRefreshChildNeeded(Z)V
14221422
PLandroidx/compose/animation/core/InfiniteTransition;->setRefreshChildNeeded(Z)V
1423-
HSPLandroidx/compose/animation/core/InfiniteTransition;->setTaskRunning(Z)V
1424-
PLandroidx/compose/animation/core/InfiniteTransition;->setTaskRunning(Z)V
1423+
HSPLandroidx/compose/animation/core/InfiniteTransition;->setShowDialog(Z)V
1424+
PLandroidx/compose/animation/core/InfiniteTransition;->setShowDialog(Z)V
14251425
Landroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;
14261426
HSPLandroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;-><init>(Landroidx/compose/animation/core/InfiniteTransition;Ljava/lang/Object;Ljava/lang/Object;Landroidx/compose/animation/core/TwoWayConverter;Landroidx/compose/animation/core/AnimationSpec;Ljava/lang/String;)V
14271427
PLandroidx/compose/animation/core/InfiniteTransition$TransitionAnimationState;-><init>(Landroidx/compose/animation/core/InfiniteTransition;Ljava/lang/Object;Ljava/lang/Object;Landroidx/compose/animation/core/TwoWayConverter;Landroidx/compose/animation/core/AnimationSpec;Ljava/lang/String;)V
@@ -1691,7 +1691,7 @@ HSPLandroidx/compose/animation/core/Transition;->getStartTimeNanos$animation_cor
16911691
HSPLandroidx/compose/animation/core/Transition;->getTargetState()Ljava/lang/Object;
16921692
HSPLandroidx/compose/animation/core/Transition;->getUpdateChildrenNeeded()Z
16931693
HSPLandroidx/compose/animation/core/Transition;->get_playTimeNanos()J
1694-
HSPLandroidx/compose/animation/core/Transition;->isTaskRunning()Z
1694+
HSPLandroidx/compose/animation/core/Transition;->getShowDialog()Z
16951695
HSPLandroidx/compose/animation/core/Transition;->isSeeking()Z
16961696
HSPLandroidx/compose/animation/core/Transition;->onChildAnimationUpdated()V
16971697
PLandroidx/compose/animation/core/Transition;->onDisposed$animation_core_release()V
@@ -1812,8 +1812,8 @@ Landroidx/compose/animation/core/TransitionState;
18121812
HSPLandroidx/compose/animation/core/TransitionState;-><clinit>()V
18131813
HSPLandroidx/compose/animation/core/TransitionState;-><init>()V
18141814
HSPLandroidx/compose/animation/core/TransitionState;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
1815-
HSPLandroidx/compose/animation/core/TransitionState;->isTaskRunning$animation_core_release()Z
1816-
HSPLandroidx/compose/animation/core/TransitionState;->setTaskRunning$animation_core_release(Z)V
1815+
HSPLandroidx/compose/animation/core/TransitionState;->getShowDialog$animation_core_release()Z
1816+
HSPLandroidx/compose/animation/core/TransitionState;->setShowDialog$animation_core_release(Z)V
18171817
Landroidx/compose/animation/core/TweenSpec;
18181818
HSPLandroidx/compose/animation/core/TweenSpec;-><clinit>()V
18191819
HSPLandroidx/compose/animation/core/TweenSpec;-><init>(IILandroidx/compose/animation/core/Easing;)V

app/src/main/java/com/raival/compose/file/explorer/App.kt

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ import com.raival.compose.file.explorer.common.extension.emptyString
2323
import com.raival.compose.file.explorer.common.extension.printFullStackTrace
2424
import com.raival.compose.file.explorer.common.extension.toFormattedDate
2525
import com.raival.compose.file.explorer.screen.main.MainActivityManager
26+
import com.raival.compose.file.explorer.screen.main.tab.files.FilesTabManager
2627
import com.raival.compose.file.explorer.screen.main.tab.files.coil.DocumentFileMapper
27-
import com.raival.compose.file.explorer.screen.main.tab.files.holder.DocumentHolder
28-
import com.raival.compose.file.explorer.screen.main.tab.files.manager.FilesTabManager
28+
import com.raival.compose.file.explorer.screen.main.tab.files.holder.LocalFileHolder
29+
import com.raival.compose.file.explorer.screen.main.tab.files.task.TaskManager
30+
import com.raival.compose.file.explorer.screen.main.tab.files.zip.ZipManager
2931
import com.raival.compose.file.explorer.screen.preferences.PreferencesManager
3032
import com.raival.compose.file.explorer.screen.textEditor.TextEditorManager
3133
import com.raival.compose.file.explorer.screen.viewer.ViewersManager
@@ -49,30 +51,31 @@ class App : Application(), coil3.SingletonImageLoader.Factory {
4951
get() = appContext as App
5052
}
5153

52-
val appFiles: DocumentHolder
53-
get() = DocumentHolder.fromFile(
54-
File(globalClass.cacheDir, "files").apply {
55-
if (!exists()) mkdirs()
56-
}
54+
val appFiles: LocalFileHolder
55+
get() = LocalFileHolder(
56+
File(globalClass.cacheDir, "files").apply { if (!exists()) mkdirs() }
5757
)
5858

59-
private val errorLogFile: DocumentHolder
60-
get() = "logs.txt".let {
61-
DocumentHolder.fromFile(File(globalClass.cacheDir, it).apply {
62-
if (!exists()) createNewFile()
63-
})
64-
}
59+
private val errorLogFile: LocalFileHolder
60+
get() = LocalFileHolder(
61+
File(globalClass.cacheDir, "logs.txt").apply { if (!exists()) createNewFile() }
62+
)
6563

66-
val recycleBinDir: DocumentHolder
67-
get() = DocumentHolder.fromFile(File(getExternalFilesDir(null), "bin").apply { mkdirs() })
64+
val recycleBinDir: LocalFileHolder
65+
get() = LocalFileHolder(File(getExternalFilesDir(null), "bin").apply { mkdirs() })
6866

6967
private var uid = 0
7068

7169
val textEditorManager: TextEditorManager by lazy { TextEditorManager().also { setupTextMate() } }
7270
val mainActivityManager: MainActivityManager by lazy { MainActivityManager().also { it.setupTabs() } }
7371
val filesTabManager: FilesTabManager by lazy { FilesTabManager() }
7472
val preferencesManager: PreferencesManager by lazy { PreferencesManager() }
75-
val viewersManager: ViewersManager by lazy { ViewersManager() }
73+
val viewersManager: ViewersManager by lazy {
74+
setupTextMate()
75+
ViewersManager()
76+
}
77+
val taskManager: TaskManager by lazy { TaskManager() }
78+
val zipManager: ZipManager by lazy { ZipManager() }
7679

7780
override fun onCreate() {
7881
Thread.setDefaultUncaughtExceptionHandler { _: Thread?, throwable: Throwable? ->
@@ -147,7 +150,7 @@ class App : Application(), coil3.SingletonImageLoader.Factory {
147150
if (!errorLogFile.exists()) return
148151
if (errorLogFile.isFolder) return
149152

150-
if (errorLogFile.fileSize > 1024 * 100) {
153+
if (errorLogFile.size > 1024 * 100) {
151154
errorLogFile.writeText(emptyString)
152155
}
153156

0 commit comments

Comments
 (0)