How can I change Theme.Holo.Light.Dialog to take up less screen space?

Currently, my application uses the Holo Light theme, unless I added settings. This is mostly normal, but it's hard for me to create a dialog box style.

The head theme has the colors I want, but Theme.Dialog more compact, i.e. takes up less screen space, which is what I want.

When I use the Holo theme with the following setting

  <style name="AlertDialogCustom" parent="@android:style/Theme.Holo.Light.Dialog"> <item name="android:buttonStyle">@style/general_button_style</item> <item name="android:textColor">@color/my_blue</item> </style> 

it looks like this:

enter image description here

When I return to the dialog box for a theme other than Holo

  <style name="AlertDialogCustom" parent="@android:style/Theme.Dialog"> <item name="android:buttonStyle">@style/general_button_style</item> <item name="android:textColor">@color/my_blue</item> </style> 

as follows:

enter image description here

What do I need to change to use the holographic theme, but to use less screen space?

+4
source share
1 answer

The extra space used in the Holo theme is used to place the scroll effect when scrolling up or down.

Both scrolling components sit inside the view, for example this .

Defining negative fields on the top / bottom of both components should do the (albeit dirty) trick:

 <TimePicker android:id="@+id/timePicker1" ... android:layout_marginBottom="-20dip" android:layout_marginTop="-20dip"/> 

Play with numbers as needed, as I have not tried it myself.

0
source

Source: https://habr.com/ru/post/1501503/


All Articles