Merge pull request #23 from SimpleMobileTools/master

upd
This commit is contained in:
solokot 2018-03-23 13:55:05 +03:00 committed by GitHub
commit 70a52296db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 40 deletions

View file

@ -6,7 +6,7 @@ buildscript {
propMinSdkVersion = 16
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '3.16.11'
propVersionName = '3.16.15'
kotlin_version = '1.2.30'
support_libs = '27.1.0'
}

View file

@ -96,6 +96,7 @@ fun Activity.isShowingSAFDialog(path: String, treeUri: String, requestCode: Int)
runOnUiThread {
WritePermissionDialog(this, false) {
Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).apply {
putExtra("android.content.extra.SHOW_ADVANCED", true)
if (resolveActivity(packageManager) == null) {
type = "*/*"
}

View file

@ -3,6 +3,7 @@ package com.simplemobiletools.commons.extensions
import android.annotation.SuppressLint
import android.content.ContentValues
import android.content.Context
import android.content.ReceiverCallNotAllowedException
import android.hardware.usb.UsbManager
import android.media.MediaScannerConnection
import android.net.Uri
@ -236,7 +237,7 @@ fun Context.rescanPaths(paths: ArrayList<String>, callback: (() -> Unit)? = null
override fun onMediaScannerConnected() {
paths.forEach {
if (connection?.isConnected == true) {
connection?.scanFile(it, "")
connection?.scanFile(it, it.getMimeType())
}
}
}
@ -250,7 +251,10 @@ fun Context.rescanPaths(paths: ArrayList<String>, callback: (() -> Unit)? = null
}
connection = MediaScannerConnection(this, connectionClient)
connection.connect()
try {
connection.connect()
} catch (ignored: ReceiverCallNotAllowedException) {
}
}
fun getPaths(file: File): ArrayList<String> {

View file

@ -9,6 +9,7 @@
android:id="@+id/dialog_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin"/>

View file

@ -220,10 +220,10 @@
<string name="fingerprint_setup_successfully">Configuració de la protecció amb èxit. Torneu a instal·lar l\'aplicació en cas de problemes amb restablir-la.</string>
<!-- Times -->
<string name="seconds_raw">seconds</string>
<string name="minutes_raw">minutes</string>
<string name="hours_raw">hours</string>
<string name="days_raw">days</string>
<string name="seconds_raw">segons</string>
<string name="minutes_raw">minuts</string>
<string name="hours_raw">hores</string>
<string name="days_raw">dies</string>
<plurals name="seconds">
<item quantity="one">%d segon</item>
@ -270,37 +270,37 @@
<!-- For example: Event reminder: 3 minutes before -->
<plurals name="seconds_before">
<item quantity="one">%d second before</item>
<item quantity="other">%d seconds before</item>
<item quantity="one">%d segon abans</item>
<item quantity="other">%d segons abans</item>
</plurals>
<plurals name="minutes_before">
<item quantity="one">%d minute before</item>
<item quantity="other">%d minutes before</item>
<item quantity="one">%d minut abans</item>
<item quantity="other">%d minuts abans</item>
</plurals>
<plurals name="hours_before">
<item quantity="one">%d hour before</item>
<item quantity="other">%d hours before</item>
<item quantity="one">%d hora abans</item>
<item quantity="other">%d hores abans</item>
</plurals>
<plurals name="days_before">
<item quantity="one">%d day before</item>
<item quantity="other">%d days before</item>
<item quantity="one">%d dia abans</item>
<item quantity="other">%d dies abans</item>
</plurals>
<!-- For example: Postpone reminder by 3 minutes -->
<plurals name="by_seconds">
<item quantity="one">%d second</item>
<item quantity="few">%d seconds</item>
<item quantity="other">%d seconds</item>
<item quantity="one">%d segon</item>
<item quantity="few">%d segons</item>
<item quantity="other">%d segons</item>
</plurals>
<plurals name="by_minutes">
<item quantity="one">%d minutu</item>
<item quantity="few">%d minuty</item>
<item quantity="other">%d minut</item>
<item quantity="one">%d minut</item>
<item quantity="few">%d minuts</item>
<item quantity="other">%d minuts</item>
</plurals>
<plurals name="by_hours">
<item quantity="one">%d hodina</item>
<item quantity="few">%d hodiny</item>
<item quantity="other">%d hodin</item>
<item quantity="one">%d hora</item>
<item quantity="few">%d hores</item>
<item quantity="other">%d hores</item>
</plurals>
<!-- For example: Time remaining till the alarm goes off: 6 hours, 5 minutes -->
@ -337,7 +337,7 @@
<string name="widgets">Ginys</string>
<string name="use_same_snooze">Utilitzeu sempre el mateix temps de posposat</string>
<string name="snooze_time">Temps de posposat</string>
<string name="vibrate_on_button_press">Vibrate on button press</string>
<string name="vibrate_on_button_press">Vibrar al prŕmer un botó</string>
<!-- Setting sections -->
<string name="visibility">Visibilitat</string>
@ -391,13 +391,13 @@
<string name="saturday_letter">DS</string>
<string name="sunday_letter">DG</string>
<string name="monday_short">Dil</string>
<string name="tuesday_short">Dim</string>
<string name="wednesday_short">Dim</string>
<string name="thursday_short">Dij</string>
<string name="friday_short">Div</string>
<string name="saturday_short">Dis</string>
<string name="sunday_short">Diu</string>
<string name="monday_short">DL</string>
<string name="tuesday_short">DT</string>
<string name="wednesday_short">DC</string>
<string name="thursday_short">DJ</string>
<string name="friday_short">DV</string>
<string name="saturday_short">DS</string>
<string name="sunday_short">DG</string>
<!-- About -->
<string name="about">Sobre</string>
@ -472,5 +472,5 @@
<string name="espresso_title">Espresso (testing helper)</string>
<string name="gson_title">Gson (JSON parser)</string>
<string name="leak_canary_title">Leak Canary (memory leak detector)</string>
<string name="number_picker_title">Number Picker (customizable number picker)</string>
<string name="number_picker_title">Selector de números (selector de números personalitzable)</string>
</resources>

View file

@ -220,7 +220,7 @@
<string name="fingerprint_setup_successfully">Configuración de protección con éxito. Por favor, vuelva a instalar la aplicación en caso de problemas al restablecerla.</string>
<!-- Times -->
<string name="seconds_raw">seconds</string>
<string name="seconds_raw">segundos</string>
<string name="minutes_raw">minutos</string>
<string name="hours_raw">horas</string>
<string name="days_raw">días</string>
@ -270,8 +270,8 @@
<!-- For example: Event reminder: 3 minutes before -->
<plurals name="seconds_before">
<item quantity="one">%d second before</item>
<item quantity="other">%d seconds before</item>
<item quantity="one">%d segundo antes</item>
<item quantity="other">%d segundos antes</item>
</plurals>
<plurals name="minutes_before">
<item quantity="one">%d minuto antes</item>
@ -288,8 +288,8 @@
<!-- For example: Postpone reminder by 3 minutes -->
<plurals name="by_seconds">
<item quantity="one">%d second</item>
<item quantity="other">%d seconds</item>
<item quantity="one">%d segundo</item>
<item quantity="other">%d segundos</item>
</plurals>
<plurals name="by_minutes">
<item quantity="one">%d minuto</item>
@ -334,7 +334,7 @@
<string name="widgets">Widgets</string>
<string name="use_same_snooze">Siempre use el mismo tiempo de repetición</string>
<string name="snooze_time">Tiempo de repetición</string>
<string name="vibrate_on_button_press">Vibrate on button press</string>
<string name="vibrate_on_button_press">Vibrar al presionar un botón</string>
<!-- Setting sections -->
<string name="visibility">Visibilidad</string>
@ -469,5 +469,5 @@
<string name="espresso_title">Espresso (testing helper)</string>
<string name="gson_title">Gson (JSON parser)</string>
<string name="leak_canary_title">Leak Canary (memory leak detector)</string>
<string name="number_picker_title">Number Picker (customizable number picker)</string>
<string name="number_picker_title">Selector de número (selector de número personalizable)</string>
</resources>