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
7c037268
Commit
7c037268
authored
Oct 08, 2023
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pic 加载图片 path 不能为空 null
parent
9666a013
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
sobot-picture-publish-mavencentral.gradle
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
+1
-1
SobotFrescoImageLoader.java
...n/java/com/sobot/pictureframe/SobotFrescoImageLoader.java
+7
-0
SobotGlideImageLoader.java
...in/java/com/sobot/pictureframe/SobotGlideImageLoader.java
+7
-0
No files found.
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
View file @
7c037268
...
@@ -13,7 +13,7 @@ ext {
...
@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'picture'
//项目名
PUBLISH_ARTIFACT_ID
=
'picture'
//项目名
//PUBLISH_ARTIFACT_ID = 'picture_x' //项目名
//PUBLISH_ARTIFACT_ID = 'picture_x' //项目名
PUBLISH_VERSION
=
'1.1.
4
'
//版本号
PUBLISH_VERSION
=
'1.1.
5
'
//版本号
}
}
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotFrescoImageLoader.java
View file @
7c037268
...
@@ -6,6 +6,7 @@ import android.net.Uri;
...
@@ -6,6 +6,7 @@ import android.net.Uri;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.text.TextUtils
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.facebook.common.executors.UiThreadImmediateExecutorService
;
import
com.facebook.common.executors.UiThreadImmediateExecutorService
;
...
@@ -23,6 +24,12 @@ import com.sobot.chat.imageloader.SobotImageLoader;
...
@@ -23,6 +24,12 @@ import com.sobot.chat.imageloader.SobotImageLoader;
public
class
SobotFrescoImageLoader
extends
SobotImageLoader
{
public
class
SobotFrescoImageLoader
extends
SobotImageLoader
{
@Override
@Override
public
void
displayImage
(
Context
context
,
final
ImageView
imageView
,
final
String
path
,
@DrawableRes
int
loadingResId
,
@DrawableRes
int
failResId
,
int
width
,
int
height
,
final
SobotDisplayImageListener
listener
)
{
public
void
displayImage
(
Context
context
,
final
ImageView
imageView
,
final
String
path
,
@DrawableRes
int
loadingResId
,
@DrawableRes
int
failResId
,
int
width
,
int
height
,
final
SobotDisplayImageListener
listener
)
{
if
(
TextUtils
.
isEmpty
(
path
)
||
"null"
.
equals
(
path
))
{
return
;
}
if
(
imageView
==
null
)
{
return
;
}
ImageRequestBuilder
builder
=
ImageRequestBuilder
.
newBuilderWithSource
(
Uri
.
parse
(
path
));
ImageRequestBuilder
builder
=
ImageRequestBuilder
.
newBuilderWithSource
(
Uri
.
parse
(
path
));
if
(
width
>
0
&&
height
>
0
)
{
if
(
width
>
0
&&
height
>
0
)
{
builder
.
setResizeOptions
(
new
ResizeOptions
(
width
,
height
));
builder
.
setResizeOptions
(
new
ResizeOptions
(
width
,
height
));
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotGlideImageLoader.java
View file @
7c037268
...
@@ -3,6 +3,7 @@ package com.sobot.pictureframe;
...
@@ -3,6 +3,7 @@ package com.sobot.pictureframe;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.DrawableRes
;
import
android.text.TextUtils
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.bumptech.glide.BitmapRequestBuilder
;
import
com.bumptech.glide.BitmapRequestBuilder
;
...
@@ -18,6 +19,12 @@ public class SobotGlideImageLoader extends SobotImageLoader {
...
@@ -18,6 +19,12 @@ public class SobotGlideImageLoader extends SobotImageLoader {
@Override
@Override
public
void
displayImage
(
Context
context
,
final
ImageView
imageView
,
final
String
path
,
@DrawableRes
int
loadingResId
,
@DrawableRes
int
failResId
,
int
width
,
int
height
,
final
SobotDisplayImageListener
listener
)
{
public
void
displayImage
(
Context
context
,
final
ImageView
imageView
,
final
String
path
,
@DrawableRes
int
loadingResId
,
@DrawableRes
int
failResId
,
int
width
,
int
height
,
final
SobotDisplayImageListener
listener
)
{
if
(
TextUtils
.
isEmpty
(
path
)
||
"null"
.
equals
(
path
))
{
return
;
}
if
(
imageView
==
null
)
{
return
;
}
BitmapRequestBuilder
<
String
,
Bitmap
>
builder
=
Glide
.
with
(
context
).
load
(
path
).
asBitmap
().
placeholder
(
loadingResId
).
error
(
failResId
);
BitmapRequestBuilder
<
String
,
Bitmap
>
builder
=
Glide
.
with
(
context
).
load
(
path
).
asBitmap
().
placeholder
(
loadingResId
).
error
(
failResId
);
if
(
width
!=
0
||
height
!=
0
)
{
if
(
width
!=
0
||
height
!=
0
)
{
builder
.
override
(
width
,
height
);
builder
.
override
(
width
,
height
);
...
...
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