M4: browser UI (navigation, sort, selection, dialogs, permission prompts, platform delete)
This commit is contained in:
@@ -1,13 +1,37 @@
|
||||
package de.softwareapp_hb.filemanager
|
||||
|
||||
import android.app.Application
|
||||
import de.softwareapp_hb.filemanager.data.DeleteRequestFactory
|
||||
import de.softwareapp_hb.filemanager.data.MediaStoreDeleter
|
||||
import de.softwareapp_hb.filemanager.data.StorageProvider
|
||||
import de.softwareapp_hb.filemanager.domain.OperationNotifier
|
||||
import de.softwareapp_hb.filemanager.service.ServiceOperationNotifier
|
||||
|
||||
/**
|
||||
* Application entry point.
|
||||
* Application entry point and the app's tiny object graph.
|
||||
*
|
||||
* Deliberately lightweight: the app has no dependency-injection graph, no analytics
|
||||
* and no network access. From M2 this will own the browser/operations controller so
|
||||
* that navigation and long-running file operations survive activity recreation; the
|
||||
* storage layer and preference stores are opened lazily where they are used.
|
||||
* There is no dependency-injection framework here on purpose: three long-lived
|
||||
* collaborators are built once and handed to the one ViewModel that needs them. Nothing
|
||||
* holds a reference to an Activity, so none of this leaks.
|
||||
*/
|
||||
class FileManagerApplication : Application()
|
||||
class FileManagerApplication : Application() {
|
||||
|
||||
/** Where files live and which backend is in effect. */
|
||||
lateinit var storage: StorageProvider
|
||||
private set
|
||||
|
||||
/** Keeps the foreground service in step with a running operation. */
|
||||
lateinit var notifier: OperationNotifier
|
||||
private set
|
||||
|
||||
/** Builds the platform's own delete confirmation, when it can. */
|
||||
lateinit var deleteRequests: DeleteRequestFactory
|
||||
private set
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
storage = StorageProvider(this)
|
||||
notifier = ServiceOperationNotifier(this)
|
||||
deleteRequests = MediaStoreDeleter(this).factory()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user