Update dependencies

Settings activity refactor
This commit is contained in:
NekoInverter committed 2020-03-23 14:26:54 +08:00
1 parent ba6d41b91f
commit a9b7df3284
248 files changed
+8700 -8980

No files matched your search

+21 -32
View File
@@ -34,9 +34,11 @@ import android.view.View;
import android.view.ViewConfiguration;
import android.widget.AbsoluteLayout;
import android.widget.PopupWindow;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.core.graphics.drawable.DrawableCompat;
import com.hippo.ehviewer.R;
import com.hippo.yorozuya.AnimationUtils;
import com.hippo.yorozuya.LayoutUtils;
@@ -51,18 +53,14 @@ public class Slider extends View {
private static final int BUBBLE_WIDTH = 26;
private static final int BUBBLE_HEIGHT = 32;
private Context mContext;
private Paint mPaint;
private Paint mBgPaint;
private final RectF mLeftRectF = new RectF();
private final RectF mRightRectF = new RectF();
private final int[] mTemp = new int[2];
private Context mContext;
private Paint mPaint;
private Paint mBgPaint;
private PopupWindow mPopup;
private BubbleView mBubble;
private int mStart;
private int mEnd;
private int mProgress;
@@ -70,24 +68,17 @@ public class Slider extends View {
private int mDrawProgress;
private float mDrawPercent;
private int mTargetProgress;
private float mThickness;
private float mRadius;
private float mCharWidth;
private float mCharHeight;
private int mBubbleWidth;
private int mBubbleHeight;
private int mBubbleMinWidth;
private int mBubbleMinHeight;
private int mPopupX;
private int mPopupY;
private int mPopupWidth;
private final int[] mTemp = new int[2];
private boolean mReverse = false;
private boolean mShowBubble;
@@ -219,7 +210,7 @@ public class Slider extends View {
mPopupX = (int) (mTemp[0] + mRadius - (mBubbleWidth / 2));
mPopupY = (int) (mTemp[1] - popupHeight + paddingTop +
((getHeight() - paddingTop - paddingBottom) / 2) -
mRadius -LayoutUtils.dp2pix(mContext, 2));
mRadius - LayoutUtils.dp2pix(mContext, 2));
mPopup.update(mPopupX, mPopupY, mPopupWidth, popupHeight, false);
}
@@ -300,6 +291,10 @@ public class Slider extends View {
updateBubbleSize();
}
public int getProgress() {
return mProgress;
}
public void setProgress(int progress) {
progress = MathUtils.clamp(progress, mStart, mEnd);
int oldProgress = mProgress;
@@ -324,10 +319,6 @@ public class Slider extends View {
}
}
public int getProgress() {
return mProgress;
}
public void setReverse(boolean reverse) {
if (mReverse != reverse) {
mReverse = reverse;
@@ -462,6 +453,15 @@ public class Slider extends View {
return true;
}
public interface OnSetProgressListener {
void onSetProgress(Slider slider, int newProgress, int oldProgress, boolean byUser, boolean confirm);
void onFingerDown();
void onFingerUp();
}
@SuppressLint("ViewConstructor")
private static class BubbleView extends AppCompatImageView {
@@ -470,10 +470,8 @@ public class Slider extends View {
private final Drawable mDrawable;
private final Paint mTextPaint;
private String mProgressStr = "";
private final Rect mRect = new Rect();
private String mProgressStr = "";
@SuppressWarnings("deprecation")
public BubbleView(Context context, Paint paint) {
@@ -516,15 +514,6 @@ public class Slider extends View {
}
}
public interface OnSetProgressListener {
void onSetProgress(Slider slider, int newProgress, int oldProgress, boolean byUser, boolean confirm);
void onFingerDown();
void onFingerUp();
}
private final class CheckForShowBubble implements Runnable {
@Override