-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3169: Item selection interaction text change and checkboxes sh…
…ould be disabled on selection (#4777) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation Fixes #3169 Fixes #3624 This PR is doing 2 things - 1. It's updating the textView based on the selection of checkboxes by the user, If the user has not selected any checkbox then the Text will be `Please select all correct choices.`, If the user has selected less than maxSelection then the text will be `You may select more choices.` and if the user has selected maxSelection then the text will be `No more than $maxSelection choices may be selected.` 2. If the user has selected maximum checkboxes that can be selected, then the non selected checkboxes will be disbaled, and if the user unselects the checkbox or checkboxes, then all checkboxes will get enabled. This is the link to the repository for the comparison of the StateFragmentTest.kt, to show that the same tests are failing on both branches(i.e. my feature branch and my develop branch) https://github.com/Akshatkamboj14/Test-Comparison-For-StateFragmentTest.kt-oppia-android <!-- - Explain what your PR does. If this PR fixes an existing bug, please include - "Fixes #bugnum:" in the explanation so that GitHub can auto-close the issue - when this PR is merged. --> ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-(A11y)-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing [issue.webm](https://user-images.githubusercontent.com/92685493/221786503-45d2c027-bedd-4cfb-92ce-3e351e81c34b.webm) --------- Co-authored-by: Ben Henning <[email protected]>
- Loading branch information
1 parent
2eed01e
commit c1ce5f8
Showing
17 changed files
with
610 additions
and
14 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
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
18 changes: 18 additions & 0 deletions
18
app/src/main/java/org/oppia/android/app/databinding/AppCompatCheckBoxBindingAdapters.java
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,18 @@ | ||
package org.oppia.android.app.databinding; | ||
|
||
import android.content.res.ColorStateList; | ||
import androidx.annotation.ColorInt; | ||
import androidx.annotation.NonNull; | ||
import androidx.appcompat.widget.AppCompatCheckBox; | ||
import androidx.databinding.BindingAdapter; | ||
|
||
/** | ||
* Custom data-binding adapters for {@link AppCompatCheckBox}s. | ||
*/ | ||
public final class AppCompatCheckBoxBindingAdapters { | ||
/** Sets the button tint for the specified checkbox, via data-binding. */ | ||
@BindingAdapter("app:buttonTint") | ||
public static void setButtonTint(@NonNull AppCompatCheckBox checkBox, @ColorInt int colorRgb) { | ||
checkBox.setSupportButtonTintList(ColorStateList.valueOf(colorRgb)); | ||
} | ||
} |
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
15 changes: 15 additions & 0 deletions
15
...c/main/java/org/oppia/android/app/testing/AppCompatCheckBoxBindingAdaptersTestActivity.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,15 @@ | ||
package org.oppia.android.app.testing | ||
|
||
import android.os.Bundle | ||
import org.oppia.android.R | ||
import org.oppia.android.app.activity.ActivityComponentImpl | ||
import org.oppia.android.app.activity.InjectableAppCompatActivity | ||
|
||
/** Test activity for [org.oppia.android.app.databinding.AppCompatCheckBoxBindingAdapters]. */ | ||
class AppCompatCheckBoxBindingAdaptersTestActivity : InjectableAppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
(activityComponent as ActivityComponentImpl).inject(this) | ||
setContentView(R.layout.test_app_compat_check_box_bindable_adapter_activity) | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
app/src/main/res/layout/test_app_compat_check_box_bindable_adapter_activity.xml
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,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<androidx.appcompat.widget.AppCompatCheckBox | ||
android:id="@+id/test_check_box" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" /> | ||
</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
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
Oops, something went wrong.