Dynamic size user adjustable view

Asked

Viewed 33 times

0

I have a LinearLayout where I need the user to adjust its size dynamically. Basically it would only be its height, the width can be a fixed size, being match_parent.

The property in which it would be changed is the android:layout_height, through the method onTouch. See below an image that illustrates the idea better:

inserir a descrição da imagem aqui

The first idea is to identify which was clicked on the edges, both top how much bottom, then drag these edges to decrease the size of the View, to take an ideal size according to the user. How could you do this?

  • Does it really have to be at the edges? It can’t be anywhere inside?

  • @ramaral I can normally redirect the height from the bottom up. Actually, it doesn’t necessarily have to be from the top down. Just adjusting the size from the bottom up is enough. I’ve done it here, but I want the edge to go with the finger, and what’s happening is I’m having a gap between the edge of the view and the finger. I’m doing the receive view time ((int) event.getRawY() - params.bottomMargin),... the problem here now is only logic ^^

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.