Commit 1ead59d1 by yang.kai

feat: ydl-platform升级引入fresco图片加载库,加载webp动态图,修改首页咨询弹窗ui

parent f6da08cb
......@@ -7,6 +7,7 @@ import android.os.Process;
import androidx.multidex.MultiDex;
import android.webkit.WebView;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.meituan.android.walle.WalleChannelReader;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
......@@ -58,6 +59,8 @@ public class ComponentTestApp extends BaseApp {
initUmeng();
registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Fresco.initialize(this);
}
private void initUmeng() {
......
......@@ -33,7 +33,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.83",
//第二步 若干
"ydl-webview" : "0.0.38.58",
......@@ -76,6 +76,7 @@ ext {
retrofitSdkVersion : "2.6.0",
dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2",
......@@ -115,7 +116,7 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.79",
"ydl-platform" : "0.0.40.83",
//第二步 若干
"ydl-webview" : "0.0.38.58",
......@@ -155,7 +156,11 @@ ext {
"glide-loader-okhttp3" : "com.github.bumptech.glide:okhttp3-integration:${version["glideSdkVersion"]}",
"glide-annotations" : "com.github.bumptech.glide:annotations:${version["glideSdkVersion"]}",
"glide-transformations" : "jp.wasabeef:glide-transformations:4.3.0",
"picasso" : "com.squareup.picasso:picasso:2.5.2",
// "picasso" : "com.squareup.picasso:picasso:2.5.2",
"fresco" : "com.facebook.fresco:fresco:${version["frescoSdkVersion"]}",
// 支持 WebP (静态图+动图),需要添加
"fresco-animated-webp" : "com.facebook.fresco:animated-webp:${version["frescoSdkVersion"]}",
"fresco-webpsupport" : "com.facebook.fresco:webpsupport:${version["frescoSdkVersion"]}",
//view
"autolayout" : "com.zhy:autolayout:1.4.5",
......
......@@ -5,17 +5,25 @@ import android.animation.Animator
import android.animation.ObjectAnimator
import android.app.Dialog
import android.content.Context
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.drawee.interfaces.DraweeController
import com.facebook.imagepipeline.common.ResizeOptions
import com.facebook.imagepipeline.common.RotationOptions
import com.facebook.imagepipeline.postprocessors.IterativeBoxBlurPostProcessor
import com.facebook.imagepipeline.request.ImageRequest
import com.facebook.imagepipeline.request.ImageRequestBuilder
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.R
import com.yidianling.consultant.modular.singlton.ConsultAssistantDialogUtils
import kotlinx.android.synthetic.main.consultant_expert_consult_assistant_popup_window.*
/**
* 咨询助理浮层
* Created by xj on 2019/10/30.
......@@ -92,6 +100,16 @@ class ConsultAssistantDialog(
})
}
val controller: DraweeController = Fresco.newDraweeControllerBuilder()
.setUri(Uri.parse("res://drawable/"+R.drawable.consultant_assistant_dialog_img))
.setOldController(consultant_assistant.controller)
.setAutoPlayAnimations(true) // 是否自动播放Gif动画
.build()
consultant_assistant.controller = controller
consultant_assistant.setOnClickListener {
consultAssistantClickListener?.onClickAction()
}
......
......@@ -10,17 +10,17 @@
android:layout_height="84dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:layout_marginRight="22dp"
android:clipChildren="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingRight="25dp"
android:paddingBottom="40dp">
>
<LinearLayout
android:id="@+id/consultant_assistant_dialog_desc_ll"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="47dp"
android:layout_marginTop="4dp"
android:background="@drawable/consultant_assistant_dialog_text_bg"
android:gravity="center">
......@@ -78,14 +78,13 @@
</LinearLayout>
<ImageView
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/consultant_assistant"
android:layout_width="61dp"
android:layout_height="101dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/consultant_assistant_dialog_img"
android:paddingBottom="40dp" />
</RelativeLayout>
\ No newline at end of file
......@@ -136,6 +136,9 @@ dependencies {
kapt rootProject.ext.dependencies["glide-compiler"]
api rootProject.ext.dependencies["glide"]
api rootProject.ext.dependencies["glide-transformations"]
api rootProject.ext.dependencies["fresco"]
api rootProject.ext.dependencies["fresco-animated-webp"]
api rootProject.ext.dependencies["fresco-webpsupport"]
api rootProject.ext.dependencies["constraint-layout"]
api rootProject.ext.dependencies["cube"]
api rootProject.ext.dependencies["support-multidex"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment