mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-04-24 22:38:42 +02:00
adding a couple more dialog updates
This commit is contained in:
parent
d42fe722ee
commit
1f6ae902ee
@ -351,6 +351,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener {
|
|||||||
|
|
||||||
view_pager.onGlobalLayout {
|
view_pager.onGlobalLayout {
|
||||||
refreshContacts(ALL_TABS_MASK)
|
refreshContacts(ALL_TABS_MASK)
|
||||||
|
refreshMenuItems()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
|
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
|
||||||
|
@ -30,17 +30,17 @@ class ExportContactsDialog(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_contacts, null) as ViewGroup).apply {
|
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_contacts, null) as ViewGroup).apply {
|
||||||
export_contacts_folder.text = activity.humanizePath(realPath)
|
export_contacts_folder.setText(activity.humanizePath(realPath))
|
||||||
export_contacts_filename.setText("contacts_${activity.getCurrentFormattedDateTime()}")
|
export_contacts_filename.setText("contacts_${activity.getCurrentFormattedDateTime()}")
|
||||||
|
|
||||||
if (hidePath) {
|
if (hidePath) {
|
||||||
export_contacts_folder_label.beGone()
|
export_contacts_folder_hint.beGone()
|
||||||
export_contacts_folder.beGone()
|
export_contacts_folder.beGone()
|
||||||
} else {
|
} else {
|
||||||
export_contacts_folder.setOnClickListener {
|
export_contacts_folder.setOnClickListener {
|
||||||
activity.hideKeyboard(export_contacts_filename)
|
activity.hideKeyboard(export_contacts_filename)
|
||||||
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
FilePickerDialog(activity, realPath, false, showFAB = true) {
|
||||||
export_contacts_folder.text = activity.humanizePath(it)
|
export_contacts_folder.setText(activity.humanizePath(it))
|
||||||
realPath = it
|
realPath = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,14 +25,14 @@ class ImportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
|||||||
val view = (activity.layoutInflater.inflate(R.layout.dialog_import_contacts, null) as ViewGroup).apply {
|
val view = (activity.layoutInflater.inflate(R.layout.dialog_import_contacts, null) as ViewGroup).apply {
|
||||||
targetContactSource = activity.config.lastUsedContactSource
|
targetContactSource = activity.config.lastUsedContactSource
|
||||||
activity.getPublicContactSource(targetContactSource) {
|
activity.getPublicContactSource(targetContactSource) {
|
||||||
import_contacts_title.text = it
|
import_contacts_title.setText(it)
|
||||||
if (it.isEmpty()) {
|
if (it.isEmpty()) {
|
||||||
ContactsHelper(activity).getContactSources {
|
ContactsHelper(activity).getContactSources {
|
||||||
val localSource = it.firstOrNull { it.name == SMT_PRIVATE }
|
val localSource = it.firstOrNull { it.name == SMT_PRIVATE }
|
||||||
if (localSource != null) {
|
if (localSource != null) {
|
||||||
targetContactSource = localSource.name
|
targetContactSource = localSource.name
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
import_contacts_title.text = localSource.publicName
|
import_contacts_title.setText(localSource.publicName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,7 +43,8 @@ class ImportContactsDialog(val activity: SimpleActivity, val path: String, priva
|
|||||||
activity.showContactSourcePicker(targetContactSource) {
|
activity.showContactSourcePicker(targetContactSource) {
|
||||||
targetContactSource = if (it == activity.getString(R.string.phone_storage_hidden)) SMT_PRIVATE else it
|
targetContactSource = if (it == activity.getString(R.string.phone_storage_hidden)) SMT_PRIVATE else it
|
||||||
activity.getPublicContactSource(it) {
|
activity.getPublicContactSource(it) {
|
||||||
import_contacts_title.text = if (it == "") activity.getString(R.string.phone_storage) else it
|
val title = if (it == "") activity.getString(R.string.phone_storage) else it
|
||||||
|
import_contacts_title.setText(title)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,9 @@ class SelectContactsDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if selecting multiple contacts is disabled, react on first contact click and dismiss the dialog
|
// if selecting multiple contacts is disabled, react on first contact click and dismiss the dialog
|
||||||
val contactClickCallback: ((Contact) -> Unit)? = if (allowSelectMultiple) null else { contact ->
|
val contactClickCallback: ((Contact) -> Unit)? = if (allowSelectMultiple) {
|
||||||
|
null
|
||||||
|
} else { contact ->
|
||||||
callback(arrayListOf(contact), arrayListOf())
|
callback(arrayListOf(contact), arrayListOf())
|
||||||
dialog!!.dismiss()
|
dialog!!.dismiss()
|
||||||
}
|
}
|
||||||
|
@ -10,42 +10,42 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin">
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin">
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||||
android:id="@+id/export_contacts_folder_label"
|
android:id="@+id/export_contacts_folder_hint"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/folder"
|
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/export_contacts_folder"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/activity_margin"
|
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
android:paddingTop="@dimen/small_margin"
|
android:hint="@string/folder"
|
||||||
android:paddingEnd="@dimen/small_margin"
|
android:paddingStart="@dimen/activity_margin"
|
||||||
android:paddingBottom="@dimen/small_margin" />
|
android:paddingEnd="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/export_contacts_folder"
|
||||||
|
style="@style/UnclickableEditText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextInputLayout
|
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||||
android:id="@+id/export_contacts_filename_hint"
|
android:id="@+id/export_contacts_filename_hint"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="@string/filename_without_vcf">
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
|
android:hint="@string/filename_without_vcf"
|
||||||
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/export_contacts_filename"
|
android:id="@+id/export_contacts_filename"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/activity_margin"
|
android:inputType="textCapWords"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:singleLine="true"
|
||||||
android:paddingEnd="@dimen/small_margin"
|
|
||||||
android:textCursorDrawable="@null"
|
android:textCursorDrawable="@null"
|
||||||
android:textSize="@dimen/normal_text_size" />
|
android:textSize="@dimen/bigger_text_size" />
|
||||||
|
|
||||||
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||||
|
|
||||||
@ -53,7 +53,9 @@
|
|||||||
android:id="@+id/export_contacts_divider"
|
android:id="@+id/export_contacts_divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1px"
|
android:layout_height="1px"
|
||||||
|
android:layout_marginStart="@dimen/activity_margin"
|
||||||
android:layout_marginTop="@dimen/medium_margin"
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:layout_marginEnd="@dimen/activity_margin"
|
||||||
android:layout_marginBottom="@dimen/medium_margin"
|
android:layout_marginBottom="@dimen/medium_margin"
|
||||||
android:background="@color/divider_grey"
|
android:background="@color/divider_grey"
|
||||||
android:importantForAccessibility="no" />
|
android:importantForAccessibility="no" />
|
||||||
@ -62,7 +64,8 @@
|
|||||||
android:id="@+id/export_contacts_pick_sources_label"
|
android:id="@+id/export_contacts_pick_sources_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="@dimen/small_margin"
|
android:paddingStart="@dimen/activity_margin"
|
||||||
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
android:text="@string/include_contact_sources"
|
android:text="@string/include_contact_sources"
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
android:textSize="@dimen/smaller_text_size" />
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.simplemobiletools.commons.views.MyRecyclerView
|
<com.simplemobiletools.commons.views.MyRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/filter_contact_sources_list"
|
android:id="@+id/filter_contact_sources_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -8,4 +7,4 @@
|
|||||||
android:clipToPadding="false"
|
android:clipToPadding="false"
|
||||||
android:overScrollMode="never"
|
android:overScrollMode="never"
|
||||||
android:paddingTop="@dimen/medium_margin"
|
android:paddingTop="@dimen/medium_margin"
|
||||||
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
|
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/import_contacts_holder"
|
android:id="@+id/import_contacts_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@ -9,23 +8,18 @@
|
|||||||
android:paddingTop="@dimen/activity_margin"
|
android:paddingTop="@dimen/activity_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin">
|
android:paddingEnd="@dimen/activity_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
<com.simplemobiletools.commons.views.MyTextInputLayout
|
||||||
android:id="@+id/import_contacts_source_label"
|
android:id="@+id/import_contacts_hint"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="@dimen/small_margin"
|
|
||||||
android:text="@string/target_contact_source"
|
|
||||||
android:textSize="@dimen/smaller_text_size" />
|
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyTextView
|
|
||||||
android:id="@+id/import_contacts_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/small_margin"
|
android:layout_marginBottom="@dimen/activity_margin"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:hint="@string/target_contact_source">
|
||||||
android:paddingTop="@dimen/activity_margin"
|
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/activity_margin"
|
|
||||||
tools:text="Phone" />
|
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/import_contacts_title"
|
||||||
|
style="@style/UnclickableEditText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
</com.simplemobiletools.commons.views.MyTextInputLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:minHeight="@dimen/min_row_height"
|
android:minHeight="@dimen/min_row_height"
|
||||||
android:paddingStart="@dimen/tiny_margin"
|
android:paddingStart="@dimen/tiny_margin"
|
||||||
android:paddingTop="@dimen/normal_margin"
|
android:paddingTop="@dimen/normal_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/normal_margin">
|
android:paddingBottom="@dimen/normal_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -49,8 +48,8 @@
|
|||||||
android:layout_toStartOf="@+id/contact_checkbox"
|
android:layout_toStartOf="@+id/contact_checkbox"
|
||||||
android:layout_toEndOf="@+id/contact_tmb"
|
android:layout_toEndOf="@+id/contact_tmb"
|
||||||
android:alpha="0.6"
|
android:alpha="0.6"
|
||||||
android:maxLines="1"
|
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
android:paddingStart="@dimen/medium_margin"
|
android:paddingStart="@dimen/medium_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
android:paddingEnd="@dimen/activity_margin"
|
||||||
android:textSize="@dimen/bigger_text_size"
|
android:textSize="@dimen/bigger_text_size"
|
||||||
@ -62,6 +61,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:gravity="center_vertical" />
|
android:gravity="center_vertical" />
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
android:minHeight="@dimen/min_row_height"
|
android:minHeight="@dimen/min_row_height"
|
||||||
android:paddingStart="@dimen/tiny_margin"
|
android:paddingStart="@dimen/tiny_margin"
|
||||||
android:paddingTop="@dimen/medium_margin"
|
android:paddingTop="@dimen/medium_margin"
|
||||||
android:paddingEnd="@dimen/activity_margin"
|
|
||||||
android:paddingBottom="@dimen/medium_margin">
|
android:paddingBottom="@dimen/medium_margin">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -47,6 +46,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
|
android:background="@null"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:gravity="center_vertical" />
|
android:gravity="center_vertical" />
|
||||||
|
@ -4,13 +4,17 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
android:padding="@dimen/normal_margin">
|
android:paddingStart="@dimen/normal_margin"
|
||||||
|
android:paddingTop="@dimen/small_margin"
|
||||||
|
android:paddingEnd="@dimen/normal_margin"
|
||||||
|
android:paddingBottom="@dimen/small_margin">
|
||||||
|
|
||||||
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
|
||||||
android:id="@+id/filter_contact_source_checkbox"
|
android:id="@+id/filter_contact_source_checkbox"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/medium_margin"
|
android:layout_marginEnd="@dimen/medium_margin"
|
||||||
|
android:background="@null"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:paddingStart="@dimen/small_margin" />
|
android:paddingStart="@dimen/small_margin" />
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user