-
Notifications
You must be signed in to change notification settings - Fork 528
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
Replace current recyclerview implementation with BindableAdapter usage #632
Comments
@rt4914 I will be taking up Continue Playing task in this list. |
@rt4914 StoryActivity already has implementation of Bindable adapter. |
…bleAdapter usage. (#641) * working on topic practice. * reverted * updated implementation * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingItemViewModel.kt * Delete OngoingListAdapter.kt * nit change * Update ContinuePlayViewModel.kt * fixed nit
…BindableAdapter usage. (oppia#641) * working on topic practice. * reverted * updated implementation * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingItemViewModel.kt * Delete OngoingListAdapter.kt * nit change * Update ContinuePlayViewModel.kt * fixed nit
* Fix #572: Keyboard visible by default in Admin Pin (#573) * By default keyboard visibility issue in Admin Pin is resolved * Created a test case to check about Keyboard visibility by default in Admin Pin. * Test is modified with the suggested changes * Fix #577: Display profile name on navigation drawer. (#578) * display profile name in navigation drawer * Updated code implementation * adding tests * added testcases * Update NavigationDrawerFragmentPresenter.kt * updated nit changes. * Fix part #44: Full UI profile pin/password screen. (#597) * done ui corrections * fixed issues. * Update pin_password_activity.xml * updated color * updated icon * updated pinview shadow * updated icon color * changed shadow * updated mock color * fix * Update pin_password_activity.xml * updated nit change. * Update pin_password_activity.xml * removed fixed width * fixed dimen file changes * Update dimens.xml * Fix part #632: Replace current recyclerview implementation with BindableAdapter usage. (#641) * working on topic practice. * reverted * updated implementation * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingFragmentPresenter.kt * Update ContinuePlayingItemViewModel.kt * Delete OngoingListAdapter.kt * nit change * Update ContinuePlayViewModel.kt * fixed nit * Add UI and finctionality for Switch Profile * Add UI Tests for switch profile option in navigation drawer * Add UI Tests for switch profile option in navigation drawer * Minor styling changes Co-authored-by: Akash Koradia <[email protected]> Co-authored-by: Veena <[email protected]>
@rt4914 Can I work on the |
@NullByte08 I would suggest you to work on simpler one first as HomeFragment is the hardest one. Still its completely fine if you work on that. |
@rt4914 Can I work on |
Sure. |
@rt4914 Can I work on |
@rt4914 I think |
@SayantanBanerjee16 @NullByte08 These arrangements have been done keep in mind the PRs that you have worked on in past. |
@rt4914 Alright sure. |
@rt4914 can I work on TopicPlay/Lessons? |
@abhinavraj23 @NullByte08 @Sarthak2601 @SayantanBanerjee16 |
…r in TopicReview/Revision (#955) * RecyclerView implementation with BindableAdapter in TopicReview/Revision * nit changes * RecyclerView implementation with BindableAdapter in TopicReview/Revision * nit changes * nit changes
…indableAdapter usage in Help Activity (#956) * Introduced Bindable Adapter * Introduced onClick in the item * Nit change
@NullByte08 and @abhinavraj23 Any updates in this? If this is not doable its fine, we can unassign you from this. |
@rt4914 I am facing a lot of errors in the |
@rt4914 Was |
|
OngoingListAdapter was renamed PromotedStoryListAdapter in #4704 |
) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation <!-- - 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. --> Fixes part of #632: Reimplementation of PromotedStoryListAdapter as BindableAdater Espresso tests are failing, but they were already failing. The errors with the new adapter are the same. The same tests pass when using gradle. There was an error in MarginBindingAdapter which I'm also fixing in this cl: MarginBindingAdapter was replacing start/end margin changes for left/right margin changes. However, this replacement relied on getting the layout direction from the View being changed. When the direction is inherited and the View is not attached to a parent (recursively until top level View), the direction defaults to LTR, no matter the Locale/language. This situation happens for example in item Views within RecyclerView. The change does not replace start/end any more, but sets them through MarginLayoutParamsCompat so that it is compatible with api < 17. ## 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)). | Current | new | |-|-| | ![bindable_adapter_current](https://user-images.githubusercontent.com/103062089/217546850-30d59ac3-d996-4856-9a55-43a61e533eb2.png) | ![bindable_adapter_new](https://user-images.githubusercontent.com/103062089/217546857-224a287d-b55a-4af9-8b05-e4855d78bd44.png) | Unit tests: ![recently_played_span_test](https://user-images.githubusercontent.com/103062089/217547368-f86fa7c4-c915-4257-948c-90a8e73c3ab6.png) Espresso Tests. The run for the new version has an extra error, but it is due to timings. In other runs it passes. ![recently_played_espresso_tests_current_vs_new](https://user-images.githubusercontent.com/103062089/217548889-21e0599e-e8b0-463d-a3f6-eeaaa93e674a.png) @rt4914 PTAL --------- Co-authored-by: Ben Henning <[email protected]>
There is only one remaining class in the codebase that implements RecyclerView.Adapter: FragmentStateAdapter I don't know if it makes sense to refactor those. Otherwise this bug can be closed. |
Unassigning masclot since his PR has been merged. |
Agreed--thanks @masclot & @adhiamboperes! I think we can go ahead and close this. |
oppia#4874) <!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> ## Explanation <!-- - 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. --> Fixes part of oppia#632: Reimplementation of PromotedStoryListAdapter as BindableAdater Espresso tests are failing, but they were already failing. The errors with the new adapter are the same. The same tests pass when using gradle. There was an error in MarginBindingAdapter which I'm also fixing in this cl: MarginBindingAdapter was replacing start/end margin changes for left/right margin changes. However, this replacement relied on getting the layout direction from the View being changed. When the direction is inherited and the View is not attached to a parent (recursively until top level View), the direction defaults to LTR, no matter the Locale/language. This situation happens for example in item Views within RecyclerView. The change does not replace start/end any more, but sets them through MarginLayoutParamsCompat so that it is compatible with api < 17. ## 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)). | Current | new | |-|-| | ![bindable_adapter_current](https://user-images.githubusercontent.com/103062089/217546850-30d59ac3-d996-4856-9a55-43a61e533eb2.png) | ![bindable_adapter_new](https://user-images.githubusercontent.com/103062089/217546857-224a287d-b55a-4af9-8b05-e4855d78bd44.png) | Unit tests: ![recently_played_span_test](https://user-images.githubusercontent.com/103062089/217547368-f86fa7c4-c915-4257-948c-90a8e73c3ab6.png) Espresso Tests. The run for the new version has an extra error, but it is due to timings. In other runs it passes. ![recently_played_espresso_tests_current_vs_new](https://user-images.githubusercontent.com/103062089/217548889-21e0599e-e8b0-463d-a3f6-eeaaa93e674a.png) @rt4914 PTAL --------- Co-authored-by: Ben Henning <[email protected]>
Reopening this since we are reverting the associated pull request. |
…dableAdapter" (#4951) This reverts commit `7fd290d68f0440d926f2d443dbd7bfb28ab20547`, fixing part of #2116. While testing #2116, we found that the UI for default profile view does not display correctly, and traced the change to #4874 in [this discusson](#2116 (comment)). #4874 introduces a change to `MarginBindingAdapters` which utilizes `MarginLayoutParamsCompat` to compute the margins of a layout before drawing it. I suspect that this works for the `Promoted Story` and `Topic Summary` because we compute the start and end margins of each item relative to grid columns laid out on the HomeActivity, but no such implementation exists for the Profile Chooser view. We need to do some further investigation into this, hence the decision to revert. We will need to test all the associated screens to make sure they still look as expected: ![Screenshot 2023-04-19 at 18 01 28](https://user-images.githubusercontent.com/59600948/233117952-8c981fa2-2d0c-45cc-80ff-651862c1fd96.png) ## 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 This was mainly a re-implimentation per #632, and the UI did not change. Please refer to #4874 for screenshots. The Affected screen displays okay with this revert: ![Screenshot_1681916915](https://user-images.githubusercontent.com/59600948/233125096-2242fb7e-eb9f-4b78-8db0-c22abb6b5cc3.png) Other screens: | | | |---|---| |![Screenshot_1681917117](https://user-images.githubusercontent.com/59600948/233126283-45a860c7-26ac-47f6-8b38-e54b1ee7cb1f.png)|![Screenshot_1681917190](https://user-images.githubusercontent.com/59600948/233126350-08033853-4434-462d-9bf3-98040ff2356d.png)|
…es. Fix #2116: UI misalignment due to not resetting the layout. (#4965) ## Explanation Fix #2116: Fix part of #632: Simplify MarginBindingAdapters. The code is mostly the same as in PR #4874, which was reverted. This PR fixes the bug that caused the rollback. The rest of the reverted changes in PR #4874 will be included in a separate PR. The fix consists of resetting the layout params after changing the top and bottom margins, by calling View.setLayoutParams(), as explained in the [layout params documentation](https://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams#bottomMargin). The same call is not needed when calling a method instead of setting a property. It also fixes an RTL issue: if the view is not attached yet, there is no layout direction information available, making the old implementation render in LTR always. Some screenshots: |new|current| |-|-| |![home_rtl](https://user-images.githubusercontent.com/103062089/236451422-13843234-5f6c-4ed3-997a-e4b0459c3641.png) | ![home_rtl_current](https://user-images.githubusercontent.com/103062089/236451614-55595920-ed58-4329-8d7d-7bdbc0487688.png)| |![profile_chooser_landscape](https://user-images.githubusercontent.com/103062089/236451425-6766ed39-4a6b-4918-bf62-28bff5d05565.png)|![profile_chooser_landscape_current](https://user-images.githubusercontent.com/103062089/236451616-6979857b-f431-45cf-82c1-8db2a7618669.png)| |![profile_chooser_portrait](https://user-images.githubusercontent.com/103062089/236451427-ba5cc671-ff03-4718-ae45-9e3cc924efeb.png)|![profile_chooser_portrait_current](https://user-images.githubusercontent.com/103062089/236451621-058ec5b9-0cdb-4713-931e-c49bd9a5edba.png)| |![recently_played_rtl](https://user-images.githubusercontent.com/103062089/236451431-01e65a32-b448-422d-88a1-efb5326d5ab9.png)|![recently_played_rtl_current](https://user-images.githubusercontent.com/103062089/236451622-57a5cc80-f0d9-400d-8003-e9ff9735950b.png)| Test results: ![Test results](https://user-images.githubusercontent.com/103062089/236451433-d5a0e34f-75c0-4a6d-aeb5-88012913796f.png) ## 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". - [ ] 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 --------- Co-authored-by: Adhiambo Peres <[email protected]>
Fix #632: Move PromotedStoryListAdapter to BindableAdater This change reverts partially #4951, which in turn reverted #4874 due to a bug. It is a partial revert because the bug was fixed independently in the previous PR #4965. I added RecentlyPlayedViewModel.kt to the list of classes not needing tests, as is usual for ViewModels. This was also part of the original PR. | current | new | |- | - | |![recently_played_ltr_current](https://github.com/oppia/oppia-android/assets/103062089/179e56c1-6548-4be0-ac03-a0b7252c3a4a)| ![recently_played_ltr_new](https://github.com/oppia/oppia-android/assets/103062089/468d13e2-f6c8-48f0-a36c-2483f6dbe728)| |![recently_played_rtl_current](https://github.com/oppia/oppia-android/assets/103062089/cf78dd4b-4fef-4311-accb-bd03d28345d6)| ![recently_played_rtl_new](https://github.com/oppia/oppia-android/assets/103062089/90a489b4-7e2a-49b3-9cbc-1eebd6dfe491) | |![recently_played_ltr_landscape_current](https://github.com/oppia/oppia-android/assets/103062089/92b12fa4-54c4-4be5-8c4f-1c73e90e9cb1)|![recently_played_ltr_landscape_new](https://github.com/oppia/oppia-android/assets/103062089/39833703-9cbd-4b63-b882-5950d3154316)| |![recently_played_rtl_landscape_current](https://github.com/oppia/oppia-android/assets/103062089/46545cf6-40aa-4f24-a977-a0a586b46445)|![recently_played_rtl_landscape_new](https://github.com/oppia/oppia-android/assets/103062089/89c6a842-e876-4dc3-8861-c2c47a938183)| ## 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/op pia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --------- Co-authored-by: Adhiambo Peres <[email protected]>
Currently the entire project has two types of RecyclerView implementation:
Recyclerview using BindableAdapter (OngoingStoryListActivity, CompletedStoryListActivity, etc.) uses it)
Recyclerview with the RecyclerViewAdapter which inflates multiple layouts.
We need to change the implementation such that all RecyclerViewAdapter to use BindableAdapter (i.e. approach similar to OngoingStoryListActivity, CompletedStoryListActivity).
Checklist
ContinuePlaying
(assigned to @veena14cs )HomeFragment
(assigned to @jcqli)StoryActivity
(Already done)TopicReview/Revision
(Assigned to @Sarthak2601 )TopicPlay/Lessons
TopicTrain/Practice
(assigned to @Luffy18346 )HelpActivity
(Assigned to @SayantanBanerjee16 )HintsAndSolutionAdapter
(Assigned to @anandwana001 )OngoingListAdapter
(open)TopicListAdapter
(assigned to @jcqli)LanguageSelectionAdapter
(assigned to @FareesHussain)StorySummaryAdapter
(open)PromotedStoryListAdapter
(assigned to @masclot )The text was updated successfully, but these errors were encountered: