fix deprecated
This commit is contained in:
@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
@ -47,25 +48,25 @@ public class CardRelativeLayout extends RelativeLayout {
|
||||
}
|
||||
|
||||
if (isTran) {
|
||||
mLeftDrawable = getResources().getDrawable(R.drawable.frame_tran_left);
|
||||
topDrawable = getResources().getDrawable(R.drawable.frame_tran_top);
|
||||
mRightDrawable = getResources().getDrawable(R.drawable.frame_tran_right);
|
||||
bottomDrawable = getResources().getDrawable(R.drawable.frame_tran_bottom);
|
||||
mLeftDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_left);
|
||||
topDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_top);
|
||||
mRightDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_right);
|
||||
bottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_bottom);
|
||||
|
||||
leftTopDrawable = getResources().getDrawable(R.drawable.frame_tran_left_top_square);
|
||||
rightTopDrawable = getResources().getDrawable(R.drawable.frame_tran_right_top_square);
|
||||
leftBottomDrawable = getResources().getDrawable(R.drawable.frame_tran_left_bottom_square);
|
||||
rightBottomDrawable = getResources().getDrawable(R.drawable.frame_tran_right_bottom_square);
|
||||
leftTopDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_left_top_square);
|
||||
rightTopDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_right_top_square);
|
||||
leftBottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_left_bottom_square);
|
||||
rightBottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_tran_right_bottom_square);
|
||||
} else {
|
||||
mLeftDrawable = getResources().getDrawable(R.drawable.frame_left);
|
||||
topDrawable = getResources().getDrawable(R.drawable.frame_top);
|
||||
mRightDrawable = getResources().getDrawable(R.drawable.frame_right);
|
||||
bottomDrawable = getResources().getDrawable(R.drawable.frame_bottom);
|
||||
mLeftDrawable = ContextCompat.getDrawable(context, R.drawable.frame_left);
|
||||
topDrawable = ContextCompat.getDrawable(context, R.drawable.frame_top);
|
||||
mRightDrawable = ContextCompat.getDrawable(context, R.drawable.frame_right);
|
||||
bottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_bottom);
|
||||
|
||||
leftTopDrawable = getResources().getDrawable(R.drawable.frame_left_top_square);
|
||||
rightTopDrawable = getResources().getDrawable(R.drawable.frame_right_top_square);
|
||||
leftBottomDrawable = getResources().getDrawable(R.drawable.frame_left_bottom_square);
|
||||
rightBottomDrawable = getResources().getDrawable(R.drawable.frame_right_bottom_square);
|
||||
leftTopDrawable = ContextCompat.getDrawable(context, R.drawable.frame_left_top_square);
|
||||
rightTopDrawable = ContextCompat.getDrawable(context, R.drawable.frame_right_top_square);
|
||||
leftBottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_left_bottom_square);
|
||||
rightBottomDrawable = ContextCompat.getDrawable(context, R.drawable.frame_right_bottom_square);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user