mirror of
https://github.com/hmalik144/Driver.git
synced 2026-03-18 15:36:03 +00:00
- minor bug fixes
Took 3 hours 24 minutes
This commit is contained in:
@@ -137,13 +137,15 @@ abstract class BaseFragment<V : BaseViewModel, VB : ViewBinding> : Fragment(), K
|
||||
open fun onImageGalleryResult(imageUris: List<Uri>?) {}
|
||||
|
||||
fun openGalleryForImage() {
|
||||
registerForActivityResult(getResultsContract()) { result ->
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when (result) {
|
||||
is Uri -> onImageGalleryResult(result)
|
||||
is List<*> -> onImageGalleryResult(result as List<Uri>)
|
||||
}
|
||||
}.launch(multipleImage)
|
||||
permissionRequest.launch(multipleImage)
|
||||
}
|
||||
|
||||
private val permissionRequest = registerForActivityResult(getResultsContract()) { result ->
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
when (result) {
|
||||
is Uri -> onImageGalleryResult(result)
|
||||
is List<*> -> onImageGalleryResult(result as List<Uri>)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getResultsContract(): ActivityResultContract<Boolean, Any?> {
|
||||
@@ -156,7 +158,7 @@ abstract class BaseFragment<V : BaseViewModel, VB : ViewBinding> : Fragment(), K
|
||||
}
|
||||
|
||||
override fun parseResult(resultCode: Int, intent: Intent?): Any? {
|
||||
intent?.clipData?.convertToList()?.let { clip ->
|
||||
intent?.clipData?.takeIf { it.itemCount > 1 }?.convertToList()?.let { clip ->
|
||||
val list = clip.takeIf { it.size > 10 }?.let {
|
||||
clip.subList(0, 9)
|
||||
} ?: clip
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#000b85</color>
|
||||
<color name="colorPrimaryDark">#010057</color>
|
||||
<color name="colorAccent">#03a9f4</color>
|
||||
<color name="colorPrimary">#548C2F</color>
|
||||
<color name="colorPrimaryDark">#104911</color>
|
||||
<color name="colorAccent">#548C2F</color>
|
||||
|
||||
|
||||
<color name="colour_one">#03a9f4</color>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
|
||||
<item name="android:windowBackground">@drawable/background_with_curve</item>
|
||||
<item name="android:actionMenuTextColor">@android:color/white</item>
|
||||
<item name="android:textColorHint">@android:color/white</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
</style>
|
||||
@@ -35,8 +34,18 @@
|
||||
<!--<item name="android:autofilledHighlight">@android:color/transparent</item>-->
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<style name="AppTheme.AppBarOverlay" parent="Theme.MaterialComponents.Dialog.Alert">
|
||||
<item name="windowActionBar">true</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="materialAlertDialogBodyTextStyle">@style/AlertDialogTextStyle</item>
|
||||
<item name="materialAlertDialogTitleTextStyle">@style/AlertDialogTextStyle</item>
|
||||
<item name="android:textColor">@color/colour_nine</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogTextStyle">
|
||||
<item name="android:textColor">#000000</item>
|
||||
<item name="android:textColorPrimary">#595959</item>
|
||||
<item name="android:colorAccent">#1b5e20</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
Reference in New Issue
Block a user