adding an explanation dialog to Grant All Files
This commit is contained in:
parent
2eafcbd22e
commit
d9351ddf9c
2 changed files with 56 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
package com.simplemobiletools.gallery.pro.dialogs
|
||||
|
||||
import android.view.View
|
||||
import com.simplemobiletools.commons.activities.BaseSimpleActivity
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.getAlertDialogBuilder
|
||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import com.simplemobiletools.gallery.pro.R
|
||||
import com.simplemobiletools.gallery.pro.extensions.launchGrantAllFilesIntent
|
||||
import kotlinx.android.synthetic.main.dialog_grant_all_files.view.*
|
||||
|
||||
class GrantAllFilesDialog(val activity: BaseSimpleActivity) {
|
||||
init {
|
||||
val view: View = activity.layoutInflater.inflate(R.layout.dialog_grant_all_files, null)
|
||||
view.grant_all_files_image.applyColorFilter(activity.getProperTextColor())
|
||||
|
||||
activity.getAlertDialogBuilder()
|
||||
.setPositiveButton(R.string.ok) { dialog, which -> activity.launchGrantAllFilesIntent() }
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.apply {
|
||||
activity.setupDialogStuff(view, this, cancelOnTouchOutside = false) { alertDialog -> }
|
||||
}
|
||||
}
|
||||
}
|
31
app/src/main/res/layout/dialog_grant_all_files.xml
Normal file
31
app/src/main/res/layout/dialog_grant_all_files.xml
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/grant_all_files_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/grant_all_files_image"
|
||||
android:layout_width="@dimen/fab_size"
|
||||
android:layout_height="@dimen/fab_size"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/bigger_margin"
|
||||
android:src="@drawable/ic_folder_vector" />
|
||||
|
||||
<com.simplemobiletools.commons.views.MyTextView
|
||||
android:id="@+id/grant_all_files_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/grant_all_files_image"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="1sp"
|
||||
android:paddingStart="@dimen/bigger_margin"
|
||||
android:paddingTop="@dimen/normal_margin"
|
||||
android:paddingEnd="@dimen/bigger_margin"
|
||||
android:paddingBottom="@dimen/normal_margin"
|
||||
android:text="@string/hidden_all_files"
|
||||
android:textColorHighlight="@color/disabled_text_color_highlight"
|
||||
android:textSize="@dimen/bigger_text_size" />
|
||||
|
||||
</RelativeLayout>
|
Loading…
Reference in a new issue