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

PreviewText: extraneous ui elements shown #11700

Closed
4 tasks done
ZetaTom opened this issue Jun 6, 2023 · 1 comment · Fixed by #11965
Closed
4 tasks done

PreviewText: extraneous ui elements shown #11700

ZetaTom opened this issue Jun 6, 2023 · 1 comment · Fixed by #11965

Comments

@ZetaTom
Copy link
Collaborator

ZetaTom commented Jun 6, 2023

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

  1. set up nextcloud app with account
  2. create empty file.txt in root directory
  3. download file via three dots menu
  4. open file (local editor)

Expected behaviour

Text editor ui replaces previous ui.

Actual behaviour

Some ui elements from previous screen remain visible, such as the display (List/Card view) and sorting options (A - Z). These elements do not perform any visible action.

Additionally, the Search icon, visible on the top right-hand corner remains on screen. Inserting any text into the provided search and returning using the back button will result in graphical glitches and eventually a list of search results being displayed. Now, one is unable to return to the main, unfiltered, view, as navigating back leads to the same screen. Further attempts to navigate anywhere result in a broken interface.

Android version

13

Device brand and model

OnePlus 6T

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

849799c

Nextcloud server version

26.0.1

Using a reverse proxy?

No

Android logs

No response

Server error logs

No response

Additional information

Custom OS: LineageOS 20.0

@ZetaTom ZetaTom added the bug label Jun 6, 2023
@parneet-guraya parneet-guraya self-assigned this Sep 2, 2023
@parneet-guraya
Copy link
Contributor

Hi, @AndyScherzinger @tobiasKaminsky. I have a solution which solves this issue (although the issue mentioned is for text previews but it was bigger than this), Just need suggestion if my approach is valid or not :-)

  • So, from the main (OCFileListFragment) we have list of files and we can go to DetailedFragment from the overflow (three dots) menu and same way we can also go into detail while we're in the preview of that same file.

But, these two cases needs different handling. First of all the main view we have has it's sortButton visible and going from there to DetailedFragment changes the visibility to false (since we are not showing sortButton in this fragment). So when coming (onBackPress) if we don't do anything sortButton's not visible (since we changed it while going in details fragment).

  • Let's say we handle this by setting the visibility to true while coming back from the DetailsFragment.

Now, there's another problem. As I mentioned we can also access DetailedFragment from the preview fragment (which needs the sortButton visibility to false). So, when we press back button, it takes us to preview fragment which should not show the sortButton but it is showing now because now DetailedFragment set it to visible while popping out. There's no way we can determine which fragment will show after the detail fragment pops out, So we cannot handle individual case.

Cases like DetailFragment can make things out of sync hence this is happening.

SOLUTION --> I chose to use a Stack Object in the Activity class (main activity for the main view FileDisplayActivity). This is how it will work -->

  • Initially the sortButton is visible.
  • When going into another fragment we will save the current visible status (true in this case) and then launch the fragment with new visibility.
  • When coming back we will pop the element (visibility status -boolean) and use that to set the sortButton status.

Example Below -->

Initial Main view stack is empty

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

Successfully merging a pull request may close this issue.

3 participants