mirror of https://github.com/FongMi/TV.git
parent
5a3f1f1bb4
commit
17391fa4fb
@ -0,0 +1,15 @@ |
||||
package com.fongmi.android.tv.ui.activity; |
||||
|
||||
import androidx.viewbinding.ViewBinding; |
||||
|
||||
import com.fongmi.android.tv.databinding.ActivityLiveBinding; |
||||
|
||||
public class LiveActivity extends BaseActivity { |
||||
|
||||
private ActivityLiveBinding mBinding; |
||||
|
||||
@Override |
||||
protected ViewBinding getBinding() { |
||||
return mBinding = ActivityLiveBinding.inflate(getLayoutInflater()); |
||||
} |
||||
} |
||||
@ -0,0 +1,4 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<item android:drawable="@drawable/shape_live_channel" android:state_selected="true" /> |
||||
</selector> |
||||
@ -0,0 +1,4 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<item android:drawable="@drawable/shape_live_group" android:state_selected="true" /> |
||||
</selector> |
||||
@ -0,0 +1,12 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:shape="rectangle"> |
||||
|
||||
<gradient |
||||
android:angle="0" |
||||
android:centerColor="#99000000" |
||||
android:endColor="#0D000000" |
||||
android:startColor="#CC000000" |
||||
android:type="linear" /> |
||||
|
||||
</shape> |
||||
@ -0,0 +1,11 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:shape="rectangle"> |
||||
|
||||
<solid android:color="#CC2196F3" /> |
||||
|
||||
<corners |
||||
android:bottomRightRadius="40dp" |
||||
android:topRightRadius="40dp" /> |
||||
|
||||
</shape> |
||||
@ -0,0 +1,7 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:shape="rectangle"> |
||||
|
||||
<solid android:color="@color/green_400" /> |
||||
|
||||
</shape> |
||||
@ -0,0 +1,55 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<FrameLayout 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:keepScreenOn="true"> |
||||
|
||||
<com.google.android.exoplayer2.ui.StyledPlayerView |
||||
android:id="@+id/surface" |
||||
style="@style/LivePlayerStyle" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:visibility="gone" |
||||
app:surface_type="surface_view" /> |
||||
|
||||
<com.google.android.exoplayer2.ui.StyledPlayerView |
||||
android:id="@+id/texture" |
||||
style="@style/LivePlayerStyle" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
android:visibility="gone" |
||||
app:surface_type="texture_view" /> |
||||
|
||||
<LinearLayout |
||||
android:id="@+id/list" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="match_parent" |
||||
android:background="@drawable/shape_live" |
||||
android:orientation="horizontal" |
||||
android:visibility="gone" |
||||
tools:visibility="visible"> |
||||
|
||||
<androidx.leanback.widget.VerticalGridView |
||||
android:id="@+id/group" |
||||
android:layout_width="120dp" |
||||
android:layout_height="match_parent" |
||||
tools:itemCount="5" |
||||
tools:listitem="@layout/adapter_live_group" /> |
||||
|
||||
<View |
||||
android:layout_width="0.3dp" |
||||
android:layout_height="match_parent" |
||||
android:background="@color/grey_700" /> |
||||
|
||||
<androidx.leanback.widget.VerticalGridView |
||||
android:id="@+id/channel" |
||||
android:layout_width="280dp" |
||||
android:layout_height="match_parent" |
||||
tools:itemCount="5" |
||||
tools:listitem="@layout/adapter_live_channel" /> |
||||
|
||||
</LinearLayout> |
||||
</FrameLayout> |
||||
|
||||
@ -0,0 +1,46 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:background="@drawable/selector_live_channel" |
||||
android:gravity="center" |
||||
android:orientation="horizontal" |
||||
android:paddingStart="20dp" |
||||
android:paddingTop="12dp" |
||||
android:paddingEnd="20dp" |
||||
android:paddingBottom="12dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/number" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_marginEnd="12dp" |
||||
android:letterSpacing="0.05" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
android:textStyle="bold" |
||||
tools:text="01" /> |
||||
|
||||
<ImageView |
||||
android:id="@+id/logo" |
||||
android:layout_width="48dp" |
||||
android:layout_height="36dp" |
||||
android:layout_marginEnd="12dp" |
||||
android:scaleType="fitCenter" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/name" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:ellipsize="marquee" |
||||
android:letterSpacing="0.05" |
||||
android:marqueeRepeatLimit="marquee_forever" |
||||
android:scrollHorizontally="true" |
||||
android:singleLine="true" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
android:textStyle="bold" |
||||
tools:text="CNN" /> |
||||
|
||||
</LinearLayout> |
||||
@ -0,0 +1,32 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:background="@drawable/selector_live_group" |
||||
android:gravity="center" |
||||
android:orientation="horizontal" |
||||
android:paddingStart="20dp" |
||||
android:paddingTop="12dp" |
||||
android:paddingEnd="20dp" |
||||
android:paddingBottom="12dp"> |
||||
|
||||
<ImageView |
||||
android:id="@+id/logo" |
||||
android:layout_width="36dp" |
||||
android:layout_height="36dp" |
||||
android:layout_marginEnd="12dp" |
||||
android:scaleType="fitCenter" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/name" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:letterSpacing="0.05" |
||||
android:singleLine="true" |
||||
android:textColor="@color/white" |
||||
android:textSize="14sp" |
||||
android:textStyle="bold" |
||||
tools:text="收藏" /> |
||||
|
||||
</LinearLayout> |
||||
Loading…
Reference in new issue