mirror of https://github.com/FongMi/TV.git
parent
3eaca1ec68
commit
98a0b3c305
@ -0,0 +1,17 @@ |
||||
package com.fongmi.android.tv.ui.base; |
||||
|
||||
import android.view.View; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
import androidx.recyclerview.widget.RecyclerView; |
||||
|
||||
import com.fongmi.android.tv.bean.Episode; |
||||
|
||||
public abstract class BaseEpisodeHolder extends RecyclerView.ViewHolder { |
||||
|
||||
public BaseEpisodeHolder(@NonNull View itemView) { |
||||
super(itemView); |
||||
} |
||||
|
||||
public abstract void initView(Episode item); |
||||
} |
||||
@ -0,0 +1,28 @@ |
||||
package com.fongmi.android.tv.ui.holder; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.fongmi.android.tv.bean.Episode; |
||||
import com.fongmi.android.tv.databinding.AdapterEpisodeGridBinding; |
||||
import com.fongmi.android.tv.ui.adapter.EpisodeAdapter; |
||||
import com.fongmi.android.tv.ui.base.BaseEpisodeHolder; |
||||
|
||||
public class EpisodeGridHolder extends BaseEpisodeHolder { |
||||
|
||||
private final EpisodeAdapter.OnClickListener listener; |
||||
private final AdapterEpisodeGridBinding binding; |
||||
|
||||
public EpisodeGridHolder(@NonNull AdapterEpisodeGridBinding binding, EpisodeAdapter.OnClickListener listener) { |
||||
super(binding.getRoot()); |
||||
this.binding = binding; |
||||
this.listener = listener; |
||||
} |
||||
|
||||
@Override |
||||
public void initView(Episode item) { |
||||
binding.text.setSelected(item.isActivated()); |
||||
binding.text.setActivated(item.isActivated()); |
||||
binding.text.setText(item.getDesc().concat(item.getName())); |
||||
binding.text.setOnClickListener(v -> listener.onItemClick(item)); |
||||
} |
||||
} |
||||
@ -0,0 +1,30 @@ |
||||
package com.fongmi.android.tv.ui.holder; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.fongmi.android.tv.Product; |
||||
import com.fongmi.android.tv.bean.Episode; |
||||
import com.fongmi.android.tv.databinding.AdapterEpisodeHoriBinding; |
||||
import com.fongmi.android.tv.ui.adapter.EpisodeAdapter; |
||||
import com.fongmi.android.tv.ui.base.BaseEpisodeHolder; |
||||
|
||||
public class EpisodeHoriHolder extends BaseEpisodeHolder { |
||||
|
||||
private final EpisodeAdapter.OnClickListener listener; |
||||
private final AdapterEpisodeHoriBinding binding; |
||||
|
||||
public EpisodeHoriHolder(@NonNull AdapterEpisodeHoriBinding binding, EpisodeAdapter.OnClickListener listener) { |
||||
super(binding.getRoot()); |
||||
this.binding = binding; |
||||
this.listener = listener; |
||||
} |
||||
|
||||
@Override |
||||
public void initView(Episode item) { |
||||
binding.text.setMaxEms(Product.getEms()); |
||||
binding.text.setSelected(item.isActivated()); |
||||
binding.text.setActivated(item.isActivated()); |
||||
binding.text.setText(item.getDesc().concat(item.getName())); |
||||
binding.text.setOnClickListener(v -> listener.onItemClick(item)); |
||||
} |
||||
} |
||||
@ -0,0 +1,28 @@ |
||||
package com.fongmi.android.tv.ui.holder; |
||||
|
||||
import androidx.annotation.NonNull; |
||||
|
||||
import com.fongmi.android.tv.bean.Episode; |
||||
import com.fongmi.android.tv.databinding.AdapterEpisodeVertBinding; |
||||
import com.fongmi.android.tv.ui.adapter.EpisodeAdapter; |
||||
import com.fongmi.android.tv.ui.base.BaseEpisodeHolder; |
||||
|
||||
public class EpisodeVertHolder extends BaseEpisodeHolder { |
||||
|
||||
private final EpisodeAdapter.OnClickListener listener; |
||||
private final AdapterEpisodeVertBinding binding; |
||||
|
||||
public EpisodeVertHolder(@NonNull AdapterEpisodeVertBinding binding, EpisodeAdapter.OnClickListener listener) { |
||||
super(binding.getRoot()); |
||||
this.binding = binding; |
||||
this.listener = listener; |
||||
} |
||||
|
||||
@Override |
||||
public void initView(Episode item) { |
||||
binding.text.setSelected(item.isActivated()); |
||||
binding.text.setActivated(item.isActivated()); |
||||
binding.text.setText(item.getDesc().concat(item.getName())); |
||||
binding.text.setOnClickListener(v -> listener.onItemClick(item)); |
||||
} |
||||
} |
||||
@ -1,123 +1,121 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
<LinearLayout 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:id="@+id/swipeLayout" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:fitsSystemWindows="true"> |
||||
android:fitsSystemWindows="true" |
||||
android:orientation="vertical"> |
||||
|
||||
<com.fongmi.android.tv.ui.custom.ProgressLayout |
||||
android:id="@+id/progressLayout" |
||||
<androidx.core.widget.NestedScrollView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent"> |
||||
android:layout_height="match_parent" |
||||
android:fillViewport="true"> |
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView |
||||
android:id="@+id/pic" |
||||
android:layout_width="120dp" |
||||
android:layout_height="168dp" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:layout_marginBottom="16dp" |
||||
android:elevation="4dp" |
||||
android:scaleType="centerCrop" |
||||
app:shapeAppearance="@style/Vod.Grid" /> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/info" |
||||
<com.fongmi.android.tv.ui.custom.ProgressLayout |
||||
android:id="@+id/progressLayout" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:layout_toEndOf="@+id/pic" |
||||
android:gravity="center_vertical" |
||||
android:minHeight="168dp" |
||||
android:orientation="vertical"> |
||||
android:layout_height="match_parent"> |
||||
|
||||
<TextView |
||||
android:id="@+id/name" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="20sp" |
||||
android:textStyle="bold" |
||||
tools:text="海賊王" /> |
||||
<com.google.android.material.imageview.ShapeableImageView |
||||
android:id="@+id/pic" |
||||
android:layout_width="120dp" |
||||
android:layout_height="168dp" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:elevation="4dp" |
||||
android:scaleType="centerCrop" |
||||
app:shapeAppearance="@style/Vod.Grid" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/director" |
||||
android:layout_width="wrap_content" |
||||
<LinearLayout |
||||
android:id="@+id/info" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:singleLine="true" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
tools:text="尾田榮一郎" /> |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:layout_toEndOf="@+id/pic" |
||||
android:gravity="center_vertical" |
||||
android:minHeight="168dp" |
||||
android:orientation="vertical"> |
||||
|
||||
<TextView |
||||
android:id="@+id/name" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="end" |
||||
android:textColor="@color/white" |
||||
android:textSize="20sp" |
||||
android:textStyle="bold" |
||||
tools:text="海賊王" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/director" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:singleLine="true" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
tools:text="尾田榮一郎" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/site" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:singleLine="true" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
tools:text="漫畫人" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<TextView |
||||
android:id="@+id/site" |
||||
android:layout_width="wrap_content" |
||||
android:id="@+id/content" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginTop="8dp" |
||||
android:singleLine="true" |
||||
android:layout_below="@+id/info" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:ellipsize="end" |
||||
android:lineSpacingExtra="4dp" |
||||
android:maxLines="2" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
tools:text="漫畫人" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/action" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/info" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="8dp" |
||||
android:layout_marginEnd="16dp"> |
||||
tools:text="相傳22年前,在一個童話般的世界裡,曾經擁有一切的海賊王在走上斷頭台的時候對人們狂笑道:“想要我的財寶是嗎,想要就給你們!去找吧,全世界的寶藏都在那裡!”……自此開始,全世界勇敢的男人都離開了平庸的生活,走向了大海,向著埋藏海賊王寶藏的偉大航道挺進!世界簡直成為了大海賊時代!在某個村子的小孩莫奇。 D.路飛對“海賊王”甚為仰慕,立志要成為新一代的海賊王。因此他希望駐紮在村子的海盜團能帶他出海,可是遭船長紅發撒古斯拒絕。有一天路飛不小心偷吃了撒古斯帶來的戰利品-惡魔果實,成為了永遠不能游泳的橡皮人,令他的海盜夢想泡湯。後來路飛被一群討厭撒古斯的人捉了,在被海獸吃掉之際,被撒古斯救走,而撒古斯的手也犧牲了。撒古斯臨行前將草帽送給路飛,使他重燃起當海賊王的決心。事隔十年,苦練一身橡皮絕技的少年路飛揚帆出發,開始找尋One Piece的冒險…… 傳說開始了! !大家帶著新的誓言,終到達了“偉大航道”的入口。路飛他們攀山、過海,眼看就要闖進去了,面前郤出現了一個黑團? !圍繞著“大秘寶one piece”而展開的海洋冒險故事現在開始!" /> |
||||
|
||||
<com.google.android.material.button.MaterialButton |
||||
android:layout_width="0dp" |
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/flag" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:backgroundTint="@color/transparent" |
||||
android:text="@string/keep" |
||||
app:icon="@drawable/ic_action_keep" |
||||
app:iconGravity="textTop" /> |
||||
android:layout_below="@+id/content" |
||||
android:layout_marginTop="16dp" |
||||
android:clipChildren="false" |
||||
android:clipToPadding="false" |
||||
android:orientation="horizontal" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp" |
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" |
||||
tools:listitem="@layout/adapter_flag" /> |
||||
|
||||
<com.google.android.material.button.MaterialButton |
||||
android:layout_width="0dp" |
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/episode" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_weight="1" |
||||
android:backgroundTint="@color/transparent" |
||||
android:text="@string/keep" |
||||
app:icon="@drawable/ic_action_keep" |
||||
app:iconGravity="textTop" /> |
||||
|
||||
</LinearLayout> |
||||
|
||||
<TextView |
||||
android:id="@+id/content" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/action" |
||||
android:layout_marginStart="16dp" |
||||
android:layout_marginTop="8dp" |
||||
android:layout_marginEnd="16dp" |
||||
android:ellipsize="end" |
||||
android:lineSpacingExtra="4dp" |
||||
android:maxLines="2" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
tools:text="相傳22年前,在一個童話般的世界裡,曾經擁有一切的海賊王在走上斷頭台的時候對人們狂笑道:“想要我的財寶是嗎,想要就給你們!去找吧,全世界的寶藏都在那裡!”……自此開始,全世界勇敢的男人都離開了平庸的生活,走向了大海,向著埋藏海賊王寶藏的偉大航道挺進!世界簡直成為了大海賊時代!在某個村子的小孩莫奇。 D.路飛對“海賊王”甚為仰慕,立志要成為新一代的海賊王。因此他希望駐紮在村子的海盜團能帶他出海,可是遭船長紅發撒古斯拒絕。有一天路飛不小心偷吃了撒古斯帶來的戰利品-惡魔果實,成為了永遠不能游泳的橡皮人,令他的海盜夢想泡湯。後來路飛被一群討厭撒古斯的人捉了,在被海獸吃掉之際,被撒古斯救走,而撒古斯的手也犧牲了。撒古斯臨行前將草帽送給路飛,使他重燃起當海賊王的決心。事隔十年,苦練一身橡皮絕技的少年路飛揚帆出發,開始找尋One Piece的冒險…… 傳說開始了! !大家帶著新的誓言,終到達了“偉大航道”的入口。路飛他們攀山、過海,眼看就要闖進去了,面前郤出現了一個黑團? !圍繞著“大秘寶one piece”而展開的海洋冒險故事現在開始!" /> |
||||
|
||||
<androidx.recyclerview.widget.RecyclerView |
||||
android:id="@+id/episode" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:layout_below="@+id/content" |
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" |
||||
app:stackFromEnd="true" /> |
||||
android:layout_below="@+id/flag" |
||||
android:layout_marginTop="16dp" |
||||
android:layout_marginBottom="16dp" |
||||
android:clipChildren="false" |
||||
android:clipToPadding="false" |
||||
android:nestedScrollingEnabled="false" |
||||
android:orientation="vertical" |
||||
android:paddingStart="16dp" |
||||
android:paddingEnd="16dp" |
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" |
||||
tools:listitem="@layout/adapter_episode_vert" /> |
||||
|
||||
</com.fongmi.android.tv.ui.custom.ProgressLayout> |
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> |
||||
</com.fongmi.android.tv.ui.custom.ProgressLayout> |
||||
</androidx.core.widget.NestedScrollView> |
||||
</LinearLayout> |
||||
@ -0,0 +1,11 @@ |
||||
<?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:id="@+id/text" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:background="@drawable/shape_item" |
||||
android:ellipsize="marquee" |
||||
android:textColor="@color/text" |
||||
android:textSize="14sp" |
||||
tools:text="20" /> |
||||
Loading…
Reference in new issue