mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-27 17:08:34 +03:00
Improve dialog theming for M3
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
1d0ff0bade
commit
62fa8c9645
3 changed files with 15 additions and 16 deletions
|
@ -5,7 +5,6 @@ import android.content.Intent
|
|||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.EditText
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.SwitchCompat
|
||||
|
@ -14,6 +13,7 @@ import com.nextcloud.talk.R
|
|||
import com.nextcloud.talk.controllers.ConversationInfoController
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.databinding.ControllerConversationInfoBinding
|
||||
import com.nextcloud.talk.databinding.DialogPasswordBinding
|
||||
import com.nextcloud.talk.models.json.conversations.Conversation
|
||||
import com.nextcloud.talk.repositories.conversations.ConversationsRepository
|
||||
import com.nextcloud.talk.utils.Mimetype
|
||||
|
@ -92,21 +92,18 @@ class GuestAccessHelper(
|
|||
private fun showPasswordDialog(guestAccessPasswordSwitch: SwitchCompat) {
|
||||
val builder = MaterialAlertDialogBuilder(activity)
|
||||
builder.apply {
|
||||
val dialogPassword = LayoutInflater.from(context).inflate(R.layout.dialog_password, null)
|
||||
setView(dialogPassword)
|
||||
setTitle("Guest access password")
|
||||
setPositiveButton(
|
||||
"OK"
|
||||
) { _, _ ->
|
||||
val password = dialogPassword.findViewById<EditText>(R.id.password).text.toString()
|
||||
val dialogPassword = DialogPasswordBinding.inflate(LayoutInflater.from(context))
|
||||
viewThemeUtils.colorEditText(dialogPassword.password)
|
||||
setView(dialogPassword.root)
|
||||
setTitle(R.string.nc_guest_access_password_dialog_title)
|
||||
setPositiveButton(R.string.nc_ok) { _, _ ->
|
||||
val password = dialogPassword.password.text.toString()
|
||||
conversationsRepository.password(password, conversation.token!!)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(PasswordResultObserver(true))
|
||||
}
|
||||
setNegativeButton(
|
||||
"Cancel"
|
||||
) { _, _ ->
|
||||
setNegativeButton(R.string.nc_cancel) { _, _ ->
|
||||
guestAccessPasswordSwitch.isChecked = false
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
<!--
|
||||
Nextcloud Talk application
|
||||
|
||||
@author Andy Scherzinger
|
||||
@author Tim Krüger
|
||||
Copyright (C) 2022 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
Copyright (C) 2022 Tim Krüger
|
||||
Copyright (C) 2022 Nextcloud GmbH
|
||||
|
||||
|
@ -30,12 +32,11 @@
|
|||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/standard_margin"
|
||||
android:layout_marginStart="@dimen/dialog_padding"
|
||||
android:layout_marginTop="@dimen/standard_margin"
|
||||
android:layout_marginEnd="@dimen/standard_margin"
|
||||
android:layout_marginEnd="@dimen/dialog_padding"
|
||||
android:layout_marginBottom="@dimen/standard_margin"
|
||||
android:hint="@string/nc_guest_access_password_hint"
|
||||
android:hint="@string/nc_guest_access_password_dialog_hint"
|
||||
android:inputType="textPassword"
|
||||
android:importantForAutofill="no" />
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -338,7 +338,8 @@
|
|||
<string name="nc_guest_access_allow_failed">Can\'t en-/disable guest access.</string>
|
||||
<string name="nc_guest_access_password_title">Password protection</string>
|
||||
<string name="nc_guest_access_password_summary">Set a password to restrict who can use the public link.</string>
|
||||
<string name="nc_guest_access_password_hint">Enter a password</string>
|
||||
<string name="nc_guest_access_password_dialog_title">Guest access password</string>
|
||||
<string name="nc_guest_access_password_dialog_hint">Enter a password</string>
|
||||
<string name="nc_guest_access_password_failed">Error during setting/disabling the password.</string>
|
||||
<string name="nc_guest_access_password_weak_alert_title">Weak password</string>
|
||||
<string name="nc_guest_access_share_link">Share conversation link</string>
|
||||
|
|
Loading…
Reference in a new issue