This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 Use new loading spinner in schedule
- Loading branch information
1 parent
71e4de2
commit 5ea1eca
Showing
4 changed files
with
167 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,65 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
<import type="androidx.lifecycle.LiveData"/> | ||
|
||
<variable name="retryCallback" type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback"/> | ||
<variable name="isChatVisible" type="LiveData<Boolean>"/> | ||
<variable name="isBuffering" type="LiveData<Boolean>"/> | ||
<import type="androidx.lifecycle.LiveData" /> | ||
|
||
</data> | ||
<variable | ||
name="retryCallback" | ||
type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback" /> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/rootConstraint" | ||
android:animateLayoutChanges="true"> | ||
<variable | ||
name="isChatVisible" | ||
type="LiveData<Boolean>" /> | ||
|
||
<com.devbrackets.android.exomedia.ui.widget.VideoView | ||
android:id="@+id/videoView" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
app:useDefaultControls="false" | ||
app:layout_constraintRight_toLeftOf="@+id/chatContainer" | ||
app:layout_constraintLeft_toLeftOf="parent"> | ||
</com.devbrackets.android.exomedia.ui.widget.VideoView> | ||
<variable | ||
name="isBuffering" | ||
type="LiveData<Boolean>" /> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/bufferingContainer" | ||
android:animateLayoutChanges="true" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:visibleHidden="@{isBuffering}"> | ||
</data> | ||
|
||
<ProgressBar | ||
style="?android:attr/progressBarStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/progressBuffering" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:indeterminateTint="@color/progressBar"/> | ||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/rootConstraint" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:animateLayoutChanges="true"> | ||
|
||
<ImageView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:srcCompat="@drawable/ic_logo" | ||
android:id="@+id/logoBuffering" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent"/> | ||
<com.devbrackets.android.exomedia.ui.widget.VideoView | ||
android:id="@+id/videoView" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toLeftOf="@+id/chatContainer" | ||
app:useDefaultControls="false" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
<include | ||
layout="@layout/loading_state_bean" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:animateLayoutChanges="true" | ||
app:isVisibleGone="@{isBuffering}" /> | ||
|
||
<FrameLayout | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/serviceInfoContainer" | ||
app:layout_constraintRight_toLeftOf="@id/chatContainer" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent"/> | ||
android:id="@+id/serviceInfoContainer" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toLeftOf="@id/chatContainer" /> | ||
|
||
<FrameLayout | ||
android:layout_width="300dp" | ||
android:layout_height="match_parent" | ||
android:id="@+id/chatContainer" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:visibleGone="@{isChatVisible}" | ||
android:visibility="gone"/> | ||
android:id="@+id/chatContainer" | ||
android:layout_width="300dp" | ||
android:layout_height="match_parent" | ||
android:visibility="gone" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:visibleGone="@{isChatVisible}" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,55 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout | ||
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"> | ||
<layout 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"> | ||
|
||
<data> | ||
<import type="androidx.lifecycle.LiveData"/> | ||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Resource"/> | ||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Schedule"/> | ||
|
||
<import type="androidx.lifecycle.LiveData" /> | ||
|
||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Resource" /> | ||
|
||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Schedule" /> | ||
|
||
<variable | ||
name="retryCallback" | ||
type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback"/> | ||
name="retryCallback" | ||
type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback" /> | ||
|
||
<variable | ||
name="schedule" | ||
type="LiveData<Resource<Schedule>>"/> | ||
name="schedule" | ||
type="LiveData<Resource<Schedule>>" /> | ||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/show_list" | ||
android:scrollbars="vertical" | ||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
tools:listitem="@layout/schedule_item"/> | ||
android:id="@+id/show_list" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:scrollbars="vertical" | ||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:listitem="@layout/schedule_item" /> | ||
|
||
<include | ||
layout="@layout/loading_state" | ||
app:resource="@{(Resource) schedule}" | ||
app:callback="@{() -> retryCallback.retry()}" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
android:layout_marginStart="8dp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
android:layout_marginEnd="8dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
android:layout_marginBottom="8dp" | ||
android:layout_marginTop="8dp" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
layout="@layout/loading_state" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_marginStart="8dp" | ||
android:layout_marginTop="8dp" | ||
android:layout_marginEnd="8dp" | ||
android:layout_marginBottom="8dp" | ||
app:callback="@{() -> retryCallback.retry()}" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:animateLayoutChanges="true" | ||
app:resource="@{(Resource) schedule}" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
|
||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,52 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
|
||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Resource" /> | ||
|
||
<import type="de.markhaehnel.rbtv.rocketbeanstv.vo.Status" /> | ||
|
||
<variable name="resource" type="Resource" /> | ||
<variable name="callback" type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback" /> | ||
<variable | ||
name="resource" | ||
type="Resource" /> | ||
|
||
<variable | ||
name="callback" | ||
type="de.markhaehnel.rbtv.rocketbeanstv.ui.common.RetryCallback" /> | ||
</data> | ||
|
||
<LinearLayout | ||
android:orientation="vertical" | ||
app:visibleGone="@{resource.data == null}" | ||
android:layout_width="wrap_content" | ||
android:gravity="center" | ||
android:layout_height="wrap_content"> | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:orientation="vertical" | ||
app:visibleGone="@{resource.data == null}"> | ||
|
||
<ProgressBar | ||
app:visibleGone="@{resource.status == Status.LOADING}" | ||
style="?android:attr/progressBarStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/progress_bar" | ||
android:layout_margin="8dp" /> | ||
<include | ||
android:id="@+id/loader" | ||
layout="@layout/loading_state_bean" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_margin="8dp" | ||
android:animateLayoutChanges="true" | ||
app:isVisibleGone="@{resource.status == Status.LOADING}" /> | ||
|
||
<Button | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/retry" | ||
android:id="@+id/retry" | ||
android:onClick="@{() -> callback.retry()}" | ||
app:visibleGone="@{resource.status == Status.ERROR}" /> | ||
android:id="@+id/retry" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:onClick="@{() -> callback.retry()}" | ||
android:text="@string/retry" | ||
app:visibleGone="@{resource.status == Status.ERROR}" /> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:id="@+id/error_msg" | ||
android:text="@{resource.message ?? @string/unknown_error}" | ||
app:visibleGone="@{resource.status == Status.ERROR}" /> | ||
android:id="@+id/error_msg" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@{resource.message ?? @string/unknown_error}" | ||
app:visibleGone="@{resource.status == Status.ERROR}" /> | ||
</LinearLayout> | ||
</layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
|
||
<data> | ||
<variable | ||
name="isVisibleGone" | ||
type="Boolean" /> | ||
</data> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:id="@+id/loadingContainer" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:animateLayoutChanges="true" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:visibleGone="@{safeUnbox(isVisibleGone)}"> | ||
|
||
<ProgressBar | ||
android:id="@+id/progressLoading" | ||
style="?android:attr/progressBarStyle" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:indeterminateTint="@color/progressBar" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<ImageView | ||
android:id="@+id/logoLoading" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:srcCompat="@drawable/ic_logo" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |