Optimize ui

pull/605/head
jhengazuki 4 months ago
parent d38fdaaaab
commit 38dd7c591d
  1. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/CastActivity.java
  2. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  3. 6
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/VideoActivity.java
  4. 10
      app/src/leanback/res/layout/activity_cast.xml
  5. 32
      app/src/leanback/res/layout/activity_live.xml
  6. 10
      app/src/leanback/res/layout/activity_video.xml
  7. 22
      app/src/leanback/res/layout/view_widget_cast.xml
  8. 22
      app/src/leanback/res/layout/view_widget_live.xml
  9. 22
      app/src/leanback/res/layout/view_widget_vod.xml

@ -216,13 +216,13 @@ public class CastActivity extends BaseActivity implements CustomKeyDownVod.Liste
}
private void showProgress() {
mBinding.widget.progress.setVisibility(View.VISIBLE);
mBinding.progress.getRoot().setVisibility(View.VISIBLE);
App.post(mR2, 0);
hideError();
}
private void hideProgress() {
mBinding.widget.progress.setVisibility(View.GONE);
mBinding.progress.getRoot().setVisibility(View.GONE);
App.removeCallbacks(mR2);
Traffic.reset();
}
@ -268,7 +268,7 @@ public class CastActivity extends BaseActivity implements CustomKeyDownVod.Liste
}
private void setTraffic() {
Traffic.setSpeed(mBinding.widget.traffic);
Traffic.setSpeed(mBinding.progress.traffic);
App.post(mR2, 1000);
}

@ -452,13 +452,13 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
}
private void showProgress() {
mBinding.widget.progress.setVisibility(View.VISIBLE);
mBinding.progress.getRoot().setVisibility(View.VISIBLE);
App.post(mR2, 0);
hideError();
}
private void hideProgress() {
mBinding.widget.progress.setVisibility(View.GONE);
mBinding.progress.getRoot().setVisibility(View.GONE);
App.removeCallbacks(mR2);
Traffic.reset();
}
@ -505,7 +505,7 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
}
private void setTraffic() {
Traffic.setSpeed(mBinding.widget.traffic);
Traffic.setSpeed(mBinding.progress.traffic);
App.post(mR2, 1000);
}

@ -844,13 +844,13 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
}
private void showProgress() {
mBinding.widget.progress.setVisibility(View.VISIBLE);
mBinding.progress.getRoot().setVisibility(View.VISIBLE);
App.post(mR3, 0);
hideError();
}
private void hideProgress() {
mBinding.widget.progress.setVisibility(View.GONE);
mBinding.progress.getRoot().setVisibility(View.GONE);
App.removeCallbacks(mR3);
Traffic.reset();
}
@ -896,7 +896,7 @@ public class VideoActivity extends BaseActivity implements CustomKeyDownVod.List
}
private void setTraffic() {
Traffic.setSpeed(mBinding.widget.traffic);
Traffic.setSpeed(mBinding.progress.traffic);
App.post(mR3, 1000);
}

@ -14,6 +14,12 @@
android:layout_height="match_parent"
app:surface_type="none" />
<include
android:id="@+id/widget"
layout="@layout/view_widget_cast"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/control"
layout="@layout/view_control_cast"
@ -23,8 +29,8 @@
android:visibility="gone" />
<include
android:id="@+id/widget"
layout="@layout/view_widget_cast"
android:id="@+id/progress"
layout="@layout/view_progress"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -21,21 +21,27 @@
android:layout_height="match_parent"
app:surface_type="none" />
</FrameLayout>
<include
android:id="@+id/widget"
layout="@layout/view_widget_live"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/control"
layout="@layout/view_control_live"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone" />
<include
android:id="@+id/control"
layout="@layout/view_control_live"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone" />
<include
android:id="@+id/widget"
layout="@layout/view_widget_live"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/progress"
layout="@layout/view_progress"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/recycler"

@ -32,6 +32,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/widget"
layout="@layout/view_widget_vod"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/control"
layout="@layout/view_control_vod"
@ -41,8 +47,8 @@
android:visibility="gone" />
<include
android:id="@+id/widget"
layout="@layout/view_widget_vod"
android:id="@+id/progress"
layout="@layout/view_progress"
android:layout_width="match_parent"
android:layout_height="match_parent" />

@ -48,28 +48,6 @@
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<include layout="@layout/view_progress" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/traffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone"
tools:text="120KB/s"
tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/error"
android:layout_width="wrap_content"

@ -49,28 +49,6 @@
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<include layout="@layout/view_progress" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/traffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone"
tools:text="120KB/s"
tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/error"
android:layout_width="wrap_content"

@ -47,28 +47,6 @@
</RelativeLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<include layout="@layout/view_progress" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/traffic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone"
tools:text="120KB/s"
tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/error"
android:layout_width="wrap_content"

Loading…
Cancel
Save