Merge branch 'redesign' of https://github.com/ztimms73/Kotatsu into devel
commit
a483d21120
@ -0,0 +1,231 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search
|
||||
|
||||
import android.animation.LayoutTransition
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import org.koitharu.kotatsu.R
|
||||
import org.koitharu.kotatsu.base.ui.widgets.search.internal.SearchLayout
|
||||
|
||||
class MaterialSearchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
defStyleRes: Int = 0
|
||||
) : SearchLayout(context, attrs, defStyleAttr, defStyleRes), CoordinatorLayout.AttachedBehavior {
|
||||
|
||||
// *********************************************************************************************
|
||||
private var mBehavior: CoordinatorLayout.Behavior<*> = SearchBehavior<MaterialSearchView>()
|
||||
private var mTransition: LayoutTransition? = null
|
||||
private var mStrokeWidth: Int = 0
|
||||
private var mRadius: Float = 0f
|
||||
private var mElevation: Float = 0f
|
||||
|
||||
// *********************************************************************************************
|
||||
init {
|
||||
inflate(context, R.layout.layout_search_view, this)
|
||||
init()
|
||||
setTransition()
|
||||
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs, R.styleable.MaterialSearchView, defStyleAttr, defStyleRes
|
||||
)
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_navigationIconSupport)) {
|
||||
navigationIconSupport = a.getInt(
|
||||
R.styleable.MaterialSearchView_search_navigationIconSupport,
|
||||
NavigationIconSupport.NONE
|
||||
)
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_navigationIcon)) {
|
||||
setNavigationIconImageDrawable(a.getDrawable(R.styleable.MaterialSearchView_search_navigationIcon))
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_clearIcon)) {
|
||||
setClearIconImageDrawable(a.getDrawable(R.styleable.MaterialSearchView_search_clearIcon))
|
||||
} else {
|
||||
setClearIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_clear
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_micIcon)) {
|
||||
setMicIconImageDrawable(a.getDrawable(R.styleable.MaterialSearchView_search_micIcon))
|
||||
} else {
|
||||
setMicIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_mic_none
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_menuIcon)) {
|
||||
setMicIconImageDrawable(a.getDrawable(R.styleable.MaterialSearchView_search_menuIcon))
|
||||
} else {
|
||||
setMicIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_more
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_dividerColor)) {
|
||||
setDividerColor(a.getInt(R.styleable.MaterialSearchView_search_dividerColor, 0))
|
||||
}
|
||||
|
||||
val defaultShadowColor = ContextCompat.getColor(context, R.color.shadow)
|
||||
setShadowColor(
|
||||
a.getInt(
|
||||
R.styleable.MaterialSearchView_search_shadowColor,
|
||||
defaultShadowColor
|
||||
)
|
||||
)
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_textHint)) {
|
||||
setTextHint(a.getText(R.styleable.MaterialSearchView_search_textHint))
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_strokeColor)) {
|
||||
setBackgroundStrokeColor(a.getInt(R.styleable.MaterialSearchView_search_strokeColor, 0))
|
||||
}
|
||||
|
||||
if (a.hasValue(R.styleable.MaterialSearchView_search_strokeWidth)) {
|
||||
setBackgroundStrokeWidth(a.getInt(R.styleable.MaterialSearchView_search_strokeWidth, 0))
|
||||
}
|
||||
|
||||
val defaultTransitionDuration =
|
||||
context.resources.getInteger(R.integer.search_animation_duration)
|
||||
setTransitionDuration(
|
||||
a.getInt(
|
||||
R.styleable.MaterialSearchView_search_transitionDuration,
|
||||
defaultTransitionDuration
|
||||
).toLong()
|
||||
)
|
||||
|
||||
val defaultRadius = context.resources.getDimensionPixelSize(R.dimen.search_radius)
|
||||
setBackgroundRadius(
|
||||
a.getInt(R.styleable.MaterialSearchView_search_radius, defaultRadius).toFloat()
|
||||
)
|
||||
|
||||
val defaultElevation = context.resources.getDimensionPixelSize(R.dimen.search_elevation)
|
||||
elevation =
|
||||
a.getInt(R.styleable.MaterialSearchView_android_elevation, defaultElevation).toFloat()
|
||||
|
||||
val imeOptions = a.getInt(R.styleable.MaterialSearchView_android_imeOptions, -1)
|
||||
if (imeOptions != -1) {
|
||||
setTextImeOptions(imeOptions)
|
||||
}
|
||||
|
||||
val inputType = a.getInt(R.styleable.MaterialSearchView_android_inputType, -1)
|
||||
if (inputType != -1) {
|
||||
setTextInputType(inputType)
|
||||
}
|
||||
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
override fun addFocus() {
|
||||
mOnFocusChangeListener?.onFocusChange(true)
|
||||
showKeyboard()
|
||||
|
||||
mStrokeWidth = getBackgroundStrokeWidth()
|
||||
mRadius = getBackgroundRadius()
|
||||
mElevation = elevation
|
||||
|
||||
setBackgroundStrokeWidth(context.resources.getDimensionPixelSize(R.dimen.search_stroke_width_focus))
|
||||
setBackgroundRadius(resources.getDimensionPixelSize(R.dimen.search_radius_focus).toFloat())
|
||||
elevation =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_elevation_focus).toFloat()
|
||||
|
||||
val left = context.resources.getDimensionPixelSize(R.dimen.search_dp_16)
|
||||
val params = mSearchEditText?.layoutParams as LinearLayout.LayoutParams
|
||||
params.setMargins(left, 0, 0, 0)
|
||||
mSearchEditText?.layoutParams = params
|
||||
|
||||
margins = Margins.FOCUS
|
||||
setLayoutHeight(context.resources.getDimensionPixelSize(R.dimen.search_layout_height_focus))
|
||||
|
||||
mViewShadow?.visibility = View.VISIBLE
|
||||
|
||||
mViewDivider?.visibility = View.VISIBLE
|
||||
mViewAnim?.visibility = View.VISIBLE
|
||||
mRecyclerView?.visibility = View.VISIBLE
|
||||
|
||||
// layoutTransition = null
|
||||
}
|
||||
|
||||
override fun removeFocus() {
|
||||
// layoutTransition = mTransition
|
||||
|
||||
mOnFocusChangeListener?.onFocusChange(false)
|
||||
hideKeyboard()
|
||||
|
||||
val params = mSearchEditText?.layoutParams as LinearLayout.LayoutParams
|
||||
params.setMargins(0, 0, 0, 0)
|
||||
mSearchEditText?.layoutParams = params
|
||||
|
||||
setBackgroundStrokeWidth(mStrokeWidth)
|
||||
setBackgroundRadius(mRadius)
|
||||
elevation = mElevation
|
||||
|
||||
setLayoutHeight(context.resources.getDimensionPixelSize(R.dimen.search_layout_height))
|
||||
margins = Margins.NO_FOCUS
|
||||
|
||||
mViewShadow?.visibility = View.GONE
|
||||
|
||||
mRecyclerView?.visibility = View.GONE
|
||||
mViewAnim?.visibility = View.GONE
|
||||
mViewDivider?.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun getBehavior(): CoordinatorLayout.Behavior<*> {
|
||||
return mBehavior
|
||||
}
|
||||
|
||||
fun setBehavior(behavior: CoordinatorLayout.Behavior<*>) {
|
||||
mBehavior = behavior
|
||||
}
|
||||
|
||||
fun setTransitionDuration(duration: Long) {
|
||||
mTransition?.setDuration(duration)
|
||||
layoutTransition = mTransition
|
||||
}
|
||||
|
||||
private fun setTransition() {
|
||||
mTransition = LayoutTransition()
|
||||
mTransition?.enableTransitionType(LayoutTransition.CHANGING)
|
||||
mTransition?.addTransitionListener(object : LayoutTransition.TransitionListener {
|
||||
override fun startTransition(
|
||||
transition: LayoutTransition?,
|
||||
container: ViewGroup?,
|
||||
view: View?,
|
||||
transitionType: Int
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
override fun endTransition(
|
||||
transition: LayoutTransition?,
|
||||
container: ViewGroup?,
|
||||
view: View?,
|
||||
transitionType: Int
|
||||
) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.Context
|
||||
import android.util.Property
|
||||
import android.view.animation.AccelerateDecelerateInterpolator
|
||||
import androidx.appcompat.graphics.drawable.DrawerArrowDrawable
|
||||
import androidx.core.content.ContextCompat
|
||||
|
||||
class SearchArrowDrawable constructor(context: Context) : DrawerArrowDrawable(context) {
|
||||
|
||||
var position: Float
|
||||
get() = progress
|
||||
set(position) {
|
||||
progress = position
|
||||
}
|
||||
|
||||
init {
|
||||
color = ContextCompat.getColor(context, android.R.color.white)
|
||||
}
|
||||
|
||||
fun animate(state: Float, duration: Long) {
|
||||
val anim: ObjectAnimator = if (state == ARROW) {
|
||||
ObjectAnimator.ofFloat(
|
||||
this,
|
||||
PROGRESS,
|
||||
MENU,
|
||||
state
|
||||
)
|
||||
} else {
|
||||
ObjectAnimator.ofFloat(
|
||||
this,
|
||||
PROGRESS,
|
||||
ARROW,
|
||||
state
|
||||
)
|
||||
}
|
||||
anim.interpolator = AccelerateDecelerateInterpolator()
|
||||
anim.duration = duration
|
||||
anim.start()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val MENU = 0.0f
|
||||
const val ARROW = 1.0f
|
||||
|
||||
private val PROGRESS =
|
||||
object : Property<SearchArrowDrawable, Float>(Float::class.java, "progress") {
|
||||
override fun set(obj: SearchArrowDrawable, value: Float?) {
|
||||
obj.progress = value!!
|
||||
}
|
||||
|
||||
override fun get(obj: SearchArrowDrawable): Float {
|
||||
return obj.progress
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search
|
||||
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.view.ViewCompat
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import org.koitharu.kotatsu.base.ui.widgets.search.internal.SearchLayout
|
||||
|
||||
class SearchBehavior<S : SearchLayout> : CoordinatorLayout.Behavior<S>() {
|
||||
|
||||
override fun layoutDependsOn(
|
||||
parent: CoordinatorLayout,
|
||||
child: S,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
return if (dependency is AppBarLayout) {
|
||||
true
|
||||
} else
|
||||
if (dependency is LinearLayout || dependency is BottomNavigationView) {
|
||||
dependency.z = child.z + 1
|
||||
true
|
||||
} else {
|
||||
super.layoutDependsOn(parent, child, dependency)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDependentViewChanged(
|
||||
parent: CoordinatorLayout,
|
||||
child: S,
|
||||
dependency: View
|
||||
): Boolean {
|
||||
if (dependency is AppBarLayout) {
|
||||
child.translationY = dependency.getY()
|
||||
return true
|
||||
}
|
||||
return super.onDependentViewChanged(parent, child, dependency)
|
||||
}
|
||||
|
||||
override fun onStartNestedScroll(
|
||||
coordinatorLayout: CoordinatorLayout,
|
||||
child: S,
|
||||
directTargetChild: View,
|
||||
target: View,
|
||||
axes: Int,
|
||||
type: Int
|
||||
): Boolean {
|
||||
return axes == ViewCompat.SCROLL_AXIS_VERTICAL
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search.internal
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.KeyEvent
|
||||
import androidx.annotation.AttrRes
|
||||
import androidx.appcompat.widget.AppCompatEditText
|
||||
|
||||
class SearchEditText : AppCompatEditText {
|
||||
|
||||
var clearFocusOnBackPressed: Boolean = false
|
||||
|
||||
constructor(context: Context) : super(context)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet?, @AttrRes defStyleAttr: Int) : super(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
)
|
||||
|
||||
override fun onKeyPreIme(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_UP && clearFocusOnBackPressed) {
|
||||
if (hasFocus()) {
|
||||
clearFocus()
|
||||
return true
|
||||
}
|
||||
}
|
||||
return super.onKeyPreIme(keyCode, event)
|
||||
}
|
||||
|
||||
override fun clearFocus() {
|
||||
super.clearFocus()
|
||||
text?.clear()
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,725 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search.internal
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.ColorFilter
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.Rect
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.Parcelable
|
||||
import android.text.Editable
|
||||
import android.text.TextUtils
|
||||
import android.text.TextWatcher
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageButton
|
||||
import android.widget.LinearLayout
|
||||
import androidx.annotation.*
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
import org.koitharu.kotatsu.R
|
||||
|
||||
abstract class SearchLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
defStyleRes: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr, defStyleRes), View.OnClickListener {
|
||||
|
||||
// *********************************************************************************************
|
||||
// Better way than enum class :-)
|
||||
@IntDef(
|
||||
NavigationIconSupport.NONE,
|
||||
NavigationIconSupport.MENU,
|
||||
NavigationIconSupport.ARROW,
|
||||
NavigationIconSupport.SEARCH
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class NavigationIconSupport {
|
||||
companion object {
|
||||
const val NONE = 0
|
||||
const val MENU = 1
|
||||
const val ARROW = 2
|
||||
const val SEARCH = 3
|
||||
}
|
||||
}
|
||||
|
||||
@IntDef(
|
||||
Margins.NO_FOCUS,
|
||||
Margins.FOCUS
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
internal annotation class Margins {
|
||||
companion object {
|
||||
const val NO_FOCUS = 4
|
||||
const val FOCUS = 5
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
private var mImageViewMic: ImageButton? = null
|
||||
private var mImageViewMenu: ImageButton? = null
|
||||
protected var mRecyclerView: RecyclerView? = null
|
||||
private var mMaterialCardView: MaterialCardView? = null
|
||||
var mSearchEditText: SearchEditText? = null
|
||||
protected var mViewShadow: View? = null
|
||||
protected var mViewDivider: View? = null
|
||||
protected var mViewAnim: View? = null
|
||||
protected var mOnFocusChangeListener: OnFocusChangeListener? = null
|
||||
|
||||
private var mLinearLayout: LinearLayout? = null
|
||||
private var mImageViewNavigation: ImageButton? = null
|
||||
private var mImageViewClear: ImageButton? = null
|
||||
private var mOnQueryTextListener: OnQueryTextListener? = null
|
||||
private var mOnNavigationClickListener: OnNavigationClickListener? = null
|
||||
private var mOnMicClickListener: OnMicClickListener? = null
|
||||
private var mOnMenuClickListener: OnMenuClickListener? = null
|
||||
private var mOnClearClickListener: OnClearClickListener? = null
|
||||
|
||||
// *********************************************************************************************
|
||||
@NavigationIconSupport
|
||||
@get:NavigationIconSupport
|
||||
var navigationIconSupport: Int = 0
|
||||
set(@NavigationIconSupport navigationIconSupport) {
|
||||
field = navigationIconSupport
|
||||
|
||||
when (navigationIconSupport) {
|
||||
NavigationIconSupport.NONE
|
||||
-> {
|
||||
setNavigationIconImageDrawable(null)
|
||||
}
|
||||
NavigationIconSupport.MENU -> {
|
||||
setNavigationIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_menu
|
||||
)
|
||||
)
|
||||
}
|
||||
NavigationIconSupport.ARROW -> {
|
||||
setNavigationIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_arrow_back
|
||||
)
|
||||
)
|
||||
}
|
||||
NavigationIconSupport.SEARCH -> {
|
||||
setNavigationIconImageDrawable(
|
||||
ContextCompat.getDrawable(
|
||||
context,
|
||||
R.drawable.ic_search
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Margins
|
||||
@get:Margins
|
||||
protected var margins: Int = 0
|
||||
set(@Margins margins) {
|
||||
field = margins
|
||||
|
||||
val left: Int
|
||||
val top: Int
|
||||
val right: Int
|
||||
val bottom: Int
|
||||
val params = mMaterialCardView?.layoutParams as LayoutParams?
|
||||
|
||||
when (margins) {
|
||||
Margins.NO_FOCUS -> {
|
||||
left =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_left_right)
|
||||
top =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_top_bottom)
|
||||
right =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_left_right)
|
||||
bottom =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_top_bottom)
|
||||
|
||||
params?.width = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
params?.height = ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
params?.setMargins(left, top, right, bottom)
|
||||
mMaterialCardView?.layoutParams = params
|
||||
}
|
||||
Margins.FOCUS -> {
|
||||
left =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_focus)
|
||||
top =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_focus)
|
||||
right =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_focus)
|
||||
bottom =
|
||||
context.resources.getDimensionPixelSize(R.dimen.search_margins_focus)
|
||||
|
||||
params?.width = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
params?.height = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
params?.setMargins(left, top, right, bottom)
|
||||
mMaterialCardView?.layoutParams = params
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
protected abstract fun addFocus()
|
||||
|
||||
protected abstract fun removeFocus()
|
||||
|
||||
// *********************************************************************************************
|
||||
protected fun init() {
|
||||
mLinearLayout = findViewById(R.id.search_linear_layout)
|
||||
|
||||
mImageViewNavigation = findViewById(R.id.search_image_view_navigation)
|
||||
mImageViewNavigation?.setOnClickListener(this)
|
||||
|
||||
mImageViewMic = findViewById(R.id.search_image_view_mic)
|
||||
mImageViewMic?.setOnClickListener(this)
|
||||
|
||||
mImageViewMenu = findViewById(R.id.search_image_view_menu)
|
||||
mImageViewMenu?.setOnClickListener(this)
|
||||
|
||||
mImageViewClear = findViewById(R.id.search_image_view_clear)
|
||||
mImageViewClear?.visibility = View.GONE
|
||||
mImageViewClear?.setOnClickListener(this)
|
||||
|
||||
mSearchEditText = findViewById(R.id.search_search_edit_text)
|
||||
mSearchEditText?.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
|
||||
this@SearchLayout.onTextChanged(s)
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
})
|
||||
mSearchEditText?.setOnEditorActionListener { _, _, _ ->
|
||||
onSubmitQuery()
|
||||
return@setOnEditorActionListener true // true
|
||||
}
|
||||
mSearchEditText?.setOnFocusChangeListener { _, hasFocus ->
|
||||
if (hasFocus) {
|
||||
addFocus()
|
||||
} else {
|
||||
removeFocus()
|
||||
}
|
||||
}
|
||||
|
||||
mRecyclerView = findViewById(R.id.search_recycler_view)
|
||||
mRecyclerView?.visibility = View.GONE
|
||||
mRecyclerView?.layoutManager = LinearLayoutManager(context)
|
||||
mRecyclerView?.isNestedScrollingEnabled = false
|
||||
mRecyclerView?.itemAnimator = DefaultItemAnimator()
|
||||
mRecyclerView?.overScrollMode = View.OVER_SCROLL_NEVER
|
||||
mRecyclerView?.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
|
||||
super.onScrollStateChanged(recyclerView, newState)
|
||||
if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
|
||||
hideKeyboard()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
mViewShadow = findViewById(R.id.search_view_shadow)
|
||||
mViewShadow?.visibility = View.GONE
|
||||
|
||||
mViewDivider = findViewById(R.id.search_view_divider)
|
||||
mViewDivider?.visibility = View.GONE
|
||||
|
||||
mViewAnim = findViewById(R.id.search_view_anim)
|
||||
mViewAnim?.visibility = View.GONE
|
||||
|
||||
mMaterialCardView = findViewById(R.id.search_material_card_view)
|
||||
margins = Margins.NO_FOCUS
|
||||
|
||||
isClickable = true
|
||||
isFocusable = true
|
||||
isFocusableInTouchMode = true
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setNavigationIconVisibility(visibility: Int) {
|
||||
mImageViewNavigation?.visibility = visibility
|
||||
}
|
||||
|
||||
fun setNavigationIconImageResource(@DrawableRes resId: Int) {
|
||||
mImageViewNavigation?.setImageResource(resId)
|
||||
}
|
||||
|
||||
fun setNavigationIconImageDrawable(@Nullable drawable: Drawable?) {
|
||||
mImageViewNavigation?.setImageDrawable(drawable)
|
||||
}
|
||||
|
||||
fun setNavigationIconColorFilter(color: Int) {
|
||||
mImageViewNavigation?.setColorFilter(color)
|
||||
}
|
||||
|
||||
fun setNavigationIconColorFilter(color: Int, mode: PorterDuff.Mode) {
|
||||
mImageViewNavigation?.setColorFilter(color, mode)
|
||||
}
|
||||
|
||||
fun setNavigationIconColorFilter(cf: ColorFilter?) {
|
||||
mImageViewNavigation?.colorFilter = cf
|
||||
}
|
||||
|
||||
fun clearNavigationIconColorFilter() {
|
||||
mImageViewNavigation?.clearColorFilter()
|
||||
}
|
||||
|
||||
fun setNavigationIconContentDescription(contentDescription: CharSequence) {
|
||||
mImageViewNavigation?.contentDescription = contentDescription
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setMicIconImageResource(@DrawableRes resId: Int) {
|
||||
mImageViewMic?.setImageResource(resId)
|
||||
}
|
||||
|
||||
fun setMicIconImageDrawable(@Nullable drawable: Drawable?) {
|
||||
mImageViewMic?.setImageDrawable(drawable)
|
||||
}
|
||||
|
||||
fun setMicIconColorFilter(color: Int) {
|
||||
mImageViewMic?.setColorFilter(color)
|
||||
}
|
||||
|
||||
fun setMicIconColorFilter(color: Int, mode: PorterDuff.Mode) {
|
||||
mImageViewMic?.setColorFilter(color, mode)
|
||||
}
|
||||
|
||||
fun setMicIconColorFilter(cf: ColorFilter?) {
|
||||
mImageViewMic?.colorFilter = cf
|
||||
}
|
||||
|
||||
fun clearMicIconColorFilter() {
|
||||
mImageViewMic?.clearColorFilter()
|
||||
}
|
||||
|
||||
fun setMicIconContentDescription(contentDescription: CharSequence) {
|
||||
mImageViewMic?.contentDescription = contentDescription
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setMenuIconImageResource(@DrawableRes resId: Int) {
|
||||
mImageViewMenu?.setImageResource(resId)
|
||||
}
|
||||
|
||||
fun setMenuIconImageDrawable(@Nullable drawable: Drawable?) {
|
||||
mImageViewMenu?.setImageDrawable(drawable)
|
||||
}
|
||||
|
||||
fun setMenuIconColorFilter(color: Int) {
|
||||
mImageViewMenu?.setColorFilter(color)
|
||||
}
|
||||
|
||||
fun setMenuIconColorFilter(color: Int, mode: PorterDuff.Mode) {
|
||||
mImageViewMenu?.setColorFilter(color, mode)
|
||||
}
|
||||
|
||||
fun setMenuIconColorFilter(cf: ColorFilter?) {
|
||||
mImageViewMenu?.colorFilter = cf
|
||||
}
|
||||
|
||||
fun clearMenuIconColorFilter() {
|
||||
mImageViewMenu?.clearColorFilter()
|
||||
}
|
||||
|
||||
fun setMenuIconContentDescription(contentDescription: CharSequence) {
|
||||
mImageViewMenu?.contentDescription = contentDescription
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setClearIconImageResource(@DrawableRes resId: Int) {
|
||||
mImageViewClear?.setImageResource(resId)
|
||||
}
|
||||
|
||||
fun setClearIconImageDrawable(@Nullable drawable: Drawable?) {
|
||||
mImageViewClear?.setImageDrawable(drawable)
|
||||
}
|
||||
|
||||
fun setClearIconColorFilter(color: Int) {
|
||||
mImageViewClear?.setColorFilter(color)
|
||||
}
|
||||
|
||||
fun setClearIconColorFilter(color: Int, mode: PorterDuff.Mode) {
|
||||
mImageViewClear?.setColorFilter(color, mode)
|
||||
}
|
||||
|
||||
fun setClearIconColorFilter(cf: ColorFilter?) {
|
||||
mImageViewClear?.colorFilter = cf
|
||||
}
|
||||
|
||||
fun clearClearIconColorFilter() {
|
||||
mImageViewClear?.clearColorFilter()
|
||||
}
|
||||
|
||||
fun setClearIconContentDescription(contentDescription: CharSequence) {
|
||||
mImageViewClear?.contentDescription = contentDescription
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setAdapterLayoutManager(@Nullable layout: RecyclerView.LayoutManager?) {
|
||||
mRecyclerView?.layoutManager = layout
|
||||
}
|
||||
|
||||
// only when height == match_parent
|
||||
fun setAdapterHasFixedSize(hasFixedSize: Boolean) {
|
||||
mRecyclerView?.setHasFixedSize(hasFixedSize)
|
||||
}
|
||||
|
||||
fun addAdapterItemDecoration(@NonNull decor: RecyclerView.ItemDecoration) {
|
||||
mRecyclerView?.addItemDecoration(decor)
|
||||
}
|
||||
|
||||
fun removeAdapterItemDecoration(@NonNull decor: RecyclerView.ItemDecoration) {
|
||||
mRecyclerView?.removeItemDecoration(decor)
|
||||
}
|
||||
|
||||
fun setAdapter(@Nullable adapter: RecyclerView.Adapter<*>?) {
|
||||
mRecyclerView?.adapter = adapter
|
||||
}
|
||||
|
||||
@Nullable
|
||||
fun getAdapter(): RecyclerView.Adapter<*>? {
|
||||
return mRecyclerView?.adapter
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
/**
|
||||
* Typeface.NORMAL
|
||||
* Typeface.BOLD
|
||||
* Typeface.ITALIC
|
||||
* Typeface.BOLD_ITALIC
|
||||
*
|
||||
* Typeface.DEFAULT
|
||||
* Typeface.DEFAULT_BOLD
|
||||
* Typeface.SANS_SERIF
|
||||
* Typeface.SERIF
|
||||
* Typeface.MONOSPACE
|
||||
*
|
||||
* Typeface.create(Typeface.NORMAL, Typeface.DEFAULT)
|
||||
*/
|
||||
fun setTextTypeface(@Nullable tf: Typeface?) {
|
||||
mSearchEditText?.typeface = tf
|
||||
}
|
||||
|
||||
fun getTextTypeface(): Typeface? {
|
||||
return mSearchEditText?.typeface
|
||||
}
|
||||
|
||||
fun setTextInputType(type: Int) {
|
||||
mSearchEditText?.inputType = type
|
||||
}
|
||||
|
||||
fun getTextInputType(): Int? {
|
||||
return mSearchEditText?.inputType
|
||||
}
|
||||
|
||||
fun setTextImeOptions(imeOptions: Int) {
|
||||
mSearchEditText?.imeOptions = imeOptions
|
||||
}
|
||||
|
||||
fun getTextImeOptions(): Int? {
|
||||
return mSearchEditText?.imeOptions
|
||||
}
|
||||
|
||||
fun setTextQuery(query: CharSequence?, submit: Boolean) {
|
||||
mSearchEditText?.setText(query)
|
||||
if (query != null) {
|
||||
mSearchEditText?.setSelection(mSearchEditText?.length()!!)
|
||||
}
|
||||
if (submit && !TextUtils.isEmpty(query)) {
|
||||
onSubmitQuery()
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
fun getTextQuery(): CharSequence? {
|
||||
return mSearchEditText?.text
|
||||
}
|
||||
|
||||
fun setTextHint(hint: CharSequence?) {
|
||||
mSearchEditText?.hint = hint
|
||||
}
|
||||
|
||||
fun getTextHint(): CharSequence? {
|
||||
return mSearchEditText?.hint
|
||||
}
|
||||
|
||||
fun setTextColor(@ColorInt color: Int) {
|
||||
mSearchEditText?.setTextColor(color)
|
||||
}
|
||||
|
||||
fun setTextSize(size: Float) {
|
||||
mSearchEditText?.textSize = size
|
||||
}
|
||||
|
||||
fun setTextGravity(gravity: Int) {
|
||||
mSearchEditText?.gravity = gravity
|
||||
}
|
||||
|
||||
fun setTextHint(@StringRes resid: Int) {
|
||||
mSearchEditText?.setHint(resid)
|
||||
}
|
||||
|
||||
fun setTextHintColor(@ColorInt color: Int) {
|
||||
mSearchEditText?.setHintTextColor(color)
|
||||
}
|
||||
|
||||
fun setClearFocusOnBackPressed(clearFocusOnBackPressed: Boolean) {
|
||||
mSearchEditText?.clearFocusOnBackPressed = clearFocusOnBackPressed
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
override fun setBackgroundColor(@ColorInt color: Int) {
|
||||
mMaterialCardView?.setCardBackgroundColor(color)
|
||||
}
|
||||
|
||||
fun setBackgroundColor(@Nullable color: ColorStateList?) {
|
||||
mMaterialCardView?.setCardBackgroundColor(color)
|
||||
}
|
||||
|
||||
override fun setElevation(elevation: Float) {
|
||||
mMaterialCardView?.cardElevation = elevation
|
||||
mMaterialCardView?.maxCardElevation = elevation
|
||||
}
|
||||
|
||||
override fun getElevation(): Float {
|
||||
return mMaterialCardView?.elevation!!
|
||||
}
|
||||
|
||||
fun setBackgroundRadius(radius: Float) {
|
||||
mMaterialCardView?.radius = radius
|
||||
}
|
||||
|
||||
fun getBackgroundRadius(): Float {
|
||||
return mMaterialCardView?.radius!!
|
||||
}
|
||||
|
||||
fun setBackgroundRippleColor(@ColorRes rippleColorResourceId: Int) {
|
||||
mMaterialCardView?.setRippleColorResource(rippleColorResourceId)
|
||||
}
|
||||
|
||||
fun setBackgroundRippleColorResource(@Nullable rippleColor: ColorStateList?) {
|
||||
mMaterialCardView?.rippleColor = rippleColor
|
||||
}
|
||||
|
||||
fun setBackgroundStrokeColor(@ColorInt strokeColor: Int) {
|
||||
mMaterialCardView?.strokeColor = strokeColor
|
||||
}
|
||||
|
||||
fun setBackgroundStrokeColor(strokeColor: ColorStateList) {
|
||||
mMaterialCardView?.setStrokeColor(strokeColor)
|
||||
}
|
||||
|
||||
fun setBackgroundStrokeWidth(@Dimension strokeWidth: Int) {
|
||||
mMaterialCardView?.strokeWidth = strokeWidth
|
||||
}
|
||||
|
||||
@Dimension
|
||||
fun getBackgroundStrokeWidth(): Int {
|
||||
return mMaterialCardView?.strokeWidth!!
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setDividerColor(@ColorInt color: Int) {
|
||||
mViewDivider?.setBackgroundColor(color)
|
||||
}
|
||||
|
||||
fun setShadowColor(@ColorInt color: Int) {
|
||||
mViewShadow?.setBackgroundColor(color)
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun setOnFocusChangeListener(listener: OnFocusChangeListener) {
|
||||
mOnFocusChangeListener = listener
|
||||
}
|
||||
|
||||
fun setOnQueryTextListener(listener: OnQueryTextListener) {
|
||||
mOnQueryTextListener = listener
|
||||
}
|
||||
|
||||
fun setOnNavigationClickListener(listener: OnNavigationClickListener) {
|
||||
mOnNavigationClickListener = listener
|
||||
}
|
||||
|
||||
fun setOnMicClickListener(listener: OnMicClickListener) {
|
||||
mOnMicClickListener = listener
|
||||
}
|
||||
|
||||
fun setOnMenuClickListener(listener: OnMenuClickListener) {
|
||||
mOnMenuClickListener = listener
|
||||
}
|
||||
|
||||
fun setOnClearClickListener(listener: OnClearClickListener) {
|
||||
mOnClearClickListener = listener
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
fun showKeyboard() {
|
||||
if (!isInEditMode) {
|
||||
val inputMethodManager =
|
||||
context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.showSoftInput(
|
||||
mSearchEditText,
|
||||
InputMethodManager.RESULT_UNCHANGED_SHOWN
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideKeyboard() {
|
||||
if (!isInEditMode) {
|
||||
val inputMethodManager =
|
||||
context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(
|
||||
windowToken,
|
||||
InputMethodManager.RESULT_UNCHANGED_SHOWN
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
protected fun setLayoutHeight(height: Int) {
|
||||
val params = mLinearLayout?.layoutParams
|
||||
params?.height = height
|
||||
params?.width = ViewGroup.LayoutParams.MATCH_PARENT
|
||||
mLinearLayout?.layoutParams = params
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
private fun onTextChanged(newText: CharSequence) {
|
||||
if (!TextUtils.isEmpty(newText)) {
|
||||
mImageViewMic?.visibility = View.GONE
|
||||
mImageViewClear?.visibility = View.VISIBLE
|
||||
} else {
|
||||
mImageViewClear?.visibility = View.GONE
|
||||
if (mSearchEditText?.hasFocus()!!) {
|
||||
mImageViewMic?.visibility = View.VISIBLE
|
||||
} else {
|
||||
mImageViewMic?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
if (mOnQueryTextListener != null) {
|
||||
mOnQueryTextListener?.onQueryTextChange(newText)
|
||||
}
|
||||
}
|
||||
|
||||
private fun onSubmitQuery() {
|
||||
val query = mSearchEditText?.text
|
||||
if (query != null && TextUtils.getTrimmedLength(query) > 0) {
|
||||
if (mOnQueryTextListener == null || !mOnQueryTextListener!!.onQueryTextSubmit(query.toString())) {
|
||||
mSearchEditText?.text = query
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
override fun onSaveInstanceState(): Parcelable? {
|
||||
val superState = super.onSaveInstanceState()
|
||||
val ss = SearchViewSavedState(superState!!)
|
||||
if (mSearchEditText?.text!!.isNotEmpty()) {
|
||||
ss.query = mSearchEditText?.text
|
||||
}
|
||||
ss.hasFocus = mSearchEditText?.hasFocus()!!
|
||||
return ss
|
||||
}
|
||||
|
||||
override fun onRestoreInstanceState(state: Parcelable?) {
|
||||
if (state !is SearchViewSavedState) {
|
||||
super.onRestoreInstanceState(state)
|
||||
return
|
||||
}
|
||||
super.onRestoreInstanceState(state.superState)
|
||||
if (state.hasFocus) {
|
||||
mSearchEditText?.requestFocus()
|
||||
}
|
||||
if (state.query != null) {
|
||||
setTextQuery(state.query, false)
|
||||
}
|
||||
requestLayout()
|
||||
}
|
||||
|
||||
override fun requestFocus(direction: Int, previouslyFocusedRect: Rect?): Boolean {
|
||||
return if (!isFocusable) {
|
||||
false
|
||||
} else {
|
||||
mSearchEditText?.requestFocus(direction, previouslyFocusedRect)!!
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearFocus() {
|
||||
super.clearFocus()
|
||||
mSearchEditText?.clearFocus()
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
if (view === mImageViewNavigation) {
|
||||
if (mOnNavigationClickListener != null) {
|
||||
mOnNavigationClickListener?.onNavigationClick(mSearchEditText?.hasFocus()!!)
|
||||
}
|
||||
} else if (view === mImageViewMic) {
|
||||
if (mOnMicClickListener != null) {
|
||||
mOnMicClickListener?.onMicClick()
|
||||
}
|
||||
} else if (view === mImageViewMenu) {
|
||||
if (mOnMenuClickListener != null) {
|
||||
mOnMenuClickListener?.onMenuClick()
|
||||
}
|
||||
} else if (view === mImageViewClear) {
|
||||
if (mSearchEditText?.text!!.isNotEmpty()) {
|
||||
mSearchEditText?.text!!.clear()
|
||||
}
|
||||
if (mOnClearClickListener != null) {
|
||||
mOnClearClickListener?.onClearClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************************************
|
||||
interface OnFocusChangeListener {
|
||||
|
||||
fun onFocusChange(hasFocus: Boolean)
|
||||
}
|
||||
|
||||
interface OnQueryTextListener {
|
||||
|
||||
fun onQueryTextChange(newText: CharSequence): Boolean
|
||||
|
||||
fun onQueryTextSubmit(query: CharSequence): Boolean
|
||||
}
|
||||
|
||||
interface OnNavigationClickListener {
|
||||
|
||||
fun onNavigationClick(hasFocus: Boolean)
|
||||
}
|
||||
|
||||
interface OnMicClickListener {
|
||||
|
||||
fun onMicClick()
|
||||
}
|
||||
|
||||
interface OnMenuClickListener {
|
||||
|
||||
fun onMenuClick()
|
||||
}
|
||||
|
||||
interface OnClearClickListener {
|
||||
|
||||
fun onClearClick()
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
/*https://github.com/lapism/search*/
|
||||
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search.internal
|
||||
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
|
||||
internal class SearchViewSavedState(superState: Parcelable) : View.BaseSavedState(superState) {
|
||||
|
||||
var query: CharSequence? = null
|
||||
var hasFocus: Boolean = false
|
||||
|
||||
override fun writeToParcel(out: Parcel, flags: Int) {
|
||||
super.writeToParcel(out, flags)
|
||||
TextUtils.writeToParcel(query, out, flags)
|
||||
out.writeInt(if (hasFocus) 1 else 0)
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.koitharu.kotatsu.base.ui.widgets.search.util
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.speech.RecognizerIntent
|
||||
|
||||
object SearchUtils {
|
||||
|
||||
const val SPEECH_REQUEST_CODE = 300
|
||||
|
||||
@JvmStatic
|
||||
fun setVoiceSearch(activity: Activity, text: String) {
|
||||
val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH)
|
||||
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
intent.putExtra(
|
||||
RecognizerIntent.EXTRA_LANGUAGE_MODEL,
|
||||
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
|
||||
)
|
||||
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, text)
|
||||
intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1)
|
||||
|
||||
activity.startActivityForResult(
|
||||
intent,
|
||||
SPEECH_REQUEST_CODE
|
||||
)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isVoiceSearchAvailable(context: Context): Boolean {
|
||||
val pm = context.packageManager
|
||||
val activities =
|
||||
pm.queryIntentActivities(Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0)
|
||||
return activities.size != 0
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.PointF
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
@ -1,4 +1,4 @@
|
||||
package org.koitharu.kotatsu.reader.ui.pager.wetoon
|
||||
package org.koitharu.kotatsu.reader.ui.pager.webtoon
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@ -0,0 +1,21 @@
|
||||
package org.koitharu.kotatsu.utils.ext
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.core.graphics.drawable.DrawableCompat
|
||||
import org.koitharu.kotatsu.R
|
||||
|
||||
fun navigationItemBackground(context: Context): Drawable? {
|
||||
// Need to inflate the drawable and CSL via AppCompatResources to work on Lollipop
|
||||
// From Google I/O repo (https://github.com/google/iosched)
|
||||
var background = AppCompatResources.getDrawable(context, R.drawable.navigation_item_background)
|
||||
if (background != null) {
|
||||
val tint = AppCompatResources.getColorStateList(
|
||||
context, R.color.navigation_item_background_tint
|
||||
)
|
||||
background = DrawableCompat.wrap(background.mutate())
|
||||
background.setTintList(tint)
|
||||
}
|
||||
return background
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorSecondary" android:alpha="0.12" android:state_checked="true" />
|
||||
<item android:color="@android:color/transparent" />
|
||||
</selector>
|
||||
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:alpha="0.2" android:color="?attr/colorAccent" />
|
||||
</selector>
|
||||
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="?attr/colorPrimary" android:state_checked="true"/>
|
||||
<item android:alpha="0.12" android:color="?attr/colorOnSurface" android:state_checked="false"/>
|
||||
</selector>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners
|
||||
android:topLeftRadius="3dp"
|
||||
android:topRightRadius="3dp"
|
||||
android:bottomLeftRadius="3dp"
|
||||
android:bottomRightRadius="3dp"/>
|
||||
<size android:height="3dp" />
|
||||
</shape>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="32dp" />
|
||||
<solid android:color="@color/red_accent" />
|
||||
</shape>
|
||||
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
|
||||
</vector>
|
||||
@ -1,11 +1,10 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M19,2L14,6.5V17.5L19,13V2M6.5,5C4.55,5 2.45,5.4 1,6.5V21.16C1,21.41 1.25,21.66 1.5,21.66C1.6,21.66 1.65,21.59 1.75,21.59C3.1,20.94 5.05,20.5 6.5,20.5C8.45,20.5 10.55,20.9 12,22C13.35,21.15 15.8,20.5 17.5,20.5C19.15,20.5 20.85,20.81 22.25,21.56C22.35,21.61 22.4,21.59 22.5,21.59C22.75,21.59 23,21.34 23,21.09V6.5C22.4,6.05 21.75,5.75 21,5.5V7.5L21,13V19C19.9,18.65 18.7,18.5 17.5,18.5C15.8,18.5 13.35,19.15 12,20V13L12,8.5V6.5C10.55,5.4 8.45,5 6.5,5V5Z" />
|
||||
</vector>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19 1L14 6V17L19 12.5V1M21 5V18.5C19.9 18.15 18.7 18 17.5 18C15.8 18 13.35 18.65 12 19.5V6C10.55 4.9 8.45 4.5 6.5 4.5C4.55 4.5 2.45 4.9 1 6V20.65C1 20.9 1.25 21.15 1.5 21.15C1.6 21.15 1.65 21.1 1.75 21.1C3.1 20.45 5.05 20 6.5 20C8.45 20 10.55 20.4 12 21.5C13.35 20.65 15.8 20 17.5 20C19.15 20 20.85 20.3 22.25 21.05C22.35 21.1 22.4 21.1 22.5 21.1C22.75 21.1 23 20.85 23 20.6V6C22.4 5.55 21.75 5.25 21 5M10 18.41C8.75 18.09 7.5 18 6.5 18C5.44 18 4.18 18.19 3 18.5V7.13C3.91 6.73 5.14 6.5 6.5 6.5C7.86 6.5 9.09 6.73 10 7.13V18.41Z"/>
|
||||
</vector>
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:tint="?android:textColorPrimary"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,4v16L6,20L6,8.83L10.83,4L18,4m0,-2h-8L4,8v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM9,7h2v4L9,11zM12,7h2v4h-2zM15,7h2v4h-2z" />
|
||||
</vector>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:tint="?android:textColorPrimary"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M21.41 11.58L12.41 2.58A2 2 0 0 0 11 2H4A2 2 0 0 0 2 4V11A2 2 0 0 0 2.59 12.42L11.59 21.42A2 2 0 0 0 13 22A2 2 0 0 0 14.41 21.41L21.41 14.41A2 2 0 0 0 22 13A2 2 0 0 0 21.41 11.58M13 20L4 11V4H11L20 13M6.5 5A1.5 1.5 0 1 1 5 6.5A1.5 1.5 0 0 1 6.5 5Z" />
|
||||
</vector>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:tint="?android:textColorPrimary"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M12,13C14.67,13 20,14.33 20,17V20H4V17C4,14.33 9.33,13 12,13M12,14.9C9.03,14.9 5.9,16.36 5.9,17V18.1H18.1V17C18.1,16.36 14.97,14.9 12,14.9Z" />
|
||||
</vector>
|
||||
@ -1,11 +0,0 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="12dp"
|
||||
android:height="12dp"
|
||||
android:tint="?android:textColorPrimary"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2s0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2s0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2s-0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2s-0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z" />
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12 19,6.41z"/>
|
||||
</vector>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z" />
|
||||
</vector>
|
||||
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:enterFadeDuration="@android:integer/config_mediumAnimTime"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
|
||||
<item android:drawable="@drawable/ic_eye" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_eye_off" android:state_checked="false" />
|
||||
</selector>
|
||||
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:fillAlpha="0.3"
|
||||
android:pathData="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,14c1.66,0 3,-1.34 3,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM11,5c0,-0.55 0.45,-1 1,-1s1,0.45 1,1v6c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1L11,5zM17,11c0,2.76 -2.24,5 -5,5s-5,-2.24 -5,-5L5,11c0,3.53 2.61,6.43 6,6.92L11,21h2v-3.08c3.39,-0.49 6,-3.39 6,-6.92h-2z"/>
|
||||
</vector>
|
||||
@ -1,11 +1,10 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z" />
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98 0,-0.34 -0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.09,-0.16 -0.26,-0.25 -0.44,-0.25 -0.06,0 -0.12,0.01 -0.17,0.03l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.06,-0.02 -0.12,-0.03 -0.18,-0.03 -0.17,0 -0.34,0.09 -0.43,0.25l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98 0,0.33 0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.09,0.16 0.26,0.25 0.44,0.25 0.06,0 0.12,-0.01 0.17,-0.03l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.06,0.02 0.12,0.03 0.18,0.03 0.17,0 0.34,-0.09 0.43,-0.25l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM17.45,11.27c0.04,0.31 0.05,0.52 0.05,0.73 0,0.21 -0.02,0.43 -0.05,0.73l-0.14,1.13 0.89,0.7 1.08,0.84 -0.7,1.21 -1.27,-0.51 -1.04,-0.42 -0.9,0.68c-0.43,0.32 -0.84,0.56 -1.25,0.73l-1.06,0.43 -0.16,1.13 -0.2,1.35h-1.4l-0.19,-1.35 -0.16,-1.13 -1.06,-0.43c-0.43,-0.18 -0.83,-0.41 -1.23,-0.71l-0.91,-0.7 -1.06,0.43 -1.27,0.51 -0.7,-1.21 1.08,-0.84 0.89,-0.7 -0.14,-1.13c-0.03,-0.31 -0.05,-0.54 -0.05,-0.74s0.02,-0.43 0.05,-0.73l0.14,-1.13 -0.89,-0.7 -1.08,-0.84 0.7,-1.21 1.27,0.51 1.04,0.42 0.9,-0.68c0.43,-0.32 0.84,-0.56 1.25,-0.73l1.06,-0.43 0.16,-1.13 0.2,-1.35h1.39l0.19,1.35 0.16,1.13 1.06,0.43c0.43,0.18 0.83,0.41 1.23,0.71l0.91,0.7 1.06,-0.43 1.27,-0.51 0.7,1.21 -1.07,0.85 -0.89,0.7 0.14,1.13zM12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
|
||||
</vector>
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z"/>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M18,16.08c-0.76,0 -1.44,0.3 -1.96,0.77L8.91,12.7c0.05,-0.23 0.09,-0.46 0.09,-0.7s-0.04,-0.47 -0.09,-0.7l7.05,-4.11c0.54,0.5 1.25,0.81 2.04,0.81 1.66,0 3,-1.34 3,-3s-1.34,-3 -3,-3 -3,1.34 -3,3c0,0.24 0.04,0.47 0.09,0.7L8.04,9.81C7.5,9.31 6.79,9 6,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3c0.79,0 1.5,-0.31 2.04,-0.81l7.12,4.16c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.61 1.31,2.92 2.92,2.92 1.61,0 2.92,-1.31 2.92,-2.92s-1.31,-2.92 -2.92,-2.92z" />
|
||||
</vector>
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,11 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="20dp"
|
||||
android:height="20dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
|
||||
</vector>
|
||||
@ -1,13 +0,0 @@
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="16dp"
|
||||
android:height="16dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="?attr/colorAccent"
|
||||
android:pathData="M12,15.4l-3.76,2.27l1,-4.28l-3.32,-2.88l4.38,-0.38l1.7,-4.03l1.71,4.04l4.38,0.38l-3.32,2.88l1,4.28z" />
|
||||
<path
|
||||
android:fillColor="?android:textColorPrimary"
|
||||
android:pathData="M22,9.24l-7.19,-0.62L12,2L9.19,8.63L2,9.24l5.46,4.73L5.82,21L12,17.27L18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27l1,-4.28l-3.32,-2.88l4.38,-0.38L12,6.1l1.71,4.04l4.38,0.38l-3.32,2.88l1,4.28L12,15.4z" />
|
||||
</vector>
|
||||
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
|
||||
</vector>
|
||||
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/selector_overlay">
|
||||
<item>
|
||||
<selector>
|
||||
<item
|
||||
android:state_selected="true"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp" />
|
||||
<solid android:color="@color/selector_overlay" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:state_activated="true"
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp" />
|
||||
<solid android:color="@color/selector_overlay" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:top="2dp"
|
||||
android:right="2dp"
|
||||
android:bottom="2dp"
|
||||
android:left="2dp">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp" />
|
||||
<solid android:color="?android:attr/windowBackground" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
</item>
|
||||
</ripple>
|
||||
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true">
|
||||
<inset
|
||||
android:insetLeft="@dimen/nav_item_background_inset_left"
|
||||
android:insetRight="@dimen/nav_item_background_inset_right">
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/nav_item_background_corner_radius_left"
|
||||
android:bottomRightRadius="@dimen/nav_item_background_corner_radius_right"
|
||||
android:topLeftRadius="@dimen/nav_item_background_corner_radius_left"
|
||||
android:topRightRadius="@dimen/nav_item_background_corner_radius_right" />
|
||||
</shape>
|
||||
</inset>
|
||||
</item>
|
||||
<item>
|
||||
<color android:color="@android:color/transparent" />
|
||||
</item>
|
||||
</selector>
|
||||
@ -0,0 +1,281 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cover_card"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:background="@tools:sample/backgrounds/scenic"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/text_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="3">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/lorem[15]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:ellipsize="end"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
||||
tools:text="@tools:sample/lorem[15]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_author"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:requiresFadingEdge="horizontal"
|
||||
android:textColor="?colorAccent"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="@id/textView_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/info_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:baselineAligned="false"
|
||||
android:divider="?android:dividerHorizontal"
|
||||
android:dividerPadding="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView_author">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rating_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_rating"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:padding="4dp"
|
||||
android:textSize="20sp"
|
||||
app:drawableEndCompat="@drawable/ic_star_manga_info"
|
||||
tools:text="4.8" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/chapters_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_chapters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_book_page"
|
||||
tools:text="52 chapters" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/source_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_web"
|
||||
tools:text="Source" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/size_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_storage"
|
||||
tools:text="1.8 GiB" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/info_layout">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_favorite"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:icon="@drawable/ic_heart_outline"
|
||||
app:iconGravity="textTop"
|
||||
app:iconPadding="0dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_read"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/read"
|
||||
android:textAllCaps="false"
|
||||
app:elevation="0dp"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="8dp"
|
||||
tools:text="@string/_continue" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.ChipsView
|
||||
android:id="@+id/chips_tags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:chipSpacingHorizontal="6dp"
|
||||
app:chipSpacingVertical="6dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/buttons_layout" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/desc_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/description"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/chips_tags" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textIsSelectable="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/desc_header"
|
||||
tools:ignore="UnusedAttribute"
|
||||
tools:text="@tools:sample/lorem/random[25]" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/main_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/cover_card"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="1"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:background="@tools:sample/backgrounds/scenic"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/text_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="2">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/lorem[30]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:ellipsize="end"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
||||
tools:text="@tools:sample/lorem[2]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_author"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:requiresFadingEdge="horizontal"
|
||||
android:textColor="?colorAccent"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="@id/textView_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
|
||||
tools:text="@tools:sample/full_names" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/info_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:baselineAligned="false"
|
||||
android:divider="?android:dividerHorizontal"
|
||||
android:dividerPadding="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView_author">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rating_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_rating"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:padding="4dp"
|
||||
android:textSize="20sp"
|
||||
app:drawableEndCompat="@drawable/ic_star_manga_info"
|
||||
tools:text="4.8" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/chapters_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_chapters"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_book_page"
|
||||
tools:text="52 chapters" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/source_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_web"
|
||||
tools:text="Source" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/size_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:padding="4dp"
|
||||
android:textSize="12sp"
|
||||
app:drawableTopCompat="@drawable/ic_storage"
|
||||
tools:text="1.8 GiB" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/info_layout">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_favorite"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:icon="@drawable/ic_heart_outline"
|
||||
app:iconGravity="textTop"
|
||||
app:iconPadding="0dp" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_read"
|
||||
style="@style/Widget.MaterialComponents.Button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_weight="1"
|
||||
android:enabled="false"
|
||||
android:text="@string/read"
|
||||
android:textAllCaps="false"
|
||||
app:elevation="0dp"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="8dp"
|
||||
tools:text="@string/_continue" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.ChipsView
|
||||
android:id="@+id/chips_tags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
app:chipSpacingHorizontal="6dp"
|
||||
app:chipSpacingVertical="6dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/main_container" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/desc_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:text="@string/description"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintTop_toBottomOf="@id/chips_tags" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textIsSelectable="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/desc_header"
|
||||
tools:ignore="UnusedAttribute"
|
||||
tools:text="@tools:sample/lorem/random[25]" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@ -1,145 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintDimensionRatio="13:18"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintWidth_percent="0.3" />
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.ChipsView
|
||||
android:id="@+id/chips_tags"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:padding="6dp"
|
||||
app:chipSpacingHorizontal="4dp"
|
||||
app:chipSpacingVertical="6dp"
|
||||
app:layout_constraintEnd_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintStart_toStartOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/imageView_cover" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:maxLines="3"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/lorem[20]" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:maxLines="2"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintStart_toStartOf="@id/textView_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_title"
|
||||
tools:text="@tools:sample/lorem[20]" />
|
||||
|
||||
<RatingBar
|
||||
android:id="@+id/ratingBar"
|
||||
style="@style/Widget.AppCompat.RatingBar.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:isIndicator="true"
|
||||
android:max="100"
|
||||
app:layout_constraintStart_toStartOf="@id/textView_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView_subtitle"
|
||||
tools:progress="70" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_read"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:enabled="false"
|
||||
android:text="@string/read"
|
||||
app:icon="@drawable/ic_read"
|
||||
app:iconPadding="12dp"
|
||||
app:layout_constraintEnd_toEndOf="@id/textView_title"
|
||||
app:layout_constraintTop_toBottomOf="@id/ratingBar" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView_favourite"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/add_to_favourites"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_heart_outline"
|
||||
app:layout_constraintBottom_toBottomOf="@id/button_read"
|
||||
app:layout_constraintDimensionRatio="1:1"
|
||||
app:layout_constraintEnd_toStartOf="@id/button_read"
|
||||
app:layout_constraintTop_toTopOf="@id/button_read"
|
||||
app:tint="?colorAccent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="?android:listDivider"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/button_read" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_description"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:justificationMode="inter_word"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:padding="12dp"
|
||||
android:textIsSelectable="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider_top"
|
||||
tools:ignore="UnusedAttribute"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/divider_top"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/imageView_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider_top"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|start"
|
||||
android:minHeight="@dimen/header_height"
|
||||
android:paddingStart="?android:listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:listPreferredItemPaddingEnd"
|
||||
android:singleLine="true"
|
||||
android:textAllCaps="true"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textStyle="bold"
|
||||
tools:text="@tools:sample/lorem[2]" />
|
||||
@ -1,38 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:strokeWidth="1dp"
|
||||
app:strokeColor="@color/stroke_color"
|
||||
app:cardElevation="0dp">
|
||||
android:background="@drawable/list_selector">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scaleType="centerCrop" />
|
||||
android:layout_margin="4dp"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_title"
|
||||
style="@style/TextAppearance.AppCompat.Body1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical|start"
|
||||
android:lines="2"
|
||||
android:elegantTextHeight="true"
|
||||
android:padding="6dp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
</LinearLayout>
|
||||
android:lineSpacingExtra="-2dp"
|
||||
android:maxLines="2"
|
||||
android:padding="4dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/card"
|
||||
tools:text="Sample name" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</FrameLayout>
|
||||
@ -1,75 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/card_cover"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
app:cardCornerRadius="4dp"
|
||||
app:cardElevation="4dp"
|
||||
app:layout_constraintDimensionRatio="h,1:1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.CoverImageView
|
||||
<ImageView
|
||||
android:id="@+id/imageView_cover"
|
||||
android:layout_width="87dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true" />
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@id/textView_chapters"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/card_cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_toEndOf="@id/imageView_cover"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1"
|
||||
tools:text="@tools:sample/lorem[6]" />
|
||||
tools:text="@tools:sample/lorem" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:id="@+id/badge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/textView_title"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:layout_toEndOf="@id/imageView_cover"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
tools:text="@tools:sample/lorem[6]" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_below="@id/textView_subtitle"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_toEndOf="@id/imageView_cover"
|
||||
android:background="?android:listDivider" />
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/badge"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="54" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView_chapters"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/divider"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_toEndOf="@id/imageView_cover"
|
||||
android:ellipsize="none"
|
||||
android:paddingBottom="12dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:id="@+id/textView_chapters"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:ellipsize="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/card_cover"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_container"
|
||||
tools:text="@tools:sample/lorem[25]" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<View
|
||||
android:id="@+id/search_view_shadow"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/search_material_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:id="@+id/search_view_anim"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_linear_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/search_layout_height"
|
||||
android:layoutDirection="locale"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/search_image_view_navigation"
|
||||
android:layout_width="@dimen/search_icon_56"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<org.koitharu.kotatsu.base.ui.widgets.search.internal.SearchEditText
|
||||
android:id="@+id/search_search_edit_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical|start"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:ellipsize="end"
|
||||
android:gravity="start|center_vertical"
|
||||
android:imeOptions="actionSearch|flagNoExtractUi"
|
||||
android:inputType="text|textNoSuggestions"
|
||||
android:layoutDirection="locale"
|
||||
android:maxLines="1"
|
||||
android:privateImeOptions="nm"
|
||||
android:singleLine="true"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textColorHint="?android:attr/textColorSecondary"
|
||||
android:textDirection="locale"
|
||||
android:textSize="@dimen/search_sp_16"
|
||||
android:windowSoftInputMode="stateAlwaysHidden|adjustPan|adjustNothing" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/search_image_view_mic"
|
||||
android:layout_width="@dimen/search_icon_48"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/search_image_view_clear"
|
||||
android:layout_width="@dimen/search_icon_48"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/search_image_view_menu"
|
||||
android:layout_width="@dimen/search_icon_48"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerInside" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/search_view_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/search_divider"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:overScrollMode="never" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
</merge>
|
||||
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/navigation_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/nav_header_logo_size"
|
||||
android:layout_height="@dimen/nav_header_logo_size"
|
||||
android:layout_marginStart="@dimen/nav_item_horizontal_padding"
|
||||
android:layout_marginTop="@dimen/margin_normal"
|
||||
android:layout_marginBottom="@dimen/margin_normal"
|
||||
app:srcCompat="@drawable/ic_totoro" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?android:attr/listDivider" />
|
||||
|
||||
</LinearLayout>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue