Durga Malleswari
Durga Malleswari

Reputation: 196

How to enable resize for widgets that are added on the screen using pick widget

I am letting users add widgets to my screen using pick widgets option. I want to give an option for user to resize them. That is, after long press on the widget, a boundary box should appear and user can resize the widget by dragging the boundaries. Can someone let me know how this can be achieved for widgets that are added using pick widget option. Thanks.

Upvotes: 2

Views: 1512

Answers (1)

Hamed Gohari
Hamed Gohari

Reputation: 88

It was better that you show us your codes but you can use this codes: first if you want to add your boundary box around your widget, you should add this line to your xml:

android:resizeMode="horizontal|vertical"

and if you add minimum resize size code to your widget, it will let user to resize it, add this code to your xml too:

android:minResizeWidth

go and see this code sample and read xml code in res folder: link

Upvotes: 3

Related Questions