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
f0b62a35
Commit
f0b62a35
authored
Apr 21, 2022
by
郑娜伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 1.1.3
parent
333b2c7d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
14 deletions
+47
-14
build.gradle
app/build.gradle
+2
-2
MainActivity.java
app/src/main/java/com/sobot/moduletest/MainActivity.java
+28
-2
aa.png
app/src/main/res/drawable-xxhdpi/aa.png
+0
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+4
-5
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotBaseActivity.java
...main/java/com/sobot/common/ui/base/SobotBaseActivity.java
+12
-4
No files found.
app/build.gradle
View file @
f0b62a35
...
...
@@ -34,8 +34,8 @@ dependencies {
implementation
'com.android.support:recyclerview-v7:28.0.0'
implementation
project
(
':sobot_common'
)
//
implementation project(':sobot_widget')
implementation
'com.sobot.library:widget:0.2
'
implementation
project
(
':sobot_widget'
)
// implementation 'com.sobot.library:widget:0.3
'
// api 'com.sobot.library:sobotcommon:1.0'
// api 'com.sobot.library:sobotcommon_x:1.0'
...
...
app/src/main/java/com/sobot/moduletest/MainActivity.java
View file @
f0b62a35
...
...
@@ -3,6 +3,7 @@ package com.sobot.moduletest;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.widget.ImageView
;
...
...
@@ -11,14 +12,18 @@ import com.sobot.common.ui.base.SobotBaseActivity;
import
com.sobot.common.ui.toast.SobotToastUtil
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotImageUtils
;
import
com.sobot.network.http.HttpUtils
;
import
com.sobot.network.http.db.SobotDownloadManager
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotSDCardUtils
;
import
com.sobot.widget.image.photoview.SobotPhotoView
;
import
com.sobot.widget.loading.SobotLoadingLayout
;
import
com.sobot.widget.refresh.layout.api.RefreshLayout
;
import
com.sobot.widget.refresh.layout.footer.ClassicsFooter
;
import
com.sobot.widget.refresh.layout.header.ClassicsHeader
;
import
java.io.File
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -27,9 +32,10 @@ import static com.sobot.common.ui.SobotBaseConstant.REQUEST_CODE_PICTURE;
public
class
MainActivity
extends
SobotBaseActivity
{
private
ImageView
img
;
private
Image
View
img2
;
private
SobotPhoto
View
img2
;
private
SobotLoadingLayout
loadinglayout
;
@Override
protected
int
getContentViewResId
()
{
return
R
.
layout
.
activity_main
;
...
...
@@ -44,7 +50,27 @@ public class MainActivity extends SobotBaseActivity {
img
=
findViewById
(
R
.
id
.
img
);
SobotBitmapUtil
.
display
(
this
,
"https://img.sobot.com/console/common/face/admin.png"
,
img
,
R
.
mipmap
.
ic_launcher
,
R
.
mipmap
.
ic_launcher
);
img2
=
findViewById
(
R
.
id
.
img2
);
SobotBitmapUtil
.
display
(
this
,
R
.
mipmap
.
ic_launcher
,
img2
);
// img2.setScaleType(ImageView.ScaleType.FIT_XY);
// SobotBitmapUtil.display(this,"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg",img2);
File
save
=
new
File
(
SobotSDCardUtils
.
getSDCardRootPath
(
MainActivity
.
this
)+
"/9410b53be86b4d589c61c60f6aee2461.jpeg"
);
HttpUtils
.
getInstance
().
download
(
"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg"
,
save
,
new
HttpUtils
.
FileCallBack
()
{
@Override
public
void
onResponse
(
File
result
)
{
Bitmap
bitmap
=
SobotBitmapUtil
.
compress
(
result
.
getPath
(),
MainActivity
.
this
,
true
);
img2
.
setImageBitmap
(
bitmap
);
}
@Override
public
void
onError
(
Exception
e
,
String
msg
,
int
responseCode
)
{
SobotLogUtils
.
i
(
"下载失败:"
+
msg
);
}
@Override
public
void
inProgress
(
int
progress
)
{
SobotLogUtils
.
i
(
"下载进度:"
+
progress
);
}
});
SobotDownloadManager
.
getInstance
().
get
(
"sdfsdfds"
);
...
...
app/src/main/res/drawable-xxhdpi/aa.png
0 → 100644
View file @
f0b62a35
774 KB
app/src/main/res/layout/activity_main.xml
View file @
f0b62a35
...
...
@@ -14,10 +14,10 @@
android:layout_width=
"60dp"
android:layout_height=
"60dp"
/>
<
Image
View
<
com.sobot.widget.image.photoview.SobotPhoto
View
android:id=
"@+id/img2"
android:layout_width=
"
60dp
"
android:layout_height=
"
60dp"
/>
android:layout_width=
"
match_parent
"
android:layout_height=
"
wrap_content"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -32,8 +32,7 @@
<com.sobot.widget.loading.SobotLoadingLayout
android:id=
"@+id/loadinglayout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:llEmptyImage=
"@drawable/ic_launcher_background"
>
android:layout_height=
"match_parent"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
...
...
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
f0b62a35
...
...
@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon'
//项目名
// PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名
PUBLISH_VERSION
=
'1.1.
2
'
//版本号
PUBLISH_VERSION
=
'1.1.
3
'
//版本号
}
...
...
sobot_common/src/main/java/com/sobot/common/ui/base/SobotBaseActivity.java
View file @
f0b62a35
...
...
@@ -217,10 +217,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
* @param textId
* @param isShow
*/
protected
void
showRightMenu
(
int
resourceId
,
String
textId
,
boolean
isShow
)
{
protected
TextView
showRightMenu
(
int
resourceId
,
String
textId
,
boolean
isShow
,
View
.
OnClickListener
clickListener
)
{
View
tmpMenu
=
getRightMenu
();
if
(
tmpMenu
==
null
||
!(
tmpMenu
instanceof
TextView
))
{
return
;
return
null
;
}
TextView
rightMenu
=
(
TextView
)
tmpMenu
;
if
(!
TextUtils
.
isEmpty
(
textId
))
{
...
...
@@ -242,6 +242,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
}
else
{
rightMenu
.
setVisibility
(
View
.
GONE
);
}
if
(
clickListener
!=
null
)
{
rightMenu
.
setOnClickListener
(
clickListener
);
}
return
rightMenu
;
}
/**
...
...
@@ -249,10 +253,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
* @param textId
* @param isShow
*/
protected
void
showLeftMenu
(
int
resourceId
,
String
textId
,
boolean
isShow
)
{
protected
TextView
showLeftMenu
(
int
resourceId
,
String
textId
,
boolean
isShow
,
View
.
OnClickListener
clickListener
)
{
View
tmpMenu
=
getLeftMenu
();
if
(
tmpMenu
==
null
||
!(
tmpMenu
instanceof
TextView
))
{
return
;
return
null
;
}
TextView
leftMenu
=
(
TextView
)
tmpMenu
;
if
(!
TextUtils
.
isEmpty
(
textId
))
{
...
...
@@ -274,6 +278,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
}
else
{
leftMenu
.
setVisibility
(
View
.
GONE
);
}
if
(
clickListener
!=
null
)
{
leftMenu
.
setOnClickListener
(
clickListener
);
}
return
leftMenu
;
}
@Override
...
...
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