I am developing profile screen using Compose UI, it has sticky scaling avatar as header base on scrolling position of the below list, the avatar will be scaled up/down when the first item of the list is visible, and when the avatar at the smallest size, the list can scroll as a normal list, as below
I am on MotionLayout approach. But can anyone give me another hint ?
Related
I have a list of items in a RecyclerView, which is scalable when pinching, and it currently scales the items fine, with the first list item staying when it is (the far left one).
What I'm looking to do is to keep the centre item pinned in the centre while I scale. I'm hoping that RecyclerView makes this easy for me.
If item is focused, LinearLayoutManager will preserve its position when layout occurs. (L-preview does not do this but L release will have it). This may not be enough for you if you want to keep item's center stable because LLM will keep the items reference point stable. (e.g. reference point is the top pixel of the item if layout is vertical and reverseLayout is false).
As a workaround, you can call LLM#scrollToPositionWithOffset with proper values each time you resize the View.
I have a custom ListView that scrolls down quite a bit. I want a background image that tiles and scrolls with the ListView.
I used the code from this answer but background images are jumpy in that at certain scrolling points the entire thing resets to what is currently the top of the viewable screen. I assume this is because of ListView optimization. How do I get around this if each item in the list has the same height? I don't need the image to load for nonexisting items, I just need the illusion of continuity.
Otherwise, tiling works just fine.
I am newbie with android,
I have made an horizontal list view with adapter so I show a list of imagesView horizontally in the screen of my mobile, each image view is inside a LinearLayout.
What I want to do is to add some effects to the behavior of the horizontalListView, I want the five elements are shown in the screen behave a little different, the element in the middle be the largest then as long as the other elements are near the end of the screen decrease the width and the height.
How could I do that in android ?
Which are the methods I should change or add ?
Greetings,
Ariel
I am having a small issue with capturing screen in android.
I am using a list view which has few items. When the items are fitting the screen there is no issue to capture the screen. But when there is a scroll view for the list items (that is there are more number of items in the listview so that it cant be fitted in the screen) i am not able to capture the screen.
The capture of the screen gives me only the visible items of the list view and the invisible items are not being captured.
I am using the link to capture the screen.
can anyone suggest me if there is anyway to capture the listview screen.
My screen has all alphabets from a-z but when i tried to capture using here i got only the below screen shot.
This is related to this question/answer here.
Basically you need to render your view to a canvas that is backed by a bitmap. This bitmap now contains your entire view.
We need to capture the listview by capturing each and every listitem in the listview.
after capturing each and every item in the listview we need to add all the captured list items and make a bitmap image.
This way we can capture an listview even if all its items are not visible
Is there a way to connect items within a GridView with lines / arrows preferably in the background?
I have a dynamic amount of items (buttons) within a GridView and have to connect certain buttons with others depending on data of a database.
The GridView will most likely be larger than the screen so the view containing the lines/arrows will have to scroll with the GridView simultaneously.
[question]: Android: network relationship graph describes my problem in a more detailed way.
If it were me, I would think to define a layout to be used as the "background" object of your gridview. The layout would be a single relative layout with a custom view that fills parent in both dimensions.
Within this custom view, I would then override the "onDraw" method and all appropriate constructors to perform your arrow drawing on the singular canvas that should be the exact size now of your gridview!
This is where I would think to begin.
Also look here:
Draw background of custom View from .png file on Android
as it shows how to set the backgroundDrawable of a view. If you implement a custom view as drawable, then you should be able to create a new one and send it into your grid view's background drawable.
To make it scroll along with your actual grid data, you may need to play around a bit with the size of the gridview being the full size of the DataSet you are displaying, and containing that within other scrollviews to get this accomplished.
I do have a gridview in an app of mine, that I implemented a horizontal scrollview (as I have buttons at the top allowing me to sort by any of the columns and want those always to be visible, and the gridview to vertically scroll underneath). This creates the overall width of the gridview for me as it simply follows the parent width which wraps the content of the linear layout defining the button set at the top. The gridview then auto scrolls in the vertical direction, leaving the higher level horizontal scroller to perform in the horizontal direction. For you, you may need to have a vertical scroller within a horizontal scroller, and allow your gridview to be full size (i.e. larger than the content view area) and allow the outer scrollers to perform the scrolling for you. This may be the only way to ensure that your background drawable view is the proper size to the table you are trying to display!!!