From fe6e543fb7ee2185d5bfbe1b4568289655bbda33 Mon Sep 17 00:00:00 2001 From: serso Date: Tue, 11 Jul 2017 12:20:35 +0200 Subject: [PATCH] Use AppCompat classes as base classes --- .../views/dragbutton/DirectionDragButton.java | 5 ----- .../views/dragbutton/DirectionDragImageButton.java | 5 ----- .../android/views/dragbutton/DragButton.java | 11 ++--------- .../android/views/dragbutton/DragImageButton.java | 12 ++---------- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragButton.java b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragButton.java index 6f67334b..f01e1ab4 100644 --- a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragButton.java +++ b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragButton.java @@ -26,11 +26,6 @@ public class DirectionDragButton extends DragButton implements DirectionDragView init(attrs); } - public DirectionDragButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - init(attrs); - } - private void init(@Nullable AttributeSet attrs) { textView.init(this, attrs); } diff --git a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragImageButton.java b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragImageButton.java index 39694780..4a59e7f3 100644 --- a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragImageButton.java +++ b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DirectionDragImageButton.java @@ -26,11 +26,6 @@ public class DirectionDragImageButton extends DragImageButton implements Directi init(attrs); } - public DirectionDragImageButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - init(attrs); - } - private void init(@Nullable AttributeSet attrs) { final TextView view = new TextView(getContext(), attrs); textView.init(this, attrs, view.getPaint()); diff --git a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragButton.java b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragButton.java index ddb7e828..18057c20 100644 --- a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragButton.java +++ b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragButton.java @@ -1,15 +1,13 @@ package org.solovyev.android.views.dragbutton; -import android.annotation.TargetApi; import android.content.Context; -import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.v7.widget.AppCompatButton; import android.util.AttributeSet; import android.view.MotionEvent; -import android.widget.Button; -public abstract class DragButton extends Button implements DragView { +public abstract class DragButton extends AppCompatButton implements DragView { @NonNull private final DragGestureDetector dragDetector = new DragGestureDetector(this); @@ -25,11 +23,6 @@ public abstract class DragButton extends Button implements DragView { super(context, attrs, defStyleAttr); } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public DragButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - @Override public boolean onTouchEvent(MotionEvent event) { if (dragDetector.onTouchEvent(event)) { diff --git a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragImageButton.java b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragImageButton.java index 95f6f7dd..dda0d6f2 100644 --- a/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragImageButton.java +++ b/dragbutton/src/main/java/org/solovyev/android/views/dragbutton/DragImageButton.java @@ -1,15 +1,13 @@ package org.solovyev.android.views.dragbutton; -import android.annotation.TargetApi; import android.content.Context; -import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; +import android.support.v7.widget.AppCompatImageButton; import android.util.AttributeSet; import android.view.MotionEvent; -import android.widget.ImageButton; -public abstract class DragImageButton extends ImageButton implements DragView { +public abstract class DragImageButton extends AppCompatImageButton implements DragView { @NonNull private final DragGestureDetector dragDetector = new DragGestureDetector(this); @@ -25,12 +23,6 @@ public abstract class DragImageButton extends ImageButton implements DragView { super(context, attrs, defStyleAttr); } - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public DragImageButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - - @Override public boolean onTouchEvent(MotionEvent event) { if (dragDetector.onTouchEvent(event)) {