Skip to content

Commit cdc177d

Browse files
committed
Remove code irrelevant to API >=15.
1 parent be38506 commit cdc177d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

library/src/main/java/com/jmedeisis/draglinearlayout/DragLinearLayout.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import android.graphics.Rect;
1313
import android.graphics.drawable.BitmapDrawable;
1414
import android.graphics.drawable.Drawable;
15-
import android.os.Build;
1615
import android.support.annotation.NonNull;
16+
import android.support.v4.content.ContextCompat;
1717
import android.support.v4.view.MotionEventCompat;
1818
import android.util.AttributeSet;
1919
import android.util.Log;
@@ -58,7 +58,7 @@ public interface OnViewSwapListener {
5858
* <p/>
5959
* No guarantee is made as to which of the two has a lesser/greater position.
6060
*/
61-
public void onSwap(View firstView, int firstPosition, View secondView, int secondPosition);
61+
void onSwap(View firstView, int firstPosition, View secondView, int secondPosition);
6262
}
6363

6464
private OnViewSwapListener swapListener;
@@ -208,13 +208,8 @@ public DragLinearLayout(Context context, AttributeSet attrs) {
208208
slop = vc.getScaledTouchSlop();
209209

210210
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);
218213
dragShadowHeight = resources.getDimensionPixelSize(R.dimen.downwards_drop_shadow_height);
219214

220215
TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.DragLinearLayout, 0, 0);

0 commit comments

Comments
 (0)