Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Linux13524 committed Sep 12, 2019
1 parent 2efad93 commit 10d3319
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions app/src/main/java/de/linux13524/ytldl/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,35 @@ class MainActivity : FragmentActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

initPermissions()
initNavigation()
initDownloadOptions()
initFilesystem()

LogReader(::updateLog).run()
}

private fun initNavigation(){
val navController = findNavController(R.id.nav_host_fragment)
val appBarConfiguration = AppBarConfiguration(navController.graph, drawer_layout)

toolbar.setupWithNavController(navController, appBarConfiguration)
nav_view.setupWithNavController(navController)
}

Filesystem.Settings.setDbPath("/data/data/de.linux13524.ytldl/databases/")
Filesystem.Settings.setVideoPath(sdCardDir)
private fun initDownloadOptions(){
syncPreferencesWithGlobalDownloadOptions()
// TODO: Add to settings fragment/preferences
GlobalDownloadOptions.setSaveVideoName(true)
GlobalDownloadOptions.setPath(sdCardDir)
}

PermissionManager.checkPermissions(this)
private fun initFilesystem(){
FilesystemSettings.setDbPath("/data/data/de.linux13524.ytldl/databases/")
}

LogReader(::updateLog).run()
private fun initPermissions(){
PermissionManager.checkPermissions(this)
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
Expand Down

0 comments on commit 10d3319

Please sign in to comment.