Removed unnecessary files and merged styles

This commit is contained in:
Viktor De Pasquale
2020-01-30 16:31:43 +01:00
committed by John Wu
parent dea607b148
commit 6e48294f2a
18 changed files with 13 additions and 178 deletions

View File

@@ -6,8 +6,8 @@ import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
import com.topjohnwu.magisk.R
open class ConsoleRvItem(val item: String) : LenientRvItem<ConsoleRvItem>() {
override val layoutRes: Int = R.layout.item_console
class ConsoleItem(val item: String) : LenientRvItem<ConsoleItem>() {
override val layoutRes = R.layout.item_console_md2
override fun onBindingBound(binding: ViewDataBinding, recyclerView: RecyclerView) {
val view = binding.root as TextView
@@ -21,10 +21,6 @@ open class ConsoleRvItem(val item: String) : LenientRvItem<ConsoleRvItem>() {
}
}
override fun contentSameAs(other: ConsoleRvItem) = itemSameAs(other)
override fun itemSameAs(other: ConsoleRvItem) = item == other.item
}
class ConsoleItem(item: String) : ConsoleRvItem(item) {
override val layoutRes = R.layout.item_console_md2
override fun contentSameAs(other: ConsoleItem) = itemSameAs(other)
override fun itemSameAs(other: ConsoleItem) = item == other.item
}

View File

@@ -1,11 +0,0 @@
package com.topjohnwu.magisk.model.entity.recycler
import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.databinding.ComparableRvItem
class SectionRvItem(val text: String) : ComparableRvItem<SectionRvItem>() {
override val layoutRes: Int = R.layout.item_section
override fun contentSameAs(other: SectionRvItem) = itemSameAs(other)
override fun itemSameAs(other: SectionRvItem) = text == other.text
}

View File

@@ -9,9 +9,7 @@ import android.view.View
import android.view.ViewAnimationUtils
import android.view.ViewGroup
import android.widget.ProgressBar
import android.widget.TextSwitcher
import android.widget.TextView
import android.widget.ViewSwitcher
import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes
import androidx.appcompat.widget.AppCompatImageView
@@ -287,24 +285,6 @@ fun View.setOnSelectClickListener(listener: View.OnClickListener, resetTime: Lon
}
}
@BindingAdapter("textCaptionVariant")
fun TextSwitcher.setTextBinding(text: CharSequence) {
tag as? ViewSwitcher.ViewFactory ?: ViewSwitcher.ViewFactory {
View.inflate(context, R.layout.swicher_caption_variant, null)
}.also {
tag = it
setFactory(it)
setInAnimation(context, R.anim.switcher_bottom_up)
setOutAnimation(context, R.anim.switcher_center_up)
}
val currentText = (currentView as? TextView)?.text
if (currentText != text) {
setText(text)
}
}
@BindingAdapter(
"android:layout_marginLeft",
"android:layout_marginTop",