Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/anki/settings/Prefs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ open class PrefsRepository(
get() = getBoolean(R.string.dev_options_enabled_by_user_key, false) || BuildConfig.DEBUG
set(value) = putBoolean(R.string.dev_options_enabled_by_user_key, value)

val isNewStudyScreenEnabled by booleanPref(R.string.new_reviewer_options_key, false)
var isNewStudyScreenEnabled by booleanPref(R.string.new_reviewer_options_key, false)

val devIsCardBrowserFragmented: Boolean
get() = getBoolean(R.string.dev_card_browser_fragmented, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class ReviewerFragment :
connect(
R.id.reviewer_menu_view,
ConstraintSet.START,
R.id.counts_flow,
R.id.counts_barrier,
ConstraintSet.END,
)
applyTo(binding.toolsLayout)
Expand Down
22 changes: 11 additions & 11 deletions AnkiDroid/src/main/res/layout-sw720dp/reviewer2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
android:id="@+id/study_counts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/back_button"
app:layout_constraintBottom_toTopOf="@id/timer"
/>

<!-- Timer below counts means UI elements may jump if timer is selectively enabled.
Expand All @@ -161,23 +164,20 @@
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/back_button"
app:layout_constraintEnd_toEndOf="@id/counts_barrier"
app:layout_constraintTop_toBottomOf="@id/study_counts"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
tools:visibility="visible"
/>

<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/counts_flow"
<androidx.constraintlayout.widget.Barrier
android:id="@+id/counts_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="study_counts,timer"
app:flow_wrapMode="chain"
app:flow_verticalStyle="packed"
app:flow_verticalGap="4dp"
app:flow_maxElementsWrap="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/back_button"
/>
app:barrierDirection="end"
app:constraint_referenced_ids="study_counts, timer"/>

<com.ichi2.anki.ui.windows.reviewer.AnswerAreaView
android:id="@+id/answer_area"
Expand Down
24 changes: 12 additions & 12 deletions AnkiDroid/src/main/res/layout/reviewer2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
android:id="@+id/study_counts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/back_button"
app:layout_constraintBottom_toTopOf="@id/timer"
/>

<!-- Timer below counts means UI elements may jump if timer is selectively enabled.
Expand All @@ -52,31 +55,28 @@
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/back_button"
app:layout_constraintEnd_toStartOf="@id/counts_barrier"
app:layout_constraintTop_toBottomOf="@id/study_counts"
app:layout_constraintBottom_toBottomOf="parent"
android:visibility="gone"
tools:visibility="visible"
/>

<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/counts_flow"
<androidx.constraintlayout.widget.Barrier
android:id="@+id/counts_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="study_counts,timer"
app:flow_wrapMode="chain"
app:flow_verticalStyle="packed"
app:flow_verticalGap="4dp"
app:flow_maxElementsWrap="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/back_button"
/>
app:barrierDirection="end"
app:constraint_referenced_ids="study_counts, timer"/>

<com.ichi2.anki.preferences.reviewer.ReviewerMenuView
android:id="@+id/reviewer_menu_view"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/counts_flow"
app:layout_constraintStart_toEndOf="@id/counts_barrier"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="12dp"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class StudyScreenScreenshotTest(
private val config: TestConfig,
) : ScreenshotTest() {
init {
Prefs.isNewStudyScreenEnabled = true
Prefs.toolbarPosition = config.toolbarPosition
Prefs.showAnswerButtons = config.showAnswerButtons
Prefs.frameStyle = config.frameStyle
Expand Down