Remove useless file
This commit is contained in:
1 parent
86d42dd283
commit
ae7c8199bf
40 files changed
+101
-9432
No files matched your search
@@ -15,9 +15,13 @@
|
||||
|
||||
package com.hippo.widget;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
@@ -25,9 +29,8 @@ import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.hippo.util.ApiHelper;
|
||||
import com.hippo.util.MathUtils;
|
||||
import com.nineoldandroids.animation.Animator;
|
||||
import com.nineoldandroids.animation.ObjectAnimator;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -117,6 +120,7 @@ public class CheckTextView extends TextView implements OnClickListener, Hotspota
|
||||
}
|
||||
};
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
private void startAnimator() {
|
||||
ObjectAnimator radiusAnim;
|
||||
if (mChecked) {
|
||||
@@ -126,9 +130,11 @@ public class CheckTextView extends TextView implements OnClickListener, Hotspota
|
||||
radiusAnim = ObjectAnimator.ofFloat(this, "radius",
|
||||
mMaxRadius, 0f);
|
||||
}
|
||||
radiusAnim.setAutoCancel(true);
|
||||
radiusAnim.setDuration(ANIMATION_DURATION); // TODO decide duration according to mMaxRadius
|
||||
radiusAnim.addListener(mAnimatorListener);
|
||||
if (ApiHelper.HAS_AUTO_CANCEL_ON_ANIMATION) {
|
||||
radiusAnim.setAutoCancel(true);
|
||||
}
|
||||
radiusAnim.start();
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
package com.hippo.widget;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
@@ -31,9 +34,7 @@ import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.nineoldandroids.animation.Animator;
|
||||
import com.nineoldandroids.animation.AnimatorListenerAdapter;
|
||||
import com.nineoldandroids.animation.ObjectAnimator;
|
||||
import com.hippo.util.ApiHelper;
|
||||
|
||||
// Get code from https://gist.github.com/jromero/233cfd8ef22a8b8c29ea
|
||||
/**
|
||||
@@ -125,20 +126,24 @@ public class FloatLabelEditText extends FrameLayout {
|
||||
/**
|
||||
* Show the label using an animation
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
protected void showLabel() {
|
||||
if (mLabel.getVisibility() != View.VISIBLE) {
|
||||
mLabel.setVisibility(View.VISIBLE);
|
||||
|
||||
final ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mLabel, "alpha",
|
||||
0f, 1f);
|
||||
alphaAnim.setAutoCancel(true);
|
||||
alphaAnim.setDuration(ANIMATION_DURATION);
|
||||
|
||||
final ObjectAnimator translationYAnim = ObjectAnimator.ofFloat(mLabel,
|
||||
"translationY", mLabel.getHeight(), 0f);
|
||||
translationYAnim.setAutoCancel(true);
|
||||
translationYAnim.setDuration(ANIMATION_DURATION);
|
||||
|
||||
if (ApiHelper.HAS_AUTO_CANCEL_ON_ANIMATION) {
|
||||
alphaAnim.setAutoCancel(true);
|
||||
translationYAnim.setAutoCancel(true);
|
||||
}
|
||||
|
||||
alphaAnim.start();
|
||||
translationYAnim.start();
|
||||
}
|
||||
@@ -147,16 +152,15 @@ public class FloatLabelEditText extends FrameLayout {
|
||||
/**
|
||||
* Hide the label using an animation
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
|
||||
protected void hideLabel() {
|
||||
if (mLabel.getVisibility() != View.GONE) {
|
||||
final ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mLabel, "alpha",
|
||||
1f, 0f);
|
||||
alphaAnim.setAutoCancel(true);
|
||||
alphaAnim.setDuration(ANIMATION_DURATION);
|
||||
|
||||
final ObjectAnimator translationYAnim = ObjectAnimator.ofFloat(mLabel,
|
||||
"translationY", 0f, mLabel.getHeight());
|
||||
translationYAnim.setAutoCancel(true);
|
||||
translationYAnim.setDuration(ANIMATION_DURATION);
|
||||
translationYAnim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
@@ -165,6 +169,11 @@ public class FloatLabelEditText extends FrameLayout {
|
||||
}
|
||||
});
|
||||
|
||||
if (ApiHelper.HAS_AUTO_CANCEL_ON_ANIMATION) {
|
||||
alphaAnim.setAutoCancel(true);
|
||||
translationYAnim.setAutoCancel(true);
|
||||
}
|
||||
|
||||
alphaAnim.start();
|
||||
translationYAnim.start();
|
||||
}
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.hippo.widget;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
/**
|
||||
* Space is a lightweight View subclass that may be used to create gaps between components
|
||||
* in general purpose layouts.
|
||||
*/
|
||||
public final class Space extends View {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public Space(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Space(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Space(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, 0);
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Space(Context context) {
|
||||
//noinspection NullableProblems
|
||||
super(context, null);
|
||||
init();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (getVisibility() == VISIBLE) {
|
||||
setVisibility(INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw nothing.
|
||||
*
|
||||
* @param canvas an unused parameter.
|
||||
*/
|
||||
@Override
|
||||
public void draw(Canvas canvas) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare to: {@link View#getDefaultSize(int, int)}
|
||||
* If mode is AT_MOST, return the child size instead of the parent size
|
||||
* (unless it is too big).
|
||||
*/
|
||||
private static int getDefaultSize2(int size, int measureSpec) {
|
||||
int result = size;
|
||||
int specMode = MeasureSpec.getMode(measureSpec);
|
||||
int specSize = MeasureSpec.getSize(measureSpec);
|
||||
|
||||
switch (specMode) {
|
||||
case MeasureSpec.UNSPECIFIED:
|
||||
result = size;
|
||||
break;
|
||||
case MeasureSpec.AT_MOST:
|
||||
result = Math.min(size, specSize);
|
||||
break;
|
||||
case MeasureSpec.EXACTLY:
|
||||
result = specSize;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
setMeasuredDimension(
|
||||
getDefaultSize2(getSuggestedMinimumWidth(), widthMeasureSpec),
|
||||
getDefaultSize2(getSuggestedMinimumHeight(), heightMeasureSpec));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user