I'm using a TListBox component to display a list with CheckBoxes.
It works very well on iOS, but on Android it generates a small lag when scrolling.
At the first glance, I thought it would be due it's design of each TListBoxItem being a container of Controls. However, when generating a simple List (without CheckBoxes) it remains to lag a little bit.
Is it a problem with the component?
Is there any solution that does not evolve removing any of my ListBoxes?
For the first question
Note: FMX.ListBox.TListBox performance can be slow on mobile. Use TListView if you want to develop more complex applications, especially apps with large databases.
From Embarcadero docwiki
For the second question
There may be. My solution would be to swap TListBox to TListView
If you need checkboxes in your listbox you can also do it with TListView. Set AccessosoryType to CheckBoxes.
Related
I am new to JetPack Compose. I am leanring Compose and was following https://developer.android.com/jetpack/compose/tutorial
But when I ran the application in my android device, the app was extremely slow.
Simple things like expanding long message and changing color of message is taking so much time.
I have googled the problem and found:
https://www.reddit.com/r/androiddev/comments/oatiur/why_simple_app_with_jetpack_compose_is_5x_times/
https://github.com/android/compose-samples/issues/21
https://jetc.dev/slack/2021-03-14-why-so-slow.html
Jetpack Compose Performance Issue that only occurs in multi module project
But none of these were helpful to me.
If there is any confusion, please tell in the comments.
I experienced the same thing. What is currently happening is:-
1.) App Startup is kinda slow
2.) App is glitchy upon start
The good news is:-
1.) The glitches only happen for the first few times you run the animation,
2.) The glitches seem to disappear from every element after you break one of the elements in.
The bad news is of course, you have to repeat the above steps upon EVERY startup. I have heard that running the production builds instead of the debug variants boosts up the performance significantly. As of now, there's nothing you can do about it. It will only break in as Compose develops. You can check the official Compose Samples too. They are as glitchy as your apps.
All you can really do at this point is wait.
EDITS BASED ON THE COMMENTS BELOW:-
1.) By The glitches seem to disappear from every element after you break one of the elements in., I mean that if you have a lot of animated content, like maybe two LazyColumns, and a few others, then upon swiping the Column back and forth a few times (breaking it in), the lag will be gone from the other columns, as well as the animated content. Element there meant element of the screen, so individual LazyColumns are each elements.
2.) To get the production build, all you need to do is click on the release tab in the left edge of the screen in studio, then select release from the dropdown list instead of debug. 'Production' was substituted by me for 'release', but it's one and the same thing you see.
This seems to me like a silly problem, however I searched for it and could not find an answer. I am learning android development, following some tutorials online. I am using ListViews right now, and in all tutorials, when they create a new, empty ListView, and place it within a ViewGroup, the 'design' view of Android Studio shows some 'dummy' rows, like that:
However, in my environment, the ListView is always empty in the AS design display. I suspect this must be a setting within AS, but I can't find it. Maybe it was 'on' by default, and in later versions it's disabled by default (I am using AS 3.6.1). Most tutorials on ListViews are quite old anyway, I know RecyclerView is favoured, but I want to check some old tutorials for learning purposes.
I understand it's not very important, I populate my ListView programmatically anyway, and it works fine, but it's still annoying. I could not find a way to display those 'dummy' rows on my AS design display. Any help would be appreciated.
I've been asked to create an app for a client which could potentially be on both android and iOS (concentrating on iOS first). So I thought that Qt may be the answer. I would like to use Qt Quick to create the app but I can't seem to find a way to efficiently handle multiple pages, baring in mind that each page could be fairly heavyweight.
So far I've tried:
Pagination with loaders i.e. dynamically pulling in the needed screen. This works but there is a noticeable delay the first time a screen is loaded
Making each page a component and showing only the necessary screen. This loads all pages on startup which is too memory heavy
Making each page a component and displaying them through a ListView. Same problem as above.
There has to be a middle ground where views can essentially go to a low memory mode like in native iOS apps. Any suggestions welcome.
NOTE: The progression of the screens is not necessarily linear
My experience with QML is rather limited but from other UX experiences I would think the solution would involve re-factoring your pages to utilize the Loader item for their inner children/Components. From what I read it sounds like you are using the Loader item on each page itself.
For example, when your program starts load in your pages, it should be pretty light on memory otherwise there many still be large components that need to be dynamically loaded.
When the user provides input to go to a specific page, animate/show as you would normally which shouldn't be delayed. The page itself should then utilize a Loader item for each component that needs to be loaded (i.e. ones with large memory footprints).
While components are loading you could show a progress bar/wheel animation. Once the component has finished loading via the onLoaded signal you can hide the progress bar/wheel.
You may also want to look at the Loader item's asynchronous property to ensure any animation (i.e. the progress bar/wheel) while the component loads avoid glitches.
Finally when the page needs to be hidden simply set each Loader item's active property to false and it should release the loaded component.
Hope that helps and isn't repeating something you've already tried.
Old question, but Qt.Controls's StackView has support for pushing and popping with various animations.
As the previous answers indicate, using a Loader is also an option but it doesn't let you easily animate the change (when changing views, the old and new are not available at the same time so you can't do nice animations).
An alternative is to use Components, lazily instantiate views and animate the transitions. Check out the example in by QtWS 2015 talk, slides and code available here.
I am new to Android development. I am working on application where Sql-lite is also involved, its a database application. The application is used on Android Tablets
In of the screen we have a lot of "related information", nearly 100 different controls (Text Data, DateTime Data, Selection list) are used to load that data, the user enters the data & can perform the CRUD operations on it. Currently i am using the ScrollView Layout as the main container for that screen.
The application is running smoothly no performance issue but the users saying we are tired of scrolling up & down all the time.
1- I need your suggestions how to resolve this issue?
2- Should i divide the information into more than one screen & what is the best solution? (For example each screen can have Forward Backward Arrows etc.)
Thanks for your valuable time & help.
How about using a PreferenceActivity? It gives a really nice, clean way of organising lots of options or data and you can define sub PreferenceScreens in the XML layout which are perfect for grouping large chuncks of options/data, or a couple of smaller groups, together. This way you can easily hide away bits that you don't need.
I'm working on an android app that has a section that feels like an iPhone home screen. There's a bunch of pages that are essentially displaying the same data in different configurations and users should be able to quickly move between them. Generally there won't be more than 4 or 5 pages.
I could just replicate the experience with the iPhone home screen with multiple dots on the bottom of the page, but that doesn't feel very android-friendly. What's the design pattern in android for viewing and interacting with this type of view? I know the android home screen has a variant with dots, but I've never seen it used within an app.
Screenshots or links to existing apps would be great.
The stock Android launcher has left/right paging behavior on the home screen, and it's open source.
This is the Workspace class. Pay special attention to the onTouchEvent and onInterceptTouchEvent methods. The utility classes Scroller and VelocityTracker are used together to define the behavior for snapping to a page when the user lets go from a drag.
https://android.googlesource.com/platform/packages/apps/Launcher2/+/master/src/com/android/launcher2/Workspace.java
Hootsuite uses this design pattern and it works well in my opinion. I don't think it affects the user experience on Android in a negative way. I find that the biggest problem with people porting iPhone applications to Android is the fact that they try to port every single design pattern over. I don't think what you're trying to implement will be an issue.