|
12 | 12 | import android.graphics.Rect;
|
13 | 13 | import android.graphics.drawable.BitmapDrawable;
|
14 | 14 | import android.graphics.drawable.Drawable;
|
15 |
| -import android.os.Build; |
16 | 15 | import android.support.annotation.NonNull;
|
| 16 | +import android.support.v4.content.ContextCompat; |
17 | 17 | import android.support.v4.view.MotionEventCompat;
|
18 | 18 | import android.util.AttributeSet;
|
19 | 19 | import android.util.Log;
|
@@ -58,7 +58,7 @@ public interface OnViewSwapListener {
|
58 | 58 | * <p/>
|
59 | 59 | * No guarantee is made as to which of the two has a lesser/greater position.
|
60 | 60 | */
|
61 |
| - public void onSwap(View firstView, int firstPosition, View secondView, int secondPosition); |
| 61 | + void onSwap(View firstView, int firstPosition, View secondView, int secondPosition); |
62 | 62 | }
|
63 | 63 |
|
64 | 64 | private OnViewSwapListener swapListener;
|
@@ -208,13 +208,8 @@ public DragLinearLayout(Context context, AttributeSet attrs) {
|
208 | 208 | slop = vc.getScaledTouchSlop();
|
209 | 209 |
|
210 | 210 | final Resources resources = getResources();
|
211 |
| - // for some reason, the drawable bounds for the top drop shadow do not work pre-API 11.. :/ |
212 |
| - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { |
213 |
| - dragTopShadowDrawable = resources.getDrawable(R.drawable.ab_solid_shadow_holo_flipped); |
214 |
| - } else { |
215 |
| - dragTopShadowDrawable = null; |
216 |
| - } |
217 |
| - dragBottomShadowDrawable = resources.getDrawable(R.drawable.ab_solid_shadow_holo); |
| 211 | + dragTopShadowDrawable = ContextCompat.getDrawable(context, R.drawable.ab_solid_shadow_holo_flipped); |
| 212 | + dragBottomShadowDrawable = ContextCompat.getDrawable(context, R.drawable.ab_solid_shadow_holo); |
218 | 213 | dragShadowHeight = resources.getDimensionPixelSize(R.dimen.downwards_drop_shadow_height);
|
219 | 214 |
|
220 | 215 | TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.DragLinearLayout, 0, 0);
|
|
0 commit comments