Preferences with conductor (#792)

* Settings with conductor WIP

* Add downloads preference controller. Implement source/track login

* Improve settings controllers

* Backup settings controller

* Delete preferences xml

* Remove keys from xml

* PreferenceKeys is now an object

* Remove now unused dependency
This commit is contained in:
inorichi
2017-05-14 00:45:14 +02:00
committed by GitHub
parent 29fd5747eb
commit ff190e02d4
51 changed files with 1969 additions and 2091 deletions

View File

@@ -107,13 +107,20 @@ object DiskUtil {
* Scans the given file so that it can be shown in gallery apps, for example.
*/
fun scanMedia(context: Context, file: File) {
scanMedia(context, Uri.fromFile(file))
}
/**
* Scans the given file so that it can be shown in gallery apps, for example.
*/
fun scanMedia(context: Context, uri: Uri) {
val action = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Intent.ACTION_MEDIA_MOUNTED
} else {
Intent.ACTION_MEDIA_SCANNER_SCAN_FILE
}
val mediaScanIntent = Intent(action)
mediaScanIntent.data = Uri.fromFile(file)
mediaScanIntent.data = uri
context.sendBroadcast(mediaScanIntent)
}