-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #676 from ooni/fix/dashboard-progress-indicator
fix: Updated `ProgressFragment` and its position on dashboard.
- Loading branch information
Showing
12 changed files
with
144 additions
and
116 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
19 changes: 19 additions & 0 deletions
19
app/src/main/java/org/openobservatory/ooniprobe/common/TestStateRepository.kt
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,19 @@ | ||
package org.openobservatory.ooniprobe.common | ||
|
||
import androidx.lifecycle.MutableLiveData | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
/** | ||
* This class is used to store the state of the test group. | ||
* It is used to communicate the state of the test group between the [org.openobservatory.ooniprobe.test.TestAsyncTask] and any [androidx.lifecycle.Observer]. | ||
* | ||
* Note: Ideally, this class should used to replace Broadcasts from [org.openobservatory.ooniprobe.test.TestAsyncTask] | ||
* and "org.openobservatory.ooniprobe.activity.RunningActivity" broadcast events | ||
*/ | ||
@Singleton | ||
class TestStateRepository @Inject constructor() { | ||
var testGroupStatus = MutableLiveData(TestGroupStatus.NOT_STARTED) | ||
} | ||
|
||
enum class TestGroupStatus { NOT_STARTED, RUNNING, FINISHED } |
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
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
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
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
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
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
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
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
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
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,54 +1,51 @@ | ||
<?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:id="@+id/progress_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/progress_background" | ||
tools:context=".fragment.ProgressFragment"> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
<ProgressBar | ||
android:id="@+id/progress" | ||
style="@style/Widget.AppCompat.ProgressBar.Horizontal" | ||
android:minHeight="8dp" | ||
android:maxHeight="8dp" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:progressDrawable="@drawable/progress_blue" | ||
android:indeterminateTint="@color/color_base"/> | ||
<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/progress_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".fragment.ProgressFragment"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="20dp" | ||
android:layout_marginBottom="20dp" | ||
android:orientation="horizontal"> | ||
|
||
<ImageView | ||
android:id="@+id/test_image" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:contentDescription="@string/OONIRun_TestName" | ||
android:src="@null" | ||
app:tint="@color/color_white" | ||
android:visibility="gone" | ||
tools:ignore="RtlSymmetry"/> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="20dp" | ||
android:layout_marginTop="20dp" | ||
android:layout_marginBottom="8dp" | ||
android:gravity="center_horizontal" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/name" | ||
style="@style/TextAppearance.AppCompat.Small" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_vertical" | ||
android:textColor="@color/color_white" | ||
android:text="@string/Dashboard_Running_PreparingTest"/> | ||
</LinearLayout> | ||
</LinearLayout> | ||
<ImageView | ||
android:id="@+id/test_image" | ||
android:layout_width="wrap_content" | ||
android:layout_height="match_parent" | ||
android:contentDescription="@string/OONIRun_TestName" | ||
android:src="@null" | ||
android:visibility="gone" | ||
app:tint="@color/color_gray9" | ||
tools:ignore="RtlSymmetry" /> | ||
|
||
</FrameLayout> | ||
<TextView | ||
android:id="@+id/name" | ||
style="@style/TextAppearance.AppCompat.Small" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:gravity="center_vertical" | ||
android:text="@string/Dashboard_Running_PreparingTest" | ||
android:textColor="@color/color_gray9" /> | ||
</LinearLayout> | ||
|
||
<ProgressBar | ||
android:id="@+id/progress" | ||
style="@style/Widget.AppCompat.ProgressBar.Horizontal" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:indeterminateTint="@color/color_base" | ||
android:maxHeight="8dp" | ||
android:minHeight="8dp" | ||
android:progressDrawable="@drawable/progress_blue" /> | ||
|
||
</LinearLayout> |