Commit 6e48294f authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

Removed unnecessary files and merged styles

parent dea607b1
...@@ -6,8 +6,8 @@ import androidx.databinding.ViewDataBinding ...@@ -6,8 +6,8 @@ import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
open class ConsoleRvItem(val item: String) : LenientRvItem<ConsoleRvItem>() { class ConsoleItem(val item: String) : LenientRvItem<ConsoleItem>() {
override val layoutRes: Int = R.layout.item_console override val layoutRes = R.layout.item_console_md2
override fun onBindingBound(binding: ViewDataBinding, recyclerView: RecyclerView) { override fun onBindingBound(binding: ViewDataBinding, recyclerView: RecyclerView) {
val view = binding.root as TextView val view = binding.root as TextView
...@@ -21,10 +21,6 @@ open class ConsoleRvItem(val item: String) : LenientRvItem<ConsoleRvItem>() { ...@@ -21,10 +21,6 @@ open class ConsoleRvItem(val item: String) : LenientRvItem<ConsoleRvItem>() {
} }
} }
override fun contentSameAs(other: ConsoleRvItem) = itemSameAs(other) override fun contentSameAs(other: ConsoleItem) = itemSameAs(other)
override fun itemSameAs(other: ConsoleRvItem) = item == other.item override fun itemSameAs(other: ConsoleItem) = item == other.item
}
class ConsoleItem(item: String) : ConsoleRvItem(item) {
override val layoutRes = R.layout.item_console_md2
} }
\ No newline at end of file
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
}
\ No newline at end of file
...@@ -9,9 +9,7 @@ import android.view.View ...@@ -9,9 +9,7 @@ import android.view.View
import android.view.ViewAnimationUtils import android.view.ViewAnimationUtils
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ProgressBar import android.widget.ProgressBar
import android.widget.TextSwitcher
import android.widget.TextView import android.widget.TextView
import android.widget.ViewSwitcher
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
...@@ -287,24 +285,6 @@ fun View.setOnSelectClickListener(listener: View.OnClickListener, resetTime: Lon ...@@ -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( @BindingAdapter(
"android:layout_marginLeft", "android:layout_marginLeft",
"android:layout_marginTop", "android:layout_marginTop",
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="item"
type="com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem" />
<!--no actions are required-->
<variable
name="viewModel"
type="Object" />
</data>
<TextView
android:focusable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:text="@{item.item}"
android:textSize="10sp"
tools:text="@tools:sample/lorem/random" />
</layout>
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<variable <variable
name="item" name="item"
type="com.topjohnwu.magisk.model.entity.recycler.ConsoleRvItem" /> type="com.topjohnwu.magisk.model.entity.recycler.ConsoleItem" />
<!--no actions are required--> <!--no actions are required-->
<variable <variable
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="item"
type="com.topjohnwu.magisk.model.entity.recycler.SectionRvItem" />
<variable
name="viewModel"
type="Object" />
</data>
<!--Paddings are trimmed from default section title because recycler adds these paddings for us already-->
<androidx.appcompat.widget.AppCompatTextView
style="@style/Widget.Text.SectionTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="0dp"
android:paddingLeft="0dp"
android:paddingTop="@dimen/margin_generic"
android:paddingEnd="0dp"
android:paddingRight="0dp"
android:paddingBottom="0dp"
android:text="@{item.text}"
android:textAppearance="@style/TextAppearance.Emphasize"
tools:text="@string/update_available" />
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.AppCompatTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:ellipsize="middle"
android:gravity="start|center_vertical"
android:singleLine="true"
tools:text="@string/magisk"
android:textAppearance="@style/AppearanceFoundation.Caption.Variant" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="SplashThemeBase.V19"/>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="SplashTheme" parent="SplashThemeBase.V19" />
<style name="Foundation.Compat"> <style name="Foundation.Compat">
<item name="android:windowTranslucentNavigation">true</item> <item name="android:windowTranslucentNavigation">true</item>
<item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentStatus">true</item>
......
<resources>
<style name="SplashTheme" parent="SplashThemeBase"/>
</resources>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="SplashTheme" parent="SplashThemeBase" />
<style name="Foundation" parent="Theme.MaterialComponents.Light.NoActionBar"> <style name="Foundation" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="android:windowBackground">?colorSurface</item> <item name="android:windowBackground">?colorSurface</item>
</style> </style>
...@@ -13,6 +15,9 @@ ...@@ -13,6 +15,9 @@
<style name="WidgetFoundation" parent="android:Widget" /> <style name="WidgetFoundation" parent="android:Widget" />
<!-- {@deprecated Use WidgetFoundation instead.} -->
<style name="Widget" parent="WidgetFoundation" />
<style name="AppearanceFoundation"> <style name="AppearanceFoundation">
<item name="android:fontFamily">@font/exo</item> <item name="android:fontFamily">@font/exo</item>
</style> </style>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<style name="W" parent="Widget" /> <style name="W" parent="android:Widget" />
<style name="W.Home" /> <style name="W.Home" />
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.Card" parent="Widget.MaterialComponents.CardView">
<item name="cardCornerRadius">@dimen/radius_generic</item>
<item name="cardElevation">0dp</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.DialogButton">
<item name="android:background">?attr/selectableItemBackground</item>
<item name="android:gravity">center</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.Divider">
<item name="android:background">@color/colorCardStrokeInverse</item>
</style>
<style name="Widget.Divider.Horizontal">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">1dp</item>
</style>
<style name="Widget.Divider.Vertical">
<item name="android:layout_width">1dp</item>
<item name="android:layout_height">0dp</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.Progress" parent="Widget.AppCompat.ProgressBar.Horizontal">
<item name="android:indeterminate">true</item>
<item name="android:layout_width">64dp</item>
<item name="android:layout_height">wrap_content</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget" />
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment