Android: Change center of linear GradientDrawable via code
EDIT: LOOK AT SOLUTION ABOVE i m freaking out. all i just want to do, is setting a linear GradientDrawable, which changes the vertical center of the gradient... drawing the gradient works fine, but how can i change the center of it?!? RelativeLayout bgScreen = (RelativeLayout) findViewById(R.id.player_screen); GradientDrawable gd = new GradientDrawable( GradientDrawable.Orientation.TOP_BOTTOM, new int[] {startColor,endColor}); gd.setCornerRadius(0f); gd.setAlpha(200); bgScreen.setBackground(gd); public void redrawOrChangeBackgroundGradient(){ //??? either change center of existing gd