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
45395773
Commit
45395773
authored
Jan 04, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widget 1.1.6 支持picasso 加载本地图片
parent
0bc403d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
sobot-picture-publish-mavencentral.gradle
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
+1
-1
SobotPicassoImageLoader.java
.../java/com/sobot/pictureframe/SobotPicassoImageLoader.java
+14
-1
No files found.
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
View file @
45395773
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'picture_x'
//项目名
PUBLISH_ARTIFACT_ID
=
'picture_x'
//项目名
PUBLISH_VERSION
=
'1.1.
5
'
//版本号
PUBLISH_VERSION
=
'1.1.
6
'
//版本号
}
}
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotPicassoImageLoader.java
View file @
45395773
...
@@ -10,6 +10,8 @@ import com.squareup.picasso.Callback;
...
@@ -10,6 +10,8 @@ import com.squareup.picasso.Callback;
import
com.squareup.picasso.Picasso
;
import
com.squareup.picasso.Picasso
;
import
com.squareup.picasso.RequestCreator
;
import
com.squareup.picasso.RequestCreator
;
import
java.io.File
;
/**
/**
* 图片加载器 Picasso
* 图片加载器 Picasso
*/
*/
...
@@ -21,7 +23,18 @@ public class SobotPicassoImageLoader extends SobotImageLoader {
...
@@ -21,7 +23,18 @@ public class SobotPicassoImageLoader extends SobotImageLoader {
if
(
TextUtils
.
isEmpty
(
path
))
{
if
(
TextUtils
.
isEmpty
(
path
))
{
pathStr
=
"error"
;
pathStr
=
"error"
;
}
}
RequestCreator
creator
=
Picasso
.
with
(
context
).
load
(
pathStr
);
RequestCreator
creator
;
if
(
pathStr
.
startsWith
(
"http"
))
{
creator
=
Picasso
.
with
(
context
).
load
(
pathStr
);
}
else
{
//本地文件
File
file
=
new
File
(
pathStr
);
if
(
file
!=
null
)
{
creator
=
Picasso
.
with
(
context
).
load
(
file
);
}
else
{
creator
=
Picasso
.
with
(
context
).
load
(
pathStr
);
}
}
if
(
loadingResId
!=
0
)
{
if
(
loadingResId
!=
0
)
{
creator
.
placeholder
(
loadingResId
);
creator
.
placeholder
(
loadingResId
);
}
}
...
...
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