69 lines
2.2 KiB
Java
69 lines
2.2 KiB
Java
package com.ubt.jimu.widgets;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.util.AttributeSet;
|
|
import android.view.LayoutInflater;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import butterknife.ButterKnife;
|
|
import com.ubt.jimu.R;
|
|
import com.ubt.jimu.R$styleable;
|
|
import com.ubtech.view.widget.ULinearLayout;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class BottomShadowLayout extends ULinearLayout {
|
|
LinearLayout bottomShadowLayout;
|
|
private View.OnClickListener c;
|
|
ImageView imageView;
|
|
TextView textView;
|
|
|
|
public BottomShadowLayout(Context context) {
|
|
this(context, null);
|
|
}
|
|
|
|
public void a(int i, int i2) {
|
|
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.bottomShadowLayout.getLayoutParams();
|
|
layoutParams.width = i;
|
|
layoutParams.height = i2;
|
|
this.bottomShadowLayout.setLayoutParams(layoutParams);
|
|
}
|
|
|
|
public void onClick(View view) {
|
|
View.OnClickListener onClickListener = this.c;
|
|
if (onClickListener != null) {
|
|
onClickListener.onClick(view);
|
|
}
|
|
}
|
|
|
|
public void setListener(View.OnClickListener onClickListener) {
|
|
this.c = onClickListener;
|
|
}
|
|
|
|
public void setText(String str) {
|
|
TextView textView = this.textView;
|
|
if (textView != null) {
|
|
textView.setText(str);
|
|
}
|
|
}
|
|
|
|
public BottomShadowLayout(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
ButterKnife.a(this, LayoutInflater.from(context).inflate(R.layout.bottom_shadow_layout, (ViewGroup) this, true));
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R$styleable.bottom_shadow, 0, 0);
|
|
int resourceId = obtainStyledAttributes.getResourceId(0, 0);
|
|
if (resourceId != 0) {
|
|
this.imageView.setImageResource(resourceId);
|
|
}
|
|
this.textView.setText(obtainStyledAttributes.getString(1));
|
|
int color = obtainStyledAttributes.getColor(2, -1);
|
|
if (color != 0) {
|
|
this.textView.setTextColor(color);
|
|
}
|
|
obtainStyledAttributes.recycle();
|
|
}
|
|
}
|