info on Drag Entered - java

When I drag my View, I want to be able to see what view I am dragging into upon drag entered.
I know I can get the View that I am dragging by using
View draggedView = (View) event.getLocalState();
Is there a way to get the View of the drag entered object?

There was no easy way of doing it.
i was able to get the view by going through the views in my layout in a for loop and finding the view by checking equality.

Related

Why is Android setting "fastScrollEnabled" to false for both a Grid View and List View?

I've been having some trouble enabling fast scrolling for a Grid View and a List View. I've set fastScrollingEnabled="true" in their XML layouts and added both the horizontal and vertical state drawables for the track and thumb. I also added these values to their styles, as well, and have "[GridView | ListView].setFastScrollEnabled(true) set programmatically. However, when I run the application, fast scrolling does not work. After some investigation, I've noticed via Layout Inspector that the fastScrollEnabled attribute is set to "false" for both the Grid View and the List View. Why would Android automatically set this value back to false? Is there a way for me to prevent this so that I can fast scroll on these view types? I've gotten fast scrolling working on Recycler Views in the same application with the same amount of setup, but for some reason the Grid View and List View fast scrolling attribute remains false.

Android animation in a recycler view to change bounds?

I have a recycler view and the rows in each recycler view can have varying size depending on information inside them which is dynamically filled into it.
Now when I scroll the recycler view the layout gets inflated and there is a sudden jerk in the screen. So i want to animate this part where i can just expand the lower bound of the row or any other method suitable.
How do i animate just the lower bound?? please help..
i have used this code
int height = holder.customLayout.getHeight();
holder.customLayout.animate().translationY(height).setDuration(1000);
but it messes up with entire view

Off set android view while using android:layout_centerVertical="true"?

I'm trying to get a view center vertically in android, but I have a imageView at the top that is 75dps, so I need my centered view to be offset from the top by 75dps so it gets centered! Is there a way to do this? I tried using android:layout_marginTop="75dp" but it didn't work! Any ideas?
You could wrap your view into a ViewGroup (e.g. LinearLayout), then make the LinearLayout centered, and add the marginTop to your view. It should work.
Anyway, it would be helpful if you post also your layout xml.

ViewPager with ImageViews having pinch-zoom and gestures capabilities - view reuse issue

I have a ViewPager with custom ImageView-based class as ViewPager childrens. In my ImageView I have implemnted gesture handling - pinch and 2-finger zoom and image move. Now my problem is that ViewPager reuses view and there is no mechanism for saving particular view state of child views. In my case it results in following - user zooms and/or moves image on particular ImageView, then ViewAdapter reuses view for current view and the image gets display with default scale/position. I wonder how to save the view state so that after view reuse I can load the last state of view to have the correct zoom/move state.
Does anybody have some hints?
Maybe you should use setTag and save the state of the modified child view. If getTag is not null, you can restore the state of the child.

keyboard - resizing viewgroup, overlaying viewgroups and custom editor view

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

Categories