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
d425081c
Commit
d425081c
authored
Dec 15, 2021
by
app_dev@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sobot common 0.6
parent
440b8dd5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
54 additions
and
92 deletions
+54
-92
MainActivity.java
app/src/main/java/com/sobot/moduletest/MainActivity.java
+17
-8
MyApp.java
app/src/main/java/com/sobot/moduletest/MyApp.java
+2
-4
colors.xml
app/src/main/res/values/colors.xml
+5
-0
build.gradle
sobot_common/build.gradle
+3
-3
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
+24
-68
SobotPermissionDialog.java
...com/sobot/common/ui/permission/SobotPermissionDialog.java
+1
-1
SobotCommonApi.java
.../src/main/java/com/sobot/common/utils/SobotCommonApi.java
+1
-6
SobotCommonUtils.java
...rc/main/java/com/sobot/common/utils/SobotCommonUtils.java
+0
-1
No files found.
app/src/main/java/com/sobot/moduletest/MainActivity.java
View file @
d425081c
...
@@ -4,17 +4,15 @@ package com.sobot.moduletest;
...
@@ -4,17 +4,15 @@ package com.sobot.moduletest;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.ui.base.SobotBaseActivity
;
import
com.sobot.common.ui.base.SobotBaseActivity
;
import
com.sobot.common.ui.toast.SobotToastUtil
;
import
com.sobot.common.ui.toast.SobotToastUtil
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.Sobot
Common
Utils
;
import
com.sobot.common.utils.Sobot
Image
Utils
;
import
com.sobot.network.http.HttpUtils
;
import
com.sobot.network.http.HttpUtils
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.pictureframe.SobotBitmapUtil
;
import
com.sobot.utils.SobotImageUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -44,8 +42,19 @@ public class MainActivity extends SobotBaseActivity {
...
@@ -44,8 +42,19 @@ public class MainActivity extends SobotBaseActivity {
SobotBitmapUtil
.
display
(
this
,
R
.
mipmap
.
ic_launcher
,
img2
);
SobotBitmapUtil
.
display
(
this
,
R
.
mipmap
.
ic_launcher
,
img2
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"appId"
,
"1c1da2c0aad047d7ba1d14ecd18ae4f6"
);
map
.
put
(
"number"
,
"142160000"
);
HttpUtils
.
getInstance
().
doPost
(
this
,
"https://api.sobot.com/chat-sdk/sdk/user/v1/getCategoryList.action"
,
map
,
null
,
new
HttpUtils
.
StringCallBack
()
{
map
.
put
(
"companyId"
,
"1eae128b7e394aedafd28828bfa84767"
);
map
.
put
(
"agentId"
,
"969a7ee9fd4c42f48171b0128df2f16c"
);
map
.
put
(
"displayNumber"
,
"01051393569"
);
map
.
put
(
"callWay"
,
"2"
);
map
.
put
(
"isRecordStereo"
,
"false"
);
map
.
put
(
"agentState"
,
"1"
);
map
.
put
(
"appId"
,
"a4b246c8b67e4543b3b870ce62f75546"
);
map
.
put
(
"groupId"
,
"36b0f8eb2de948d99e89c8f0c3d92e68_5"
);
map
.
put
(
"agentPhoneNum"
,
"18600978969"
);
HttpUtils
.
getInstance
().
doPostByJsonString
(
this
,
"https://sobot.com/comm/api/4/call/agentOnWork?access_token=c273b74c-3b37-48cf-937f-9c46940cc19d"
,
map
,
null
,
new
HttpUtils
.
StringCallBack
()
{
@Override
@Override
public
void
onResponse
(
String
result
)
{
public
void
onResponse
(
String
result
)
{
SobotLogUtils
.
i
(
result
);
SobotLogUtils
.
i
(
result
);
...
@@ -63,14 +72,14 @@ public class MainActivity extends SobotBaseActivity {
...
@@ -63,14 +72,14 @@ public class MainActivity extends SobotBaseActivity {
});
});
// selectPicFromLocal();
// selectPicFromLocal();
// selectVedioFromLocal();
// selectVedioFromLocal();
openCamera
();
//
openCamera();
}
}
@Override
@Override
protected
void
initData
()
{
protected
void
initData
()
{
}
}
@Override
@Override
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
public
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
try
{
try
{
...
@@ -90,7 +99,7 @@ public class MainActivity extends SobotBaseActivity {
...
@@ -90,7 +99,7 @@ public class MainActivity extends SobotBaseActivity {
}
}
}
}
if
(
cameraFile
!=
null
&&
cameraFile
.
exists
())
{
if
(
cameraFile
!=
null
&&
cameraFile
.
exists
())
{
SobotLogUtils
.
i
(
"相机拍照:"
+
cameraFile
.
toString
());
SobotLogUtils
.
i
(
"相机拍照:"
+
cameraFile
.
toString
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
app/src/main/java/com/sobot/moduletest/MyApp.java
View file @
d425081c
...
@@ -2,10 +2,9 @@ package com.sobot.moduletest;
...
@@ -2,10 +2,9 @@ package com.sobot.moduletest;
import
android.app.Application
;
import
android.app.Application
;
import
com.sobot.
network.apiUtils.SobotHttpUtils
;
import
com.sobot.
common.utils.SobotCommonApi
;
import
com.sobot.network.http.log.SobotNetLogUtils
;
import
com.sobot.network.http.log.SobotNetLogUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotUtils
;
/**
/**
* @Description: java类作用描述
* @Description: java类作用描述
...
@@ -17,8 +16,7 @@ public class MyApp extends Application {
...
@@ -17,8 +16,7 @@ public class MyApp extends Application {
@Override
@Override
public
void
onCreate
()
{
public
void
onCreate
()
{
super
.
onCreate
();
super
.
onCreate
();
SobotUtils
.
init
(
this
);
SobotCommonApi
.
init
(
this
);
SobotHttpUtils
.
init
(
this
);
SobotNetLogUtils
.
setShowDebug
(
true
);
SobotNetLogUtils
.
setShowDebug
(
true
);
SobotLogUtils
.
setShowDebug
(
true
);
SobotLogUtils
.
setShowDebug
(
true
);
...
...
app/src/main/res/values/colors.xml
View file @
d425081c
...
@@ -3,4 +3,8 @@
...
@@ -3,4 +3,8 @@
<color
name=
"colorPrimary"
>
#3F51B5
</color>
<color
name=
"colorPrimary"
>
#3F51B5
</color>
<color
name=
"colorPrimaryDark"
>
#303F9F
</color>
<color
name=
"colorPrimaryDark"
>
#303F9F
</color>
<color
name=
"colorAccent"
>
#FF4081
</color>
<color
name=
"colorAccent"
>
#FF4081
</color>
<color
name=
"sobot_status_bar_color"
>
#FF4081
</color>
<color
name=
"sobot_color_title_bar_bg"
>
#FF4081
</color>
</resources>
</resources>
\ No newline at end of file
sobot_common/build.gradle
View file @
d425081c
...
@@ -13,14 +13,14 @@ android {
...
@@ -13,14 +13,14 @@ android {
dependencies
{
dependencies
{
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
api
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compileOnly
'com.squareup.okhttp3:okhttp:3.12.0'
compileOnly
'com.squareup.okhttp3:okhttp:3.12.0'
compileOnly
'com.android.support:
support-v4
:28.0.0'
compileOnly
'com.android.support:
appcompat-v7
:28.0.0'
// api project(':sobot_utils')
// api project(':sobot_utils')
// api project(':sobot_pictureframe')
// api project(':sobot_pictureframe')
// api project(':sobot_network')
// api project(':sobot_network')
// api project(':sobot_gson')
// api project(':sobot_gson')
api
'com.sobot.library:utils:1.0.
1
'
api
'com.sobot.library:utils:1.0.
4
'
api
'com.sobot.library:picture:1.0.1'
api
'com.sobot.library:picture:1.0.1'
api
'com.sobot.library:net:1.0.
1
'
api
'com.sobot.library:net:1.0.
3
'
api
'com.sobot.library:gson:0.1'
api
'com.sobot.library:gson:0.1'
}
}
...
...
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
d425081c
...
@@ -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
=
'sobotcommon'
//项目名
PUBLISH_ARTIFACT_ID
=
'sobotcommon'
//项目名
PUBLISH_VERSION
=
'0.
2
'
//版本号
PUBLISH_VERSION
=
'0.
6
'
//版本号
}
}
...
...
sobot_common/src/main/java/com/sobot/common/ui/base/SobotBaseActivity.java
View file @
d425081c
...
@@ -35,8 +35,8 @@ import com.sobot.common.ui.permission.SobotPermissionTipDialog;
...
@@ -35,8 +35,8 @@ import com.sobot.common.ui.permission.SobotPermissionTipDialog;
import
com.sobot.common.ui.statusbar.SobotStatusBarUtils
;
import
com.sobot.common.ui.statusbar.SobotStatusBarUtils
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotCommonUtils
;
import
com.sobot.common.utils.SobotCommonUtils
;
import
com.sobot.common.utils.SobotGlobalContext
;
import
com.sobot.common.utils.SobotResourceUtils
;
import
com.sobot.common.utils.SobotResourceUtils
;
import
com.sobot.utils.SobotGlobalContext
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotSharedPreferencesUtil
;
import
com.sobot.utils.SobotSharedPreferencesUtil
;
import
com.sobot.utils.SobotSystemUtils
;
import
com.sobot.utils.SobotSystemUtils
;
...
@@ -85,7 +85,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -85,7 +85,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
setUpToolBar
();
setUpToolBar
();
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_HIDDEN
);
SobotGlobalContext
.
getInstance
(
getSobotBaseActivity
()).
addActivity
(
this
);
SobotGlobalContext
.
getInstance
(
getSobotBaseActivity
()).
addActivity
(
this
);
View
toolBar
=
findViewById
(
getResId
(
"sobot_
common_
layout_titlebar"
));
View
toolBar
=
findViewById
(
getResId
(
"sobot_layout_titlebar"
));
if
(
toolBar
!=
null
)
{
if
(
toolBar
!=
null
)
{
setUpToolBarLeftMenu
();
setUpToolBarLeftMenu
();
...
@@ -146,13 +146,6 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -146,13 +146,6 @@ public abstract class SobotBaseActivity extends FragmentActivity {
Configuration
conf
=
new
Configuration
();
Configuration
conf
=
new
Configuration
();
conf
.
locale
=
language
;
conf
.
locale
=
language
;
res
.
updateConfiguration
(
conf
,
dm
);
res
.
updateConfiguration
(
conf
,
dm
);
}
else
{
//清除上次app 语言设置
Resources
res
=
getResources
();
DisplayMetrics
dm
=
res
.
getDisplayMetrics
();
Configuration
conf
=
new
Configuration
();
conf
.
locale
=
null
;
res
.
updateConfiguration
(
conf
,
dm
);
}
}
}
}
...
@@ -277,7 +270,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -277,7 +270,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
@Override
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
SobotGlobalContext
.
getInstance
(
getSobotBaseActivity
()).
delete
Activity
(
this
);
SobotGlobalContext
.
getInstance
(
getSobotBaseActivity
()).
finish
Activity
(
this
);
super
.
onDestroy
();
super
.
onDestroy
();
}
}
...
@@ -462,15 +455,15 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -462,15 +455,15 @@ public abstract class SobotBaseActivity extends FragmentActivity {
return
;
return
;
}
}
}
else
if
(
type
==
2
)
{
}
else
if
(
type
==
2
)
{
if
(!
check
StorageAnd
AudioPermission
())
{
if
(!
checkAudioPermission
())
{
return
;
return
;
}
}
}
else
if
(
type
==
3
)
{
}
else
if
(
type
==
3
)
{
if
(!
check
Storage
AudioAndCameraPermission
())
{
if
(!
checkAudioAndCameraPermission
())
{
return
;
return
;
}
}
}
else
if
(
type
==
4
)
{
}
else
if
(
type
==
4
)
{
if
(!
check
StorageAnd
CameraPermission
())
{
if
(!
checkCameraPermission
())
{
return
;
return
;
}
}
}
}
...
@@ -595,18 +588,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -595,18 +588,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
*
*
* @return true, 已经获取权限;false,没有权限,尝试获取
* @return true, 已经获取权限;false,没有权限,尝试获取
*/
*/
protected
boolean
check
StorageAnd
AudioPermission
()
{
protected
boolean
checkAudioPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
29
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
29
)
{
//分区存储 从andrid10手机开始 TargetSdkVersion >= 29,以下几种情况不需要文件存储权限
}
else
{
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
RECORD_AUDIO
},
SobotBaseConstant
.
SOBOT_CODE_PERMISSIONS_REQUEST
);
return
false
;
}
}
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
RECORD_AUDIO
)
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
RECORD_AUDIO
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
RECORD_AUDIO
},
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
RECORD_AUDIO
},
...
@@ -637,19 +620,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -637,19 +620,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
*
*
* @return true, 已经获取权限;false,没有权限,尝试获取
* @return true, 已经获取权限;false,没有权限,尝试获取
*/
*/
protected
boolean
check
Storage
AudioAndCameraPermission
()
{
protected
boolean
checkAudioAndCameraPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
29
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
29
)
{
//分区存储 从andrid10手机开始 TargetSdkVersion >= 29,不需要文件存储权限
}
else
{
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
,
Manifest
.
permission
.
CAMERA
,
Manifest
.
permission
.
RECORD_AUDIO
}
,
SobotBaseConstant
.
SOBOT_CODE_PERMISSIONS_REQUEST
);
return
false
;
}
}
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
CAMERA
)
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
CAMERA
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
CAMERA
,
Manifest
.
permission
.
RECORD_AUDIO
}
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
CAMERA
,
Manifest
.
permission
.
RECORD_AUDIO
}
...
@@ -687,18 +659,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -687,18 +659,8 @@ public abstract class SobotBaseActivity extends FragmentActivity {
*
*
* @return true, 已经获取权限;false,没有权限,尝试获取
* @return true, 已经获取权限;false,没有权限,尝试获取
*/
*/
protected
boolean
check
StorageAnd
CameraPermission
()
{
protected
boolean
checkCameraPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
23
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
29
&&
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
>=
29
)
{
//分区存储 从andrid10手机开始 TargetSdkVersion >= 29,不需要文件存储权限
}
else
{
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
CAMERA
},
SobotBaseConstant
.
SOBOT_CODE_PERMISSIONS_REQUEST
);
return
false
;
}
}
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
CAMERA
)
if
(
ContextCompat
.
checkSelfPermission
(
getSobotBaseActivity
(),
Manifest
.
permission
.
CAMERA
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
!=
PackageManager
.
PERMISSION_GRANTED
)
{
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
CAMERA
},
this
.
requestPermissions
(
new
String
[]{
Manifest
.
permission
.
CAMERA
},
...
@@ -745,13 +707,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -745,13 +707,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
SobotCommonUtils
.
openSelectPic
(
getSobotBaseActivity
());
SobotCommonUtils
.
openSelectPic
(
getSobotBaseActivity
());
}
}
};
};
if
(
Build
.
VERSION
.
SDK_INT
<
30
||
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
().
getApplicationContext
())
<
30
)
{
if
(
checkIsShowPermissionPop
(
getResString
(
"sobot_memory_card"
),
getResString
(
"sobot_memory_card_yongtu"
),
1
))
{
if
(
checkIsShowPermissionPop
(
getResString
(
"sobot_memory_card"
),
getResString
(
"sobot_memory_card_yongtu"
),
1
))
{
return
;
return
;
}
}
if
(!
checkStoragePermission
())
{
if
(!
checkStoragePermission
())
{
return
;
return
;
}
}
}
SobotCommonUtils
.
openSelectPic
(
this
);
SobotCommonUtils
.
openSelectPic
(
this
);
}
}
...
@@ -777,13 +737,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -777,13 +737,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
SobotCommonUtils
.
openSelectVedio
(
getSobotBaseActivity
());
SobotCommonUtils
.
openSelectVedio
(
getSobotBaseActivity
());
}
}
};
};
if
(
Build
.
VERSION
.
SDK_INT
<
30
||
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
<
30
)
{
if
(
checkIsShowPermissionPop
(
getResString
(
"sobot_memory_card"
),
getResString
(
"sobot_memory_card_yongtu"
),
1
))
{
if
(
checkIsShowPermissionPop
(
getResString
(
"sobot_memory_card"
),
getResString
(
"sobot_memory_card_yongtu"
),
1
))
{
return
;
return
;
}
}
if
(!
checkStoragePermission
())
{
if
(!
checkStoragePermission
())
{
return
;
return
;
}
}
}
SobotCommonUtils
.
openSelectVedio
(
getSobotBaseActivity
());
SobotCommonUtils
.
openSelectVedio
(
getSobotBaseActivity
());
}
}
...
@@ -812,13 +770,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -812,13 +770,11 @@ public abstract class SobotBaseActivity extends FragmentActivity {
}
}
}
}
};
};
if
(
Build
.
VERSION
.
SDK_INT
<
30
||
SobotSystemUtils
.
getTargetSdkVersion
(
getSobotBaseActivity
())
<
30
)
{
if
(
checkIsShowPermissionPop
(
TextUtils
.
isEmpty
(
title
)
?
getResString
(
"sobot_camera"
)
:
title
,
TextUtils
.
isEmpty
(
content
)
?
getResString
(
"sobot_camera_yongtu"
)
:
content
,
4
))
{
if
(
checkIsShowPermissionPop
(
TextUtils
.
isEmpty
(
title
)
?
getResString
(
"sobot_camera"
)
:
title
,
TextUtils
.
isEmpty
(
content
)
?
getResString
(
"sobot_camera_yongtu"
)
:
content
,
4
))
{
return
;
return
;
}
}
if
(!
checkCameraPermission
())
{
if
(!
checkStorageAndCameraPermission
())
{
return
;
return
;
}
}
}
if
(
isCameraCanUse
())
{
if
(
isCameraCanUse
())
{
cameraFile
=
SobotCommonUtils
.
openCamera
(
getSobotBaseActivity
());
cameraFile
=
SobotCommonUtils
.
openCamera
(
getSobotBaseActivity
());
...
...
sobot_common/src/main/java/com/sobot/common/ui/permission/SobotPermissionDialog.java
View file @
d425081c
...
@@ -17,8 +17,8 @@ import android.widget.LinearLayout;
...
@@ -17,8 +17,8 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.utils.SobotResourceUtils
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotCommonApi
;
import
com.sobot.common.utils.SobotResourceUtils
;
import
com.sobot.utils.SobotDensityUtil
;
import
com.sobot.utils.SobotDensityUtil
;
/**
/**
...
...
sobot_common/src/main/java/com/sobot/common/utils/SobotCommonApi.java
View file @
d425081c
package
com
.
sobot
.
common
.
utils
;
package
com
.
sobot
.
common
.
utils
;
import
android.app.Application
;
import
android.app.Application
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.content.res.Resources
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.common.ui.SobotMarkConfig
;
import
com.sobot.gson.SobotGsonUtil
;
import
com.sobot.network.apiUtils.SobotHttpUtils
;
import
com.sobot.network.apiUtils.SobotHttpUtils
;
import
com.sobot.network.http.log.SobotNetLogUtils
;
import
com.sobot.network.http.log.SobotNetLogUtils
;
import
com.sobot.utils.SobotGlobalContext
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotLogUtils
;
import
com.sobot.utils.SobotNetUtils
;
import
com.sobot.utils.SobotUtils
;
public
class
SobotCommonApi
{
public
class
SobotCommonApi
{
...
@@ -22,8 +17,8 @@ public class SobotCommonApi {
...
@@ -22,8 +17,8 @@ public class SobotCommonApi {
*/
*/
public
static
void
init
(
Application
application
)
{
public
static
void
init
(
Application
application
)
{
if
(
application
!=
null
)
{
if
(
application
!=
null
)
{
SobotUtils
.
init
(
application
);
SobotHttpUtils
.
init
(
application
);
SobotHttpUtils
.
init
(
application
);
SobotGlobalContext
.
init
(
application
);
}
}
}
}
...
...
sobot_common/src/main/java/com/sobot/common/utils/SobotCommonUtils.java
View file @
d425081c
...
@@ -15,7 +15,6 @@ import android.support.v4.content.FileProvider;
...
@@ -15,7 +15,6 @@ import android.support.v4.content.FileProvider;
import
com.sobot.common.ui.SobotBaseConstant
;
import
com.sobot.common.ui.SobotBaseConstant
;
import
com.sobot.common.ui.toast.SobotToastUtil
;
import
com.sobot.common.ui.toast.SobotToastUtil
;
import
com.sobot.utils.SobotIOUtils
;
import
com.sobot.utils.SobotIOUtils
;
import
com.sobot.utils.SobotPathManager
;
import
java.io.File
;
import
java.io.File
;
...
...
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