Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaojieonly committed Nov 29, 2024
1 parent 3f8c11e commit a4ec74f
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions app/src/main/java/com/hippo/widget/LoadImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@

package com.hippo.widget;

import static com.hippo.ehviewer.client.EhUrl.DOMAIN_E;
import static com.hippo.ehviewer.client.EhUrl.DOMAIN_EX;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.AnimatedImageDrawable;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
Expand Down Expand Up @@ -62,11 +57,6 @@
public class LoadImageView extends FixedAspectImageView implements Unikery<Image>,
View.OnClickListener, View.OnLongClickListener, Animatable {

public enum LoadSource {
DOWNLOAD_LIST, DEFAULT
}


public static final int RETRY_TYPE_NONE = 0;
public static final int RETRY_TYPE_CLICK = 1;
public static final int RETRY_TYPE_LONG_CLICK = 2;
Expand Down Expand Up @@ -156,8 +146,7 @@ protected void onDetachedFromWindow() {

private Drawable getImageDrawable() {
Drawable drawable = getDrawable();
if (drawable instanceof TransitionDrawable) {
TransitionDrawable transitionDrawable = (TransitionDrawable) drawable;
if (drawable instanceof TransitionDrawable transitionDrawable) {
if (transitionDrawable.getNumberOfLayers() == 2) {
drawable = transitionDrawable.getDrawable(1);
}
Expand Down

0 comments on commit a4ec74f

Please sign in to comment.