Swipe and expand view Android - android

Good evening everyone,
I've been struggling to find out a way to do this. I have an activity. In this activity I have a "top menu", and a fragment holding a listview. The goal is for the top menu to be expanded either when the setting button is pressed, or the down arrow is swiped:
Currently, I'm just adjusting the height and properties of the top menu view according to if it's expanded or not. I'm pretty sure this is not the proper way to implement this. Thanks in advance!

I have faced similar problem with swiping elements. You can use OnTouchListener and GestureDetector to detect dragging
I wrote simple android library for this problem, it has also functions to expand view on your setting button press.
swiping library

Related

Show/hide a layout on scroll up/down android

I am working on an android application and want to implement a functionality in which I want to show a layout which will contain Like/Comment of that content at the bottom of the page.
I want this layout to be shown when I scroll up the page and hide when I scroll down the page.
I have scene many applications that have implemented this feature, but I have no idea how to implement this feature in my app.
Please check this link of the app which is giving the same functionality which I want to implenment https://play.google.com/store/apps/details?id=com.midsizemango.materialapps
Please help if anyone have idea here, Thanks a lot in advanced.
You need to do the same thing which happens with fab, first create a class extendingCoordinatorLayout.Behavior<View> and implement it like other fab examples. just remember that it won't work on simple listView and gridView.
Also here's a good detailed tutorial for you.
You Just have to set Scroll-Up & Scroll-Down listener of your Recycler view or Scroll View check Reference link.
Now base on Scroll-Up & Scroll-Down listener set VISIBLE / GONEof your footer view either it is LinearLayout or Toolbar with animation.

Android hierarchical ListView

I am trying to implement a simple tree-like menu. I have a ListView as the root. Each item is a custom View that consists of an arrow icon at the right if it has a submenu and a checkbox taking up the rest of the row. This is all great.
Now here is what I want to do and can't figure out how (I am new to Android, but Googling didn't help me):
If the user slides to the left on an item with an arrow, the whole list will slide out to the left and the corresponding submenu will slide in from the right. If the user slides to the right anywhere on the menu, the whole menu will slide out to the right and the parent menu will slide back in from the left. When you picture it it is really a simple concept.
My problem seems to be double:
I can't figure out how to capture a sliding motion. I assume there is some onSlide event or some such, but I can't find it.
I can't seem to attach events to the individual items. I tried just a simple toast with the onItemClickListener and couldn't get it to fire.
Any help or reference would be appreciated.
For the Sliding, check out the ViewPager class and the matching Adapter class, but generally what you describe sounds a lot like iOS and you should rather not try to duplicate a behaviour that's alien to Android users.

How to make my screen to listen to drag listener, android

I was trying to implement a drag down listener on my android app, and make a layout which is in view.GONE state animate and increase upto certain height as I drag down.
I tried using OnTouchListener Action Down and Action Up but it is not helping me.
How to achieve this?
Layout1(App_Header)
Layout2(MapView)
Layout3(ViewPager)
Layout 2 is hidden(View.GONE) after pressing a button.
now by dragging down the screen from the header I should get back my Layout2(MapView) increasing its height as I drag down.
I also tried using DragListener to PagerTabStrip on Layout 3, but it didn't work.
Are there any one who can help me on this?
The best way to achieve it is using OnTouchListener and a custom OnDragListener.
Here is a great example and here is another one (from google documentation)
If you need any additional help just ask!

TouchListView : OnClickListener

Whenever I am setting OnClickListener for TouchListView then DropListener and DragListener are not working.
I downloaded the demo of the CWAC: TouchListView.
So how should I implement the OnClickListener for the TouchListView.
Please Help.
Thanks.
As i Understand there are 2 ways to solve this problem:
1. You must make only one small area off each item touchable to drag. And user will drag your items if he touch item in this area. You can implement it using x-coordinates of your item.
2. You can implement special mode of work of your listview. You can switch to this mode through menu (or another way) and in this mode all area off item can be touchable to drag but not clickable. After draging you can switch back to usual mode of listview.
PS: I describe my approach to solving the problem. It will be great to see something else.
I have just had the same problem.
If you follow the Demo project you can set your OnClickListener on the label in the IconicAdapter. The user can scroll using the ImageView and they can press the label to do whatever you would like them to do.
This solution worked for me.

PopupWindow with swiping scrollable views

I'm trying to create a Popupindow in which the views can be changed by swiping. Each view should also be scrollable when larger than the popup window. I also want to move only one view when swiping. I can't find any simple way to do that (the Gallery move several views when swiping).
Is there any widget I missed or do I have to implement everything to achieve that (with ViewFlipper and gesture detection for instance)?
Anybody can help with the best way to do that?
Thanks
I've found and ended up using the fantastic HorizontalPager.

Categories

Resources