parent
48a1e8f74c
commit
575eaee1d2
@ -0,0 +1,36 @@
|
|||||||
|
package eu.kanade.tachiyomi.widget
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.RelativeLayout
|
||||||
|
import eu.kanade.tachiyomi.R
|
||||||
|
import eu.kanade.tachiyomi.util.getResourceColor
|
||||||
|
import eu.kanade.tachiyomi.util.setVectorCompat
|
||||||
|
import kotlinx.android.synthetic.main.view_empty.view.*
|
||||||
|
|
||||||
|
class EmptyView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
|
||||||
|
RelativeLayout (context, attrs) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
inflate(context, R.layout.view_empty, this)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the information view
|
||||||
|
*/
|
||||||
|
fun hide() {
|
||||||
|
this.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the information view
|
||||||
|
* @param drawable icon of information view
|
||||||
|
* @param textResource text of information view
|
||||||
|
*/
|
||||||
|
fun show(drawable: Int, textResource: Int) {
|
||||||
|
image_view.setVectorCompat(drawable, context.theme.getResourceColor(android.R.attr.textColorHint))
|
||||||
|
text_label.text = context.getString(textResource)
|
||||||
|
this.visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/colorAccentDark"
|
||||||
|
>
|
||||||
|
<item>
|
||||||
|
<selector>
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<color android:color="@color/selectorColorDark"/>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:state_activated="true">
|
||||||
|
<color android:color="@color/selectorColorDark"/>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<color android:color="@color/backgroundDark"/>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
|
||||||
|
</ripple>
|
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/colorAccentLight"
|
||||||
|
>
|
||||||
|
<item>
|
||||||
|
<selector>
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<color android:color="@color/selectorColorLight"/>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:state_activated="true">
|
||||||
|
<color android:color="@color/selectorColorLight"/>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<color android:color="@color/backgroundLight"/>
|
||||||
|
</item>
|
||||||
|
</selector>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
|
||||||
|
</ripple>
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector android:exitFadeDuration="@android:integer/config_longAnimTime"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_focused="true" android:drawable="@color/selectorColorDark"/>
|
||||||
|
<item android:state_pressed="true" android:drawable="@color/selectorColorDark"/>
|
||||||
|
<item android:state_activated="true" android:drawable="@color/selectorColorDark"/>
|
||||||
|
<item android:drawable="@color/backgroundDark"/>
|
||||||
|
|
||||||
|
</selector>
|
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--<selector android:exitFadeDuration="@android:integer/config_longAnimTime"-->
|
||||||
|
<!--xmlns:android="http://schemas.android.com/apk/res/android">-->
|
||||||
|
|
||||||
|
<!--<item android:state_focused="true" android:drawable="?attr/colorAccent"/>-->
|
||||||
|
<!--<item android:state_pressed="true" android:drawable="?attr/colorAccent"/>-->
|
||||||
|
<!--<item android:state_activated="true" android:drawable="?attr/colorAccent"/>-->
|
||||||
|
<!--<item android:drawable="?android:attr/colorBackground"/>-->
|
||||||
|
<!--</selector>-->
|
||||||
|
|
||||||
|
<selector android:exitFadeDuration="@android:integer/config_longAnimTime"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:state_focused="true" android:drawable="@color/selectorColorLight"/>
|
||||||
|
<item android:state_pressed="true" android:drawable="@color/selectorColorLight"/>
|
||||||
|
<item android:state_activated="true" android:drawable="@color/selectorColorLight"/>
|
||||||
|
<item android:drawable="@color/backgroundLight"/>
|
||||||
|
|
||||||
|
</selector>
|
@ -1,142 +1,151 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout
|
<android.support.v7.widget.CardView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/cv_mal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="@dimen/card_margin"
|
||||||
|
>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/myanimelist_title_layout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?android:listPreferredItemHeightSmall"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/selectable_list_drawable"
|
android:padding="@dimen/card_margin">
|
||||||
android:clickable="true"
|
|
||||||
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
<RelativeLayout
|
||||||
android:paddingRight="?android:listPreferredItemPaddingRight">
|
android:id="@+id/myanimelist_title_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
<TextView
|
android:layout_height="?android:listPreferredItemHeightSmall"
|
||||||
android:layout_width="wrap_content"
|
android:background="?attr/selectable_list_drawable"
|
||||||
android:layout_height="wrap_content"
|
android:clickable="true"
|
||||||
android:layout_centerVertical="true"
|
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
||||||
android:text="Title"
|
android:paddingRight="?android:listPreferredItemPaddingRight">
|
||||||
style="@style/TextAppearance.Regular.Body1"/>
|
|
||||||
|
<TextView
|
||||||
<TextView
|
style="@style/TextAppearance.Regular.Body1"
|
||||||
android:id="@+id/myanimelist_title"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:text="Title"/>
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:text="@string/action_edit"
|
<TextView
|
||||||
style="@style/TextAppearance.Medium.Button"/>
|
android:id="@+id/myanimelist_title"
|
||||||
|
style="@style/TextAppearance.Medium.Button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="@string/action_edit"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider1"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/myanimelist_title_layout"
|
||||||
|
android:background="?android:attr/divider"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/myanimelist_status_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:listPreferredItemHeightSmall"
|
||||||
|
android:layout_below="@id/divider1"
|
||||||
|
android:background="?attr/selectable_list_drawable"
|
||||||
|
android:clickable="true"
|
||||||
|
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
||||||
|
android:paddingRight="?android:listPreferredItemPaddingRight"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/TextAppearance.Regular.Body1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="Status"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/myanimelist_status"
|
||||||
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
tools:text="Reading"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider2"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/myanimelist_status_layout"
|
||||||
|
android:background="?android:attr/divider"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/myanimelist_chapters_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:listPreferredItemHeightSmall"
|
||||||
|
android:layout_below="@id/divider2"
|
||||||
|
android:background="?attr/selectable_list_drawable"
|
||||||
|
android:clickable="true"
|
||||||
|
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
||||||
|
android:paddingRight="?android:listPreferredItemPaddingRight">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/TextAppearance.Regular.Body1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="Chapters"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/myanimelist_chapters"
|
||||||
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
tools:text="12/24"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider3"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/myanimelist_chapters_layout"
|
||||||
|
android:background="?android:attr/divider"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/myanimelist_score_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?android:listPreferredItemHeightSmall"
|
||||||
|
android:layout_below="@id/divider3"
|
||||||
|
android:background="?attr/selectable_list_drawable"
|
||||||
|
android:clickable="true"
|
||||||
|
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
||||||
|
android:paddingRight="?android:listPreferredItemPaddingRight">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/TextAppearance.Regular.Body1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:text="@string/score"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/myanimelist_score"
|
||||||
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
tools:text="10"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
</android.support.v7.widget.CardView>
|
||||||
android:id="@+id/divider1"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_below="@id/myanimelist_title_layout"
|
|
||||||
android:background="?android:attr/divider" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/myanimelist_status_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:listPreferredItemHeightSmall"
|
|
||||||
android:layout_below="@id/divider1"
|
|
||||||
android:background="?attr/selectable_list_drawable"
|
|
||||||
android:clickable="true"
|
|
||||||
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
|
||||||
android:paddingRight="?android:listPreferredItemPaddingRight"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:text="Status"
|
|
||||||
style="@style/TextAppearance.Regular.Body1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/myanimelist_status"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
tools:text="Reading"
|
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/divider2"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_below="@id/myanimelist_status_layout"
|
|
||||||
android:background="?android:attr/divider" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/myanimelist_chapters_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:listPreferredItemHeightSmall"
|
|
||||||
android:layout_below="@id/divider2"
|
|
||||||
android:background="?attr/selectable_list_drawable"
|
|
||||||
android:clickable="true"
|
|
||||||
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
|
||||||
android:paddingRight="?android:listPreferredItemPaddingRight">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:text="Chapters"
|
|
||||||
style="@style/TextAppearance.Regular.Body1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/myanimelist_chapters"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
tools:text="12/24"
|
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/divider3"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="1dp"
|
|
||||||
android:layout_below="@id/myanimelist_chapters_layout"
|
|
||||||
android:background="?android:attr/divider" />
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/myanimelist_score_layout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="?android:listPreferredItemHeightSmall"
|
|
||||||
android:layout_below="@id/divider3"
|
|
||||||
android:background="?attr/selectable_list_drawable"
|
|
||||||
android:clickable="true"
|
|
||||||
android:paddingLeft="?android:listPreferredItemPaddingLeft"
|
|
||||||
android:paddingRight="?android:listPreferredItemPaddingRight">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:text="@string/score"
|
|
||||||
style="@style/TextAppearance.Regular.Body1"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/myanimelist_score"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
tools:text="10"
|
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<android.support.v7.widget.AppCompatImageView
|
||||||
|
android:id="@+id/image_view"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_label"
|
||||||
|
style="@style/TextAppearance.Medium.Body2.Hint"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/image_view"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
Loading…
Reference in new issue