keyboard - resizing viewgroup, overlaying viewgroups and custom editor view - java

im writing a keyboard and there are a number of things i want to do:
1) i want to be able to dyamically resize the the keyboard view. I
have a custom view for my keyboard, created by my
InputMethodService.onCreateInputView
i've tried calling invalidate, requestLayout, forceLayout, on the
keyboard view, on its parent and on the view root but nothing seems to
call the onMeasure code again in my layout to allow it to resize.
2) i would also like to have a view group that goes over the edit
window and possibly over the rest of the screen. for example if the
user preses a button i want to draw above thier finger (which could be
over the editor window) what the are pressing or some additional
information.
3) i would like to be able to disable the editor window and do this my
self, so for example i can change how this functions

Related

How to make dimming effect of Youtube when motionLayout transitions from start to end?

I'm trying to make this effect but has no idea, how to achieve it:
My idea is to have a Frame Layout which wraps the video fragment, and the Video fragment has motion Layout as its root layout. So, Frame Layout is in main Activity, but motion Layout is inside a .xml file, which will soon be inflated as the Video fragment's layout. It looks something like this (The frag container will match parent in its width and height):
My questions are:
Is this a good idea to make this transition?
How to make the dimming effects that YouTube has? I'm planning to use this Listener for tracking the transition but has no idea how to make the slowly dimming effect :(. MotionLayout.TransitionListener
Any idea?
One way I can think of cover the screen with a a View that is
#000000 and transition the views color to #FF000000 using a custom Attribute.
The View would need to be gone, Invisible, or translationZ = -1 at the start

How to expand layout when scrolling in Android?

Now I want to create layout like this in my MainActivity
and I want to set up my scroll view. When I scrolling Content view move to top of Main view like this
It move to Top of main view and expand content view follow my scroll view
and when it expanded reach the specified point I want to make it like this
set the top layout of content view (Red color) to fix not moving and go to scroll only main content layout (Blue Green Orange color)
and then finish of scrolling when i scroll down it all of layout return to first picture
Anyone can help recommend me.
I have been stuck in this problem for many days.
Java, Android Studio
I'm sorry for my English I'm not good at English

Design decision for custom view

I want to design a custom card view which displays information about a duel in an android app. Here is a screenshot of what the view looks like right now.
The image and the green button should be clickable, however, this design is currently done in one custom view extending CardView. The green button is a Rectangle and the polygon is a filled Path which overlays the button.
Because I have done everything in one onDraw() method, there is no onClick() method for solely the button or solely the image. Is there any clever way to do this? Maybe I'm conceptually wrong somewhere?
My thoughts so far:
Have a transparent button on top of the green button in the xml
Maybe there is a way to include a button in the onDraw() method
Make the whole view clickable and include the image in the xml
This is how I solved it now. I changed the custom view to only display the skewed rectangle. The other resources were created in a seperate xml file. With an <include />, I was able to place the rectangle over the button.

Android Scrollview gets overlapped by a view and keyboard

I have searched the web for about 2 hours and no solution, now I will try it here.
My problem is that when I open the keyboard the scrollview gets overlapped by a view and the keyboard. I want to see the bottom elements of the scrollview.
Here are the screenshots: screenshot1, screenshot2.
The scrollview doesn't respond to adjustReize like other views do, the solution (like other people have done e.g. Why doesn't android:windowSoftInputMode="stateVisible|adjustResize" adjust the screen when soft keyboard is shown?) will simply listen to the view's hierarchy and scroll to the bottom when the keyboard is shown

Codename One - autoscroll the screen

In a Codename One GUI builder app when I navigate back to my Main form, the screen is always shown at the top.
How can I get the screen to auto scroll down to the part I want and retain its previous scroll?
I'm assuming that this is a GUI builder app.
Normally this should be seamless as the UI will scroll to the last focused component but if you don't have focusable elements this might be harder. You can store the scroll Y value on the exitForm event and restore it the beforeShow event using something like:
f.addShowListener((e) -> f.scrollY(yValue));

Categories