Minor tracking updates from PR

Updated remove tracking strings
Login dialog cannot be cancelled while logging in
Extremly minor layout changes
This commit is contained in:
Jay 2020-06-06 21:31:13 -04:00
parent 7fc84f6924
commit 3bd8f92824
3 changed files with 18 additions and 13 deletions

View File

@ -36,19 +36,22 @@ class TrackRemoveDialog<T> : DialogController
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
val item = item
val dialog = MaterialDialog(activity!!)
.title(R.string.remove_tracking)
val dialog = MaterialDialog(activity!!).title(R.string.remove_tracking)
.negativeButton(android.R.string.cancel)
if (item.service.canRemoveFromService()) {
dialog.checkBoxPrompt(
text = activity!!.getString(
R.string.remove_tracking_from_, item.service.name
), onToggle = null
).positiveButton(android.R.string.ok) { listener.removeTracker(item, it.isCheckPromptChecked()) }
), isCheckedDefault = true, onToggle = null
).positiveButton(R.string.remove) {
listener.removeTracker(
item, it.isCheckPromptChecked()
)
}
dialog.getCheckBoxPrompt().textSize = 16f
} else {
dialog.positiveButton(android.R.string.ok) { listener.removeTracker(item, false) }
dialog.positiveButton(R.string.remove) { listener.removeTracker(item, false) }
}
return dialog

View File

@ -41,6 +41,8 @@ class TrackLoginDialog(usernameLabel: String? = null, bundle: Bundle? = null) :
return
}
dialog?.setCancelable(false)
dialog?.setCanceledOnTouchOutside(false)
val user = username.text.toString()
val pass = password.text.toString()
scope.launch {
@ -62,6 +64,8 @@ class TrackLoginDialog(usernameLabel: String? = null, bundle: Bundle? = null) :
private fun errorResult() {
v?.apply {
dialog?.setCancelable(true)
dialog?.setCanceledOnTouchOutside(true)
login.revertAnimation {
login.text = activity!!.getText(R.string.unknown_error)
}

View File

@ -65,31 +65,29 @@
android:maxLines="1"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="8dp"
android:paddingEnd="30dp"
android:paddingBottom="16dp"
android:text="@string/title"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/track_remove"
app:layout_constraintEnd_toEndOf="@id/status_container"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="dfdffggjdfigjssdfgidfjgidgjdifgjfdgifdjgid" />
tools:text="Tracking name that is really long so i can see the padding" />
<ImageView
android:id="@+id/track_remove"
style="@style/Theme.Widget.CustomImageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/open_in_webview"
android:src="@drawable/ic_close_circle_24dp"
android:layout_marginStart="2dp"
android:layout_marginEnd="4dp"
android:contentDescription="@string/open_in_webview"
android:src="@drawable/ic_close_circle_24dp"
android:tint="@color/text_color_secondary"
android:tooltipText="@string/remove_tracking"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/status_container"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@id/track_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>