Android keyboard lags/is slow while closing using adjustResize - android

I have a custom layout as a form field in an activity.
The structure of the layout of the custom layout is as follows:
<Relative Layout A>
<Linear Layout B>
<Relative Layout C>
<Text View>
<Edit Text>
</Relative Layout C Ends>
<Relative Layout D>
<Text View>
<Image View>
</Relative Layout D Ends>
<Relative Layout E>
<Text View>
<Image View>
</Relative Layout E Ends>
</Linear Layout B Ends>
<View for horizontal line>
</Relative Layout A ends>
This is a form field that is added into the when a button is clicked.
When the android keyboard is closed, it is slow to close and causes some lag, resulting in a momentary blank keyboard state like this:
The more custom fields I add into this layout the worse this lag gets.
With 4 such fields it is a good 2 seconds.
I have tried using adjustPan instead of adjustResize in my AndroidManifest. That works but then the accessibility to the rest of my layout elements is compromised.
Does anyone have any ideas what is causing this lag, or how to solve it without compromising any behaviours?
Thanks!
P.S.: In the picture attached, only the edit text is visible and the rest of the fields are hidden.

Related

Coordinator layout scrolling with unwanted parallax

So we have a 3 part app structure with 2 toolbars: 1 that is significant and should be always visible and 1 that is insignificant and should only be visible when user has scrolled to the top of page .the third part is a complex structure with nested view group, swipe to refresh, recycler view and some extra views . Note that we are not using the Collapsible toolbar or any other toolbar, but rather custom viewgroups.
I tried to achieve the behavior of toolbars with my current xml structure like this (notice the layout behavior flags) (PS: i cannot share the exact code,but would provide more details if needed)
<Coordinator layout>
<include layout=“xyz”> <— <appbarlayout>
<linearlayout :layout_behavior:scroll|enterAlways …/>
<linearlayout :layout_behavior:noscroll …/>
</appbarlayout>
<swipe refresh layout : layout_behavior="....AppBarLayout$ScrollingViewBehavior”>
<Nested ScrollView : mp/mp , fillviewport :true>
<constraint layout : mp/mp>
<RecyclerView : nested scrollin enabled:false (via java code)>
<View>
</constraint layout>
</nested scrollview>
</swipe refresh layout>,
</Coordinator layout>
<!-- mp = match_parent -->
the result looks something like this( gif / video ) (note the gif/video has some delay, please wait 7-8 seconds to see the action ) .
As you can see, the upper toolbar gets hidden when scrolled very hardly, but when scrolled slowly, the upper bar does not hide.
What can i do to fix this? i have tried changing the behavior flags as well as setting the heights as wrap content. I am guessing it is either due to wrong flags or due to complexity in bottom layout

Android layout organization

I have some general question about layouts in my application I ma trying to make. I have attached a screenshot of how this is suppose to look like. There are 2 headers at the top (search bar with back button), another list of properties (Crag, Grade...). Then we have vertical scrollable table layout.
This is little bit of beginner question, but what layouts would I use to create such page, for example something like this (of course this would need to go in more details to handle all information, but as in rough layout?
<Relative layout>
<Frame layout> search bar </Frame layout>
<Frame layout> list of properties (Crag, Grade...) </Frame layout>
<Table layout> vertical scrollable </Table layout>
</Relative layout>
You can do something like below
<LinearLayout orientation=vertical>
<Toolbar> search bar </Toolbar>
<LinearLayout orientation=horizontal> list of properties (Crag, Grade...) </LinearLayout>
<RecyclerView>
</LinearLayout>

Making a View scroll once bottom is reached

Im trying to create a layout with following looks and behaviour.
<Layout>
<Text "Header"/>
<List> "Contains a couple of texts, most likely LinearLayout" </List>
<Button "Confirm"/>
</Layout>
<Text "Information/Hint"/>
Top-Level Layout is centered on the screen
Information-Text is placed right beneath it (Layout is centered without accounting for this text)
Once the list fills to the point where the Information-Text is pushed out of the screen, the List starts scrolling and the Information-Text remains visible at the bottom of the screen. Distance of the top-border of the top-level-layout to the screen-border is the same as the hight of the information-text
The scrolling-behaviour also takes action if the android-system-settings increased display/text-size to the point where said borders are reached
Its the last two points that give me trouble. I've been experimenting with ConstraintLayout and LinearLayout, but every time the scrolling would work the layout wasn't correct anymore (not centered or margins on the texts screwed)
Any ideas how this could be achived without writing a custom Layout?
Do your view hierarchy like this:
<ScrollView>
<LinearLayout>
<Layout>
<Text "Header"/>
<List> "Contains a couple of texts, most likely LinearLayout" </List>
<Button "Confirm"/>
</Layout>
<Text "Information/Hint"/>
</LinearLayout>
</ScrollView>

adjustPan ScrollView above included layout

Hey there I'm dealing with some kind of problem showing the softkeyboard in some android layout the layout ist organized like this:
<RelativeLayout>
<ScrollView>
Some stuff here...
</ScrollView>
<include ... />
<RelativeLayout>
I habe already set adjustPan and I have tried some experimental stuff with focusing. But my content inside the ScrollView is getting hidden by the included layout everytime its getting focus.
It may be just a logical problem but how do I tell e.g.: my EditText which is in the center of some other stuff like TextViews, ViewPager etc. to be above the included layout when gaining focus ?

Android Paralloid and ImageView onClick

I'm currently trying to implement Paralloid by chrisjenx for Android. It uses a FrameLayout that hosts two different layouts that take up the entire screen size. I need to perform an event during an ImageView's onClick(). The ImageView is located in the first layout.
For example:
<Frame Layout>
<Relative Layout>
<ImageView/>
<!-- Need this guys onclick, nothing outputted though. -->
</Relative Layout>
<chris.jenx.paralloid/>
</Frame Layout>
I've even gone as far as making sure Relative Layout and Image View both have clickable="true" and focusable="true". No Luck.
Have you tried setting the Image clickable property to true?
android:clickable="true";

Categories

Resources