model_zoo/ernie-tiny/deploy/android/ui/src/main/java/com/baidu/paddle/paddlenlp/ui/layout/ActionBarLayout.java
<filename>model_zoo/ernie-tiny/deploy/android/ui/src/main/java/com/baidu/paddle/paddlenlp/ui/layout/ActionBarLayout.javapackage com.baidu.paddle.paddlenlp.ui.layout;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.RelativeLayout;


public class ActionBarLayout extends RelativeLayout {
    private int layoutHeight = 150;

    public ActionBarLayout(Context context) {
        super(context);
    }

    public ActionBarLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public ActionBarLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int width = MeasureSpec.getSize(widthMeasureSpec);
        setMeasuredDimension(width, layoutHeight);
        setBackgroundColor(Color.BLACK);
        setAlpha(0.9f);
    }
}