diff --git a/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesAdapter.kt b/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesAdapter.kt index fd95ce7..ecd98f1 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesAdapter.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesAdapter.kt @@ -35,7 +35,7 @@ class IdentitiesAdapter(private val listener: Listener) : listener.onIdentityClick(item) } holder.binding.container.setOnLongClickListener { - listener.onIdentityLongClick(item, holder.itemView); + listener.onIdentityLongClick(item, holder.itemView) true } } diff --git a/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesFragment.kt b/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesFragment.kt index 5c98097..f336cb9 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesFragment.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/IdentitiesFragment.kt @@ -20,7 +20,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import java.util.* -class IdentitiesFragment : Fragment(), IdentitiesAdapter.Listener, IdentityDialog.Listener { +class IdentitiesFragment : Fragment(), IdentitiesAdapter.Listener, IdentityEditDialog.Listener { private val vm: IdentitiesViewModel by viewModels() private lateinit var binding: FragmentIdentitiesBinding private lateinit var adapter: IdentitiesAdapter @@ -41,7 +41,7 @@ class IdentitiesFragment : Fragment(), IdentitiesAdapter.Listener, IdentityDialo adapter = IdentitiesAdapter(this) binding.list.adapter = adapter - binding.floatingActionButton.setOnClickListener { openNewIdentityEditor() } + binding.floatingActionButton.setOnClickListener { openIdentityWizard() } vm.identities.observe(viewLifecycleOwner) { adapter.setIdentities(it) } @@ -49,7 +49,7 @@ class IdentitiesFragment : Fragment(), IdentitiesAdapter.Listener, IdentityDialo } override fun onIdentityClick(identity: Identity) { - IdentityDialog(requireContext(), identity, this).show() + IdentityEditDialog(requireContext(), identity, this).show() } override fun onIdentityLongClick(identity: Identity, view: View) { @@ -59,7 +59,7 @@ class IdentitiesFragment : Fragment(), IdentitiesAdapter.Listener, IdentityDialo setOnMenuItemClickListener { item -> when (item.itemId) { R.id.item_edit -> { - IdentityDialog( + IdentityEditDialog( requireContext(), identity, this@IdentitiesFragment diff --git a/app/src/main/java/dev/lowrespalmtree/comet/IdentityDialog.kt b/app/src/main/java/dev/lowrespalmtree/comet/IdentityEditDialog.kt similarity index 97% rename from app/src/main/java/dev/lowrespalmtree/comet/IdentityDialog.kt rename to app/src/main/java/dev/lowrespalmtree/comet/IdentityEditDialog.kt index 20ccc01..f34eb9f 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/IdentityDialog.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/IdentityEditDialog.kt @@ -5,7 +5,7 @@ import android.content.Context import android.view.LayoutInflater import dev.lowrespalmtree.comet.databinding.DialogIdentityBinding -class IdentityDialog( +class IdentityEditDialog( private val context: Context, private val identity: Identities.Identity, private val listener: Listener diff --git a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt index d9590b4..586f310 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/PageFragment.kt @@ -5,19 +5,15 @@ import android.content.ActivityNotFoundException import android.content.Intent import android.net.Uri import android.os.Bundle -import android.text.InputType import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager -import android.widget.EditText -import android.widget.FrameLayout import android.widget.TextView import androidx.activity.addCallback import androidx.appcompat.app.AlertDialog -import androidx.core.view.setMargins import androidx.fragment.app.Fragment import androidx.fragment.app.viewModels import androidx.preference.PreferenceManager diff --git a/app/src/main/java/dev/lowrespalmtree/comet/utils/Ui.kt b/app/src/main/java/dev/lowrespalmtree/comet/utils/Ui.kt index 20a0262..1899933 100644 --- a/app/src/main/java/dev/lowrespalmtree/comet/utils/Ui.kt +++ b/app/src/main/java/dev/lowrespalmtree/comet/utils/Ui.kt @@ -28,6 +28,7 @@ fun confirm(context: Context, @StringRes prompt: Int, onOk: () -> Unit) { .setTitle(R.string.confirm) .setView(binding.root) .setPositiveButton(android.R.string.ok) { _, _ -> onOk() } + .setNegativeButton(android.R.string.cancel) { dialog, _ -> dialog.dismiss() } .create() .show() } \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_confirm.xml b/app/src/main/res/layout/dialog_confirm.xml index 7b52893..1b708f6 100644 --- a/app/src/main/res/layout/dialog_confirm.xml +++ b/app/src/main/res/layout/dialog_confirm.xml @@ -8,6 +8,6 @@ android:id="@+id/text_view" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="16sp" /> + style="@style/CometText" /> \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_identity.xml b/app/src/main/res/layout/dialog_identity.xml index fe29ca5..0ca2203 100644 --- a/app/src/main/res/layout/dialog_identity.xml +++ b/app/src/main/res/layout/dialog_identity.xml @@ -10,7 +10,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/identity_name" - android:textAppearance="@style/TextAppearance.AppCompat.Medium" /> + style="@style/CometLabel" /> + style="@style/CometLabel" /> + style="@style/CometLabel" /> false ?attr/selectableItemBackground + \ No newline at end of file