From 789493b7220210add21fb1f8daf4aedd02fcc5af Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Wed, 15 Mar 2023 03:31:23 -0400 Subject: [PATCH] Android: Convert HeaderHyperLinkViewHolder to Kotlin --- .../viewholder/HeaderHyperLinkViewHolder.java | 36 ------------------- .../viewholder/HeaderHyperLinkViewHolder.kt | 27 ++++++++++++++ 2 files changed, 27 insertions(+), 36 deletions(-) delete mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.java create mode 100644 Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.kt diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.java deleted file mode 100644 index 2d3e9ac5d0..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.java +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.ui.viewholder; - -import android.text.method.LinkMovementMethod; - -import androidx.annotation.NonNull; - -import com.google.android.material.color.MaterialColors; - -import org.dolphinemu.dolphinemu.R; -import org.dolphinemu.dolphinemu.databinding.ListItemHeaderBinding; -import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem; -import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter; - -public final class HeaderHyperLinkViewHolder extends HeaderViewHolder -{ - private final ListItemHeaderBinding mBinding; - - public HeaderHyperLinkViewHolder(@NonNull ListItemHeaderBinding binding, SettingsAdapter adapter) - { - super(binding, adapter); - mBinding = binding; - itemView.setOnClickListener(null); - } - - @Override - public void bind(@NonNull SettingsItem item) - { - super.bind(item); - - mBinding.textHeaderName.setMovementMethod(LinkMovementMethod.getInstance()); - mBinding.textHeaderName.setLinkTextColor( - MaterialColors.getColor(itemView, R.attr.colorTertiary)); - } -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.kt new file mode 100644 index 0000000000..5bb58cf489 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/HeaderHyperLinkViewHolder.kt @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.ui.viewholder + +import android.text.method.LinkMovementMethod +import com.google.android.material.color.MaterialColors +import org.dolphinemu.dolphinemu.R +import org.dolphinemu.dolphinemu.databinding.ListItemHeaderBinding +import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem +import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter + +class HeaderHyperLinkViewHolder( + private val binding: ListItemHeaderBinding, + adapter: SettingsAdapter? +) : HeaderViewHolder(binding, adapter) { + init { + itemView.setOnClickListener(null) + } + + override fun bind(item: SettingsItem) { + super.bind(item) + binding.textHeaderName.movementMethod = LinkMovementMethod.getInstance() + binding.textHeaderName.setLinkTextColor( + MaterialColors.getColor(itemView, R.attr.colorTertiary) + ) + } +}