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
0aa4d5d6
Commit
0aa4d5d6
authored
Jun 03, 2023
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widget 1.0.8 baseactivity 修改国际化语言
parent
fedd3d93
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
build.gradle
sobot_widget/build.gradle
+1
-1
sobot-widget-publish-mavencentral.gradle
sobot_widget/sobot-widget-publish-mavencentral.gradle
+1
-1
SobotBaseActivity.java
...main/java/com/sobot/widget/ui/base/SobotBaseActivity.java
+8
-11
No files found.
sobot_widget/build.gradle
View file @
0aa4d5d6
...
@@ -6,7 +6,7 @@ android {
...
@@ -6,7 +6,7 @@ android {
compileSdkVersion
33
compileSdkVersion
33
defaultConfig
{
defaultConfig
{
minSdkVersion
1
6
minSdkVersion
1
7
}
}
}
}
...
...
sobot_widget/sobot-widget-publish-mavencentral.gradle
View file @
0aa4d5d6
...
@@ -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
=
'widget'
//项目名
PUBLISH_ARTIFACT_ID
=
'widget'
//项目名
// PUBLISH_ARTIFACT_ID = 'widget_x' //项目名
// PUBLISH_ARTIFACT_ID = 'widget_x' //项目名
PUBLISH_VERSION
=
'1.0.
8
'
//版本号
PUBLISH_VERSION
=
'1.0.
9
'
//版本号
}
}
...
...
sobot_widget/src/main/java/com/sobot/widget/ui/base/SobotBaseActivity.java
View file @
0aa4d5d6
...
@@ -26,7 +26,6 @@ import android.widget.LinearLayout;
...
@@ -26,7 +26,6 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
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
;
import
com.sobot.widget.R
;
import
com.sobot.widget.R
;
...
@@ -56,6 +55,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -56,6 +55,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
protected
File
cameraFile
;
protected
File
cameraFile
;
//权限回调
//权限回调
public
SobotPermissionListener
permissionListener
;
public
SobotPermissionListener
permissionListener
;
private
int
initMode
;
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
...
@@ -63,6 +63,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -63,6 +63,7 @@ public abstract class SobotBaseActivity extends FragmentActivity {
//修改国际化语言
//修改国际化语言
changeAppLanguage
();
changeAppLanguage
();
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
initMode
=
getResources
().
getConfiguration
().
uiMode
&
Configuration
.
UI_MODE_NIGHT_MASK
;
if
(
Build
.
VERSION
.
SDK_INT
!=
Build
.
VERSION_CODES
.
O
)
{
if
(
Build
.
VERSION
.
SDK_INT
!=
Build
.
VERSION_CODES
.
O
)
{
if
(!
SobotWidgetApi
.
getSwitchMarkStatus
(
SobotMarkConfig
.
LANDSCAPE_SCREEN
))
{
if
(!
SobotWidgetApi
.
getSwitchMarkStatus
(
SobotMarkConfig
.
LANDSCAPE_SCREEN
))
{
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_SENSOR_PORTRAIT
);
//竖屏
setRequestedOrientation
(
ActivityInfo
.
SCREEN_ORIENTATION_SENSOR_PORTRAIT
);
//竖屏
...
@@ -174,6 +175,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -174,6 +175,10 @@ public abstract class SobotBaseActivity extends FragmentActivity {
public
void
changeAppLanguage
()
{
public
void
changeAppLanguage
()
{
try
{
try
{
Locale
locale
=
(
Locale
)
SobotSharedPreferencesUtil
.
getInstance
(
getSobotBaseContext
()).
get
(
"SobotLanguage"
,
Locale
.
class
);
Locale
locale
=
(
Locale
)
SobotSharedPreferencesUtil
.
getInstance
(
getSobotBaseContext
()).
get
(
"SobotLanguage"
,
Locale
.
class
);
if
(
locale
==
null
)
{
//获取系统语言
locale
=
getSysPreferredLocale
();
}
updateLanguage
(
locale
);
updateLanguage
(
locale
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -486,17 +491,9 @@ public abstract class SobotBaseActivity extends FragmentActivity {
...
@@ -486,17 +491,9 @@ public abstract class SobotBaseActivity extends FragmentActivity {
public
void
onConfigurationChanged
(
Configuration
newConfig
)
{
public
void
onConfigurationChanged
(
Configuration
newConfig
)
{
super
.
onConfigurationChanged
(
newConfig
);
super
.
onConfigurationChanged
(
newConfig
);
int
currentNightMode
=
newConfig
.
uiMode
&
Configuration
.
UI_MODE_NIGHT_MASK
;
int
currentNightMode
=
newConfig
.
uiMode
&
Configuration
.
UI_MODE_NIGHT_MASK
;
switch
(
currentNightMode
)
{
if
(
initMode
!=
currentNightMode
)
{
case
Configuration
.
UI_MODE_NIGHT_NO
:
initMode
=
currentNightMode
;
SobotLogUtils
.
i
(
"=====关闭夜间模式===="
);
recreate
();
break
;
case
Configuration
.
UI_MODE_NIGHT_YES
:
SobotLogUtils
.
i
(
"=====开启夜间模式===="
);
recreate
();
recreate
();
break
;
default
:
break
;
}
}
}
}
...
...
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