Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix part of #40 #42: Highfi drag and drop #3385

Merged
merged 5 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Full UI with accessibility
  • Loading branch information
Rajat Talesra committed Jun 29, 2021
commit 9da72e48fa7286da1069b4e4c3acd6e21c8207b9
10 changes: 6 additions & 4 deletions app/src/main/res/layout/drag_drop_interaction_items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@

<ImageButton
android:id="@+id/drag_drop_move_up_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/move_item_up"
android:enabled="@{viewModel.itemIndex != 0}"
android:focusable="true"
android:onClick="@{(v) -> viewModel.handleUpMovement(adapter)}"
android:padding="16dp"
android:src="@drawable/ic_arrow_up_black_24dp"
android:tint="@{dragDropMoveUpItem.enabled? @color/mergeIconEnabled : @color/mergeIconDisabled}"
app:layout_constraintBottom_toBottomOf="parent"
Expand All @@ -54,14 +55,15 @@

<ImageButton
android:id="@+id/drag_drop_move_down_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:contentDescription="@string/move_item_down"
android:enabled="@{viewModel.itemIndex != viewModel.listSize-1}"
android:focusable="true"
android:onClick="@{(v) -> viewModel.handleDownMovement(adapter)}"
android:padding="16dp"
android:src="@drawable/ic_keyboard_arrow_down_black_24dp"
android:tint="@{dragDropMoveDownItem.enabled? @color/mergeIconEnabled : @color/mergeIconDisabled}" />
</LinearLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ import org.oppia.android.domain.topic.TEST_EXPLORATION_ID_5
import org.oppia.android.domain.topic.TEST_STORY_ID_0
import org.oppia.android.domain.topic.TEST_TOPIC_ID_0
import org.oppia.android.testing.AccessibilityTestRule
import org.oppia.android.testing.DisableAccessibilityChecks
import org.oppia.android.testing.OppiaTestRule
import org.oppia.android.testing.RunOn
import org.oppia.android.testing.TestLogReportingModule
Expand Down Expand Up @@ -529,7 +528,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_mergeFirstTwoItems_worksCorrectly() {
launchForExploration(TEST_EXPLORATION_ID_4).use {
startPlayingExploration()
Expand All @@ -548,7 +546,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_mergeFirstTwoItems_invalidAnswer_correctItemCount() {
launchForExploration(TEST_EXPLORATION_ID_4).use {
startPlayingExploration()
Expand All @@ -569,7 +566,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_wrongAnswer_contentDescriptionIsCorrect() {
launchForExploration(TEST_EXPLORATION_ID_4).use {
startPlayingExploration()
Expand All @@ -589,7 +585,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_correctAnswer_contentDescriptionIsCorrect() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand Down Expand Up @@ -619,7 +614,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_mergeFirstTwoItems_dragItem_worksCorrectly() {
// Note to self: current setup allows the user to drag the view without issues (now that
// event interception isn't a problem), however the view is going partly offscreen which
Expand All @@ -642,7 +636,6 @@ class StateFragmentTest {
}

@Test
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadDragDropExp_mergeFirstTwoItems_unlinkFirstItem_worksCorrectly() {
launchForExploration(TEST_EXPLORATION_ID_4).use {
startPlayingExploration()
Expand Down Expand Up @@ -922,7 +915,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadExp_continueToEndExploration_hasReturnToTopicButton() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand All @@ -939,7 +931,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadExp_changeConfiguration_continueToEnd_hasReturnToTopicButton() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand All @@ -957,7 +948,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadExp_continueToEndExploration_clickReturnToTopic_destroysActivity() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand All @@ -972,7 +962,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_loadExp_changeConfig_continueToEnd_clickReturnToTopic_destroysActivity() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand Down Expand Up @@ -1320,7 +1309,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_interactions_dragAndDropNoGrouping_canSuccessfullySubmitAnswer() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand All @@ -1344,7 +1332,6 @@ class StateFragmentTest {

@Test
@RunOn(TestPlatform.ESPRESSO) // TODO(#1612): Enable for Robolectric.
@DisableAccessibilityChecks // TODO(#3251): Enable AccessibilityChecks
fun testStateFragment_interactions_dragAndDropWithGrouping_canSuccessfullySubmitAnswer() {
launchForExploration(TEST_EXPLORATION_ID_2).use {
startPlayingExploration()
Expand Down