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 slowness of upload activity #2402

Open
maskaravivek opened this issue Feb 3, 2019 · 11 comments
Open

Fix slowness of upload activity #2402

maskaravivek opened this issue Feb 3, 2019 · 11 comments

Comments

@maskaravivek
Copy link
Member

maskaravivek commented Feb 3, 2019

I am using a decent Android phone and expect the app to run smoothly. But on the upload screen, I experience a noticeable lag in UI rendering. PFA the video:

https://drive.google.com/file/d/1ZMUt4RkxMlPFZcN1oKxxN5TacIYL_GOn/view?usp=sharing

The upload experience should be as smooth as possible. How can we improve the UI rendering?

  • Is there too much nesting of elements ie. too many View elements making the UI slow?
  • Is the keyboard forced to hide/show too many times? In the video its apparent that the lag is while changing the focus of EditText
  • The bottom card uses HeightLimitedRecyclerView which internally overrides onMeasure. Is it causing issues?
  • The background of the screen is rendering a full size Bitmap. Is it causing performance issues?
  • The screen uses Viewflipper and has a total of 4 child views. Would it be better to have individual activities/fragments for each of them?
  • Is the EditText for Title and Description attached to too many event listeners?
@ShridharGoel
Copy link
Contributor

I would like to improve this. Maybe we can just use hardware acceleration?

@maskaravivek
Copy link
Member Author

@ShridharGoel The first step would be to investigate the causes. It would be great if you could pick up a couple of points and post the findings of your investigation here. Once we are able to identify concrete reasons, we can create separate issues and fix them. :)

I won't be marking the issue as assigned as this issue would benefit from insights from multiple contributors. :)

@vanshikaarora
Copy link
Collaborator

  • Is the keyboard forced to hide/show too many times? In the video its apparent that the lag is while changing the focus of EditText

Two of the major problems that I feel are:

I have noticed this aspect quite a few times that that showing keyboard and then hiding keyboard toggle's the views. Yes this slows down the app's activity.
Also the toggling of the view are sometimes not smoothly carried out this also degrades the user experience. it would definitely be a better option to eliminate this view flipping

@maskaravivek
Copy link
Member Author

I have noticed this aspect quite a few times that that showing keyboard and then hiding keyboard toggle's the views. Yes this slows down the app's activity.

Would it help if the bottom and top cards are swapped ie, show the title/desc card at the top and image thumbnails at the bottom?

Also the toggling of the view are sometimes not smoothly carried out this also degrades the user experience. it would definitely be a better option to eliminate this view flipping

Do you mean removing ViewFlipper?

@vanshikaarora
Copy link
Collaborator

Would it help if the bottom and top cards are swapped ie, show the title/desc card at the top and image thumbnails at the bottom?

Yes I think we can try removing the cards and instead create a new layout which has EditText at the top and image at the bottom to prevent toggling of keyboard

Do you mean removing ViewFlipper?

Yes, ViewFlipper can be removed with individual activities and that might give a better user experience

@maskaravivek
Copy link
Member Author

Yes, ViewFlipper can be removed with individual activities and that might give a better user experience

Let's investigate a bit before making this change. I am optimistic that this would improve performance but it would be a decently big task. So, let us dig up a few articles/references before working on it. :)

@vanshikaarora
Copy link
Collaborator

Let's investigate a bit before making this change. I am optimistic that this would improve performance but it would be a decently big task. So, let us dig up a few articles/references before working on it. :)

Yes definitely I'll go through some reading s to first know the reason for this

@vanshikaarora
Copy link
Collaborator

  • The screen uses Viewflipper and has a total of 4 child views. Would it be better to have individual activities/fragments for each of them?

With #1192 in progress, where we need to place edit option for images shall we beforehand update the upload activity to support activities instead of view flippers?

@maskaravivek
Copy link
Member Author

I am fine with picking this up before #1192 but it might take a decent amount of changes to convert it to different activities. So if you are willing to take it to completion then feel free to take this up.

@vanshikaarora
Copy link
Collaborator

@maskaravivek So do you have any particular UI in my mind if we want to change it to activities?

@maskaravivek
Copy link
Member Author

I think we can UI as it is. Just split it into activities

  • UploadActivity >> that receives the images ie the first screen
  • CategorySelectionActivity >> that allows you to select categories
  • LicenseSelectionActivity that lets you select the license

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

No branches or pull requests

3 participants