updating add a context toast extension too

This commit is contained in:
tibbi 2017-07-28 20:24:31 +02:00
parent 287d77cac6
commit 82e50bbcce
2 changed files with 6 additions and 1 deletions

View file

@ -29,7 +29,7 @@ ext {
propMinSdkVersion = 16
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '2.22.8'
propVersionName = '2.22.9'
kotlin_version = '1.1.3-2'
support_libs = '25.3.1'
}

View file

@ -12,6 +12,7 @@ import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.widget.TextView
import android.widget.Toast
import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.helpers.BaseConfig
import com.simplemobiletools.commons.helpers.PREFS_KEY
@ -92,6 +93,10 @@ fun Context.setupDialogStuff(view: View, dialog: AlertDialog, titleId: Int = 0)
}
}
fun Context.toast(id: Int, length: Int = Toast.LENGTH_SHORT) {
Toast.makeText(this, id, length).show()
}
val Context.baseConfig: BaseConfig get() = BaseConfig.newInstance(this)
val Context.sdCardPath: String get() = baseConfig.sdCardPath
val Context.internalStoragePath: String get() = baseConfig.internalStoragePath