Android: Convert HeaderHyperLinkViewHolder to Kotlin

This commit is contained in:
Charles Lombardo 2023-03-15 03:31:23 -04:00
parent 220cdafbaa
commit 789493b722
2 changed files with 27 additions and 36 deletions

View File

@ -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));
}
}

View File

@ -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)
)
}
}