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
fceb9d4d
Commit
fceb9d4d
authored
Jan 04, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widget 1.1.6 支持picasso 加载本地图片
parent
7750ced8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
5 deletions
+18
-5
build.gradle
sobot_pictureframe/build.gradle
+3
-3
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/build.gradle
View file @
fceb9d4d
...
@@ -3,7 +3,7 @@ plugins {
...
@@ -3,7 +3,7 @@ plugins {
}
}
android
{
android
{
compileSdkVersion
29
compileSdkVersion
33
defaultConfig
{
defaultConfig
{
minSdkVersion
14
minSdkVersion
14
...
@@ -11,7 +11,7 @@ android {
...
@@ -11,7 +11,7 @@ android {
//这里就是打jar包
//这里就是打jar包
task
makeJar
(
type:
Copy
)
{
task
makeJar
(
type:
Copy
)
{
//删除旧的jar包
//删除旧的jar包
delete
'build/libs/sobot_picture_1.1.
4
.jar'
delete
'build/libs/sobot_picture_1.1.
6
.jar'
//原地址
//原地址
from
(
'build/intermediates/packaged-classes/release/'
)
from
(
'build/intermediates/packaged-classes/release/'
)
//导出jar包的地址
//导出jar包的地址
...
@@ -19,7 +19,7 @@ android {
...
@@ -19,7 +19,7 @@ android {
//包含的jar包
//包含的jar包
include
(
'classes.jar'
)
include
(
'classes.jar'
)
//重命名jar包为mysdk
//重命名jar包为mysdk
rename
(
'classes.jar'
,
'sobot_picture_1.1.
4
.jar'
)
rename
(
'classes.jar'
,
'sobot_picture_1.1.
6
.jar'
)
}
}
makeJar
.
dependsOn
(
build
)
makeJar
.
dependsOn
(
build
)
...
...
sobot_pictureframe/sobot-picture-publish-mavencentral.gradle
View file @
fceb9d4d
...
@@ -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.
5
'
//版本号
PUBLISH_VERSION
=
'1.1.
6
'
//版本号
}
}
...
...
sobot_pictureframe/src/main/java/com/sobot/pictureframe/SobotPicassoImageLoader.java
View file @
fceb9d4d
...
@@ -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