Last active
October 5, 2023 21:20
-
-
Save armanso/4c8023b3ee84751838469f5184f1f5dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.annotation.Nullable; | |
import android.support.v4.content.ContextCompat; | |
import android.util.AttributeSet; | |
import android.widget.LinearLayout; | |
import arman.so.shadowexample.R; | |
import arman.so.shadowexample.utils.ViewUtils; | |
/** | |
* Created by ArmanSo on 4/16/17. | |
*/ | |
public class RoundLinerLayoutNormal extends LinearLayout { | |
public RoundLinerLayoutNormal(Context context) { | |
super(context); | |
initBackground(); | |
} | |
public RoundLinerLayoutNormal(Context context, @Nullable AttributeSet attrs) { | |
super(context, attrs); | |
initBackground(); | |
} | |
public RoundLinerLayoutNormal(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { | |
super(context, attrs, defStyleAttr); | |
initBackground(); | |
} | |
private void initBackground() { | |
setBackground(ViewUtils.generateBackgroundWithShadow(this,R.color.white, | |
R.dimen.radius_corner,R.color.shadowColor,R.dimen.elevation, Gravity.BOTTOM)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, nice solution! But it's ignoring the width and height values I'm setting in the child layout XML and changing the view's size to be really close to its content area. I tried to set the fixed size in the parent view, but the result is the same. Any thoughts?