hxb
2022-11-22 b3513b1713bb979d0a69c5a8c4ddcd038f184e6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package com.mm.android.deviceaddmodule.mobilecommon.widget;
 
import android.os.Parcel;
import android.os.Parcelable;
 
/**
 * BottomMenuDialog按钮资源(注:TextAppearance中属性会被TextColor和TextSize属性覆盖)
 */
public class CommonMenu4Lc implements Parcelable {
    private int     mTextResId;                                 //按钮文字字符串资源
    private int     mTextColorResId;                            //按钮文字颜色资源
    private float   mTextSize              = -1;                //按钮文字大小
    private int     mBackgroundResId;                           //按钮背景资源
    private int     mTextAppearanceResId;                       //文字外观Style
    private int[]   mMargins               = new int[4];        //按钮Margins
    
    public CommonMenu4Lc() {
 
    }
    
    public CommonMenu4Lc(int strRes) {
        mTextResId = strRes;
    }
 
    protected CommonMenu4Lc(Parcel in) {
        mTextResId = in.readInt();
        mTextColorResId = in.readInt();
        mTextSize = in.readFloat();
        mBackgroundResId = in.readInt();
        mTextAppearanceResId = in.readInt();
        mMargins = in.createIntArray();
    }
 
    public static final Creator<CommonMenu4Lc> CREATOR = new Creator<CommonMenu4Lc>() {
        @Override
        public CommonMenu4Lc createFromParcel(Parcel in) {
            return new CommonMenu4Lc(in);
        }
 
        @Override
        public CommonMenu4Lc[] newArray(int size) {
            return new CommonMenu4Lc[size];
        }
    };
 
    public int getTextAppearance() {
        return mTextAppearanceResId;
    }
 
    public void setTextAppearance(int textAppearance) {
        mTextAppearanceResId = textAppearance;
    }
 
    public int getStringId() {
        return mTextResId;
    }
 
    public void setStringId(int stringId) {
        mTextResId = stringId;
    }
 
    public int getColorId() {
        return mTextColorResId;
    }
 
    public void setColorId(int colorId) {
        mTextColorResId = colorId;
    }
 
    public int getDrawId() {
        return mBackgroundResId;
    }
 
    public void setDrawId(int drawId) {
        mBackgroundResId = drawId;
    }
 
    public int[] getMargins() {
        return mMargins;
    }
    
    public void setMargins(int left, int top, int right, int bottom) {
        mMargins[0] = left;
        mMargins[1] = top;
        mMargins[2] = right;
        mMargins[3] = bottom;
    }
    
    public float getTextSize() {
        return mTextSize;
    }
 
    public void setTextSize(int textSize) {
        this.mTextSize = textSize;
    }
 
    @Override
    public int describeContents() {
 
        return 0;
    }
 
    @Override
    public void writeToParcel(Parcel arg0, int arg1) {
        arg0.writeInt(mTextResId);
        arg0.writeInt(mTextColorResId);
        arg0.writeFloat(mTextSize);
        arg0.writeInt(mBackgroundResId);
        arg0.writeInt(mTextAppearanceResId);
        arg0.writeIntArray(mMargins);
    }
}