新增VAP特效库
This commit is contained in:
@@ -269,6 +269,7 @@ dependencies {
|
||||
}
|
||||
|
||||
api 'com.tencent.vasdolly:helper:3.0.3'
|
||||
implementation "io.github.tencent:vap:2.0.24"
|
||||
}
|
||||
|
||||
String storageUrl = System.env.FLUTTER_STORAGE_BASE_URL ?: "https://storage.googleapis.com"
|
||||
|
@@ -8,12 +8,10 @@ import android.widget.RadioGroup;
|
||||
import com.idlefish.flutterboost.FlutterBoost;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.base.BaseActivity;
|
||||
import com.yizhuan.erban.ui.webview.CommonWebViewActivity;
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtils;
|
||||
import com.yizhuan.xchat_android_core.DemoCache;
|
||||
import com.yizhuan.xchat_android_core.Env;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_library.utils.config.BasicConfig;
|
||||
import com.yizhuan.xchat_android_library.utils.pref.CommonPref;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -27,12 +25,13 @@ public class LabActivity extends BaseActivity {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_lab);
|
||||
//h5测试地址
|
||||
findViewById(R.id.rb_h5_test).setOnClickListener(v -> CommonWebViewActivity.start(context, "http://192.168.10.7:5503/"));
|
||||
//vue测试地址
|
||||
findViewById(R.id.rb_vue_test).setOnClickListener(v -> CommonWebViewActivity.start(context, "http://192.168.10.7:8080/"));
|
||||
findViewById(R.id.rb_flutter_test).setOnClickListener(v -> FlutterBoost.instance().open("/", null));
|
||||
int enviroment = CommonPref.instance(BasicConfig.INSTANCE.getAppContext()).getInt(Env.KEY_ENVIRONMENT);
|
||||
findViewById(R.id.rb_vap_test).setOnClickListener(v ->
|
||||
ImageLoadUtils.loadVAP(
|
||||
findViewById(R.id.anim_vap_test),
|
||||
"http://img.uat.lecheng163.com/mask_trunk_demo.mp4")
|
||||
);
|
||||
|
||||
//根据ID找到RadioGroup实例
|
||||
RadioGroup group = (RadioGroup) this.findViewById(R.id.radioGroup);
|
||||
RadioButton rbRelease = (RadioButton) findViewById(R.id.rb_release);
|
||||
|
@@ -4,6 +4,7 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import android.text.TextUtils;
|
||||
@@ -18,17 +19,28 @@ import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestListener;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.target.CustomViewTarget;
|
||||
import com.bumptech.glide.request.target.SimpleTarget;
|
||||
import com.bumptech.glide.request.target.Target;
|
||||
import com.bumptech.glide.request.target.ViewTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.netease.nim.uikit.common.util.string.StringUtil;
|
||||
import com.netease.nim.uikit.support.glide.GlideApp;
|
||||
import com.tencent.qgame.animplayer.AnimConfig;
|
||||
import com.tencent.qgame.animplayer.AnimView;
|
||||
import com.tencent.qgame.animplayer.inter.IAnimListener;
|
||||
import com.tencent.qgame.animplayer.util.ScaleType;
|
||||
import com.yizhuan.erban.R;
|
||||
import com.yizhuan.erban.ui.widget.magicindicator.buildins.UIUtil;
|
||||
import com.yizhuan.erban.utils.BlurTransformation;
|
||||
import com.yizhuan.xchat_android_core.utils.LogUtils;
|
||||
import com.yizhuan.xchat_android_core.utils.SystemUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.codec.MD5Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import io.reactivex.Single;
|
||||
|
||||
@@ -504,4 +516,37 @@ public class ImageLoadUtils {
|
||||
return getCustomSizeUrl(url, 150);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载VAP动画
|
||||
* test url http://img.uat.lecheng163.com/mask_trunk_demo.mp4
|
||||
*
|
||||
* @param animView
|
||||
* @param vapUrl
|
||||
*/
|
||||
public static void loadVAP(AnimView animView, String vapUrl) {
|
||||
GlideApp.with(animView)
|
||||
.asFile()
|
||||
.dontTransform()
|
||||
.load(vapUrl)
|
||||
.into(new CustomTarget<File>() {
|
||||
@Override
|
||||
public void onResourceReady(@NonNull File resource, @Nullable Transition<? super File> transition) {
|
||||
animView.setScaleType(ScaleType.FIT_CENTER);
|
||||
animView.startPlay(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed(@Nullable Drawable errorDrawable) {
|
||||
super.onLoadFailed(errorDrawable);
|
||||
LogUtils.d("onLoadFailed");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,75 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="您选择的环境是:"
|
||||
android:textSize="9pt" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="性别">
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="您选择的环境是:"
|
||||
android:textSize="9pt" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_release"
|
||||
<RadioGroup
|
||||
android:id="@+id/radioGroup"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="正式环境" />
|
||||
android:contentDescription="性别">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_staging"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="预发布环境" />
|
||||
<RadioButton
|
||||
android:id="@+id/rb_release"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="正式环境" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_debug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="测试环境" />
|
||||
<RadioButton
|
||||
android:id="@+id/rb_staging"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="预发布环境" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_debug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="测试环境" />
|
||||
|
||||
</RadioGroup>
|
||||
</RadioGroup>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rb_h5_test"
|
||||
<TextView
|
||||
android:id="@+id/rb_flutter_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/color_f5f5f5"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:text="flutter测试入口"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rb_vap_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/color_f5f5f5"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:text="vap测试"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.tencent.qgame.animplayer.AnimView
|
||||
android:id="@+id/anim_vap_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:text="h5测试入口"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/color_f5f5f5"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
<TextView
|
||||
android:id="@+id/rb_vue_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:text="vue测试入口"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/color_f5f5f5"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
<TextView
|
||||
android:id="@+id/rb_flutter_test"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="10dp"
|
||||
android:text="flutter测试入口"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/color_f5f5f5"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
|
Reference in New Issue
Block a user