Android Question All Activities and Panels with the same gradient drawable

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Hi,
How to set All Activities and Panels with the same gradient drawable?
Thanks
 

Attachments

  • 2015-12-11_1532.png
    2015-12-11_1532.png
    7.1 KB · Views: 260

Alberto Michelis

Well-Known Member
Licensed User
Longtime User
Thanks but I have a problem doing this that does not appear if I set the GD in the designer...
Look at the image, the activity and the panel are smaller than the screen?!?!?
 

Attachments

  • Screenshot_2015-12-11-16-59-23[1].png
    Screenshot_2015-12-11-16-59-23[1].png
    115.8 KB · Views: 283
Upvote 0

netsistemas

Active Member
Licensed User
Longtime User
Insert this code in module:

public Sub SetGD(Act As Activity)
Dim GD As GradientDrawable
Dim number1 As Long
number1 = 0xFF1798A2
Dim number2 As Long
number2 = 0xFFECF0BC' 0xFF1798A2
'GD.Initialize("RIGHT_LEFT", Array As Int(#FF1798A2, #FF1798A2))
GD.Initialize("RIGHT_LEFT", Array As Int(number1, number2))
Act.Background = GD
End Sub

public Sub ActivityLoadLayout (Act As Activity,NombreActividad As String)
Act.LoadLayout(NombreActividad)
SetGD (Act)
End Sub

and call
YourModule.ActivityLoadyaout(activity)
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I may be misunderstanding this post so I post my question...
do you want a single uniform gradient to show through all views an panels or do you want each view to have its own gradient resulting in a non-uniform background?
if you want the second, the answer has been given by LucaS, but if you're looking for a single uniform background, then set the activity background to your liking and set all panels background to be transparent (opacity).
activities will always take full screen, independently of screen size or resolution. a panel can have different sizes and the final size depends on a few factors like screen resolution, used anchors, etc...
 
Upvote 0
Top