|
9 | 9 |
|
10 | 10 | public class SlidingMenu extends RelativeLayout {
|
11 | 11 |
|
12 |
| - public static final int TOUCHMODE_FULLSCREEN = 0; |
13 |
| - public static final int TOUCHMODE_MARGIN = 1; |
| 12 | + public static final int TOUCHMODE_MARGIN = 0; |
| 13 | + public static final int TOUCHMODE_FULLSCREEN = 1; |
14 | 14 |
|
15 | 15 | private CustomViewAbove mViewAbove;
|
16 | 16 | private CustomViewBehind mViewBehind;
|
@@ -48,6 +48,10 @@ public SlidingMenu(Context context, AttributeSet attrs, int defStyle) {
|
48 | 48 | View v = LayoutInflater.from(context).inflate(viewBehind, null);
|
49 | 49 | setViewBehind(v);
|
50 | 50 | }
|
| 51 | + int touchModeAbove = ta.getInt(R.styleable.SlidingMenu_aboveTouchMode, TOUCHMODE_MARGIN); |
| 52 | + setTouchModeAbove(touchModeAbove); |
| 53 | + int touchModeBehind = ta.getInt(R.styleable.SlidingMenu_behindTouchMode, TOUCHMODE_MARGIN); |
| 54 | + setTouchModeBehind(touchModeBehind); |
51 | 55 | // set the offset and scroll scale if defined in xml
|
52 | 56 | int offsetBehind = (int) ta.getDimension(R.styleable.SlidingMenu_behindOffset, 0);
|
53 | 57 | setBehindOffset(offsetBehind);
|
@@ -166,23 +170,23 @@ public void setBehindScrollScale(float f) {
|
166 | 170 | mViewAbove.setScrollScale(f);
|
167 | 171 | }
|
168 | 172 |
|
169 |
| - public int getAboveTouchMode() { |
| 173 | + public int getTouchModeAbove() { |
170 | 174 | return mViewAbove.getAboveTouchMode();
|
171 | 175 | }
|
172 | 176 |
|
173 |
| - public void setAboveTouchMode(int i) { |
| 177 | + public void setTouchModeAbove(int i) { |
174 | 178 | if (i != TOUCHMODE_FULLSCREEN && i != TOUCHMODE_MARGIN) {
|
175 | 179 | throw new IllegalStateException("TouchMode must be set to either" +
|
176 | 180 | "TOUCHMODE_FULLSCREEN or TOUCHMODE_MARGIN.");
|
177 | 181 | }
|
178 | 182 | mViewAbove.setAboveTouchMode(i);
|
179 | 183 | }
|
180 | 184 |
|
181 |
| - public int getBehindTouchMode() { |
| 185 | + public int getTouchModeBehind() { |
182 | 186 | return mViewAbove.getBehindTouchMode();
|
183 | 187 | }
|
184 | 188 |
|
185 |
| - public void setBehindTouchMode(int i) { |
| 189 | + public void setTouchModeBehind(int i) { |
186 | 190 | if (i != TOUCHMODE_FULLSCREEN && i != TOUCHMODE_MARGIN) {
|
187 | 191 | throw new IllegalStateException("TouchMode must be set to either" +
|
188 | 192 | "TOUCHMODE_FULLSCREEN or TOUCHMODE_MARGIN.");
|
|
0 commit comments