Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sobot_android
Sobot_module_Dev
Commits
c9ee982d
Commit
c9ee982d
authored
Sep 23, 2022
by
郑娜伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture 支持fresco
parent
27207957
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
9 deletions
+11
-9
build.gradle
app/build.gradle
+1
-0
MyApp.java
app/src/main/java/com/sobot/moduletest/MyApp.java
+2
-0
build.gradle
sobot_pictureframe/build.gradle
+1
-1
sobot-picture-publish-mavencentral.gradle
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
+1
-1
SobotFrescoImageLoader.java
...n/java/com/sobot/pictureframe/SobotFrescoImageLoader.java
+6
-7
No files found.
app/build.gradle
View file @
c9ee982d
...
...
@@ -41,6 +41,7 @@ dependencies {
implementation
'com.github.bumptech.glide:glide:4.9.0'
implementation
'com.sobot.chat:sobotsupport-glidev4:2.1'
// implementation 'com.facebook.fresco:fresco:1.13.0'
implementation
'com.squareup.okhttp3:okhttp:4.4.0'
//添加此行
...
...
app/src/main/java/com/sobot/moduletest/MyApp.java
View file @
c9ee982d
...
...
@@ -3,6 +3,7 @@ package com.sobot.moduletest;
import
android.app.Application
;
import
android.support.multidex.MultiDex
;
import
com.facebook.drawee.backends.pipeline.Fresco
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.utils.SobotCommonApi
;
...
...
@@ -16,6 +17,7 @@ public class MyApp extends Application {
@Override
public
void
onCreate
()
{
super
.
onCreate
();
Fresco
.
initialize
(
this
);
// 主要是添加下面这句代码
MultiDex
.
install
(
this
);
SobotCommonApi
.
init
(
this
,
"https://sobot.com"
);
...
...
sobot_pictureframe/build.gradle
View file @
c9ee982d
...
...
@@ -31,7 +31,7 @@ dependencies {
compileOnly
'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compileOnly
'com.github.bumptech.glide:glide:3.8.0'
compileOnly
'com.squareup.picasso:picasso:2.5.2'
compileOnly
'com.facebook.fresco:fresco:
2.6
.0'
compileOnly
'com.facebook.fresco:fresco:
1.13
.0'
api
'com.sobot.chat:sobotsupport-glidev4:2.0'
}
...
...
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
View file @
c9ee982d
...
...
@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'picture'
//项目名
//PUBLISH_ARTIFACT_ID = 'picture_x' //项目名
PUBLISH_VERSION
=
'1.1'
//版本号
PUBLISH_VERSION
=
'1.1
.1
'
//版本号
}
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotFrescoImageLoader.java
View file @
c9ee982d
...
...
@@ -35,7 +35,6 @@ public class SobotFrescoImageLoader extends SobotImageLoader {
BaseBitmapDataSubscriber
subscriber
=
new
BaseBitmapDataSubscriber
()
{
@Override
public
void
onNewResultImpl
(
@Nullable
Bitmap
bitmap
)
{
// if (listener != null) {
new
AsyncTask
<
Bitmap
,
Void
,
Bitmap
>()
{
@Override
protected
Bitmap
doInBackground
(
Bitmap
...
params
)
{
...
...
@@ -50,10 +49,8 @@ public class SobotFrescoImageLoader extends SobotImageLoader {
@Override
protected
void
onPostExecute
(
Bitmap
bitmap
)
{
if
(
bitmap
!=
null
)
{
// listener.onLoadComplete(bitmap);
imageView
.
setImageBitmap
(
bitmap
);
}
else
{
// listener.onLoadFailed(null);
}
}
}.
execute
(
bitmap
);
...
...
@@ -62,9 +59,6 @@ public class SobotFrescoImageLoader extends SobotImageLoader {
@Override
public
void
onFailureImpl
(
DataSource
dataSource
)
{
// if (listener != null) {
// listener.onLoadFailed(dataSource.getFailureCause());
// }
}
};
...
...
@@ -73,6 +67,11 @@ public class SobotFrescoImageLoader extends SobotImageLoader {
@Override
public
void
displayImage
(
Context
context
,
final
ImageView
imageView
,
@DrawableRes
int
targetResId
,
@DrawableRes
int
loadingResId
,
@DrawableRes
int
failResId
,
int
width
,
int
height
,
final
SobotDisplayImageListener
listener
)
{
try
{
if
(
imageView
!=
null
)
{
imageView
.
setBackgroundResource
(
targetResId
);
}
}
catch
(
Exception
e
)
{
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment