重新启用美颜sdk
调整美颜sdk只使用美颜功能
This commit is contained in:
@@ -2,6 +2,8 @@ package com.yunbao.common.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.DisplayMetrics;
|
||||
|
||||
/**
|
||||
@@ -55,4 +57,16 @@ public class DeviceUtils {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (pxValue / scale + 0.5f);
|
||||
}
|
||||
|
||||
public static String getVersionName(Context context) {
|
||||
try {
|
||||
PackageManager manager = context.getPackageManager();
|
||||
PackageInfo info = manager.getPackageInfo(context.getPackageName(),0);
|
||||
return info.versionName;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "0";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class GiftCacheUtil {
|
||||
|
||||
@Override
|
||||
public void onProgress(int progress) {
|
||||
Log.i(TAG, "onProgress: "+progress);
|
||||
// Log.i(TAG, "onProgress: "+progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
public class SVGAViewUtils {
|
||||
private final static List<SVGAImageView> SVGA_CACHE = new ArrayList<>();
|
||||
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear) {
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear, SVGACallback callback) {
|
||||
if (!isClear) {
|
||||
if (!SVGA_CACHE.contains(svga)) {
|
||||
SVGA_CACHE.add(svga);
|
||||
@@ -21,7 +21,9 @@ public class SVGAViewUtils {
|
||||
svga.setCallback(new SVGACallback() {
|
||||
@Override
|
||||
public void onPause() {
|
||||
|
||||
if (callback != null) {
|
||||
callback.onPause();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,16 +32,23 @@ public class SVGAViewUtils {
|
||||
if (isClear) {
|
||||
svga.clear();
|
||||
}
|
||||
if (callback != null) {
|
||||
callback.onFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRepeat() {
|
||||
|
||||
if (callback != null) {
|
||||
callback.onRepeat();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStep(int i, double v) {
|
||||
|
||||
if (callback != null) {
|
||||
callback.onStep(i, v);
|
||||
}
|
||||
}
|
||||
});
|
||||
svga.startAnimation();
|
||||
@@ -58,6 +67,10 @@ public class SVGAViewUtils {
|
||||
SVGA_CACHE.clear();
|
||||
}
|
||||
|
||||
public static void playEndClear(SVGAImageView svga, boolean isClear) {
|
||||
playEndClear(svga, isClear, null);
|
||||
}
|
||||
|
||||
public static void playEndClear(SVGAImageView svga) {
|
||||
playEndClear(svga, true);
|
||||
}
|
||||
@@ -65,7 +78,7 @@ public class SVGAViewUtils {
|
||||
/**
|
||||
* 获取svga动画播放时间
|
||||
*/
|
||||
public static long getPlayTimer(SVGAImageView svga){
|
||||
public static long getPlayTimer(SVGAImageView svga) {
|
||||
return svga.getPlayDuration();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user