I have a widget with 2 oval buttons (defined in a XML file). At the moment, I've hard coded the width and height of the button to 180dp, but this poses problems when making the widget smaller.
Is there anyway I can set the width and height of the button to scale as the widget size is changed?
Resizable widgets are preferred feature for collection widgets such as those based on ListView or GridView. App Widget Design Guideline
So for your purpose it's better to use different layout if your widget gets resized. On Android 4.1 and above you may use onAppWidgetOptionsChanged()
method to load different layout when your widget is resized. See these answers for more information: