Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Scroll to top when we reselect the tab once again #234

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajay-prabhakar
Copy link
Contributor

@ajay-prabhakar ajay-prabhakar commented Apr 2, 2019

Closes #232

What has been done to verif8y that this works as intended?

Tested on my android of Samsung j8 it is working as expected
Tested is it scrolling to top or not in both filled forms and blank forms fragment
Tested in the android studio no warning are produced

Why is this the best possible solution? Were any other approaches considered?

I added the setOnTabSelectedListener to tab layout in that created method called onTabReselected
to scroll up I added the smoothScrollToPosition

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

because of adding this feature if the user wants to scroll to the top without scrolling the entire recycle view he/she can instantly scroll to top by reselecting the tab

GIF

ezgif com-video-to-gif

Before submitting this PR, please make sure you have:

  • run ./gradlew checkCode and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.

@ajay-prabhakar
Copy link
Contributor Author

@lakshyagupta21 @shobhitagarwal1612 please review it

@shobhitagarwal1612
Copy link
Contributor

I tested this on Lenovo Tab Android 6.0 and it didn't work for me. I attached the debugger and the method onTabReselected was indeed getting called but the list isn't scrolling as expected

SendFormsActivity > Blank Forms > Scrolled to the bottom > Tapped on tab

@ajay-prabhakar
Copy link
Contributor Author

I tested this on Lenovo Tab Android 6.0 and it didn't work for me. I attached the debugger and the method onTabReselected was indeed getting called but the list isn't scrolling as expected

SendFormsActivity > Blank Forms > Scrolled to the bottom > Tapped on tab

I checked it is working fine for me but I checked in filled forms as I do not have blank forms(I don't know how to increase it) can you once please check it in filled forms also

@shobhitagarwal1612
Copy link
Contributor

You can create new forms and add them to /sdcard/odk/forms https://build.opendatakit.org/

@ajay-prabhakar
Copy link
Contributor Author

ajay-prabhakar commented Apr 4, 2019

@shobhitagarwal1612 I just now checked with Android 7, 9 it is working fine I can't test it on 6 due to I didn't have a device
mRecyclerView.smoothScrollToPosition(-mRecyclerView.getAdapter().getItemCount()); this is also it working fine for me can you please check it is working or not

@lakshyagupta21 can you please check is this feature works for you as I can not understand what changes I have to make

@shobhitagarwal1612
Copy link
Contributor

@Chromicle Were you able to create some dummy forms? Do you need help with that?

@ajay-prabhakar
Copy link
Contributor Author

@Chromicle Were you able to create some dummy forms? Do you need help with that?

Yeah, I can not create forms as you gave a link but I can not

@shobhitagarwal1612
Copy link
Contributor

shobhitagarwal1612 commented Apr 16, 2019

Here you go then (11 forms). forms.zip

@ajay-prabhakar
Copy link
Contributor Author

Thanks a lot, I copied all things and placed in the place of forms but the App is not recognizing the forms it is in the backward state only

@shobhitagarwal1612
Copy link
Contributor

You have to open ODK Collect to add the manually added forms to the db. After that, it will appear

@ajay-prabhakar
Copy link
Contributor Author

Yeah, It is appearing now thanks

@lakshyagupta21
Copy link
Contributor

@Chromicle Any updates on this?

@ajay-prabhakar
Copy link
Contributor Author

ajay-prabhakar commented Jun 11, 2019

@Chromicle Any updates on this?

Apologize for the late reply as I am traveling
I got stuck in this issue as it works for filled forms but it is not working for blanked forms

@lakshyagupta21
Copy link
Contributor

@Chromicle Do you need any help on this?

@ajay-prabhakar
Copy link
Contributor Author

@Chromicle Do you need any help on this?

Yeah, I am unable to find solution

@ajay-prabhakar
Copy link
Contributor Author

@lakshyagupta21 @shobhitagarwal1612 it is now working on both fragments and I updated the PR template how it works can you please review now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when tab is re selected so recycle view scroll to top
3 participants