Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
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
杨凯
YDL-Component-Medical
Commits
5e2fb2d5
Commit
5e2fb2d5
authored
Aug 12, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: minSdkVersion 升级到23
parent
901d7e61
Hide whitespace changes
Inline
Side-by-side
Showing
108 changed files
with
714 additions
and
1606 deletions
+714
-1606
MDTLoginActivity.kt
app/src/main/java/com/ydl/component/rtc/MDTLoginActivity.kt
+6
-13
MDTMainActivity.java
app/src/main/java/com/ydl/component/rtc/MDTMainActivity.java
+6
-11
ProfileActivity.java
app/src/main/java/com/ydl/component/rtc/ProfileActivity.java
+6
-11
TUICallingEntranceActivity.java
app/src/main/java/com/ydl/component/rtc/TUICallingEntranceActivity.java
+9
-15
build.gradle
app2/build.gradle
+1
-1
build.gradle
build.gradle
+1
-1
config.gradle
config.gradle
+1
-1
build.gradle
m-article/build.gradle
+0
-1
build.gradle
m-audioim/build.gradle
+0
-3
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+8
-13
AudioPlayer.kt
m-audioim/src/main/java/com/ydl/audioim/player/AudioPlayer.kt
+8
-17
build.gradle
m-confide/build.gradle
+0
-1
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+4
-7
ConfideHomeRecentView.kt
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecentView.kt
+6
-9
ExpertIntroActivity.kt
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
+6
-9
VersionedGestureDetector.java
m-consultant/src/main/java/com/yidianling/consultant/preview/VersionedGestureDetector.java
+1
-10
SeekBar.java
m-consultant/src/main/java/com/yidianling/consultant/ui/view/rangeseekbar/SeekBar.java
+3
-16
Utils.java
m-consultant/src/main/java/com/yidianling/consultant/ui/view/rangeseekbar/Utils.java
+1
-6
build.gradle
m-course/build.gradle
+0
-1
CoursePlayActivity.kt
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
+17
-25
HPlayView.kt
m-course/src/main/java/com/yidianling/course/widget/HPlayView.kt
+5
-6
build.gradle
m-dynamic/build.gradle
+0
-1
BrowsePicturesActivity.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity.java
+8
-10
BrowsePicturesActivity2.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity2.java
+7
-9
NineGridViewWrapper.java
m-dynamic/src/main/java/com/yidianling/dynamic/common/view/NineGridViewWrapper.java
+4
-12
MembersActivity.java
m-dynamic/src/main/java/com/yidianling/dynamic/members/MembersActivity.java
+5
-15
TrendsHomeFragment.java
m-dynamic/src/main/java/com/yidianling/dynamic/trendsHome/TrendsHomeFragment.java
+22
-23
FMDetailActivity.java
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
+8
-14
HomeConfideView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConfideView.kt
+6
-10
HomeConsultView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
+5
-7
HomeConfideView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConfideView.kt
+7
-6
HomeConsultView.kt
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultView.kt
+7
-6
build.gradle
m-im/build.gradle
+0
-1
AVChatProfile.java
m-im/src/main/java/com/yidianling/avchatkit/AVChatProfile.java
+0
-17
AVChatActivity.java
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
+0
-1
AVChatBaseUI.java
m-im/src/main/java/com/yidianling/avchatkit/common/activity/AVChatBaseUI.java
+6
-11
BaseMPermission.java
m-im/src/main/java/com/yidianling/avchatkit/common/permission/BaseMPermission.java
+8
-40
MPermission.java
m-im/src/main/java/com/yidianling/avchatkit/common/permission/MPermission.java
+1
-9
BaseViewHolder.java
m-im/src/main/java/com/yidianling/avchatkit/common/recyclerview/holder/BaseViewHolder.java
+5
-14
AVChatVideoUI.java
m-im/src/main/java/com/yidianling/avchatkit/ui/AVChatVideoUI.java
+3
-22
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+5
-16
ContactsSelectHolder.java
m-im/src/main/java/com/yidianling/uikit/business/contact/selector/viewholder/ContactsSelectHolder.java
+2
-7
CaptureVideoActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/CaptureVideoActivity.java
+19
-41
VideoMessageHelper.java
m-im/src/main/java/com/yidianling/uikit/business/session/helper/VideoMessageHelper.java
+2
-7
NormalTeamInfoActivity.java
m-im/src/main/java/com/yidianling/uikit/business/team/activity/NormalTeamInfoActivity.java
+0
-4
ChooseMusicActivity.kt
m-muse/src/main/java/com/yidianling/muse/activity/ChooseMusicActivity.kt
+2
-9
ChooseMusicDialog.kt
m-muse/src/main/java/com/yidianling/muse/dialog/ChooseMusicDialog.kt
+1
-6
MeditationFloatPermissionUtil.kt
m-muse/src/main/java/com/yidianling/muse/utils/MeditationFloatPermissionUtil.kt
+5
-8
TestHomeActivity.kt
m-tests/src/main/java/com/yidianling/tests/home/TestHomeActivity.kt
+10
-12
build.gradle
m-user/build.gradle
+0
-1
NotificationsSettingActivity.java
m-user/src/main/java/com/yidianling/user/mine/NotificationsSettingActivity.java
+2
-8
ReceiveRedPacketActivity.kt
m-user/src/main/java/com/yidianling/user/mine/ReceiveRedPacketActivity.kt
+6
-8
FingerPrintUtil.kt
m-user/src/main/java/com/yidianling/user/safePrivate/FingerPrintUtil.kt
+18
-27
SecretActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
+3
-5
VerificationCodeActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
+3
-6
SquarePinField.kt
m-user/src/main/java/com/yidianling/user/widget/PinField/SquarePinField.kt
+13
-5
build.gradle
ydl-media/build.gradle
+3
-4
MediaSessionManager.kt
ydl-media/src/main/java/com/ydl/media/audio/manager/MediaSessionManager.kt
+0
-5
build.gradle
ydl-net/build.gradle
+3
-4
build.gradle
ydl-pay/build.gradle
+3
-4
NetUtils.java
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/http/utils/NetUtils.java
+1
-6
RxDeviceTool.java
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/http/utils/RxDeviceTool.java
+7
-15
Cockroach.java
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/crash/Cockroach.java
+13
-11
BrowsePicturesActivity.java
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/imagepicker/BrowsePicturesActivity.java
+6
-8
StatusBarOptions.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/StatusBarOptions.kt
+4
-11
AndroidSystemHelper.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AndroidSystemHelper.kt
+2
-6
ApkInstallTool.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ApkInstallTool.kt
+19
-12
DeviceTool.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
+6
-22
DeviceUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceUtils.kt
+12
-47
FileUtils.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/FileUtils.java
+4
-4
KeyboardChangeListener.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/KeyboardChangeListener.java
+1
-4
StatusBarUtils.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
+132
-235
Utils.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/Utils.java
+1
-7
FlymeStatusbarUtils.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/statusBar/FlymeStatusbarUtils.java
+4
-11
StatusBarUtil.java
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/statusBar/StatusBarUtil.java
+12
-24
BaseViewHolder.java
ydl-platform/src/main/java/com/ydl/ydlcommon/view/BaseViewHolder.java
+4
-13
SlidingTabLayout.java
ydl-platform/src/main/java/com/ydl/ydlcommon/view/SlidingTabLayout.java
+12
-17
TabView.java
ydl-platform/src/main/java/com/ydl/ydlcommon/view/verticaltablayout/TabView.java
+5
-12
build.gradle
ydl-resource/build.gradle
+3
-3
TUIThemeManager.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIThemeManager.java
+2
-3
PermissionUtil.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/trtccalling/model/util/PermissionUtil.java
+2
-10
TRTCBaseActivity.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/TRTCBaseActivity.java
+19
-21
FileUtil.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/FileUtil.java
+1
-5
PopWindowUtil.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/PopWindowUtil.java
+2
-5
StatusBarUtil.java
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/StatusBarUtil.java
+21
-39
RxBarTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxBarTool.java
+14
-35
RxDataTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxDataTool.java
+9
-8
RxDeviceTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxDeviceTool.java
+7
-15
RxFileTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxFileTool.java
+10
-23
RxImageTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxImageTool.java
+4
-9
RxIntentTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxIntentTool.java
+4
-16
RxNetTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxNetTool.java
+1
-8
RxPhotoTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxPhotoTool.java
+12
-13
RxProcessTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxProcessTool.java
+0
-130
RxWebViewTool.java
ydl-utils/src/main/java/com/yidianling/common/tools/RxWebViewTool.java
+6
-17
DisplayMetricsHolder.java
ydl-utils/src/main/java/com/yidianling/common/tools/keyboard/DisplayMetricsHolder.java
+1
-26
ToastCompat.java
ydl-utils/src/main/java/com/yidianling/common/tools/support/toast/ToastCompat.java
+4
-3
RxDialog.java
ydl-utils/src/main/java/com/yidianling/common/view/dialog/RxDialog.java
+7
-9
RxPopupViewBackgroundConstructor.java
ydl-utils/src/main/java/com/yidianling/common/view/popupwindows/tools/RxPopupViewBackgroundConstructor.java
+4
-17
RxPopupViewManager.java
ydl-utils/src/main/java/com/yidianling/common/view/popupwindows/tools/RxPopupViewManager.java
+12
-14
RxIconRoundProgressBar.java
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxIconRoundProgressBar.java
+2
-11
RxRoundProgressBar.java
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxRoundProgressBar.java
+1
-6
RxTextRoundProgressBar.java
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxTextRoundProgressBar.java
+10
-58
RxBaseRoundProgressBar.java
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/common/RxBaseRoundProgressBar.java
+7
-18
WaveSideBarView.java
ydl-utils/src/main/java/com/yidianling/common/view/sidebar/WaveSideBarView.java
+1
-4
build.gradle
ydl-webview/build.gradle
+3
-4
ProxyCheckUtils.kt
ydl-webview/src/main/java/com/ydl/utils/ProxyCheckUtils.kt
+5
-13
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+4
-6
No files found.
app/src/main/java/com/ydl/component/rtc/MDTLoginActivity.kt
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.ydl.component.rtc
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.graphics.Color
import
android.os.Build
import
android.os.Bundle
import
android.text.TextUtils
import
android.util.Log
...
...
@@ -23,11 +22,9 @@ import com.ydl.component.rtc.bean.UserSigResponse
import
com.ydl.component.rtc.http.MDTHttpImpl.Companion.getInstance
import
com.ydl.ydlcommon.modular.ModularServiceManager.provide
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.api.bean.UserResponseBean
import
com.yidianling.user.api.service.IUserService
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
java.util.*
class
MDTLoginActivity
:
AppCompatActivity
()
{
private
var
mEditUserId
:
EditText
?
=
null
...
...
@@ -157,16 +154,12 @@ class MDTLoginActivity : AppCompatActivity() {
}
private
fun
initStatusBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
val
window
=
window
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
.
decorView
.
systemUiVisibility
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
val
window
=
window
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
.
decorView
.
systemUiVisibility
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
companion
object
{
...
...
app/src/main/java/com/ydl/component/rtc/MDTMainActivity.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.app.Dialog;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
...
...
@@ -63,16 +62,12 @@ public class MDTMainActivity extends AppCompatActivity {
}
private
void
initStatusBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
private
void
login
()
{
...
...
app/src/main/java/com/ydl/component/rtc/ProfileActivity.java
View file @
5e2fb2d5
...
...
@@ -2,7 +2,6 @@ package com.ydl.component.rtc;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.TextUtils
;
...
...
@@ -158,15 +157,11 @@ public class ProfileActivity extends AppCompatActivity {
}
private
void
initStatusBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
}
app/src/main/java/com/ydl/component/rtc/TUICallingEntranceActivity.java
View file @
5e2fb2d5
...
...
@@ -111,16 +111,12 @@ public class TUICallingEntranceActivity extends Activity {
}
private
void
initStatusBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
Window
window
=
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
private
void
initView
()
{
...
...
@@ -401,11 +397,9 @@ public class TUICallingEntranceActivity extends Activity {
return
;
}
//其他厂商
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_OVERLAY_PERMISSION
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
PERMISSION_RESULT_CODE
);
}
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_OVERLAY_PERMISSION
);
intent
.
setData
(
Uri
.
parse
(
"package:"
+
getPackageName
()));
startActivityForResult
(
intent
,
PERMISSION_RESULT_CODE
);
}
else
{
//已经有权限
PermissionUtil
.
mHasPermissionOrHasHinted
=
true
;
...
...
app2/build.gradle
View file @
5e2fb2d5
...
...
@@ -8,7 +8,7 @@ android {
defaultConfig
{
applicationId
"com.cxzapp.yidianling"
minSdk
2
1
minSdk
2
3
targetSdk
28
versionCode
1
versionName
"1.0"
...
...
build.gradle
View file @
5e2fb2d5
...
...
@@ -5,7 +5,7 @@ buildscript {
ext
{
kotlin_version
=
'1.6.10'
support_version
=
'26.1.0'
minSdkVersion
=
2
1
minSdkVersion
=
2
3
targetSdkVersion
=
28
compileSdkVersion
=
28
buildToolsVersion
=
'28.0.3'
...
...
config.gradle
View file @
5e2fb2d5
...
...
@@ -16,7 +16,7 @@ ext {
android
=
[
compileSdkVersion:
28
,
buildToolsVersion:
"28.0.3"
,
minSdkVersion
:
2
1
,
minSdkVersion
:
2
3
,
targetSdkVersion
:
28
,
versionCode
:
1000
,
versionName
:
"1.0.00"
,
...
...
m-article/build.gradle
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
...
...
m-audioim/build.gradle
View file @
5e2fb2d5
...
...
@@ -15,10 +15,7 @@ android {
compileSdkVersion
rootProject
.
ext
.
compileSdkVersion
buildToolsVersion
rootProject
.
ext
.
buildToolsVersion
defaultConfig
{
// minSdkVersion rootProject.ext.android["minSdkVersion"]
// targetSdkVersion rootProject.ext.android["targetSdkVersion"]
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
versionCode
1
...
...
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
5e2fb2d5
...
...
@@ -55,7 +55,6 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.findRouteService
import
com.ydl.ydlcommon.router.YdlCommonRouterManager
import
com.ydl.ydlcommon.utils.LogUtil
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.Utils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.ydl.ydlcommon.utils.log.AliYunLogConfig
...
...
@@ -548,18 +547,14 @@ class AudioHomeActivity :
private
fun
setWindowStatusBarColor
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
{
val
decorView
=
window
.
decorView
val
option
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
decorView
.
systemUiVisibility
=
option
window
.
statusBarColor
=
Color
.
TRANSPARENT
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
window
.
attributes
?.
layoutInDisplayCutoutMode
=
WindowManager
.
LayoutParams
.
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
}
else
{
StatusBarUtils
.
setWindowStatusBarColor
(
this
,
R
.
color
.
audioim_color_40353535
)
val
decorView
=
window
.
decorView
val
option
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
decorView
.
systemUiVisibility
=
option
window
.
statusBarColor
=
Color
.
TRANSPARENT
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
window
.
attributes
?.
layoutInDisplayCutoutMode
=
WindowManager
.
LayoutParams
.
LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
}
...
...
m-audioim/src/main/java/com/ydl/audioim/player/AudioPlayer.kt
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.content.Context
import
android.media.AudioAttributes
import
android.media.AudioManager
import
android.media.MediaPlayer
import
android.os.Build
/**
...
...
@@ -23,14 +22,10 @@ class AudioPlayer {
this
.
mContext
=
mContext
mPlayer
=
MediaPlayer
()
if
(
isSpeakerphoneOn
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_MUSIC
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_MUSIC
)
}
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_MUSIC
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
audioManager
=
mContext
!!
.
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
?
audioManager
?.
setStreamVolume
(
...
...
@@ -41,14 +36,10 @@ class AudioPlayer {
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
}
else
{
mPlayer
?.
setAudioStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
}
var
attributes
=
AudioAttributes
.
Builder
()
.
setLegacyStreamType
(
AudioManager
.
STREAM_VOICE_CALL
)
.
build
()
mPlayer
?.
setAudioAttributes
(
attributes
)
audioManager
=
mContext
!!
.
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
?
audioManager
?.
setStreamVolume
(
...
...
m-confide/build.gradle
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
compileSdkVersion
buildToolsVersion
rootProject
.
ext
.
buildToolsVersion
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
minSdkVersion
targetSdkVersion
rootProject
.
ext
.
targetSdkVersion
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
5e2fb2d5
...
...
@@ -5,7 +5,6 @@ import android.content.Context
import
android.content.Intent
import
android.graphics.Color
import
android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -310,12 +309,10 @@ class ConfideHomeActivity :
* 初始化状态栏位置
*/
private
fun
initStatusBar
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
window
?.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
?.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
?.
statusBarColor
=
Color
.
WHITE
window
?.
decorView
?.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
window
?.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
?.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
?.
statusBarColor
=
Color
.
WHITE
window
?.
decorView
?.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
/**
...
...
m-confide/src/main/java/com/ydl/confide/home/widget/ConfideHomeRecentView.kt
View file @
5e2fb2d5
package
com.ydl.confide.home.widget
import
android.content.Context
import
android.os.Build
import
androidx.cardview.widget.CardView
import
androidx.recyclerview.widget.RecyclerView
import
android.text.TextUtils
import
android.view.View
import
android.view.ViewGroup
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.transform.GlideRoundTransform
import
com.yidianling.common.tools.RxImageTool
import
androidx.cardview.widget.CardView
import
androidx.recyclerview.widget.RecyclerView
import
com.ydl.confide.R
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.transform.GlideRoundTransform
import
com.yidianling.common.tools.RxImageTool
import
kotlinx.android.synthetic.main.confide_recent_view.view.*
/**
...
...
@@ -46,9 +45,7 @@ class ConfideHomeRecentView(mContext: Context, private var confideHomeEvent: ICo
params
.
setMargins
(
dp15
,
RxImageTool
.
dip2px
(
28f
),
dp15
,
RxImageTool
.
dip2px
(
24f
))
radius
=
RxImageTool
.
dip2px
(
23f
).
toFloat
()
layoutParams
=
params
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
elevation
=
RxImageTool
.
dip2px
(
1f
).
toFloat
()
}
elevation
=
RxImageTool
.
dip2px
(
1f
).
toFloat
()
}
/**
...
...
m-confide/src/main/java/com/ydl/confide/intro/ExpertIntroActivity.kt
View file @
5e2fb2d5
package
com.ydl.confide.intro
import
android.graphics.Color
import
android.os.Build
import
android.os.Bundle
import
android.view.View
import
androidx.appcompat.app.AppCompatActivity
...
...
@@ -64,16 +63,14 @@ class ExpertIntroActivity : AppCompatActivity() {
super
.
onCreate
(
savedInstanceState
)
ARouter
.
getInstance
().
inject
(
this
)
binding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
activity_expert_intro
)
if
(
Build
.
VERSION
.
SDK_INT
>=
21
)
{
val
decorView
=
window
.
decorView
val
option
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
decorView
.
systemUiVisibility
=
option
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
val
decorView
=
window
.
decorView
val
option
=
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
)
decorView
.
systemUiVisibility
=
option
window
.
statusBarColor
=
Color
.
TRANSPARENT
if
(
initData
!=
null
)
{
val
beans
=
JSON
.
parseArray
(
initData
,
ConfideHomeBodyBean
::
class
.
java
)
val
isLogin
=
findRouteService
(
IUserService
::
class
.
java
).
isLogin
()
val
isLogin
=
findRouteService
(
IUserService
::
class
.
java
).
isLogin
()
val
vms
=
beans
.
map
{
VideoViewModel
().
mapOf
(
it
).
apply
{
showFreeTag
.
set
(!
isLogin
)
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/preview/VersionedGestureDetector.java
View file @
5e2fb2d5
...
...
@@ -17,7 +17,6 @@ package com.yidianling.consultant.preview;
*******************************************************************************/
import
android.content.Context
;
import
android.os.Build
;
/**
* @author rainb
...
...
@@ -26,16 +25,8 @@ public final class VersionedGestureDetector {
public
static
GestureDetector
newInstance
(
Context
context
,
OnGestureListener
listener
)
{
final
int
sdkVersion
=
Build
.
VERSION
.
SDK_INT
;
GestureDetector
detector
;
if
(
sdkVersion
<
Build
.
VERSION_CODES
.
ECLAIR
)
{
detector
=
new
CupcakeGestureDetector
(
context
);
}
else
if
(
sdkVersion
<
Build
.
VERSION_CODES
.
FROYO
)
{
detector
=
new
EclairGestureDetector
(
context
);
}
else
{
detector
=
new
FroyoGestureDetector
(
context
);
}
detector
=
new
FroyoGestureDetector
(
context
);
detector
.
setOnGestureListener
(
listener
);
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/rangeseekbar/SeekBar.java
View file @
5e2fb2d5
...
...
@@ -15,7 +15,6 @@ import android.graphics.Path;
import
android.graphics.Rect
;
import
android.graphics.RectF
;
import
android.graphics.Typeface
;
import
android.os.Build
;
import
android.text.TextUtils
;
import
android.util.AttributeSet
;
...
...
@@ -571,11 +570,7 @@ public class SeekBar {
public
void
setThumbInactivatedDrawableId
(
@DrawableRes
int
thumbInactivatedDrawableId
,
int
width
,
int
height
)
{
if
(
thumbInactivatedDrawableId
!=
0
&&
getResources
()
!=
null
)
{
this
.
thumbInactivatedDrawableId
=
thumbInactivatedDrawableId
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
thumbInactivatedBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbInactivatedDrawableId
,
null
));
}
else
{
thumbInactivatedBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbInactivatedDrawableId
));
}
thumbInactivatedBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbInactivatedDrawableId
,
null
));
}
}
...
...
@@ -589,22 +584,14 @@ public class SeekBar {
}
if
(
thumbDrawableId
!=
0
&&
getResources
()
!=
null
)
{
this
.
thumbDrawableId
=
thumbDrawableId
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
thumbBitmap
=
Utils
.
drawableToBitmap
(
thumbWidth
,
thumbHeight
,
getResources
().
getDrawable
(
thumbDrawableId
,
null
));
}
else
{
thumbBitmap
=
Utils
.
drawableToBitmap
(
thumbWidth
,
thumbHeight
,
getResources
().
getDrawable
(
thumbDrawableId
));
}
thumbBitmap
=
Utils
.
drawableToBitmap
(
thumbWidth
,
thumbHeight
,
getResources
().
getDrawable
(
thumbDrawableId
,
null
));
}
}
public
void
setThumbDrawableId
(
@DrawableRes
int
thumbDrawableId
,
int
width
,
int
height
)
{
if
(
thumbDrawableId
!=
0
&&
getResources
()
!=
null
&&
width
>
0
&&
height
>
0
)
{
this
.
thumbDrawableId
=
thumbDrawableId
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
thumbBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbDrawableId
,
null
));
}
else
{
thumbBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbDrawableId
));
}
thumbBitmap
=
Utils
.
drawableToBitmap
(
width
,
height
,
getResources
().
getDrawable
(
thumbDrawableId
,
null
));
}
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/rangeseekbar/Utils.java
View file @
5e2fb2d5
...
...
@@ -10,7 +10,6 @@ import android.graphics.Paint;
import
android.graphics.Rect
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.util.Log
;
import
androidx.annotation.ColorRes
;
...
...
@@ -42,11 +41,7 @@ public class Utils {
public
static
Bitmap
drawableToBitmap
(
Context
context
,
int
width
,
int
height
,
int
drawableId
)
{
if
(
context
==
null
||
width
<=
0
||
height
<=
0
||
drawableId
==
0
)
return
null
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
return
Utils
.
drawableToBitmap
(
width
,
height
,
context
.
getResources
().
getDrawable
(
drawableId
,
null
));
}
else
{
return
Utils
.
drawableToBitmap
(
width
,
height
,
context
.
getResources
().
getDrawable
(
drawableId
));
}
return
Utils
.
drawableToBitmap
(
width
,
height
,
context
.
getResources
().
getDrawable
(
drawableId
,
null
));
}
/**
...
...
m-course/build.gradle
View file @
5e2fb2d5
...
...
@@ -8,7 +8,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
...
...
m-course/src/main/java/com/yidianling/course/coursePlay/CoursePlayActivity.kt
View file @
5e2fb2d5
...
...
@@ -5,9 +5,7 @@ import android.app.AlertDialog
import
android.content.Intent
import
android.content.res.Configuration
import
android.graphics.Color
import
android.os.Build
import
android.os.Handler
import
androidx.recyclerview.widget.LinearLayoutManager
import
android.text.TextUtils
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -15,6 +13,7 @@ import android.view.WindowManager
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.bumptech.glide.Glide
import
com.dou361.ijkplayer.widget.PlayStateParams
...
...
@@ -52,7 +51,6 @@ import com.yidianling.ydl_pay.common.CommonPayDialog
import
kotlinx.android.synthetic.main.activity_course_play.*
import
org.json.JSONException
import
org.json.JSONObject
import
java.util.*
/**
* 课程播放页面
...
...
@@ -324,28 +322,22 @@ class CoursePlayActivity : BaseActivity() {
}
private
fun
initWindows
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
val
window
=
window
//获取状态栏高度
var
statusBarheight
:
Int
=
ScreenUtil
.
getStatusBarHeight
(
mContext
)
//设置边距
setMargins
(
title_bar_layout
,
RxImageTool
.
dp2px
(
15f
),
statusBarheight
,
RxImageTool
.
dp2px
(
15f
),
0
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
window
.
statusBarColor
=
Color
.
TRANSPARENT
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
}
else
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
}
val
window
=
window
//获取状态栏高度
var
statusBarheight
:
Int
=
ScreenUtil
.
getStatusBarHeight
(
mContext
)
//设置边距
setMargins
(
title_bar_layout
,
RxImageTool
.
dp2px
(
15f
),
statusBarheight
,
RxImageTool
.
dp2px
(
15f
),
0
)
window
.
statusBarColor
=
Color
.
TRANSPARENT
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
}
private
fun
setMargins
(
v
:
View
?,
l
:
Int
,
t
:
Int
,
r
:
Int
,
b
:
Int
)
{
...
...
m-course/src/main/java/com/yidianling/course/widget/HPlayView.kt
View file @
5e2fb2d5
...
...
@@ -2,15 +2,14 @@ package com.yidianling.course.widget
import
android.annotation.SuppressLint
import
android.app.Activity
import
android.os.Build
import
android.os.Handler
import
androidx.annotation.DrawableRes
import
androidx.annotation.Nullable
import
androidx.annotation.RawRes
import
android.view.View
import
android.widget.ImageView
import
android.widget.RelativeLayout
import
android.widget.SeekBar
import
androidx.annotation.DrawableRes
import
androidx.annotation.Nullable
import
androidx.annotation.RawRes
import
com.bumptech.glide.Glide
import
com.ydl.media.audio.AudioPlayer
import
com.ydl.media.audio.OnPlayerEventListener
...
...
@@ -22,7 +21,6 @@ import com.yidianling.course.listener.HPlayStatusListener
import
kotlinx.android.synthetic.main.course_play_music_view.view.*
/**
* Created by hgw on 2018/4/28.
*/
...
...
@@ -279,6 +277,6 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
* @return
*/
fun
isDestroy
():
Boolean
{
return
mContext
==
null
||
mContext
!!
.
isFinishing
||
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
&&
mContext
!!
.
isDestroyed
return
mContext
==
null
||
mContext
!!
.
isFinishing
||
mContext
?.
isDestroyed
==
true
}
}
\ No newline at end of file
m-dynamic/build.gradle
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity.java
View file @
5e2fb2d5
...
...
@@ -5,14 +5,10 @@ import android.content.Context;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Parcelable
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.Window
;
...
...
@@ -20,19 +16,23 @@ import android.view.WindowManager;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
com.luck.picture.lib.photoview.PhotoView
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.ydl.ydlcommon.data.http.RxUtils
;
import
com.ydl.ydlcommon.ui.ParcelableImage
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.dynamic.bean.DynamicConstants
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.bean.DynamicConstants
;
import
com.yidianling.dynamic.common.net.DynamicApiUtils
;
import
com.yidianling.dynamic.common.tool.DownLoadImageService
;
import
com.yidianling.dynamic.common.tool.ImageDownLoadCallBack
;
import
com.yidianling.dynamic.model.Command
;
import
com.ydl.ydlcommon.ui.ParcelableImage
;
import
java.io.File
;
import
java.util.ArrayList
;
...
...
@@ -226,11 +226,9 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
}
private
void
initWindows
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
getWindow
();
Window
window
=
getWindow
();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
private
Handler
mHandler
=
new
Handler
()
{
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/browsePictures/BrowsePicturesActivity2.java
View file @
5e2fb2d5
...
...
@@ -3,26 +3,26 @@ package com.yidianling.dynamic.common.browsePictures;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Parcelable
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
com.luck.picture.lib.photoview.PhotoView
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseActivity
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.yidianling.dynamic.bean.DynamicConstants
;
import
com.yidianling.dynamic.R
;
import
com.yidianling.dynamic.bean.DynamicConstants
;
import
com.yidianling.dynamic.common.tool.DownLoadImageService
;
import
com.yidianling.dynamic.common.tool.ImageDownLoadCallBack
;
...
...
@@ -164,11 +164,9 @@ public class BrowsePicturesActivity2 extends BaseActivity implements ViewPager.O
}
private
void
initWindows
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
getWindow
();
Window
window
=
getWindow
();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
private
Handler
mHandler
=
new
Handler
(){
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/common/view/NineGridViewWrapper.java
View file @
5e2fb2d5
...
...
@@ -7,14 +7,14 @@ import android.graphics.Paint;
import
android.graphics.PorterDuff
;
import
android.graphics.RectF
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
androidx.core.view.ViewCompat
;
import
android.text.TextPaint
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.MotionEvent
;
import
android.widget.ImageView
;
import
androidx.core.view.ViewCompat
;
public
class
NineGridViewWrapper
extends
ImageView
{
private
int
moreNum
=
0
;
//显示更多的数量
...
...
@@ -56,16 +56,8 @@ public class NineGridViewWrapper extends ImageView {
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
if
(
moreNum
>
0
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
canvas
.
drawRoundRect
(
getWidth
()
/
2
,
0
f
,
getRight
(),
getHeight
()
/
4
,
20
f
,
20
f
,
mPaint
);
}
else
{
mRectF
.
left
=
getWidth
()
/
2
;
mRectF
.
top
=
0
;
mRectF
.
bottom
=
getHeight
()
/
4
;
mRectF
.
right
=
getRight
();
canvas
.
drawRoundRect
(
mRectF
,
20
f
,
20
f
,
mPaint
);
}
// canvas.drawColor(maskColor);
canvas
.
drawRoundRect
(
getWidth
()
/
2
,
0
f
,
getRight
(),
getHeight
()
/
4
,
20
f
,
20
f
,
mPaint
);
// canvas.drawColor(maskColor);
float
baseY
=
getHeight
()
/
8
-
(
textPaint
.
ascent
()
+
textPaint
.
descent
())
/
2
;
canvas
.
drawText
(
msg
,
getWidth
()
/
2
+
10
,
baseY
,
textPaint
);
}
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/members/MembersActivity.java
View file @
5e2fb2d5
...
...
@@ -13,10 +13,6 @@ import android.os.Bundle;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Parcelable
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentTransaction
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
androidx.appcompat.app.AlertDialog
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
import
android.widget.ImageView
;
...
...
@@ -24,6 +20,11 @@ import android.widget.LinearLayout;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentTransaction
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
com.google.gson.internal.LinkedTreeMap
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseActivity
;
...
...
@@ -197,17 +198,6 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
});
}
/* @SuppressLint("WrongConstant")
private void initWindows() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
Window window = getWindow();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
} else {
members_top_view.setVisibility(View.GONE);
}
}*/
/**
* 获取顶部图片高度后,设置滚动监听
*/
...
...
m-dynamic/src/main/java/com/yidianling/dynamic/trendsHome/TrendsHomeFragment.java
View file @
5e2fb2d5
package
com
.
yidianling
.
dynamic
.
trendsHome
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_PAGE_STAY_VISIT
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_PAGE_VISIT
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_QUESTIONS_BUTTON_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_TYPE_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_THOUGHTS_GROUP_MORE_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_THOUGHTS_GROUP_TYPE_CLICK
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
com.google.android.material.appbar.AppBarLayout
;
import
com.google.android.material.appbar.CollapsingToolbarLayout
;
import
com.google.android.material.floatingactionbutton.FloatingActionButton
;
import
androidx.fragment.app.Fragment
;
import
androidx.viewpager.widget.ViewPager
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
androidx.appcompat.widget.Toolbar
;
import
android.view.View
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.fragment.app.Fragment
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
androidx.viewpager.widget.ViewPager
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.google.android.material.appbar.AppBarLayout
;
import
com.google.android.material.appbar.CollapsingToolbarLayout
;
import
com.google.android.material.floatingactionbutton.FloatingActionButton
;
import
com.ydl.ydl_image.module.GlideApp
;
import
com.ydl.ydlcommon.base.BaseFragment
;
import
com.ydl.ydlcommon.utils.BuryPointUtils
;
...
...
@@ -43,13 +50,6 @@ import java.util.List;
import
jp.wasabeef.glide.transformations.RoundedCornersTransformation
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_PAGE_STAY_VISIT
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_PAGE_VISIT
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_QUESTIONS_BUTTON_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_ASK_TYPE_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_THOUGHTS_GROUP_MORE_CLICK
;
import
static
com
.
yidianling
.
dynamic
.
bean
.
DynamicConstants
.
YDL_USER_THOUGHTS_GROUP_TYPE_CLICK
;
/**
* Created by Jim on 2017/9/22 0022.
* 首页问答fragment
...
...
@@ -151,14 +151,13 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
}
private
void
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
int
statusBarHeight
=
ScreenUtil
.
getStatusBarHeight
(
getActivity
());
CollapsingToolbarLayout
.
LayoutParams
layoutParams
=
(
CollapsingToolbarLayout
.
LayoutParams
)
mToolBarTv
.
getLayoutParams
();
layoutParams
.
height
=
(
int
)
(
getResources
().
getDimension
(
R
.
dimen
.
title_bar_height
)
+
statusBarHeight
);
mToolBarTv
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
);
mToolBarTv
.
setLayoutParams
(
layoutParams
);
//4.4以下不支持状态栏变色
int
statusBarHeight
=
ScreenUtil
.
getStatusBarHeight
(
getActivity
());
CollapsingToolbarLayout
.
LayoutParams
layoutParams
=
(
CollapsingToolbarLayout
.
LayoutParams
)
mToolBarTv
.
getLayoutParams
();
layoutParams
.
height
=
(
int
)
(
getResources
().
getDimension
(
R
.
dimen
.
title_bar_height
)
+
statusBarHeight
);
mToolBarTv
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
);
mToolBarTv
.
setLayoutParams
(
layoutParams
);
}
}
private
void
initDatas
()
{
...
...
m-fm/src/main/java/com/yidianling/fm/FMDetailActivity.java
View file @
5e2fb2d5
...
...
@@ -5,9 +5,7 @@ import android.annotation.SuppressLint;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
androidx.cardview.widget.CardView
;
import
android.text.TextUtils
;
import
android.view.KeyEvent
;
import
android.view.View
;
...
...
@@ -21,6 +19,8 @@ import android.widget.RelativeLayout;
import
android.widget.SeekBar
;
import
android.widget.TextView
;
import
androidx.cardview.widget.CardView
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.ydl.media.audio.AudioPlayer
;
import
com.ydl.media.audio.OnPlayerEventListener
;
...
...
@@ -269,18 +269,12 @@ public class FMDetailActivity extends BaseActivity implements View.OnClickListen
int
changeProgress
=
0
;
void
init
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
getWindow
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
}
else
{
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
}
Window
window
=
getWindow
();
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
fm_progress
.
setMax
(
max_progress
);
tb_title
.
setDivideVisible
(
View
.
GONE
);
tb_title
.
setLeftListener
(
new
View
.
OnClickListener
()
{
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConfideView.kt
View file @
5e2fb2d5
...
...
@@ -2,18 +2,16 @@ package com.yidianling.home.ui.view
import
android.content.Context
import
android.graphics.Typeface
import
android.os.Build
import
com.google.android.material.tabs.TabLayout
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.RecyclerView
import
com.google.android.material.tabs.TabLayout
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.home.R
import
com.yidianling.home.event.HomeImpl
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.home.model.bean.HomeConfideBean
import
com.yidianling.home.model.bean.HomeHeaderBean
import
kotlinx.android.synthetic.xlzx.home_confide_view.view.*
...
...
@@ -83,11 +81,9 @@ class HomeConfideView(private val mContext: Context, private var homeEvent: Home
textView
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_color_242424
))
textView
.
typeface
=
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
)
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
}
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.yidianling.home.ui.view
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Typeface
import
android.os.Build
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
...
...
@@ -98,12 +97,11 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
try
{
var
textView
=
tab_layout
.
getTabAt
(
0
)
as
TextView
updateText
(
textView
,
true
)
}
catch
(
e
:
Exception
)
{}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
}
catch
(
e
:
Exception
)
{
}
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConfideView.kt
View file @
5e2fb2d5
...
...
@@ -72,17 +72,18 @@ class HomeConfideView(private val mContext: Context, private var homeEvent: IHom
}
listener
=
ConfideExpertTabSelectedListener
(
list
,
tab_layout
)
tab_layout
.
addOnTabSelectedListener
(
listener
!!
)
var
textView
=
((
tab_layout
!!
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
lastPosition
)
as
LinearLayout
).
getChildAt
(
1
)
var
textView
=
((
tab_layout
!!
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
lastPosition
)
as
LinearLayout
).
getChildAt
(
1
)
if
(
textView
!=
null
&&
textView
is
TextView
)
{
textView
.
textSize
=
17f
textView
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_color_242424
))
textView
.
typeface
=
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
)
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/view/HomeConsultView.kt
View file @
5e2fb2d5
...
...
@@ -75,17 +75,18 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
}
listener
=
ConsultTabSelectedListener
(
list
,
tab_layout
)
tab_layout
.
addOnTabSelectedListener
(
listener
!!
)
val
textView
=
((
tab_layout
!!
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
lastPosition
)
as
LinearLayout
).
getChildAt
(
1
)
val
textView
=
((
tab_layout
!!
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
lastPosition
)
as
LinearLayout
).
getChildAt
(
1
)
if
(
textView
!=
null
&&
textView
is
TextView
)
{
textView
.
textSize
=
17f
textView
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
platform_color_242424
))
textView
.
typeface
=
Typeface
.
defaultFromStyle
(
Typeface
.
BOLD
)
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
tab_layout
.
setOnScrollChangeListener
{
v
,
scrollX
,
scrollY
,
oldScrollX
,
oldScrollY
->
LogUtil
.
e
(
"scrollX=$scrollX"
)
LogUtil
.
e
(
"oldScrollX=$oldScrollX"
)
}
}
...
...
m-im/build.gradle
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
...
...
m-im/src/main/java/com/yidianling/avchatkit/AVChatProfile.java
View file @
5e2fb2d5
package
com
.
yidianling
.
avchatkit
;
import
android.app.NotificationManager
;
import
android.app.PendingIntent
;
import
android.content.Intent
;
import
android.os.Handler
;
import
android.text.TextUtils
;
import
androidx.annotation.Nullable
;
import
androidx.core.app.NotificationCompat
;
import
com.netease.nimlib.sdk.avchat.model.AVChatData
;
import
com.yidianling.avchatkit.activity.AVChatActivity
;
...
...
@@ -52,20 +49,6 @@ public class AVChatProfile {
Runnable
runnable
=
new
Runnable
()
{
@Override
public
void
run
()
{
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && AppForegroundWatcherCompat.isBackground()) {
backgroundIncomingCallData = data;
backgroundIncomingCallNotification = new AVChatNotification(AVChatKit.getContext());
backgroundIncomingCallNotification.init(data.getAccount(), displayName);
backgroundIncomingCallNotification.activeIncomingCallNotification(true, backgroundIncomingCallData);
} else {
// 启动,如果 task正在启动,则稍等一下
if (AVChatKit.isMainTaskLaunching()) {
launchIncomingCall(data, displayName, source);
} else {
launchActivityTimeout();
AVChatActivity.incomingCall(AVChatKit.getContext(), data, displayName, source);
}}*/
// 启动,如果 task正在启动,则稍等一下
if
(
AVChatKit
.
isMainTaskLaunching
())
{
launchIncomingCall
(
data
,
displayName
,
source
);
...
...
m-im/src/main/java/com/yidianling/avchatkit/activity/AVChatActivity.java
View file @
5e2fb2d5
...
...
@@ -175,7 +175,6 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
cancelCallingNotifier
();
if
(
hasOnPause
)
{
avChatVideoUI
.
onResume
();
avChatController
.
resumeVideo
();
hasOnPause
=
false
;
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/activity/AVChatBaseUI.java
View file @
5e2fb2d5
package
com
.
yidianling
.
avchatkit
.
common
.
activity
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentTransaction
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
android.text.TextUtils
;
import
android.view.KeyEvent
;
import
android.view.MenuItem
;
import
android.view.View
;
import
android.view.inputmethod.InputMethodManager
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.appcompat.widget.Toolbar
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentTransaction
;
import
com.yidianling.avchatkit.common.TFragment
;
import
com.yidianling.avchatkit.common.log.LogUtil
;
import
com.yidianling.avchatkit.common.util.ReflectionUtil
;
...
...
@@ -183,14 +183,9 @@ public abstract class AVChatBaseUI extends AppCompatActivity {
public
boolean
isDestroyedCompatible
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
17
)
{
return
isDestroyedCompatible17
();
}
else
{
return
destroyed
||
super
.
isFinishing
();
}
return
isDestroyedCompatible17
();
}
@TargetApi
(
17
)
private
boolean
isDestroyedCompatible17
()
{
return
super
.
isDestroyed
();
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/permission/BaseMPermission.java
View file @
5e2fb2d5
package
com
.
yidianling
.
avchatkit
.
common
.
permission
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.pm.PackageManager
;
import
android.os.Build
;
import
androidx.fragment.app.Fragment
;
import
android.util.Log
;
import
androidx.fragment.app.Fragment
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -18,10 +17,6 @@ public class BaseMPermission {
GRANTED
,
DENIED
,
DENIED_NEVER_ASK_AGAIN
}
static
boolean
isOverMarshmallow
()
{
return
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
;
}
static
Activity
getActivity
(
Object
object
)
{
if
(
object
instanceof
Fragment
)
{
return
((
Fragment
)
object
).
getActivity
();
...
...
@@ -42,23 +37,17 @@ public class BaseMPermission {
return
findPermissionResult
(
fragment
.
getActivity
(),
permissions
);
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
private
static
List
<
MPermissionResultEnum
>
findPermissionResult
(
Activity
activity
,
String
...
permissions
)
{
boolean
overM
=
isOverMarshmallow
();
List
<
MPermissionResultEnum
>
result
=
new
ArrayList
<>();
for
(
String
p
:
permissions
)
{
if
(
overM
)
{
if
(
activity
.
checkSelfPermission
(
p
)
==
PackageManager
.
PERMISSION_GRANTED
)
{
result
.
add
(
MPermissionResultEnum
.
GRANTED
);
if
(
activity
.
checkSelfPermission
(
p
)
==
PackageManager
.
PERMISSION_GRANTED
)
{
result
.
add
(
MPermissionResultEnum
.
GRANTED
);
}
else
{
if
(!
activity
.
shouldShowRequestPermissionRationale
(
p
))
{
result
.
add
(
MPermissionResultEnum
.
DENIED_NEVER_ASK_AGAIN
);
}
else
{
if
(!
activity
.
shouldShowRequestPermissionRationale
(
p
))
{
result
.
add
(
MPermissionResultEnum
.
DENIED_NEVER_ASK_AGAIN
);
}
else
{
result
.
add
(
MPermissionResultEnum
.
DENIED
);
}
result
.
add
(
MPermissionResultEnum
.
DENIED
);
}
}
else
{
result
.
add
(
MPermissionResultEnum
.
GRANTED
);
}
}
...
...
@@ -76,12 +65,7 @@ public class BaseMPermission {
return
findDeniedPermissions
(
fragment
.
getActivity
(),
permissions
);
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
static
List
<
String
>
findDeniedPermissions
(
Activity
activity
,
String
...
permissions
)
{
if
(!
isOverMarshmallow
())
{
return
null
;
}
List
<
String
>
denyPermissions
=
new
ArrayList
<>();
for
(
String
value
:
permissions
)
{
if
(
activity
.
checkSelfPermission
(
value
)
!=
PackageManager
.
PERMISSION_GRANTED
)
{
...
...
@@ -103,12 +87,7 @@ public class BaseMPermission {
return
findNeverAskAgainPermissions
(
fragment
.
getActivity
(),
permissions
);
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
private
static
List
<
String
>
findNeverAskAgainPermissions
(
Activity
activity
,
String
...
permissions
)
{
if
(!
isOverMarshmallow
())
{
return
null
;
}
List
<
String
>
neverAskAgainPermission
=
new
ArrayList
<>();
for
(
String
value
:
permissions
)
{
if
(
activity
.
checkSelfPermission
(
value
)
!=
PackageManager
.
PERMISSION_GRANTED
&&
...
...
@@ -122,12 +101,7 @@ public class BaseMPermission {
return
neverAskAgainPermission
;
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
static
boolean
hasNeverAskAgainPermission
(
Activity
activity
,
List
<
String
>
permission
)
{
if
(!
isOverMarshmallow
())
{
return
false
;
}
for
(
String
value
:
permission
)
{
if
(
activity
.
checkSelfPermission
(
value
)
!=
PackageManager
.
PERMISSION_GRANTED
&&
!
activity
.
shouldShowRequestPermissionRationale
(
value
))
{
...
...
@@ -149,12 +123,7 @@ public class BaseMPermission {
return
findDeniedPermissionWithoutNeverAskAgain
(
fragment
.
getActivity
(),
permissions
);
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
private
static
List
<
String
>
findDeniedPermissionWithoutNeverAskAgain
(
Activity
activity
,
String
...
permission
)
{
if
(!
isOverMarshmallow
())
{
return
null
;
}
List
<
String
>
denyPermissions
=
new
ArrayList
<>();
for
(
String
value
:
permission
)
{
if
(
activity
.
checkSelfPermission
(
value
)
!=
PackageManager
.
PERMISSION_GRANTED
&&
...
...
@@ -162,7 +131,6 @@ public class BaseMPermission {
denyPermissions
.
add
(
value
);
// 上次申请被用户拒绝了
}
}
return
denyPermissions
;
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/permission/MPermission.java
View file @
5e2fb2d5
package
com
.
yidianling
.
avchatkit
.
common
.
permission
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.pm.PackageManager
;
import
android.os.Build
;
import
androidx.annotation.NonNull
;
import
androidx.fragment.app.Fragment
;
...
...
@@ -49,18 +48,11 @@ public class MPermission extends BaseMPermission {
* ********************* request *********************
*/
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
public
void
request
()
{
doRequestPermissions
(
object
,
requestCode
,
permissions
);
}
@TargetApi
(
value
=
Build
.
VERSION_CODES
.
M
)
private
static
void
doRequestPermissions
(
Object
object
,
int
requestCode
,
String
[]
permissions
)
{
if
(!
isOverMarshmallow
())
{
doExecuteSuccess
(
object
,
requestCode
);
return
;
}
List
<
String
>
deniedPermissions
=
findDeniedPermissions
(
getActivity
(
object
),
permissions
);
if
(
deniedPermissions
!=
null
&&
deniedPermissions
.
size
()
>
0
)
{
if
(
object
instanceof
Activity
)
{
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/recyclerview/holder/BaseViewHolder.java
View file @
5e2fb2d5
...
...
@@ -20,14 +20,9 @@ import android.graphics.Bitmap;
import
android.graphics.Paint
;
import
android.graphics.Typeface
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
androidx.annotation.DrawableRes
;
import
androidx.annotation.StringRes
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.text.util.Linkify
;
import
android.util.SparseArray
;
import
android.view.View
;
import
android.view.animation.AlphaAnimation
;
import
android.widget.Adapter
;
import
android.widget.AdapterView
;
import
android.widget.CheckedTextView
;
...
...
@@ -37,6 +32,10 @@ import android.widget.ProgressBar;
import
android.widget.RatingBar
;
import
android.widget.TextView
;
import
androidx.annotation.DrawableRes
;
import
androidx.annotation.StringRes
;
import
androidx.recyclerview.widget.RecyclerView
;
import
java.util.HashSet
;
import
java.util.LinkedHashSet
;
...
...
@@ -179,15 +178,7 @@ public class BaseViewHolder extends RecyclerView.ViewHolder {
* Alpha between 0-1.
*/
public
BaseViewHolder
setAlpha
(
int
viewId
,
float
value
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
{
getView
(
viewId
).
setAlpha
(
value
);
}
else
{
// Pre-honeycomb hack to set Alpha value
AlphaAnimation
alpha
=
new
AlphaAnimation
(
value
,
value
);
alpha
.
setDuration
(
0
);
alpha
.
setFillAfter
(
true
);
getView
(
viewId
).
startAnimation
(
alpha
);
}
getView
(
viewId
).
setAlpha
(
value
);
return
this
;
}
...
...
m-im/src/main/java/com/yidianling/avchatkit/ui/AVChatVideoUI.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.Manifest;
import
android.app.Activity
;
import
android.content.Context
;
import
android.graphics.Rect
;
import
android.os.Build
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.MotionEvent
;
...
...
@@ -16,6 +15,7 @@ import android.widget.FrameLayout;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.netease.nimlib.sdk.avchat.AVChatManager
;
import
com.netease.nimlib.sdk.avchat.constant.AVChatType
;
import
com.netease.nimlib.sdk.avchat.constant.AVChatVideoScalingType
;
...
...
@@ -25,8 +25,8 @@ import com.netease.nimlib.sdk.avchat.video.AVChatSurfaceViewRenderer;
import
com.netease.nrtc.video.render.IVideoRender
;
import
com.tbruyelle.rxpermissions2.Permission
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
com.ydl.ydlcommon.utils.DeviceTool
;
import
com.yidianling.avchatkit.AVChatKit
;
import
com.yidianling.im.R
;
import
com.yidianling.avchatkit.common.imageview.HeadImageView
;
import
com.yidianling.avchatkit.common.permission.BaseMPermission
;
import
com.yidianling.avchatkit.common.util.ScreenUtil
;
...
...
@@ -38,7 +38,7 @@ import com.yidianling.avchatkit.controll.AVChatController;
import
com.yidianling.avchatkit.module.AVChatControllerCallback
;
import
com.yidianling.avchatkit.module.AVSwitchListener
;
import
com.yidianling.common.tools.ToastUtil
;
import
com.y
dl.ydlcommon.utils.DeviceTool
;
import
com.y
idianling.im.R
;
import
java.util.List
;
...
...
@@ -334,10 +334,6 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener {
videoInit
=
true
;
}
public
void
onResume
()
{
surfaceViewFixBefore43
(
smallSizePreviewLayout
,
largeSizePreviewLayout
);
}
public
void
onDestroy
()
{
if
(
time
!=
null
)
{
time
.
stop
();
...
...
@@ -848,20 +844,5 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener {
return
avChatData
;
}
private
void
surfaceViewFixBefore43
(
ViewGroup
front
,
ViewGroup
back
)
{
if
(
Build
.
VERSION
.
SDK_INT
<=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR2
)
{
if
(
back
.
getChildCount
()
>
0
)
{
View
child
=
back
.
getChildAt
(
0
);
back
.
removeView
(
child
);
back
.
addView
(
child
);
}
if
(
front
.
getChildCount
()
>
0
)
{
View
child
=
front
.
getChildAt
(
0
);
front
.
removeView
(
child
);
front
.
addView
(
child
);
}
}
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
5e2fb2d5
package
com
.
yidianling
.
im
.
session
.
viewholder
;
import
android.os.Build
;
import
android.view.View
;
import
android.widget.TextView
;
...
...
@@ -180,15 +179,11 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
if
(
multipleAnswers
.
size
()>
0
){
confirm_multiple_choice
.
setEnabled
(
true
);
confirm_multiple_choice
.
setText
(
String
.
format
(
"确定(%d)"
,
multipleAnswers
.
size
()));
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getResources
().
getDrawable
(
R
.
drawable
.
im_background_18dp_1da1f2
));
}
confirm_multiple_choice
.
setBackground
(
context
.
getResources
().
getDrawable
(
R
.
drawable
.
im_background_18dp_1da1f2
));
}
else
{
confirm_multiple_choice
.
setEnabled
(
false
);
confirm_multiple_choice
.
setText
(
"确定"
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
}
...
...
@@ -197,9 +192,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
if
(!
singleOrMultipletype
.
contains
(
"radio"
)){
confirm_multiple_choice
.
setEnabled
(
false
);
confirm_multiple_choice
.
setText
(
"确定"
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -365,15 +358,11 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
confirm_multiple_choice
.
setText
(
String
.
format
(
"确定(%d)"
,
selectedStr
.
size
()));
if
(
selectedStr
.
size
()
>
0
)
{
confirm_multiple_choice
.
setEnabled
(
true
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getResources
().
getDrawable
(
R
.
drawable
.
im_background_18dp_1da1f2
));
}
confirm_multiple_choice
.
setBackground
(
context
.
getResources
().
getDrawable
(
R
.
drawable
.
im_background_18dp_1da1f2
));
}
else
{
confirm_multiple_choice
.
setEnabled
(
false
);
confirm_multiple_choice
.
setText
(
"确定"
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
confirm_multiple_choice
.
setBackground
(
context
.
getDrawable
(
R
.
drawable
.
im_background_18dp_ebebeb
));
}
stringBuffer
.
delete
(
3
,
stringBuffer
.
length
());
for
(
int
i
=
0
;
i
<
selectedStr
.
size
();
i
++)
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/contact/selector/viewholder/ContactsSelectHolder.java
View file @
5e2fb2d5
package
com
.
yidianling
.
uikit
.
business
.
contact
.
selector
.
viewholder
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.common.ui.imageview.HeadImageView
;
import
com.yidianling.uikit.api.NimUIKit
;
import
com.yidianling.uikit.business.contact.core.item.ContactItem
;
import
com.yidianling.uikit.business.contact.core.model.ContactDataAdapter
;
import
com.yidianling.uikit.business.contact.core.model.IContact
;
import
com.yidianling.uikit.business.contact.core.viewholder.AbsContactViewHolder
;
import
com.yidianling.uikit.business.contact.selector.adapter.ContactSelectAdapter
;
import
com.yidianling.nimbase.common.ui.imageview.HeadImageView
;
public
class
ContactsSelectHolder
extends
AbsContactViewHolder
<
ContactItem
>
{
private
final
boolean
multi
;
...
...
@@ -79,10 +78,6 @@ public class ContactsSelectHolder extends AbsContactViewHolder<ContactItem> {
}
private
void
setBackground
(
View
view
,
Drawable
drawable
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
view
.
setBackground
(
drawable
);
}
else
{
view
.
setBackgroundDrawable
(
drawable
);
}
view
.
setBackground
(
drawable
);
}
}
m-im/src/main/java/com/yidianling/uikit/business/session/activity/CaptureVideoActivity.java
View file @
5e2fb2d5
package
com
.
yidianling
.
uikit
.
business
.
session
.
activity
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -24,6 +23,7 @@ import android.widget.ImageView;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
com.yidianling.im.R
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.activity.ToolBarOptions
;
import
com.yidianling.nimbase.common.activity.UI
;
...
...
@@ -32,7 +32,6 @@ import com.yidianling.nimbase.common.ui.dialog.EasyAlertDialogHelper;
import
com.yidianling.nimbase.common.util.file.AttachmentStore
;
import
com.yidianling.nimbase.common.util.log.LogUtil
;
import
com.yidianling.nimbase.common.util.sys.TimeUtil
;
import
com.yidianling.im.R
;
import
java.io.File
;
import
java.util.Date
;
...
...
@@ -203,17 +202,15 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
});
}
@TargetApi
(
9
)
private
void
switchCamera
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
cameraId
=
(
cameraId
+
1
)
%
Camera
.
getNumberOfCameras
();
}
cameraId
=
(
cameraId
+
1
)
%
Camera
.
getNumberOfCameras
();
resizeSurfaceView
();
shutdownCamera
();
initCamera
();
startPreview
();
}
@Override
public
void
onResume
()
{
super
.
onResume
();
...
...
@@ -221,6 +218,7 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
WindowManager
.
LayoutParams
.
FLAG_KEEP_SCREEN_ON
);
}
@Override
public
void
onPause
()
{
super
.
onPause
();
...
...
@@ -366,10 +364,8 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
backCameraSize
.
clear
();
frontCameraSize
.
clear
();
getVideoPreviewSize
(
false
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
if
(
Camera
.
getNumberOfCameras
()
>=
2
)
{
getVideoPreviewSize
(
true
);
}
if
(
Camera
.
getNumberOfCameras
()
>=
2
)
{
getVideoPreviewSize
(
true
);
}
}
...
...
@@ -419,15 +415,7 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
profile
.
videoCodec
=
MediaRecorder
.
VideoEncoder
.
H264
;
}
if
(
Build
.
VERSION
.
SDK_INT
>=
14
)
{
profile
.
audioCodec
=
MediaRecorder
.
AudioEncoder
.
AAC
;
}
else
{
if
(
Build
.
DISPLAY
!=
null
&&
Build
.
DISPLAY
.
indexOf
(
"MIUI"
)
>=
0
)
{
profile
.
audioCodec
=
MediaRecorder
.
AudioEncoder
.
AAC
;
}
else
{
profile
.
audioCodec
=
MediaRecorder
.
AudioEncoder
.
AMR_NB
;
}
}
profile
.
audioCodec
=
MediaRecorder
.
AudioEncoder
.
AAC
;
mediaRecorder
.
setProfile
(
profile
);
}
else
{
mediaRecorder
.
setOutputFormat
(
MediaRecorder
.
OutputFormat
.
MPEG_4
);
...
...
@@ -439,11 +427,9 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
@SuppressLint
(
"NewApi"
)
private
void
setVideoOrientation
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
Camera
.
CameraInfo
info
=
new
Camera
.
CameraInfo
();
Camera
.
getCameraInfo
(
cameraId
,
info
);
mediaRecorder
.
setOrientationHint
(
info
.
orientation
);
}
Camera
.
CameraInfo
info
=
new
Camera
.
CameraInfo
();
Camera
.
getCameraInfo
(
cameraId
,
info
);
mediaRecorder
.
setOrientationHint
(
info
.
orientation
);
}
public
void
updateRecordUI
()
{
...
...
@@ -591,13 +577,9 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
*/
@SuppressLint
(
"NewApi"
)
public
void
checkMultiCamera
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
if
(
Camera
.
getNumberOfCameras
()
>
1
)
{
multiCamera
=
true
;
switchCamera
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
switchCamera
.
setVisibility
(
View
.
GONE
);
}
if
(
Camera
.
getNumberOfCameras
()
>
1
)
{
multiCamera
=
true
;
switchCamera
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
switchCamera
.
setVisibility
(
View
.
GONE
);
}
...
...
@@ -628,10 +610,8 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
private
void
setCameraParameters
()
{
Camera
.
Parameters
params
=
camera
.
getParameters
();
if
(
Build
.
VERSION
.
SDK_INT
>=
15
)
{
if
(
params
.
isVideoStabilizationSupported
())
{
params
.
setVideoStabilization
(
true
);
}
if
(
params
.
isVideoStabilizationSupported
())
{
params
.
setVideoStabilization
(
true
);
}
List
<
String
>
focusMode
=
params
.
getSupportedFocusModes
();
...
...
@@ -711,12 +691,10 @@ public class CaptureVideoActivity extends UI implements SurfaceHolder.Callback {
public
int
setCameraDisplayOrientation
(
Context
context
,
int
cameraId
,
Camera
camera
)
{
int
orientation
=
90
;
boolean
front
=
(
cameraId
==
1
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
Camera
.
CameraInfo
info
=
new
Camera
.
CameraInfo
();
Camera
.
getCameraInfo
(
cameraId
,
info
);
orientation
=
info
.
orientation
;
front
=
(
info
.
facing
==
Camera
.
CameraInfo
.
CAMERA_FACING_FRONT
);
}
Camera
.
CameraInfo
info
=
new
Camera
.
CameraInfo
();
Camera
.
getCameraInfo
(
cameraId
,
info
);
orientation
=
info
.
orientation
;
front
=
(
info
.
facing
==
Camera
.
CameraInfo
.
CAMERA_FACING_FRONT
);
WindowManager
manager
=
(
WindowManager
)
context
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
int
rotation
=
manager
.
getDefaultDisplay
().
getRotation
();
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/helper/VideoMessageHelper.java
View file @
5e2fb2d5
...
...
@@ -5,12 +5,10 @@ import android.content.ActivityNotFoundException;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.provider.MediaStore
;
import
android.text.TextUtils
;
import
com.yidianling.im.R
;
import
com.yidianling.uikit.business.session.activity.CaptureVideoActivity
;
import
com.yidianling.nimbase.common.ToastHelper
;
import
com.yidianling.nimbase.common.ui.dialog.CustomAlertDialog
;
import
com.yidianling.nimbase.common.util.C
;
...
...
@@ -20,6 +18,7 @@ import com.yidianling.nimbase.common.util.storage.StorageType;
import
com.yidianling.nimbase.common.util.storage.StorageUtil
;
import
com.yidianling.nimbase.common.util.string.MD5
;
import
com.yidianling.nimbase.common.util.string.StringUtil
;
import
com.yidianling.uikit.business.session.activity.CaptureVideoActivity
;
import
java.io.File
;
...
...
@@ -91,11 +90,7 @@ public class VideoMessageHelper {
* 从本地相册中选择视频
*/
protected
void
chooseVideoFromLocal
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
19
)
{
chooseVideoFromLocalKitKat
();
}
else
{
chooseVideoFromLocalBeforeKitKat
();
}
chooseVideoFromLocalKitKat
();
}
/**
...
...
m-im/src/main/java/com/yidianling/uikit/business/team/activity/NormalTeamInfoActivity.java
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.yidianling.uikit.business.team.activity;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.view.KeyEvent
;
import
android.view.MotionEvent
;
...
...
@@ -521,9 +520,6 @@ public class NormalTeamInfoActivity extends UI implements OnClickListener, TAdap
}
}
// 为了解决2.3系统,移除用户后刷新界面不显示的问题
if
(
Build
.
VERSION
.
SDK_INT
<
11
)
{
adapter
.
setMode
(
TeamMemberAdapter
.
Mode
.
NORMAL
);
}
adapter
.
notifyDataSetChanged
();
}
...
...
m-muse/src/main/java/com/yidianling/muse/activity/ChooseMusicActivity.kt
View file @
5e2fb2d5
...
...
@@ -5,7 +5,6 @@ import android.content.Context
import
android.content.Intent
import
android.content.res.Resources
import
android.net.Uri
import
android.os.Build
import
android.os.Bundle
import
android.text.TextUtils
import
android.util.Log
...
...
@@ -82,9 +81,7 @@ class ChooseMusicActivity : BaseActivity() {
mWebSettings
.
textZoom
=
100
//设置字体不跟随字体变化而变化
mWebSettings
.
allowFileAccessFromFileURLs
=
true
mWebSettings
.
blockNetworkImage
=
false
// 解决图片不显示
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
mWebSettings
.
mixedContentMode
=
WebSettings
.
LOAD_NORMAL
}
mWebSettings
.
mixedContentMode
=
WebSettings
.
LOAD_DEFAULT
wv_choose_music
.
scrollBarStyle
=
View
.
SCROLLBARS_INSIDE_OVERLAY
//滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
wv_choose_music
.
addJavascriptInterface
(
jtoJHandle
,
"javascriptHandler"
)
...
...
@@ -98,11 +95,7 @@ class ChooseMusicActivity : BaseActivity() {
super
.
onPageFinished
(
view
,
url
)
}
override
fun
shouldOverrideUrlLoading
(
view
:
WebView
,
request
:
WebResourceRequest
):
Boolean
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
loadUrl
(
request
.
url
.
toString
(),
view
)
}
else
{
loadUrl
(
request
.
toString
(),
view
)
}
loadUrl
(
request
.
url
.
toString
(),
view
)
return
true
}
}
...
...
m-muse/src/main/java/com/yidianling/muse/dialog/ChooseMusicDialog.kt
View file @
5e2fb2d5
...
...
@@ -5,7 +5,6 @@ import android.app.Activity
import
android.app.Dialog
import
android.content.res.Resources
import
android.net.Uri
import
android.os.Build
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.Gravity
...
...
@@ -14,10 +13,8 @@ import android.view.WindowManager
import
android.webkit.WebSettings
import
com.ydl.utils.WebUrlParamsUtils
import
com.ydl.webview.H5Params
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.muse.R
import
com.yidianling.muse.activity.PlayMeditationActivity
import
kotlinx.android.synthetic.main.dialog_choose_music.*
/**
...
...
@@ -63,9 +60,7 @@ class ChooseMusicDialog(activity: Activity,h5Params: H5Params) : Dialog(activity
mWebSettings
.
textZoom
=
100
//设置字体不跟随字体变化而变化
mWebSettings
.
allowFileAccessFromFileURLs
=
true
mWebSettings
.
blockNetworkImage
=
false
// 解决图片不显示
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
mWebSettings
.
mixedContentMode
=
WebSettings
.
LOAD_NORMAL
}
mWebSettings
.
mixedContentMode
=
WebSettings
.
LOAD_NORMAL
wv_choose_music
.
scrollBarStyle
=
View
.
SCROLLBARS_INSIDE_OVERLAY
//滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
// val jsInterface = JsInterface(mActivity as PlayMeditationActivity)
// wv_choose_music.addJavascriptInterface(jsInterface, "javascriptHandler")
...
...
m-muse/src/main/java/com/yidianling/muse/utils/MeditationFloatPermissionUtil.kt
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.provider.Settings
object
MeditationFloatPermissionUtil
{
...
...
@@ -13,14 +12,12 @@ object MeditationFloatPermissionUtil {
private
fun
commonROMPermissionCheck
(
context
:
Context
?):
Boolean
{
var
result
=
true
if
(
Build
.
VERSION
.
SDK_INT
>=
23
){
try
{
val
clazz
:
Class
<*>
=
Settings
::
class
.
java
val
canDrawOverlays
=
clazz
.
getDeclaredMethod
(
"canDrawOverlays"
,
Context
::
class
.
java
)
result
=
canDrawOverlays
.
invoke
(
null
,
context
)
as
Boolean
}
catch
(
e
:
Exception
){
try
{
val
clazz
:
Class
<*>
=
Settings
::
class
.
java
val
canDrawOverlays
=
clazz
.
getDeclaredMethod
(
"canDrawOverlays"
,
Context
::
class
.
java
)
result
=
canDrawOverlays
.
invoke
(
null
,
context
)
as
Boolean
}
catch
(
e
:
Exception
)
{
}
}
return
result
}
...
...
m-tests/src/main/java/com/yidianling/tests/home/TestHomeActivity.kt
View file @
5e2fb2d5
package
com.yidianling.tests.home
import
android.os.Build
import
androidx.core.content.ContextCompat
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
android.text.TextUtils
import
android.view.View
import
android.widget.LinearLayout
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.ydl.ydlcommon.base.BaseMvpActivity
...
...
@@ -103,13 +102,12 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
* 初始化状态栏位置
*/
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
this
)
val
lp1
=
rl_tests_title_layout
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
48f
)
+
statusBarHeight
)
rl_tests_title_layout
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
this
)
val
lp1
=
rl_tests_title_layout
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
48f
)
+
statusBarHeight
)
rl_tests_title_layout
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
...
...
m-user/build.gradle
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ android {
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
buildToolsVersion
rootProject
.
ext
.
android
[
"buildToolsVersion"
]
defaultConfig
{
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
...
...
m-user/src/main/java/com/yidianling/user/mine/NotificationsSettingActivity.java
View file @
5e2fb2d5
...
...
@@ -171,14 +171,8 @@ public class NotificationsSettingActivity extends BaseActivity {
private
void
getAppDetailSettingIntent
(
Context
context
)
{
Intent
localIntent
=
new
Intent
();
localIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
getPackageName
(),
null
));
}
else
if
(
Build
.
VERSION
.
SDK_INT
<=
8
)
{
localIntent
.
setAction
(
Intent
.
ACTION_VIEW
);
localIntent
.
setClassName
(
"com.android.settings"
,
"com.android.settings.InstalledAppDetails"
);
localIntent
.
putExtra
(
"com.android.settings.ApplicationPkgName"
,
getPackageName
());
}
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
getPackageName
(),
null
));
startActivity
(
localIntent
);
}
...
...
m-user/src/main/java/com/yidianling/user/mine/ReceiveRedPacketActivity.kt
View file @
5e2fb2d5
...
...
@@ -2,7 +2,6 @@ package com.yidianling.user.mine
import
android.app.Activity
import
android.content.Intent
import
android.os.Build
import
android.text.SpannableStringBuilder
import
android.text.Spanned
import
android.text.TextUtils
...
...
@@ -139,13 +138,12 @@ class ReceiveRedPacketActivity : BaseActivity(),View.OnClickListener {
* 初始化状态栏位置
*/
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
this
)
val
lp1
=
title_bar
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
45f
)
+
statusBarHeight
)
title_bar
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
val
statusBarHeight
=
StatusBarUtils
.
getStatusBarHeight
(
this
)
val
lp1
=
title_bar
.
layoutParams
as
LinearLayout
.
LayoutParams
lp1
.
height
=
(
RxImageTool
.
dp2px
(
45f
)
+
statusBarHeight
)
title_bar
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
}
override
fun
initDataAndEvent
()
{
...
...
m-user/src/main/java/com/yidianling/user/safePrivate/FingerPrintUtil.kt
View file @
5e2fb2d5
...
...
@@ -2,7 +2,6 @@ package com.yidianling.user.safePrivate
import
android.app.KeyguardManager
import
android.content.Context
import
android.os.Build
import
androidx.core.hardware.fingerprint.FingerprintManagerCompat
import
androidx.core.os.CancellationSignal
import
com.ydl.ydlcommon.base.BaseApp
...
...
@@ -70,21 +69,15 @@ class FingerPrintUtil {
}
private
fun
init
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
if
(
manager
==
null
&&
keyManager
==
null
)
{
manager
=
FingerprintManagerCompat
.
from
(
context
)
keyManager
=
context
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
}
if
(
manager
==
null
&&
keyManager
==
null
)
{
manager
=
FingerprintManagerCompat
.
from
(
context
)
keyManager
=
context
.
getSystemService
(
Context
.
KEYGUARD_SERVICE
)
as
KeyguardManager
}
}
//硬件设备是否支持指纹解锁功能
fun
isFingerPrintAvaliable
():
Boolean
?
{
return
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
manager
?.
isHardwareDetected
}
else
{
false
}
return
manager
?.
isHardwareDetected
}
//判断是否有锁屏密码
...
...
@@ -95,22 +88,21 @@ class FingerPrintUtil {
// 判断设备是否录入指纹,貌似APP无法直接唤醒指纹设置页面
fun
isHaveFingerPrint
():
Boolean
?
{
return
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
manager
?.
hasEnrolledFingerprints
()
}
else
{
false
}
return
manager
?.
hasEnrolledFingerprints
()
}
// 开始识别指纹
// 参数分别是:防止第三方恶意攻击的包装类,CancellationSignal对象,flags,回调对象,handle
fun
startFingerPrint
(
call
:
FingerCallback
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
if
(
mCancellationSignal
==
null
)
{
mCancellationSignal
=
CancellationSignal
()
}
manager
?.
authenticate
(
null
,
0
,
mCancellationSignal
,
object
:
FingerprintManagerCompat
.
AuthenticationCallback
()
{
if
(
mCancellationSignal
==
null
)
{
mCancellationSignal
=
CancellationSignal
()
}
manager
?.
authenticate
(
null
,
0
,
mCancellationSignal
,
object
:
FingerprintManagerCompat
.
AuthenticationCallback
()
{
override
fun
onAuthenticationError
(
errorCode
:
Int
,
errString
:
CharSequence
)
{
super
.
onAuthenticationError
(
errorCode
,
errString
)
call
.
onAuthenticationError
()
...
...
@@ -128,16 +120,15 @@ class FingerPrintUtil {
call
.
onAuthenticationFailed
()
LogUtil
.
d
(
"指纹识别失败"
)
}
},
null
)
}
},
null
)
}
//停止指纹监听
fun
cancelFingerListener
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
mCancellationSignal
?.
cancel
()
mCancellationSignal
=
null
}
mCancellationSignal
?.
cancel
()
mCancellationSignal
=
null
}
private
object
Inner
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/SecretActivity.kt
View file @
5e2fb2d5
...
...
@@ -2,7 +2,6 @@ package com.yidianling.user.ui.login
import
android.app.Activity
import
android.content.Intent
import
android.os.Build
import
android.text.Html
import
android.view.KeyEvent
import
com.ydl.ydlcommon.base.BaseActivity
...
...
@@ -110,10 +109,9 @@ class SecretActivity : BaseActivity() {
}
private
fun
initStatus
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
)
}
//4.4以下不支持状态栏变色
StatusBarUtils
.
setTransparentForImageView
(
this
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
)
}
private
fun
agreeAction
()
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
View file @
5e2fb2d5
...
...
@@ -5,7 +5,6 @@ import android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.text.TextUtils
import
android.view.View
import
android.view.animation.AnimationUtils
...
...
@@ -278,11 +277,9 @@ class VerificationCodeActivity :
override
fun
verificationErrorCode
()
{
//验证码异常回调
verify_code
.
highlightSingleFieldType
=
HighlightType
.
ALL_FIELDS
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
verify_code
.
highlightPaintColor
=
getColor
(
R
.
color
.
user_bgcolorred
)
verify_code
.
setText
(
""
)
}
verify_code
.
highlightSingleFieldType
=
HighlightType
.
ALL_FIELDS
verify_code
.
highlightPaintColor
=
getColor
(
R
.
color
.
user_bgcolorred
)
verify_code
.
setText
(
""
)
verify_code
.
invalidate
()
dismissProgressDialog
()
val
shake
=
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
user_shake_input
)
//加载动画资源文件
...
...
m-user/src/main/java/com/yidianling/user/widget/PinField/SquarePinField.kt
View file @
5e2fb2d5
...
...
@@ -11,7 +11,6 @@ import `in`.srain.cube.util.LocalDisplay.dp2px
import
android.content.Context
import
android.graphics.Canvas
import
android.graphics.Paint
import
android.os.Build
import
android.util.AttributeSet
import
com.yidianling.user.R
...
...
@@ -110,10 +109,18 @@ class SquarePinField : PinField{
}
private
fun
drawRect
(
canvas
:
Canvas
?,
paddedX1
:
Float
,
paddedY1
:
Float
,
paddedX2
:
Float
,
paddedY2
:
Float
,
paint
:
Paint
){
if
(
cornerRadius
>
0
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
){
canvas
?.
drawRoundRect
(
paddedX1
,
paddedY1
-
20f
,
paddedX2
+
20f
,
paddedY2
,
cornerRadius
,
cornerRadius
,
paint
)
}
else
{
canvas
?.
drawRect
(
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
paint
)
if
(
cornerRadius
>
0
)
{
canvas
?.
drawRoundRect
(
paddedX1
,
paddedY1
-
20f
,
paddedX2
+
20f
,
paddedY2
,
cornerRadius
,
cornerRadius
,
paint
)
}
else
{
canvas
?.
drawRect
(
paddedX1
,
paddedY1
,
paddedX2
,
paddedY2
,
paint
)
}
}
}
\ No newline at end of file
ydl-media/build.gradle
View file @
5e2fb2d5
...
...
@@ -10,12 +10,11 @@ kapt {
}
}
android
{
compileSdkVersion
28
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
defaultConfig
{
minSdkVersion
21
targetSdkVersion
28
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
versionCode
1
versionName
"1.0"
...
...
ydl-media/src/main/java/com/ydl/media/audio/manager/MediaSessionManager.kt
View file @
5e2fb2d5
...
...
@@ -2,7 +2,6 @@ package com.ydl.media.audio.manager
import
android.content.Context
import
android.graphics.Bitmap
import
android.os.Build
import
android.support.v4.media.MediaMetadataCompat
import
android.support.v4.media.session.MediaSessionCompat
import
android.support.v4.media.session.PlaybackStateCompat
...
...
@@ -92,10 +91,6 @@ class MediaSessionManager private constructor() {
MediaMetadataCompat
.
METADATA_KEY_ALBUM_ART
,
bitmap
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
// TODO: 2019-10-26 by:HaoRui
// metaData.putLong(MediaMetadataCompat.METADATA_KEY_NUM_TRACKS, AppCache.get().getLocalMusicList().size());
}
mediaSession
?.
setMetadata
(
metaData
.
build
())
}
})
...
...
ydl-net/build.gradle
View file @
5e2fb2d5
...
...
@@ -5,12 +5,11 @@ apply plugin: 'kotlin-kapt'
apply
from:
"../publish.gradle"
android
{
compileSdkVersion
28
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
defaultConfig
{
minSdkVersion
21
targetSdkVersion
28
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
versionCode
1
versionName
"1.0"
...
...
ydl-pay/build.gradle
View file @
5e2fb2d5
...
...
@@ -5,12 +5,11 @@ apply plugin: 'kotlin-android-extensions'
apply
from:
"../publish.gradle"
android
{
compileSdkVersion
28
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
defaultConfig
{
minSdkVersion
21
targetSdkVersion
28
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
versionCode
1
versionName
"1.0"
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/http/utils/NetUtils.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.os.Build
;
import
android.telephony.TelephonyManager
;
import
java.io.BufferedReader
;
...
...
@@ -318,11 +317,7 @@ public class NetUtils {
* @param context 上下文
*/
public
static
void
openWirelessSettings
(
Context
context
)
{
if
(
Build
.
VERSION
.
SDK_INT
>
10
)
{
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
}
else
{
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_WIRELESS_SETTINGS
));
}
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
}
/**
...
...
ydl-pay/src/main/java/com/yidianling/ydl_pay/common/http/utils/RxDeviceTool.java
View file @
5e2fb2d5
...
...
@@ -11,7 +11,6 @@ import android.content.res.Configuration;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.telephony.TelephonyManager
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
...
...
@@ -332,20 +331,13 @@ public class RxDeviceTool {
*/
public
static
boolean
checkPermission
(
Context
context
,
String
permission
)
{
boolean
result
=
false
;
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
try
{
Class
clazz
=
Class
.
forName
(
"android.content.Context"
);
Method
method
=
clazz
.
getMethod
(
"checkSelfPermission"
,
String
.
class
);
int
rest
=
(
Integer
)
method
.
invoke
(
context
,
permission
);
result
=
rest
==
PackageManager
.
PERMISSION_GRANTED
;
}
catch
(
Exception
e
)
{
result
=
false
;
}
}
else
{
PackageManager
pm
=
context
.
getPackageManager
();
if
(
pm
.
checkPermission
(
permission
,
context
.
getPackageName
())
==
PackageManager
.
PERMISSION_GRANTED
)
{
result
=
true
;
}
try
{
Class
clazz
=
Class
.
forName
(
"android.content.Context"
);
Method
method
=
clazz
.
getMethod
(
"checkSelfPermission"
,
String
.
class
);
int
rest
=
(
Integer
)
method
.
invoke
(
context
,
permission
);
result
=
rest
==
PackageManager
.
PERMISSION_GRANTED
;
}
catch
(
Exception
e
)
{
result
=
false
;
}
return
result
;
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/crash/Cockroach.java
View file @
5e2fb2d5
...
...
@@ -5,11 +5,17 @@ import android.os.Build;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.os.Message
;
import
com.ydl.ydlcommon.actions.crash.compat.*
;
import
me.weishu.reflection.Reflection
;
import
com.ydl.ydlcommon.actions.crash.compat.ActivityKillerV21_V23
;
import
com.ydl.ydlcommon.actions.crash.compat.ActivityKillerV24_V25
;
import
com.ydl.ydlcommon.actions.crash.compat.ActivityKillerV26
;
import
com.ydl.ydlcommon.actions.crash.compat.ActivityKillerV28
;
import
com.ydl.ydlcommon.actions.crash.compat.IActivityKiller
;
import
java.lang.reflect.Field
;
import
me.weishu.reflection.Reflection
;
/**
* Created by wanjian on 2017/2/14.
...
...
@@ -61,18 +67,14 @@ public final class Cockroach {
*/
private
static
void
initActivityKiller
()
{
//各版本android的ActivityManager获取方式,finishActivity的参数,token(binder对象)的获取不一样
if
(
Build
.
VERSION
.
SDK_INT
>=
28
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
sActivityKiller
=
new
ActivityKillerV28
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
26
)
{
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
sActivityKiller
=
new
ActivityKillerV26
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
==
25
||
Build
.
VERSION
.
SDK_INT
==
24
)
{
}
else
if
(
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
N_MR1
||
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
N
)
{
sActivityKiller
=
new
ActivityKillerV24_V25
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
21
&&
Build
.
VERSION
.
SDK_INT
<=
23
)
{
}
else
{
sActivityKiller
=
new
ActivityKillerV21_V23
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
15
&&
Build
.
VERSION
.
SDK_INT
<=
20
)
{
sActivityKiller
=
new
ActivityKillerV15_V20
();
}
else
if
(
Build
.
VERSION
.
SDK_INT
<
15
)
{
sActivityKiller
=
new
ActivityKillerV15_V20
();
}
try
{
...
...
@@ -103,7 +105,7 @@ public final class Cockroach {
callbackField
.
set
(
mhHandler
,
new
Handler
.
Callback
()
{
@Override
public
boolean
handleMessage
(
Message
msg
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
28
)
{
//android P 生命周期全部走这
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
P
)
{
//android P 生命周期全部走这
final
int
EXECUTE_TRANSACTION
=
159
;
if
(
msg
.
what
==
EXECUTE_TRANSACTION
)
{
try
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/actions/imagepicker/BrowsePicturesActivity.java
View file @
5e2fb2d5
...
...
@@ -5,14 +5,10 @@ import android.content.Context;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Parcelable
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.Window
;
...
...
@@ -20,6 +16,10 @@ import android.view.WindowManager;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
com.luck.picture.lib.photoview.PhotoView
;
import
com.miracle.view.imageeditor.utils.FileUtils
;
import
com.ydl.ydl_image.module.GlideApp
;
...
...
@@ -208,11 +208,9 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
}
private
void
initWindows
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
getWindow
();
Window
window
=
getWindow
();
// window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
private
Handler
mHandler
=
new
Handler
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/bean/StatusBarOptions.kt
View file @
5e2fb2d5
package
com.ydl.ydlcommon.bean
import
android.graphics.Color
import
android.os.Build
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.base.BaseApp
/**
* Created by haorui on 2019-08-15.
...
...
@@ -14,14 +11,10 @@ class StatusBarOptions {
var
statusBarDarkMode
:
Boolean
=
false
var
statusColor
:
String
?=
null
get
()
{
if
(
field
!=
null
){
return
field
}
else
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
return
"#FFFFFF"
}
// return "#"+Integer.toHexString(ContextCompat.getColor(BaseApp.getApp(), R.color.platform_main_theme))
return
BaseApp
.
getApp
().
resources
.
getString
(
0
+
R
.
color
.
platform_main_theme
);
return
if
(
field
!=
null
)
{
field
}
else
{
"#FFFFFF"
}
}
var
bottomStatusColor
:
Int
=
Color
.
parseColor
(
"#00000000"
)
//底部颜色默认透明色,个别页面自己设置即可
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/AndroidSystemHelper.kt
View file @
5e2fb2d5
...
...
@@ -177,12 +177,8 @@ class AndroidSystemHelper {
val
heightDifference
=
usableHeightSansKeyboard
-
usableHeightNow
if
(
heightDifference
>
usableHeightSansKeyboard
/
4
)
{
// keyboard probably just became visible
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
frameLayoutParams
.
height
=
usableHeightSansKeyboard
-
heightDifference
+
statusBarHeight
}
else
{
frameLayoutParams
.
height
=
usableHeightSansKeyboard
-
heightDifference
}
frameLayoutParams
.
height
=
usableHeightSansKeyboard
-
heightDifference
+
statusBarHeight
}
else
{
frameLayoutParams
.
height
=
contentHeight
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/ApkInstallTool.kt
View file @
5e2fb2d5
...
...
@@ -9,9 +9,8 @@ import android.os.Build
import
android.provider.Settings
import
androidx.core.content.FileProvider
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.yidianling.common.tools.ToastUtil
import
com.ydl.ydlcommon.bean.VersionData
import
com.yidianling.common.tools.ToastUtil
import
java.io.File
import
java.io.FileOutputStream
import
java.io.IOException
...
...
@@ -50,18 +49,18 @@ class ApkInstallTool {
* 判断是否是8.0,8.0需要处理未知应用来源权限问题,否则直接安装
*/
private
fun
checkIsAndroidO
(
context
:
Activity
?)
{
if
(
context
==
null
)
return
if
(
Build
.
VERSION
.
SDK_INT
>=
26
)
{
if
(
context
==
null
)
return
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
val
b
=
context
.
packageManager
.
canRequestPackageInstalls
()
if
(
b
)
{
startDownload
()
//安装应用的逻辑
}
else
{
//请求安装未知应用来源的权限
context
.
runOnUiThread
{
context
.
runOnUiThread
{
RxPermissions
(
context
)
.
requestEach
(
Manifest
.
permission
.
REQUEST_INSTALL_PACKAGES
)
.
subscribe
{
permission
->
if
(
permission
.
granted
)
{
.
requestEach
(
Manifest
.
permission
.
REQUEST_INSTALL_PACKAGES
)
.
subscribe
{
permission
->
if
(
permission
.
granted
)
{
startDownload
()
}
else
if
(
permission
.
shouldShowRequestPermissionRationale
)
{
checkIsAndroidO
(
context
)
...
...
@@ -99,15 +98,23 @@ class ApkInstallTool {
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
)
// 由于没有在Activity环境下启动Activity,设置下面的标签
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
if
(
Build
.
VERSION
.
SDK_INT
>=
24
)
{
//判读版本是否在7.0以上
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
//判读版本是否在7.0以上
//参数1 上下文, 参数2 Provider主机地址 和配置文件中保持一致 参数3 共享的文件
val
apkUri
=
context
?.
let
{
FileProvider
.
getUriForFile
(
it
,
"${it.applicationContext.packageName}.fileprovider"
,
file
)
}
val
apkUri
=
context
?.
let
{
FileProvider
.
getUriForFile
(
it
,
"${it.applicationContext.packageName}.fileprovider"
,
file
)
}
//添加这一句表示对目标应用临时授权该Uri所代表的文件
intent
.
addFlags
(
Intent
.
FLAG_GRANT_READ_URI_PERMISSION
)
intent
.
setDataAndType
(
apkUri
,
"application/vnd.android.package-archive"
)
}
else
{
intent
.
setDataAndType
(
Uri
.
fromFile
(
file
),
"application/vnd.android.package-archive"
)
intent
.
setDataAndType
(
Uri
.
fromFile
(
file
),
"application/vnd.android.package-archive"
)
}
context
?.
startActivity
(
intent
)
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceTool.java
View file @
5e2fb2d5
package
com
.
ydl
.
ydlcommon
.
utils
;
import
static
com
.
umeng
.
socialize
.
utils
.
ContextUtil
.
getPackageName
;
import
android.Manifest
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
...
...
@@ -36,8 +38,6 @@ import java.util.Collections;
import
java.util.Enumeration
;
import
java.util.List
;
import
static
com
.
umeng
.
socialize
.
utils
.
ContextUtil
.
getPackageName
;
public
class
DeviceTool
{
public
static
void
openPersisonSetting
(
Activity
activity
)
{
...
...
@@ -75,14 +75,8 @@ public class DeviceTool {
private
static
Intent
getAppDetailSettingIntent
()
{
Intent
localIntent
=
new
Intent
();
localIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
getPackageName
(),
null
));
}
else
if
(
Build
.
VERSION
.
SDK_INT
<=
8
)
{
localIntent
.
setAction
(
Intent
.
ACTION_VIEW
);
localIntent
.
setClassName
(
"com.android.settings"
,
"com.android.settings.InstalledAppDetails"
);
localIntent
.
putExtra
(
"com.android.settings.ApplicationPkgName"
,
getPackageName
());
}
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
getPackageName
(),
null
));
return
localIntent
;
}
...
...
@@ -275,14 +269,10 @@ public class DeviceTool {
public
static
String
getMac
(
Context
context
)
{
if
(
checkHasAgreeSecret
())
{
String
strMac
=
null
;
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
{
strMac
=
getLocalMacAddressFromWifiInfo
(
context
);
return
strMac
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
N
&&
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
N
)
{
strMac
=
getMacAddress
(
context
);
return
strMac
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
}
else
{
if
(!
TextUtils
.
isEmpty
(
getMacAddress
()))
{
strMac
=
getMacAddress
();
return
strMac
;
...
...
@@ -463,12 +453,6 @@ public class DeviceTool {
public
static
String
getMacAddress
(
Context
context
)
{
if
(
checkHasAgreeSecret
())
{
// 如果是6.0以下,直接通过wifimanager获取
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
{
String
macAddress0
=
getMacAddress0
(
context
);
if
(!
TextUtils
.
isEmpty
(
macAddress0
))
{
return
macAddress0
;
}
}
String
str
=
""
;
String
macSerial
=
""
;
try
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/DeviceUtils.kt
View file @
5e2fb2d5
...
...
@@ -42,9 +42,6 @@ class DeviceUtils private constructor() {
val
NETTYPE_WIFI
=
0
x01
val
NETTYPE_CMWAP
=
0
x02
val
NETTYPE_CMNET
=
0
x03
var
GTE_HC
:
Boolean
=
false
var
GTE_ICS
:
Boolean
=
false
var
PRE_HC
:
Boolean
=
false
private
var
_hasBigScreen
:
Boolean
?
=
null
private
var
_hasCamera
:
Boolean
?
=
null
private
var
_isTablet
:
Boolean
?
=
null
...
...
@@ -52,9 +49,6 @@ class DeviceUtils private constructor() {
var
displayDensity
=
0.0f
init
{
GTE_ICS
=
Build
.
VERSION
.
SDK_INT
>=
14
GTE_HC
=
Build
.
VERSION
.
SDK_INT
>=
11
PRE_HC
=
Build
.
VERSION
.
SDK_INT
<
11
}
/**
...
...
@@ -147,27 +141,16 @@ class DeviceUtils private constructor() {
screenWidth
=
metrics
.
widthPixels
screenHeight
=
metrics
.
heightPixels
// includes window decorations (statusbar bar/menu bar)
if
(
Build
.
VERSION
.
SDK_INT
>=
14
&&
Build
.
VERSION
.
SDK_INT
<
17
)
try
{
screenWidth
=
Display
::
class
.
java
.
getMethod
(
"getRawWidth"
)
.
invoke
(
d
)
as
Int
screenHeight
=
Display
::
class
.
java
.
getMethod
(
"getRawHeight"
).
invoke
(
d
)
as
Int
}
catch
(
ignored
:
Exception
)
{
}
// includes window decorations (statusbar bar/menu bar)
if
(
Build
.
VERSION
.
SDK_INT
>=
17
)
try
{
val
realSize
=
Point
()
Display
::
class
.
java
.
getMethod
(
"getRealSize"
,
Point
::
class
.
java
).
invoke
(
d
,
realSize
)
screenWidth
=
realSize
.
x
screenHeight
=
realSize
.
y
}
catch
(
ignored
:
Exception
)
{
}
try
{
val
realSize
=
Point
()
Display
::
class
.
java
.
getMethod
(
"getRealSize"
,
Point
::
class
.
java
).
invoke
(
d
,
realSize
)
screenWidth
=
realSize
.
x
screenHeight
=
realSize
.
y
}
catch
(
ignored
:
Exception
)
{
}
size
[
0
]
=
screenWidth
size
[
1
]
=
screenHeight
...
...
@@ -250,14 +233,7 @@ class DeviceUtils private constructor() {
* @return
*/
fun
hasHardwareMenuKey
(
context
:
Context
):
Boolean
{
var
flag
=
false
if
(
PRE_HC
)
flag
=
true
else
if
(
GTE_ICS
)
{
flag
=
ViewConfiguration
.
get
(
context
).
hasPermanentMenuKey
()
}
else
flag
=
false
return
flag
return
ViewConfiguration
.
get
(
context
).
hasPermanentMenuKey
()
}
/**
...
...
@@ -270,10 +246,7 @@ class DeviceUtils private constructor() {
val
flag
:
Boolean
val
manager
=
context
.
applicationContext
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
)
as
ConnectivityManager
if
(
manager
!=
null
&&
manager
.
activeNetworkInfo
!=
null
)
flag
=
true
else
flag
=
false
flag
=
manager
.
activeNetworkInfo
!=
null
return
flag
}
...
...
@@ -297,10 +270,6 @@ class DeviceUtils private constructor() {
return
false
}
fun
hideAnimatedView
(
view
:
View
?)
{
if
(
PRE_HC
&&
view
!=
null
)
view
.
setPadding
(
view
.
width
,
0
,
0
,
0
)
}
/**
* 隐藏软键盘
...
...
@@ -362,10 +331,6 @@ class DeviceUtils private constructor() {
return
_isTablet
!!
}
fun
showAnimatedView
(
view
:
View
?)
{
if
(
PRE_HC
&&
view
!=
null
)
view
.
setPadding
(
0
,
0
,
0
,
0
)
}
fun
showSoftKeyboard
(
dialog
:
Dialog
)
{
dialog
.
window
!!
.
setSoftInputMode
(
4
)
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/FileUtils.java
View file @
5e2fb2d5
...
...
@@ -16,9 +16,10 @@ import android.os.Build;
import
android.os.Environment
;
import
android.provider.DocumentsContract
;
import
android.provider.MediaStore
;
import
androidx.core.content.FileProvider
;
import
android.util.Log
;
import
androidx.core.content.FileProvider
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.FileInputStream
;
...
...
@@ -295,7 +296,7 @@ public class FileUtils {
throw
new
NullPointerException
();
}
Uri
uri
;
if
(
Build
.
VERSION
.
SDK_INT
>=
24
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
uri
=
FileProvider
.
getUriForFile
(
context
.
getApplicationContext
(),
"com.honjane.providerdemo.fileprovider"
,
file
);
}
else
{
uri
=
Uri
.
fromFile
(
file
);
...
...
@@ -407,9 +408,8 @@ public class FileUtils {
*/
@SuppressLint
(
"NewApi"
)
public
static
String
getPathByUri4kitkat
(
final
Context
context
,
final
Uri
uri
)
{
final
boolean
isKitKat
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
;
// DocumentProvider
if
(
isKitKat
&&
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
if
(
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
if
(
Utils
.
isExternalStorageDocument
(
uri
))
{
// ExternalStorageProvider
final
String
docId
=
DocumentsContract
.
getDocumentId
(
uri
);
final
String
[]
split
=
docId
.
split
(
":"
);
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/KeyboardChangeListener.java
View file @
5e2fb2d5
package
com
.
ydl
.
ydlcommon
.
utils
;
import
android.app.Activity
;
import
android.os.Build
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewTreeObserver
;
...
...
@@ -91,9 +90,7 @@ public class KeyboardChangeListener implements ViewTreeObserver.OnGlobalLayoutLi
public
void
destroy
()
{
if
(
mContentView
!=
null
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mContentView
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
}
mContentView
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
}
}
}
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/StatusBarUtils.kt
View file @
5e2fb2d5
...
...
@@ -6,17 +6,17 @@ import android.app.Dialog
import
android.content.Context
import
android.graphics.Color
import
android.os.Build
import
android.view.View
import
android.view.ViewGroup
import
android.view.WindowManager
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
androidx.annotation.ColorInt
import
androidx.annotation.IntRange
import
androidx.annotation.LayoutRes
import
androidx.coordinatorlayout.widget.CoordinatorLayout
import
androidx.core.content.ContextCompat
import
androidx.drawerlayout.widget.DrawerLayout
import
android.view.View
import
android.view.ViewGroup
import
android.view.WindowManager
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
com.ydl.ydlcommon.R
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.yidianling.common.tools.RxImageTool
...
...
@@ -32,14 +32,12 @@ class StatusBarUtils {
fun
setWindowStatusBarColor
(
activity
:
Activity
,
colorResId
:
Int
)
{
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
val
window
=
activity
.
window
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
.
statusBarColor
=
ContextCompat
.
getColor
(
activity
,
colorResId
)
val
window
=
activity
.
window
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
.
statusBarColor
=
ContextCompat
.
getColor
(
activity
,
colorResId
)
//底部导航栏
//window.setNavigationBarColor(activity.getResources().getColor(colorResId));
}
//底部导航栏
//window.setNavigationBarColor(activity.getResources().getColor(colorResId));
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
...
...
@@ -48,14 +46,12 @@ class StatusBarUtils {
fun
setWindowStatusBarColor
(
dialog
:
Dialog
,
colorResId
:
Int
)
{
try
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
val
window
=
dialog
.
window
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
.
statusBarColor
=
ContextCompat
.
getColor
(
dialog
.
context
,
colorResId
)
val
window
=
dialog
.
window
window
?.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
window
?.
statusBarColor
=
ContextCompat
.
getColor
(
dialog
.
context
,
colorResId
)
//底部导航栏
//window.setNavigationBarColor(activity.getResources().getColor(colorResId));
}
//底部导航栏
//window.setNavigationBarColor(activity.getResources().getColor(colorResId));
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
...
...
@@ -92,36 +88,10 @@ class StatusBarUtils {
*/
fun
setColor
(
activity
:
Activity
,
@ColorInt
color
:
Int
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
calculateStatusColor
(
color
,
statusBarAlpha
)
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
val
decorView
=
activity
.
window
.
decorView
as
ViewGroup
val
fakeStatusBarView
=
decorView
.
findViewById
<
View
>(
FAKE_STATUS_BAR_VIEW_ID
)
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
visibility
==
View
.
GONE
)
{
fakeStatusBarView
.
visibility
=
View
.
VISIBLE
}
fakeStatusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
)
}
else
{
decorView
.
addView
(
createStatusBarView
(
activity
,
color
,
statusBarAlpha
)
)
}
setRootView
(
activity
)
}
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
calculateStatusColor
(
color
,
statusBarAlpha
)
}
/**
...
...
@@ -149,45 +119,28 @@ class StatusBarUtils {
activity
:
Activity
,
@ColorInt
color
:
Int
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
val
contentView
=
activity
.
findViewById
<
View
>(
android
.
R
.
id
.
content
)
as
ViewGroup
val
rootView
=
contentView
.
getChildAt
(
0
)
val
statusBarHeight
=
getStatusBarHeight
(
activity
)
if
(
rootView
!=
null
&&
rootView
is
CoordinatorLayout
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
rootView
.
fitsSystemWindows
=
false
contentView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
)
val
isNeedRequestLayout
=
contentView
.
paddingTop
<
statusBarHeight
if
(
isNeedRequestLayout
)
{
contentView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
rootView
.
post
{
rootView
.
requestLayout
()
}
}
}
else
{
rootView
.
setStatusBarBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
)
}
}
else
{
contentView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
contentView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
val
contentView
=
activity
.
findViewById
<
View
>(
android
.
R
.
id
.
content
)
as
ViewGroup
val
rootView
=
contentView
.
getChildAt
(
0
)
val
statusBarHeight
=
getStatusBarHeight
(
activity
)
if
(
rootView
!=
null
&&
rootView
is
CoordinatorLayout
)
{
rootView
.
setStatusBarBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
}
setTransparentForWindow
(
activity
)
)
}
else
{
contentView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
)
contentView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
)
)
}
setTransparentForWindow
(
activity
)
}
/**
...
...
@@ -208,9 +161,6 @@ class StatusBarUtils {
*/
@Deprecated
(
""
)
fun
setColorDiff
(
activity
:
Activity
,
@ColorInt
color
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
transparentStatusBar
(
activity
)
val
contentView
=
activity
.
findViewById
<
View
>(
android
.
R
.
id
.
content
)
as
ViewGroup
// 移除半透明矩形,以免叠加
...
...
@@ -256,9 +206,6 @@ class StatusBarUtils {
* @param statusBarAlpha 状态栏透明度
*/
fun
setTranslucent
(
activity
:
Activity
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
setTransparent
(
activity
)
addTranslucentView
(
activity
,
statusBarAlpha
)
}
...
...
@@ -273,9 +220,6 @@ class StatusBarUtils {
* @param statusBarAlpha 状态栏透明度
*/
fun
setTranslucentForCoordinatorLayout
(
activity
:
Activity
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
transparentStatusBar
(
activity
)
addTranslucentView
(
activity
,
statusBarAlpha
)
}
...
...
@@ -286,9 +230,6 @@ class StatusBarUtils {
* @param activity 需要设置的activity
*/
fun
setTransparent
(
activity
:
Activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
transparentStatusBar
(
activity
)
setRootView
(
activity
)
}
...
...
@@ -303,11 +244,9 @@ class StatusBarUtils {
*/
@Deprecated
(
""
)
fun
setTranslucentDiff
(
activity
:
Activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
// 设置状态栏透明
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
setRootView
(
activity
)
}
// 设置状态栏透明
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
setRootView
(
activity
)
}
/**
...
...
@@ -354,16 +293,9 @@ class StatusBarUtils {
activity
:
Activity
,
drawerLayout
:
DrawerLayout
,
@ColorInt
color
:
Int
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
else
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
// 生成一个状态栏大小的矩形
// 添加 statusBarView 到布局中
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
...
...
@@ -418,40 +350,41 @@ class StatusBarUtils {
*/
@Deprecated
(
""
)
fun
setColorForDrawerLayoutDiff
(
activity
:
Activity
,
drawerLayout
:
DrawerLayout
,
@ColorInt
color
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
// 生成一个状态栏大小的矩形
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
val
fakeStatusBarView
=
contentLayout
.
findViewById
<
View
>(
FAKE_STATUS_BAR_VIEW_ID
)
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
visibility
==
View
.
GONE
)
{
fakeStatusBarView
.
visibility
=
View
.
VISIBLE
}
fakeStatusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
DEFAULT_STATUS_BAR_ALPHA
)
)
}
else
{
// 添加 statusBarView 到布局中
contentLayout
.
addView
(
createStatusBarView
(
activity
,
color
),
0
)
}
// 内容布局不是 LinearLayout 时,设置padding top
if
(
contentLayout
!
is
LinearLayout
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
)
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
// 生成一个状态栏大小的矩形
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
val
fakeStatusBarView
=
contentLayout
.
findViewById
<
View
>(
FAKE_STATUS_BAR_VIEW_ID
)
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
visibility
==
View
.
GONE
)
{
fakeStatusBarView
.
visibility
=
View
.
VISIBLE
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
fakeStatusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
DEFAULT_STATUS_BAR_ALPHA
)
)
}
else
{
// 添加 statusBarView 到布局中
contentLayout
.
addView
(
createStatusBarView
(
activity
,
color
),
0
)
}
// 内容布局不是 LinearLayout 时,设置padding top
if
(
contentLayout
!
is
LinearLayout
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
)
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
)
}
/**
...
...
@@ -478,9 +411,6 @@ class StatusBarUtils {
activity
:
Activity
,
drawerLayout
:
DrawerLayout
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
setTransparentForDrawerLayout
(
activity
,
drawerLayout
...
...
@@ -495,22 +425,17 @@ class StatusBarUtils {
* @param drawerLayout DrawerLayout
*/
fun
setTransparentForDrawerLayout
(
activity
:
Activity
,
drawerLayout
:
DrawerLayout
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
else
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
// 内容布局不是 LinearLayout 时,设置padding top
if
(
contentLayout
!
is
LinearLayout
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
)
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
)
}
// 设置属性
...
...
@@ -525,19 +450,17 @@ class StatusBarUtils {
*/
@Deprecated
(
""
)
fun
setTranslucentForDrawerLayoutDiff
(
activity
:
Activity
,
drawerLayout
:
DrawerLayout
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
// 设置状态栏透明
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
// 设置内容布局属性
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
contentLayout
.
fitsSystemWindows
=
true
contentLayout
.
clipToPadding
=
true
// 设置抽屉布局属性
val
vg
=
drawerLayout
.
getChildAt
(
1
)
as
ViewGroup
vg
.
fitsSystemWindows
=
false
// 设置 DrawerLayout 属性
drawerLayout
.
fitsSystemWindows
=
false
}
// 设置状态栏透明
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
// 设置内容布局属性
val
contentLayout
=
drawerLayout
.
getChildAt
(
0
)
as
ViewGroup
contentLayout
.
fitsSystemWindows
=
true
contentLayout
.
clipToPadding
=
true
// 设置抽屉布局属性
val
vg
=
drawerLayout
.
getChildAt
(
1
)
as
ViewGroup
vg
.
fitsSystemWindows
=
false
// 设置 DrawerLayout 属性
drawerLayout
.
fitsSystemWindows
=
false
}
/**
...
...
@@ -579,9 +502,6 @@ class StatusBarUtils {
activity
:
Activity
,
@IntRange
(
from
=
0
,
to
=
255
)
statusBarAlpha
:
Int
,
needOffsetView
:
View
?
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
}
setTransparentForWindow
(
activity
)
addTranslucentView
(
activity
,
statusBarAlpha
)
if
(
needOffsetView
!=
null
)
{
...
...
@@ -644,9 +564,6 @@ class StatusBarUtils {
statusBarAlpha
,
needOffsetView
)
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
clearPreviousSetting
(
activity
)
}
}
/**
...
...
@@ -761,33 +678,20 @@ class StatusBarUtils {
* 设置透明
*/
private
fun
setTransparentForWindow
(
activity
:
Activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
/**
* 使状态栏透明
*/
@TargetApi
(
Build
.
VERSION_CODES
.
KITKAT
)
private
fun
transparentStatusBar
(
activity
:
Activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
else
{
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
}
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
)
activity
.
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
)
activity
.
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
)
activity
.
window
.
statusBarColor
=
Color
.
TRANSPARENT
}
/**
...
...
@@ -857,19 +761,17 @@ class StatusBarUtils {
*/
fun
statusBarLightMode
(
activity
:
Activity
):
Int
{
var
result
=
0
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
setStatusBarLightMode
(
activity
,
true
))
{
result
=
ANDROID_M
}
if
(
setMIUIStatusBarLightMode
(
activity
,
true
))
{
result
=
MIUI
}
else
if
(
setFlymeStatusBarLightMode
(
activity
,
true
)
)
{
result
=
FLYME
}
if
(
setStatusBarLightMode
(
activity
,
true
))
{
result
=
ANDROID_M
}
if
(
setMIUIStatusBarLightMode
(
activity
,
true
))
{
result
=
MIUI
}
else
if
(
setFlymeStatusBarLightMode
(
activity
,
true
)
)
{
result
=
FLYME
}
return
result
}
...
...
@@ -909,18 +811,15 @@ class StatusBarUtils {
}
fun
setStatusBarLightMode
(
activity
:
Activity
,
isFontColorDark
:
Boolean
):
Boolean
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
if
(
isFontColorDark
)
{
// 沉浸式
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
else
{
//非沉浸式
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_VISIBLE
}
return
true
if
(
isFontColorDark
)
{
// 沉浸式
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
or
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
else
{
//非沉浸式
activity
.
window
.
decorView
.
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_VISIBLE
}
return
fals
e
return
tru
e
}
fun
setMIUIStatusBarLightMode
(
activity
:
Activity
,
isFontColorDark
:
Boolean
):
Boolean
{
...
...
@@ -1061,19 +960,17 @@ class StatusBarUtils {
containerView
:
View
,
statusBarOptions
:
StatusBarOptions
):
View
?
{
var
statusView
:
View
?=
null
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
statusView
=
containerView
.
findViewById
<
View
>(
R
.
id
.
view_status_place_holder
)
statusView
?.
setBackgroundColor
(
Color
.
parseColor
(
statusBarOptions
.
statusColor
))
val
statusBarHeight
=
getStatusBarHeight
(
context
)
statusView
?.
let
{
val
layoutParams
=
statusView
?.
getLayoutParams
()
as
LinearLayout
.
LayoutParams
layoutParams
.
height
=
statusBarHeight
statusView
?.
layoutParams
=
layoutParams
}
setTransparentForImageView
(
context
,
null
)
var
statusView
:
View
?
=
null
statusView
=
containerView
.
findViewById
<
View
>(
R
.
id
.
view_status_place_holder
)
statusView
?.
setBackgroundColor
(
Color
.
parseColor
(
statusBarOptions
.
statusColor
))
val
statusBarHeight
=
getStatusBarHeight
(
context
)
statusView
?.
let
{
val
layoutParams
=
statusView
.
layoutParams
as
LinearLayout
.
LayoutParams
layoutParams
.
height
=
statusBarHeight
statusView
.
layoutParams
=
layoutParams
}
setTransparentForImageView
(
context
,
null
)
if
(
statusBarOptions
.
statusBarDarkMode
)
{
statusBarLightMode
(
context
)
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/Utils.java
View file @
5e2fb2d5
package
com
.
ydl
.
ydlcommon
.
utils
;
import
android.annotation.TargetApi
;
import
android.content.ContentUris
;
import
android.content.Context
;
import
android.database.Cursor
;
import
android.graphics.Color
;
import
android.graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Environment
;
import
android.provider.DocumentsContract
;
import
android.provider.MediaStore
;
...
...
@@ -68,13 +66,9 @@ public class Utils {
* @param uri The Uri to query.
* @author paulburke
*/
@TargetApi
(
Build
.
VERSION_CODES
.
KITKAT
)
public
static
String
getPath
(
final
Context
context
,
final
Uri
uri
)
{
final
boolean
isKitKat
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
;
// DocumentProvider
if
(
isKitKat
&&
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
if
(
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
// ExternalStorageProvider
if
(
isExternalStorageDocument
(
uri
))
{
final
String
docId
=
DocumentsContract
.
getDocumentId
(
uri
);
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/statusBar/FlymeStatusbarUtils.java
View file @
5e2fb2d5
package
com
.
ydl
.
ydlcommon
.
utils
.
statusBar
;
import
android.app.Activity
;
import
android.os.Build
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
...
...
@@ -101,9 +100,7 @@ public class FlymeStatusbarUtils {
public
static
void
setStatusBarDarkIcon
(
Window
window
,
int
color
)
{
try
{
setStatusBarColor
(
window
,
color
);
if
(
Build
.
VERSION
.
SDK_INT
>
22
)
{
setStatusBarDarkIcon
(
window
.
getDecorView
(),
true
);
}
setStatusBarDarkIcon
(
window
.
getDecorView
(),
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -186,13 +183,9 @@ public class FlymeStatusbarUtils {
* @param dark 是否深色 true为深色 false 为白色
*/
public
static
void
setStatusBarDarkIcon
(
Window
window
,
boolean
dark
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
23
)
{
changeMeizuFlag
(
window
.
getAttributes
(),
"MEIZU_FLAG_DARK_STATUS_BAR_ICON"
,
dark
);
}
else
{
View
decorView
=
window
.
getDecorView
();
setStatusBarDarkIcon
(
decorView
,
dark
);
setStatusBarColor
(
window
,
0
);
}
View
decorView
=
window
.
getDecorView
();
setStatusBarDarkIcon
(
decorView
,
dark
);
setStatusBarColor
(
window
,
0
);
}
private
static
void
setStatusBarDarkIcon
(
Activity
activity
,
boolean
dark
,
boolean
flag
)
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/utils/statusBar/StatusBarUtil.java
View file @
5e2fb2d5
...
...
@@ -30,7 +30,6 @@ public class StatusBarUtil {
* @param color 状态栏颜色值
*/
public
static
void
setColor
(
Activity
activity
,
int
color
)
{
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// 设置状态栏透明
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
// 生成一个状态栏大小的矩形
...
...
@@ -42,7 +41,6 @@ public class StatusBarUtil {
ViewGroup
rootView
=
(
ViewGroup
)
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
)).
getChildAt
(
0
);
rootView
.
setFitsSystemWindows
(
true
);
rootView
.
setClipToPadding
(
true
);
// }
}
/**
...
...
@@ -74,12 +72,11 @@ public class StatusBarUtil {
* 修改状态栏为全透明
*/
public
static
void
setTranslucent
(
Window
window
)
{
if
(
null
==
window
)
return
;
if
(
null
==
window
)
{
return
;
}
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
else
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
...
...
@@ -101,17 +98,15 @@ public class StatusBarUtil {
*/
public
static
int
statusBarDarkMode
(
Activity
activity
)
{
int
result
=
0
;
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if
(
mIUISetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
result
=
1
;
}
else
if
(
isFlyme
())
{
FlymeStatusbarUtils
.
setStatusBarDarkIcon
(
activity
,
true
);
result
=
2
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
}
else
{
setAndroidNativeLightStatusBar
(
activity
.
getWindow
(),
true
);
result
=
3
;
}
// }
return
result
;
}
...
...
@@ -123,17 +118,15 @@ public class StatusBarUtil {
*/
public
static
int
statusBarLightMode
(
Activity
activity
)
{
int
result
=
0
;
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if
(
mIUISetStatusBarLightMode
(
activity
.
getWindow
(),
false
))
{
result
=
1
;
}
else
if
(
isFlyme
())
{
FlymeStatusbarUtils
.
setStatusBarDarkIcon
(
activity
,
false
);
result
=
2
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
}
else
{
setAndroidNativeLightStatusBar
(
activity
.
getWindow
(),
false
);
result
=
3
;
}
// }
return
result
;
}
...
...
@@ -194,13 +187,11 @@ public class StatusBarUtil {
}
result
=
true
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
if
(
dark
)
{
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
}
//开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
if
(
dark
)
{
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -212,10 +203,7 @@ public class StatusBarUtil {
private
static
void
setAndroidNativeLightStatusBar
(
Window
window
,
boolean
dark
)
{
View
decor
=
window
.
getDecorView
();
if
(
dark
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
decor
.
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
else
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
decor
.
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
decor
.
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/view/BaseViewHolder.java
View file @
5e2fb2d5
...
...
@@ -4,22 +4,21 @@ import android.annotation.SuppressLint;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.text.SpannableStringBuilder
;
import
android.text.TextUtils
;
import
android.util.SparseArray
;
import
android.view.View
;
import
android.view.animation.AlphaAnimation
;
import
android.widget.Checkable
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.ydl.ydl_image.config.ISimpleImageOpConfig
;
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
;
import
com.ydl.ydl_image.manager.YDLImageCacheManager
;
import
com.ydl.ydlcommon.view.widgets.RoundImageView
;
import
com.ydl.ydlcommon.R
;
import
com.ydl.ydlcommon.view.widgets.RoundImageView
;
public
class
BaseViewHolder
extends
RecyclerView
.
ViewHolder
{
...
...
@@ -182,15 +181,7 @@ public class BaseViewHolder extends RecyclerView.ViewHolder {
@SuppressLint
(
"NewApi"
)
public
BaseViewHolder
setAlpha
(
int
viewId
,
float
value
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
{
getView
(
viewId
).
setAlpha
(
value
);
}
else
{
// Pre-honeycomb hack to set Alpha value
AlphaAnimation
alpha
=
new
AlphaAnimation
(
value
,
value
);
alpha
.
setDuration
(
0
);
alpha
.
setFillAfter
(
true
);
getView
(
viewId
).
startAnimation
(
alpha
);
}
getView
(
viewId
).
setAlpha
(
value
);
return
this
;
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/view/SlidingTabLayout.java
View file @
5e2fb2d5
...
...
@@ -17,11 +17,6 @@
package
com
.
ydl
.
ydlcommon
.
view
;
import
android.content.Context
;
import
android.os.Build
;
import
androidx.fragment.app.Fragment
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
android.util.AttributeSet
;
import
android.util.TypedValue
;
import
android.view.Gravity
;
...
...
@@ -31,6 +26,10 @@ import android.view.ViewGroup;
import
android.widget.HorizontalScrollView
;
import
android.widget.TextView
;
import
androidx.fragment.app.Fragment
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.viewpager.widget.ViewPager
;
import
com.yidianling.common.tools.RxDeviceTool
;
import
java.util.ArrayList
;
...
...
@@ -193,19 +192,15 @@ public class SlidingTabLayout extends HorizontalScrollView {
textView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
TAB_VIEW_TEXT_SIZE_SP
);
textView
.
setTextColor
(
textColor
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
{
// If we're running on Honeycomb or newer, then we can use the Theme's
// selectableItemBackground to ensure that the View has a pressed state
TypedValue
outValue
=
new
TypedValue
();
getContext
().
getTheme
().
resolveAttribute
(
android
.
R
.
attr
.
selectableItemBackground
,
outValue
,
true
);
textView
.
setBackgroundResource
(
outValue
.
resourceId
);
}
// If we're running on Honeycomb or newer, then we can use the Theme's
// selectableItemBackground to ensure that the View has a pressed state
TypedValue
outValue
=
new
TypedValue
();
getContext
().
getTheme
().
resolveAttribute
(
android
.
R
.
attr
.
selectableItemBackground
,
outValue
,
true
);
textView
.
setBackgroundResource
(
outValue
.
resourceId
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ICE_CREAM_SANDWICH
)
{
// If we're running on ICS or newer, enable all-caps to match the Action Bar tab style
textView
.
setAllCaps
(
true
);
}
// If we're running on ICS or newer, enable all-caps to match the Action Bar tab style
textView
.
setAllCaps
(
true
);
int
padding
=
(
int
)
(
TAB_VIEW_PADDING_DIPS
*
getResources
().
getDisplayMetrics
().
density
);
int
paddingBottomTop
=
(
int
)
(
PADDING_BOTTOM_TOP_DIPS
*
getResources
().
getDisplayMetrics
().
density
);
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/view/verticaltablayout/TabView.java
View file @
5e2fb2d5
...
...
@@ -5,8 +5,6 @@ import android.content.res.TypedArray;
import
android.graphics.Typeface
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
androidx.annotation.Px
;
import
androidx.annotation.RequiresApi
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.widget.Checkable
;
...
...
@@ -14,6 +12,9 @@ import android.widget.FrameLayout;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.annotation.Px
;
import
androidx.annotation.RequiresApi
;
import
com.ydl.ydlcommon.utils.DisplayUtils
;
/**
...
...
@@ -36,11 +37,7 @@ public class TabView extends FrameLayout implements Checkable {
mTabTitle
=
new
TabTitle
.
Builder
().
build
();
initView
();
int
[]
attrs
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
attrs
=
new
int
[]{
android
.
R
.
attr
.
selectableItemBackgroundBorderless
};
}
else
{
attrs
=
new
int
[]{
android
.
R
.
attr
.
selectableItemBackground
};
}
attrs
=
new
int
[]{
android
.
R
.
attr
.
selectableItemBackgroundBorderless
};
TypedArray
a
=
mContext
.
getTheme
().
obtainStyledAttributes
(
attrs
);
mDefaultBackground
=
a
.
getDrawable
(
0
);
a
.
recycle
();
...
...
@@ -169,11 +166,7 @@ public class TabView extends FrameLayout implements Checkable {
@Override
public
void
setBackground
(
Drawable
background
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
super
.
setBackground
(
background
);
}
else
{
super
.
setBackgroundDrawable
(
background
);
}
super
.
setBackground
(
background
);
}
@Override
...
...
ydl-resource/build.gradle
View file @
5e2fb2d5
...
...
@@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
//apply from: "../publish.gradle"
android
{
compileSdkVersion
28
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
defaultConfig
{
minSdkVersion
21
targetSdkVersion
28
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
flavorDimensions
"versionCode"
//Flavor 维度信息
}
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/TUIThemeManager.java
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.tencent.qcloud.tuicore;
import
android.app.Activity
;
import
android.app.Application
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
...
...
@@ -177,10 +176,10 @@ public class TUIThemeManager {
}
resources
.
updateConfiguration
(
configuration
,
null
);
if
(
Build
.
VERSION
.
SDK_INT
>=
25
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N_MR1
)
{
context
=
context
.
createConfigurationContext
(
configuration
);
context
.
getResources
().
updateConfiguration
(
configuration
,
resources
.
getDisplayMetrics
());
resources
.
getDisplayMetrics
());
}
}
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/trtccalling/model/util/PermissionUtil.java
View file @
5e2fb2d5
...
...
@@ -31,11 +31,7 @@ public class PermissionUtil {
}
else
if
(
BrandUtil
.
isBrandVivo
())
{
return
isVivoBgStartPermissionAllowed
(
context
);
}
else
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
return
Settings
.
canDrawOverlays
(
context
);
}
else
{
return
hasPermissionBelowMarshmallow
(
context
);
}
return
Settings
.
canDrawOverlays
(
context
);
}
}
...
...
@@ -43,11 +39,7 @@ public class PermissionUtil {
if
(
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
O
)
{
return
hasPermissionForO
(
context
);
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
return
Settings
.
canDrawOverlays
(
context
);
}
else
{
return
hasPermissionBelowMarshmallow
(
context
);
}
return
Settings
.
canDrawOverlays
(
context
);
}
/**
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/calling/videocall/TRTCBaseActivity.java
View file @
5e2fb2d5
...
...
@@ -2,11 +2,11 @@ package com.tencent.qcloud.tuicore.calling.videocall;
import
android.Manifest
;
import
android.content.pm.PackageManager
;
import
android.os.Build
;
import
android.widget.Toast
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.core.app.ActivityCompat
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -19,26 +19,24 @@ public abstract class TRTCBaseActivity extends AppCompatActivity {
protected
abstract
void
onPermissionGranted
();
protected
boolean
checkPermission
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
List
<
String
>
permissions
=
new
ArrayList
<>();
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
))
{
permissions
.
add
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
CAMERA
))
{
permissions
.
add
(
Manifest
.
permission
.
CAMERA
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
RECORD_AUDIO
))
{
permissions
.
add
(
Manifest
.
permission
.
RECORD_AUDIO
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
))
{
permissions
.
add
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
);
}
if
(
permissions
.
size
()
!=
0
)
{
ActivityCompat
.
requestPermissions
(
TRTCBaseActivity
.
this
,
permissions
.
toArray
(
new
String
[
0
]),
REQ_PERMISSION_CODE
);
return
false
;
}
List
<
String
>
permissions
=
new
ArrayList
<>();
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
))
{
permissions
.
add
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
CAMERA
))
{
permissions
.
add
(
Manifest
.
permission
.
CAMERA
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
RECORD_AUDIO
))
{
permissions
.
add
(
Manifest
.
permission
.
RECORD_AUDIO
);
}
if
(
PackageManager
.
PERMISSION_GRANTED
!=
ActivityCompat
.
checkSelfPermission
(
this
,
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
))
{
permissions
.
add
(
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
);
}
if
(
permissions
.
size
()
!=
0
)
{
ActivityCompat
.
requestPermissions
(
TRTCBaseActivity
.
this
,
permissions
.
toArray
(
new
String
[
0
]),
REQ_PERMISSION_CODE
);
return
false
;
}
return
true
;
}
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/FileUtil.java
View file @
5e2fb2d5
...
...
@@ -28,7 +28,6 @@ import java.io.File;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
...
...
@@ -128,11 +127,8 @@ public class FileUtil {
* 专为Android4.4以上设计的从Uri获取文件路径
*/
public
static
String
getPath
(
final
Context
context
,
final
Uri
uri
)
{
final
boolean
isKitKat
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
;
// DocumentProvider
if
(
isKitKat
&&
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
if
(
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
// ExternalStorageProvider
if
(
isExternalStorageDocument
(
uri
))
{
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/PopWindowUtil.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.app.Activity;
import
android.app.AlertDialog
;
import
android.graphics.Color
;
import
android.graphics.drawable.ColorDrawable
;
import
android.os.Build
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.WindowManager
;
...
...
@@ -16,10 +15,8 @@ import com.tencent.qcloud.tuicore.R;
public
class
PopWindowUtil
{
public
static
AlertDialog
buildFullScreenDialog
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
{
if
(
activity
.
isDestroyed
())
return
null
;
}
if
(
activity
.
isDestroyed
())
return
null
;
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
activity
,
R
.
style
.
TUIKit_AlertDialogStyle
);
builder
.
setTitle
(
""
);
builder
.
setCancelable
(
true
);
...
...
ydl-tuicore/src/main/java/com/tencent/qcloud/tuicore/util/StatusBarUtil.java
View file @
5e2fb2d5
package
com
.
tencent
.
qcloud
.
tuicore
.
util
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
...
...
@@ -24,22 +22,13 @@ public class StatusBarUtil {
*/
@SuppressLint
(
"ObsoleteSdkInt"
)
@TargetApi
(
19
)
public
static
void
transparencyBar
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
activity
.
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
activity
.
getWindow
();
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
Window
window
=
activity
.
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
window
.
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
);
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
/**
...
...
@@ -53,19 +42,16 @@ public class StatusBarUtil {
public
static
int
StatusBarLightMode
(
Activity
activity
)
{
int
result
=
0
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
MIUISetStatusBarLightMode
(
activity
,
true
))
{
//小米
result
=
1
;
}
else
if
(
FlymeSetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
//魅族
result
=
2
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//6.0以上
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
result
=
3
;
}
if
(
MIUISetStatusBarLightMode
(
activity
,
true
))
{
//小米
result
=
1
;
}
else
if
(
FlymeSetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
//魅族
result
=
2
;
}
else
{
//6.0以上
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
result
=
3
;
}
...
...
@@ -139,19 +125,15 @@ public class StatusBarUtil {
extraFlagField
.
invoke
(
window
,
0
,
darkModeFlag
);
//清除黑色字体
}
result
=
true
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
//开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
if
(
dark
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_VISIBLE
);
}
//开发版 7.7.13 及以后版本采用了系统API,旧方法无效但不会报错,所以两个方式都要加上
if
(
dark
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
}
else
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_VISIBLE
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxBarTool.java
View file @
5e2fb2d5
...
...
@@ -5,15 +5,11 @@ import android.annotation.TargetApi;
import
android.app.Activity
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.util.TypedValue
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
com.readystatesoftware.systembartint.SystemBarTintManager
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
...
...
@@ -47,10 +43,8 @@ public class RxBarTool {
* @param activity activity
*/
public
static
void
setTransparentStatusBar
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
//透明状态栏
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
);
//透明导航栏
}
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
//透明状态栏
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
);
//透明导航栏
}
/**
...
...
@@ -126,8 +120,7 @@ public class RxBarTool {
* @param isSettingPanel {@code true}: 打开设置<br>{@code false}: 打开通知
*/
public
static
void
showNotificationBar
(
Context
context
,
boolean
isSettingPanel
)
{
String
methodName
=
(
Build
.
VERSION
.
SDK_INT
<=
16
)
?
"expand"
:
(
isSettingPanel
?
"expandSettingsPanel"
:
"expandNotificationsPanel"
);
String
methodName
=
isSettingPanel
?
"expandSettingsPanel"
:
"expandNotificationsPanel"
;
invokePanels
(
context
,
methodName
);
}
...
...
@@ -138,7 +131,7 @@ public class RxBarTool {
* @param context 上下文
*/
public
static
void
hideNotificationBar
(
Context
context
)
{
String
methodName
=
(
Build
.
VERSION
.
SDK_INT
<=
16
)
?
"collapse"
:
"collapsePanels"
;
String
methodName
=
"collapsePanels"
;
invokePanels
(
context
,
methodName
);
}
...
...
@@ -176,7 +169,7 @@ public class RxBarTool {
*/
@TargetApi
(
19
)
public
static
void
transparencyBar
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
{
Window
window
=
activity
.
getWindow
();
window
.
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
|
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
);
...
...
@@ -186,10 +179,6 @@ public class RxBarTool {
window
.
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
window
.
setStatusBarColor
(
Color
.
TRANSPARENT
);
window
.
setNavigationBarColor
(
Color
.
TRANSPARENT
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
Window
window
=
activity
.
getWindow
();
window
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
}
...
...
@@ -201,17 +190,9 @@ public class RxBarTool {
*/
public
static
void
setStatusBarColor
(
Activity
activity
,
int
colorId
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
Window
window
=
activity
.
getWindow
();
Window
window
=
activity
.
getWindow
();
// window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window
.
setStatusBarColor
(
activity
.
getResources
().
getColor
(
colorId
));
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
//使用SystemBarTint库使4.4版本状态栏变色,需要先将状态栏设置为透明
transparencyBar
(
activity
);
SystemBarTintManager
tintManager
=
new
SystemBarTintManager
(
activity
);
tintManager
.
setStatusBarTintEnabled
(
true
);
tintManager
.
setStatusBarTintResource
(
colorId
);
}
window
.
setStatusBarColor
(
activity
.
getResources
().
getColor
(
colorId
));
}
/**
...
...
@@ -223,15 +204,13 @@ public class RxBarTool {
*/
public
static
int
StatusBarLightMode
(
Activity
activity
)
{
int
result
=
0
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
if
(
MIUISetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
result
=
1
;
}
else
if
(
FlymeSetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
result
=
2
;
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
result
=
3
;
}
if
(
MIUISetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
result
=
1
;
}
else
if
(
FlymeSetStatusBarLightMode
(
activity
.
getWindow
(),
true
))
{
result
=
2
;
}
else
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
);
result
=
3
;
}
return
result
;
}
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxDataTool.java
View file @
5e2fb2d5
package
com
.
yidianling
.
common
.
tools
;
import
android.os.Build
;
import
androidx.annotation.Nullable
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
BYTE
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
GB
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
KB
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
MB
;
import
android.util.SparseArray
;
import
android.util.SparseBooleanArray
;
import
android.util.SparseIntArray
;
import
android.util.SparseLongArray
;
import
androidx.annotation.Nullable
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
...
...
@@ -20,8 +25,6 @@ import java.util.Collection;
import
java.util.Locale
;
import
java.util.Map
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.*;
/**
* Created by vondear on 2016/1/24.
* 数据处理相关
...
...
@@ -90,10 +93,8 @@ public class RxDataTool {
if
(
obj
instanceof
SparseIntArray
&&
((
SparseIntArray
)
obj
).
size
()
==
0
)
{
return
true
;
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR2
)
{
if
(
obj
instanceof
SparseLongArray
&&
((
SparseLongArray
)
obj
).
size
()
==
0
)
{
return
true
;
}
if
(
obj
instanceof
SparseLongArray
&&
((
SparseLongArray
)
obj
).
size
()
==
0
)
{
return
true
;
}
return
false
;
}
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxDeviceTool.java
View file @
5e2fb2d5
...
...
@@ -14,7 +14,6 @@ import android.net.Uri;
import
android.net.wifi.WifiInfo
;
import
android.net.wifi.WifiManager
;
import
android.os.Build
;
import
android.provider.Settings
;
import
android.telephony.TelephonyManager
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
...
...
@@ -358,20 +357,13 @@ public class RxDeviceTool {
*/
public
static
boolean
checkPermission
(
Context
context
,
String
permission
)
{
boolean
result
=
false
;
if
(
Build
.
VERSION
.
SDK_INT
>=
23
)
{
try
{
Class
clazz
=
Class
.
forName
(
"android.content.Context"
);
Method
method
=
clazz
.
getMethod
(
"checkSelfPermission"
,
String
.
class
);
int
rest
=
(
Integer
)
method
.
invoke
(
context
,
permission
);
result
=
rest
==
PackageManager
.
PERMISSION_GRANTED
;
}
catch
(
Exception
e
)
{
result
=
false
;
}
}
else
{
PackageManager
pm
=
context
.
getPackageManager
();
if
(
pm
.
checkPermission
(
permission
,
context
.
getPackageName
())
==
PackageManager
.
PERMISSION_GRANTED
)
{
result
=
true
;
}
try
{
Class
clazz
=
Class
.
forName
(
"android.content.Context"
);
Method
method
=
clazz
.
getMethod
(
"checkSelfPermission"
,
String
.
class
);
int
rest
=
(
Integer
)
method
.
invoke
(
context
,
permission
);
result
=
rest
==
PackageManager
.
PERMISSION_GRANTED
;
}
catch
(
Exception
e
)
{
result
=
false
;
}
return
result
;
}
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxFileTool.java
View file @
5e2fb2d5
...
...
@@ -15,6 +15,8 @@
*/
package
com
.
yidianling
.
common
.
tools
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
KB
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
...
...
@@ -29,10 +31,11 @@ import android.os.Environment;
import
android.os.StatFs
;
import
android.provider.DocumentsContract
;
import
android.provider.MediaStore
;
import
androidx.core.content.FileProvider
;
import
android.util.Base64
;
import
android.util.Log
;
import
androidx.core.content.FileProvider
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.BufferedReader
;
...
...
@@ -59,8 +62,6 @@ import java.util.Collections;
import
java.util.List
;
import
java.util.Vector
;
import
static
com
.
yidianling
.
common
.
tools
.
RxConstTool
.
KB
;
//import android.util.Log;
/**
...
...
@@ -393,13 +394,8 @@ public class RxFileTool {
File
path
=
getRootPath
();
StatFs
stat
=
new
StatFs
(
path
.
getPath
());
long
blockSize
,
availableBlocks
;
if
(
Build
.
VERSION
.
SDK_INT
>=
18
)
{
blockSize
=
stat
.
getBlockSizeLong
();
availableBlocks
=
stat
.
getAvailableBlocksLong
();
}
else
{
blockSize
=
stat
.
getBlockSize
();
availableBlocks
=
stat
.
getAvailableBlocks
();
}
blockSize
=
stat
.
getBlockSizeLong
();
availableBlocks
=
stat
.
getAvailableBlocksLong
();
return
availableBlocks
*
blockSize
;
}
...
...
@@ -411,13 +407,8 @@ public class RxFileTool {
public
static
long
getDirSize
(
String
path
)
{
StatFs
stat
=
new
StatFs
(
path
);
long
blockSize
,
availableBlocks
;
if
(
Build
.
VERSION
.
SDK_INT
>=
18
)
{
blockSize
=
stat
.
getBlockSizeLong
();
availableBlocks
=
stat
.
getAvailableBlocksLong
();
}
else
{
blockSize
=
stat
.
getBlockSize
();
availableBlocks
=
stat
.
getAvailableBlocks
();
}
blockSize
=
stat
.
getBlockSizeLong
();
availableBlocks
=
stat
.
getAvailableBlocksLong
();
return
availableBlocks
*
blockSize
;
}
...
...
@@ -1797,7 +1788,7 @@ public class RxFileTool {
*/
public
static
Uri
getUriForFile
(
Context
mContext
,
File
file
)
{
Uri
fileUri
=
null
;
if
(
Build
.
VERSION
.
SDK_INT
>=
24
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
N
)
{
fileUri
=
FileProvider
.
getUriForFile
(
mContext
,
mContext
.
getPackageName
()
+
".fileprovider"
,
file
);
}
else
{
fileUri
=
Uri
.
fromFile
(
file
);
...
...
@@ -1843,13 +1834,9 @@ public class RxFileTool {
return
new
File
(
RxPhotoTool
.
getImageAbsolutePath
(
context
,
uri
));
}
@TargetApi
(
19
)
public
static
String
getPathFromUri
(
final
Context
context
,
final
Uri
uri
)
{
final
boolean
isKitKat
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
;
// DocumentProvider
if
(
isKitKat
&&
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
if
(
DocumentsContract
.
isDocumentUri
(
context
,
uri
))
{
// ExternalStorageProvider
if
(
isExternalStorageDocument
(
uri
))
{
final
String
docId
=
DocumentsContract
.
getDocumentId
(
uri
);
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxImageTool.java
View file @
5e2fb2d5
package
com
.
yidianling
.
common
.
tools
;
import
android.animation.ObjectAnimator
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.graphics.Bitmap
;
...
...
@@ -28,7 +27,6 @@ import android.graphics.drawable.Drawable;
import
android.media.ExifInterface
;
import
android.media.ThumbnailUtils
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.renderscript.Allocation
;
import
android.renderscript.Element
;
import
android.renderscript.RenderScript
;
...
...
@@ -885,11 +883,7 @@ public class RxImageTool {
paint
.
setColorFilter
(
filter
);
canvas
.
scale
(
scale
,
scale
);
canvas
.
drawBitmap
(
scaleBitmap
,
0
,
0
,
paint
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
{
scaleBitmap
=
renderScriptBlur
(
scaleBitmap
,
radius
);
}
else
{
scaleBitmap
=
stackBlur
(
scaleBitmap
,
(
int
)
radius
,
true
);
}
scaleBitmap
=
renderScriptBlur
(
scaleBitmap
,
radius
);
if
(
scale
==
1
)
return
scaleBitmap
;
Bitmap
ret
=
Bitmap
.
createScaledBitmap
(
scaleBitmap
,
width
,
height
,
true
);
if
(
scaleBitmap
!=
null
&&
!
scaleBitmap
.
isRecycled
())
scaleBitmap
.
recycle
();
...
...
@@ -905,9 +899,10 @@ public class RxImageTool {
* @param radius 模糊度(0...25)
* @return 模糊后的图片
*/
@TargetApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
public
static
Bitmap
renderScriptBlur
(
Bitmap
src
,
float
radius
)
{
if
(
isEmptyBitmap
(
src
))
return
null
;
if
(
isEmptyBitmap
(
src
))
{
return
null
;
}
RenderScript
rs
=
null
;
try
{
rs
=
RenderScript
.
create
(
RxTool
.
getContext
());
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxIntentTool.java
View file @
5e2fb2d5
...
...
@@ -128,14 +128,8 @@ public class RxIntentTool {
public
static
Intent
getAppDetailsSettingsIntent
(
Context
mContext
)
{
Intent
localIntent
=
new
Intent
();
localIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
mContext
.
getPackageName
(),
null
));
}
else
if
(
Build
.
VERSION
.
SDK_INT
<=
8
)
{
localIntent
.
setAction
(
Intent
.
ACTION_VIEW
);
localIntent
.
setClassName
(
"com.android.settings"
,
"com.android.settings.InstalledAppDetails"
);
localIntent
.
putExtra
(
"com.android.settings.ApplicationPkgName"
,
mContext
.
getPackageName
());
}
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
mContext
.
getPackageName
(),
null
));
return
localIntent
;
}
...
...
@@ -148,14 +142,8 @@ public class RxIntentTool {
public
static
Intent
getAppDetailsSettingsIntent
(
String
packageName
)
{
Intent
localIntent
=
new
Intent
();
localIntent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
if
(
Build
.
VERSION
.
SDK_INT
>=
9
)
{
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
packageName
,
null
));
}
else
if
(
Build
.
VERSION
.
SDK_INT
<=
8
)
{
localIntent
.
setAction
(
Intent
.
ACTION_VIEW
);
localIntent
.
setClassName
(
"com.android.settings"
,
"com.android.settings.InstalledAppDetails"
);
localIntent
.
putExtra
(
"com.android.settings.ApplicationPkgName"
,
packageName
);
}
localIntent
.
setAction
(
"android.settings.APPLICATION_DETAILS_SETTINGS"
);
localIntent
.
setData
(
Uri
.
fromParts
(
"package"
,
packageName
,
null
));
return
localIntent
;
}
}
ydl-utils/src/main/java/com/yidianling/common/tools/RxNetTool.java
View file @
5e2fb2d5
...
...
@@ -2,17 +2,14 @@ package com.yidianling.common.tools;
import
android.content.Context
;
import
android.content.Intent
;
import
android.location.LocationManager
;
import
android.net.ConnectivityManager
;
import
android.net.NetworkInfo
;
import
android.os.Build
;
import
android.telephony.TelephonyManager
;
import
java.io.BufferedReader
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.util.List
;
/**
...
...
@@ -320,11 +317,7 @@ public class RxNetTool {
* @param context 上下文
*/
public
static
void
openWirelessSettings
(
Context
context
)
{
if
(
Build
.
VERSION
.
SDK_INT
>
10
)
{
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
}
else
{
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_WIRELESS_SETTINGS
));
}
context
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
}
/**
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxPhotoTool.java
View file @
5e2fb2d5
package
com
.
yidianling
.
common
.
tools
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
getDataColumn
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isDownloadsDocument
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isExternalStorageDocument
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isGooglePhotosUri
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isMediaDocument
;
import
android.Manifest
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.ContentResolver
;
import
android.content.ContentUris
;
...
...
@@ -14,22 +19,16 @@ import android.net.Uri;
import
android.os.Environment
;
import
android.provider.DocumentsContract
;
import
android.provider.MediaStore
;
import
androidx.core.app.ActivityCompat
;
import
androidx.fragment.app.Fragment
;
import
androidx.core.content.ContextCompat
;
import
android.util.Log
;
import
androidx.core.app.ActivityCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.fragment.app.Fragment
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Locale
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
getDataColumn
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isDownloadsDocument
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isExternalStorageDocument
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isGooglePhotosUri
;
import
static
com
.
yidianling
.
common
.
tools
.
RxFileTool
.
isMediaDocument
;
/**
* Created by vondear on 2016/1/24.
*/
...
...
@@ -217,11 +216,11 @@ public class RxPhotoTool {
* @author yaoxing
* @date 2014-10-12
*/
@TargetApi
(
19
)
public
static
String
getImageAbsolutePath
(
Context
context
,
Uri
imageUri
)
{
if
(
context
==
null
||
imageUri
==
null
)
if
(
context
==
null
||
imageUri
==
null
)
{
return
null
;
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
KITKAT
&&
DocumentsContract
.
isDocumentUri
(
context
,
imageUri
))
{
}
if
(
DocumentsContract
.
isDocumentUri
(
context
,
imageUri
))
{
if
(
isExternalStorageDocument
(
imageUri
))
{
String
docId
=
DocumentsContract
.
getDocumentId
(
imageUri
);
String
[]
split
=
docId
.
split
(
":"
);
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/RxProcessTool.java
deleted
100644 → 0
View file @
901d7e61
package
com
.
yidianling
.
common
.
tools
;
/**
* Created by vondear on 2016/12/21.
*/
public
class
RxProcessTool
{
/**
* 获取前台线程包名
* <p>当不是查看当前App,且SDK大于21时,
* 需添加权限 {@code <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>}</p>
*
* @return 前台应用包名
*/
// public static String getForegroundProcessName(Context context) {
// ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// List<ActivityManager.RunningAppProcessInfo> infos = manager.getRunningAppProcesses();
// if (infos != null && infos.size() != 0) {
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// if (info.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {
// return info.processName;
// }
// }
// }
// if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.LOLLIPOP) {
// PackageManager packageManager = context.getPackageManager();
// Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
// List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
//// System.out.println(list);
// if (list.size() > 0) {// 有"有权查看使用权限的应用"选项
// try {
// ApplicationInfo info = packageManager.getApplicationInfo(context.getPackageName(), 0);
// AppOpsManager aom = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
// if (aom.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS, info.uid, info.packageName) != AppOpsManager.MODE_ALLOWED) {
// context.startActivity(intent);
// }
// if (aom.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS, info.uid, info.packageName) != AppOpsManager.MODE_ALLOWED) {
// Log.d("getForegroundApp", "没有打开\"有权查看使用权限的应用\"选项");
// return null;
// }
// UsageStatsManager usageStatsManager = (UsageStatsManager) context.getSystemService(Context.USAGE_STATS_SERVICE);
// long endTime = System.currentTimeMillis();
// long beginTime = endTime - 86400000 * 7;
// List<UsageStats> usageStatses = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST, beginTime, endTime);
// if (usageStatses == null || usageStatses.isEmpty()) return null;
// UsageStats recentStats = null;
// for (UsageStats usageStats : usageStatses) {
// if (recentStats == null || usageStats.getLastTimeUsed() > recentStats.getLastTimeUsed()) {
// recentStats = usageStats;
// }
// }
// return recentStats == null ? null : recentStats.getPackageName();
// } catch (PackageManager.NameNotFoundException e) {
// e.printStackTrace();
// }
// } else {
// Log.d("getForegroundApp", "无\"有权查看使用权限的应用\"选项");
// }
// }
// return null;
// }
/**
* 获取后台服务进程
* <p>需添加权限 {@code <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>}</p>
*
* @return 后台服务进程
*/
// public static Set<String> getAllBackgroundProcesses(Context context) {
// ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// List<ActivityManager.RunningAppProcessInfo> infos = am.getRunningAppProcesses();
// Set<String> set = new HashSet<>();
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// Collections.addAll(set, info.pkgList);
// }
// return set;
// }
/**
* 杀死后台服务进程
* <p>需添加权限 {@code <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>}</p>
*
* @return 被暂时杀死的服务集合
*/
// public static Set<String> killAllBackgroundProcesses(Context context) {
// ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// List<ActivityManager.RunningAppProcessInfo> infos = am.getRunningAppProcesses();
// Set<String> set = new HashSet<>();
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// for (String pkg : info.pkgList) {
// am.killBackgroundProcesses(pkg);
// set.add(pkg);
// }
// }
// infos = am.getRunningAppProcesses();
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// for (String pkg : info.pkgList) {
// set.remove(pkg);
// }
// }
// return set;
// }
/**
* 杀死后台服务进程
* <p>需添加权限 {@code <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>}</p>
*
* @param packageName 包名
* @return {@code true}: 杀死成功<br>{@code false}: 杀死失败
*/
// public static boolean killBackgroundProcesses(Context context, String packageName) {
// if (RxDataTool.isNullString(packageName)) return false;
// ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
// List<ActivityManager.RunningAppProcessInfo> infos = am.getRunningAppProcesses();
// if (infos == null || infos.size() == 0) return true;
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// if (Arrays.asList(info.pkgList).contains(packageName)) {
// am.killBackgroundProcesses(packageName);
// }
// }
// infos = am.getRunningAppProcesses();
// if (infos == null || infos.size() == 0) return true;
// for (ActivityManager.RunningAppProcessInfo info : infos) {
// if (Arrays.asList(info.pkgList).contains(packageName)) {
// return false;
// }
// }
// return true;
// }
}
ydl-utils/src/main/java/com/yidianling/common/tools/RxWebViewTool.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.view.View
;
import
android.webkit.DownloadListener
;
import
android.webkit.WebSettings
;
...
...
@@ -19,27 +18,17 @@ public class RxWebViewTool {
public
static
void
initWebView
(
final
Context
context
,
final
WebView
webBase
)
{
WebSettings
webSettings
=
webBase
.
getSettings
();
if
(
Build
.
VERSION
.
SDK_INT
>=
19
)
{
webSettings
.
setCacheMode
(
WebSettings
.
LOAD_CACHE_ELSE_NETWORK
);
//加载缓存否则网络
}
if
(
Build
.
VERSION
.
SDK_INT
>=
19
)
{
webSettings
.
setLoadsImagesAutomatically
(
true
);
//图片自动缩放 打开
}
else
{
webSettings
.
setLoadsImagesAutomatically
(
false
);
//图片自动缩放 关闭
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
HONEYCOMB
)
{
webBase
.
setLayerType
(
View
.
LAYER_TYPE_SOFTWARE
,
null
);
//软件解码
}
webSettings
.
setCacheMode
(
WebSettings
.
LOAD_CACHE_ELSE_NETWORK
);
//加载缓存否则网络
webSettings
.
setLoadsImagesAutomatically
(
true
);
//图片自动缩放 打开
webBase
.
setLayerType
(
View
.
LAYER_TYPE_SOFTWARE
,
null
);
//软件解码
webBase
.
setLayerType
(
View
.
LAYER_TYPE_HARDWARE
,
null
);
//硬件解码
// webSettings.setAllowContentAccess(true);
// webSettings.setAllowFileAccessFromFileURLs(true);
// webSettings.setAppCacheEnabled(true);
/* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}*/
// webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
// setMediaPlaybackRequiresUserGesture(boolean require) //是否需要用户手势来播放Media,默认true
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/keyboard/DisplayMetricsHolder.java
View file @
5e2fb2d5
...
...
@@ -10,16 +10,12 @@
package
com
.
yidianling
.
common
.
tools
.
keyboard
;
import
android.content.Context
;
import
android.os.Build
;
import
android.util.DisplayMetrics
;
import
android.view.Display
;
import
android.view.WindowManager
;
import
org.jetbrains.annotations.Nullable
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Method
;
/**
* Holds an instance of the current DisplayMetrics so we don't have to thread it through all the
* classes that need it.
...
...
@@ -64,28 +60,7 @@ public class DisplayMetricsHolder {
// The real metrics include system decor elements (e.g. soft menu bar).
//
// See: http://developer.android.com/reference/android/view/Display.html#getRealMetrics(android.util.DisplayMetrics)
if
(
Build
.
VERSION
.
SDK_INT
>=
17
)
{
display
.
getRealMetrics
(
screenDisplayMetrics
);
}
else
{
// For 14 <= API level <= 16, we need to invoke getRawHeight and getRawWidth to get the real dimensions.
// Since react-native only supports API level 16+ we don't have to worry about other cases.
//
// Reflection exceptions are rethrown at runtime.
//
// See: http://stackoverflow.com/questions/14341041/how-to-get-real-screen-height-and-width/23861333#23861333
try
{
Method
mGetRawH
=
Display
.
class
.
getMethod
(
"getRawHeight"
);
Method
mGetRawW
=
Display
.
class
.
getMethod
(
"getRawWidth"
);
screenDisplayMetrics
.
widthPixels
=
(
Integer
)
mGetRawW
.
invoke
(
display
);
screenDisplayMetrics
.
heightPixels
=
(
Integer
)
mGetRawH
.
invoke
(
display
);
}
catch
(
InvocationTargetException
e
)
{
throw
new
RuntimeException
(
"Error getting real dimensions for API level < 17"
,
e
);
}
catch
(
IllegalAccessException
e
)
{
throw
new
RuntimeException
(
"Error getting real dimensions for API level < 17"
,
e
);
}
catch
(
NoSuchMethodException
e
)
{
throw
new
RuntimeException
(
"Error getting real dimensions for API level < 17"
,
e
);
}
}
display
.
getRealMetrics
(
screenDisplayMetrics
);
DisplayMetricsHolder
.
setScreenDisplayMetrics
(
screenDisplayMetrics
);
}
...
...
ydl-utils/src/main/java/com/yidianling/common/tools/support/toast/ToastCompat.java
View file @
5e2fb2d5
...
...
@@ -6,11 +6,12 @@ import android.app.Application;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.os.Build
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.StringRes
;
import
android.view.View
;
import
android.widget.Toast
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.StringRes
;
import
java.lang.reflect.Field
;
/**
...
...
@@ -171,7 +172,7 @@ public final class ToastCompat extends Toast {
private
static
void
setContextCompat
(
@NonNull
View
view
,
@NonNull
Context
context
)
{
if
(
Build
.
VERSION
.
SDK_INT
==
25
)
{
if
(
Build
.
VERSION
.
SDK_INT
==
Build
.
VERSION_CODES
.
N_MR1
)
{
try
{
Field
field
=
View
.
class
.
getDeclaredField
(
"mContext"
);
field
.
setAccessible
(
true
);
...
...
ydl-utils/src/main/java/com/yidianling/common/view/dialog/RxDialog.java
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.yidianling.common.view.dialog;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.os.Build
;
import
android.view.Gravity
;
import
android.view.Window
;
import
android.view.WindowManager.LayoutParams
;
...
...
@@ -74,9 +73,6 @@ public class RxDialog extends Dialog {
* 隐藏头部导航栏状态栏
*/
public
void
skipTools
()
{
if
(
Build
.
VERSION
.
SDK_INT
<
19
)
{
return
;
}
getWindow
().
setFlags
(
LayoutParams
.
FLAG_FULLSCREEN
,
LayoutParams
.
FLAG_FULLSCREEN
);
}
...
...
@@ -85,11 +81,13 @@ public class RxDialog extends Dialog {
*/
public
void
setFullScreen
()
{
Window
window
=
getWindow
();
window
.
getDecorView
().
setPadding
(
0
,
0
,
0
,
0
);
LayoutParams
lp
=
window
.
getAttributes
();
lp
.
width
=
LayoutParams
.
FILL_PARENT
;
lp
.
height
=
LayoutParams
.
FILL_PARENT
;
window
.
setAttributes
(
lp
);
if
(
window
!=
null
)
{
window
.
getDecorView
().
setPadding
(
0
,
0
,
0
,
0
);
LayoutParams
lp
=
window
.
getAttributes
();
lp
.
width
=
LayoutParams
.
MATCH_PARENT
;
lp
.
height
=
LayoutParams
.
MATCH_PARENT
;
window
.
setAttributes
(
lp
);
}
}
/**
...
...
ydl-utils/src/main/java/com/yidianling/common/view/popupwindows/tools/RxPopupViewBackgroundConstructor.java
View file @
5e2fb2d5
package
com
.
yidianling
.
common
.
view
.
popupwindows
.
tools
;
import
android.content.Context
;
import
android.graphics.PorterDuff
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.view.View
;
import
com.yidianling.common.R
;
...
...
@@ -109,25 +107,14 @@ class RxPopupViewBackgroundConstructor {
}
private
static
void
setViewBackground
(
View
view
,
Drawable
drawable
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
view
.
setBackground
(
drawable
);
}
else
{
view
.
setBackgroundDrawable
(
drawable
);
}
view
.
setBackground
(
drawable
);
}
private
static
Drawable
getTintedDrawable
(
Context
context
,
int
drawableRes
,
int
color
)
{
Drawable
drawable
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
drawable
=
context
.
getResources
().
getDrawable
(
drawableRes
,
null
);
if
(
drawable
!=
null
)
{
drawable
.
setTint
(
color
);
}
}
else
{
drawable
=
context
.
getResources
().
getDrawable
(
drawableRes
);
if
(
drawable
!=
null
)
{
drawable
.
setColorFilter
(
color
,
PorterDuff
.
Mode
.
SRC_ATOP
);
}
drawable
=
context
.
getResources
().
getDrawable
(
drawableRes
,
null
);
if
(
drawable
!=
null
)
{
drawable
.
setTint
(
color
);
}
return
drawable
;
...
...
ydl-utils/src/main/java/com/yidianling/common/view/popupwindows/tools/RxPopupViewManager.java
View file @
5e2fb2d5
...
...
@@ -5,13 +5,13 @@ import android.animation.AnimatorListenerAdapter;
import
android.annotation.SuppressLint
;
import
android.graphics.Outline
;
import
android.graphics.Point
;
import
android.os.Build
;
import
androidx.annotation.NonNull
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.ViewOutlineProvider
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
com.yidianling.common.tools.RxAnimationTool
;
import
java.util.HashMap
;
...
...
@@ -129,18 +129,16 @@ public class RxPopupViewManager {
}
private
void
setTipViewElevation
(
TextView
tipView
,
RxPopupView
rxPopupView
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
if
(
rxPopupView
.
getElevation
()
>
0
)
{
ViewOutlineProvider
viewOutlineProvider
=
new
ViewOutlineProvider
()
{
@SuppressLint
(
"NewApi"
)
@Override
public
void
getOutline
(
View
view
,
Outline
outline
)
{
outline
.
setEmpty
();
}
};
tipView
.
setOutlineProvider
(
viewOutlineProvider
);
tipView
.
setElevation
(
rxPopupView
.
getElevation
());
}
if
(
rxPopupView
.
getElevation
()
>
0
)
{
ViewOutlineProvider
viewOutlineProvider
=
new
ViewOutlineProvider
()
{
@SuppressLint
(
"NewApi"
)
@Override
public
void
getOutline
(
View
view
,
Outline
outline
)
{
outline
.
setEmpty
();
}
};
tipView
.
setOutlineProvider
(
viewOutlineProvider
);
tipView
.
setElevation
(
rxPopupView
.
getElevation
());
}
}
...
...
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxIconRoundProgressBar.java
View file @
5e2fb2d5
...
...
@@ -3,7 +3,6 @@ package com.yidianling.common.view.roundprogressbar;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.drawable.GradientDrawable
;
import
android.os.Build
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.util.AttributeSet
;
...
...
@@ -100,11 +99,7 @@ public class RxIconRoundProgressBar extends RxBaseRoundProgressBar implements Vi
else
backgroundDrawable
.
setCornerRadii
(
new
float
[]{
0
,
0
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
0
,
0
});
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
layoutProgress
.
setBackground
(
backgroundDrawable
);
}
else
{
layoutProgress
.
setBackgroundDrawable
(
backgroundDrawable
);
}
layoutProgress
.
setBackground
(
backgroundDrawable
);
float
ratio
=
max
/
progress
;
int
progressWidth
=
(
int
)
((
totalWidth
-
((
padding
*
2
)
+
ivProgressIcon
.
getWidth
()))
/
ratio
);
...
...
@@ -146,11 +141,7 @@ public class RxIconRoundProgressBar extends RxBaseRoundProgressBar implements Vi
GradientDrawable
iconBackgroundDrawable
=
createGradientDrawable
(
colorIconBackground
);
int
radius
=
getRadius
()
-
(
getPadding
()
/
2
);
iconBackgroundDrawable
.
setCornerRadii
(
new
float
[]{
radius
,
radius
,
0
,
0
,
0
,
0
,
radius
,
radius
});
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
ivProgressIcon
.
setBackground
(
iconBackgroundDrawable
);
}
else
{
ivProgressIcon
.
setBackgroundDrawable
(
iconBackgroundDrawable
);
}
ivProgressIcon
.
setBackground
(
iconBackgroundDrawable
);
}
public
int
getIconImageResource
()
{
...
...
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxRoundProgressBar.java
View file @
5e2fb2d5
...
...
@@ -20,7 +20,6 @@ package com.yidianling.common.view.roundprogressbar;
import
android.content.Context
;
import
android.graphics.drawable.GradientDrawable
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
...
...
@@ -61,11 +60,7 @@ public class RxRoundProgressBar extends RxBaseRoundProgressBar {
GradientDrawable
backgroundDrawable
=
createGradientDrawable
(
colorProgress
);
int
newRadius
=
radius
-
(
padding
/
2
);
backgroundDrawable
.
setCornerRadii
(
new
float
[]{
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
});
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
layoutProgress
.
setBackground
(
backgroundDrawable
);
}
else
{
layoutProgress
.
setBackgroundDrawable
(
backgroundDrawable
);
}
layoutProgress
.
setBackground
(
backgroundDrawable
);
float
ratio
=
max
/
progress
;
int
progressWidth
=
(
int
)
((
totalWidth
-
(
padding
*
2
))
/
ratio
);
...
...
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/RxTextRoundProgressBar.java
View file @
5e2fb2d5
...
...
@@ -4,7 +4,6 @@ import android.content.Context;
import
android.content.res.TypedArray
;
import
android.graphics.Color
;
import
android.graphics.drawable.GradientDrawable
;
import
android.os.Build
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
android.util.AttributeSet
;
...
...
@@ -69,11 +68,7 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
GradientDrawable
backgroundDrawable
=
createGradientDrawable
(
colorProgress
);
int
newRadius
=
radius
-
(
padding
/
2
);
backgroundDrawable
.
setCornerRadii
(
new
float
[]{
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
});
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
layoutProgress
.
setBackground
(
backgroundDrawable
);
}
else
{
layoutProgress
.
setBackgroundDrawable
(
backgroundDrawable
);
}
layoutProgress
.
setBackground
(
backgroundDrawable
);
float
ratio
=
max
/
progress
;
int
progressWidth
=
(
int
)
((
totalWidth
-
(
padding
*
2
))
/
ratio
);
...
...
@@ -110,18 +105,6 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
}
private
void
drawTextProgressPosition
()
{
// tvProgress.setVisibility(View.INVISIBLE);
// tvProgress.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
// @SuppressWarnings("deprecation")
// @Override
// public void onGlobalLayout() {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
// tvProgress.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// else
// tvProgress.getViewTreeObserver().removeGlobalOnLayoutListener(this);
// setTextProgressAlign();
// }
// });
clearTextProgressAlign
();
int
textProgressWidth
=
tvProgress
.
getMeasuredWidth
()
+
(
getTextProgressMargin
()
*
2
);
float
ratio
=
getMax
()
/
getProgress
();
...
...
@@ -133,40 +116,16 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
}
}
// private void setTextProgressAlign() {
// tvProgress.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
// @SuppressWarnings("deprecation")
// @Override
// public void onGlobalLayout() {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
// tvProgress.getViewTreeObserver().removeOnGlobalLayoutListener(this);
// else
// tvProgress.getViewTreeObserver().removeGlobalOnLayoutListener(this);
// tvProgress.setVisibility(View.VISIBLE);
// }
// });
// int textProgressWidth = tvProgress.getMeasuredWidth() + (getTextProgressMargin() * 2);
// float ratio = getMax() / getProgress();
// int progressWidth = (int) ((getLayoutWidth() - (getPadding() * 2)) / ratio);
// if (textProgressWidth + textProgressMargin < progressWidth) {
// alignTextProgressInsideProgress();
// } else {
// alignTextProgressOutsideProgress();
// }
// }
private
void
clearTextProgressAlign
()
{
RelativeLayout
.
LayoutParams
params
=
(
RelativeLayout
.
LayoutParams
)
tvProgress
.
getLayoutParams
();
params
.
addRule
(
RelativeLayout
.
ALIGN_LEFT
,
0
);
params
.
addRule
(
RelativeLayout
.
ALIGN_RIGHT
,
0
);
params
.
addRule
(
RelativeLayout
.
LEFT_OF
,
0
);
params
.
addRule
(
RelativeLayout
.
RIGHT_OF
,
0
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
{
params
.
removeRule
(
RelativeLayout
.
START_OF
);
params
.
removeRule
(
RelativeLayout
.
END_OF
);
params
.
removeRule
(
RelativeLayout
.
ALIGN_START
);
params
.
removeRule
(
RelativeLayout
.
ALIGN_END
);
}
params
.
removeRule
(
RelativeLayout
.
START_OF
);
params
.
removeRule
(
RelativeLayout
.
END_OF
);
params
.
removeRule
(
RelativeLayout
.
ALIGN_START
);
params
.
removeRule
(
RelativeLayout
.
ALIGN_END
);
tvProgress
.
setLayoutParams
(
params
);
}
...
...
@@ -174,12 +133,10 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
RelativeLayout
.
LayoutParams
params
=
(
RelativeLayout
.
LayoutParams
)
tvProgress
.
getLayoutParams
();
if
(
isReverse
())
{
params
.
addRule
(
RelativeLayout
.
ALIGN_LEFT
,
R
.
id
.
layout_progress
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
params
.
addRule
(
RelativeLayout
.
ALIGN_START
,
R
.
id
.
layout_progress
);
params
.
addRule
(
RelativeLayout
.
ALIGN_START
,
R
.
id
.
layout_progress
);
}
else
{
params
.
addRule
(
RelativeLayout
.
ALIGN_RIGHT
,
R
.
id
.
layout_progress
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
params
.
addRule
(
RelativeLayout
.
ALIGN_END
,
R
.
id
.
layout_progress
);
params
.
addRule
(
RelativeLayout
.
ALIGN_END
,
R
.
id
.
layout_progress
);
}
tvProgress
.
setLayoutParams
(
params
);
}
...
...
@@ -188,12 +145,10 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
RelativeLayout
.
LayoutParams
params
=
(
RelativeLayout
.
LayoutParams
)
tvProgress
.
getLayoutParams
();
if
(
isReverse
())
{
params
.
addRule
(
RelativeLayout
.
LEFT_OF
,
R
.
id
.
layout_progress
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
params
.
addRule
(
RelativeLayout
.
START_OF
,
R
.
id
.
layout_progress
);
params
.
addRule
(
RelativeLayout
.
START_OF
,
R
.
id
.
layout_progress
);
}
else
{
params
.
addRule
(
RelativeLayout
.
RIGHT_OF
,
R
.
id
.
layout_progress
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
params
.
addRule
(
RelativeLayout
.
END_OF
,
R
.
id
.
layout_progress
);
params
.
addRule
(
RelativeLayout
.
END_OF
,
R
.
id
.
layout_progress
);
}
tvProgress
.
setLayoutParams
(
params
);
}
...
...
@@ -245,10 +200,7 @@ public class RxTextRoundProgressBar extends RxBaseRoundProgressBar implements Vi
@Override
public
void
onGlobalLayout
()
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
tvProgress
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
else
tvProgress
.
getViewTreeObserver
().
removeGlobalOnLayoutListener
(
this
);
tvProgress
.
getViewTreeObserver
().
removeOnGlobalLayoutListener
(
this
);
drawTextProgressPosition
();
}
...
...
ydl-utils/src/main/java/com/yidianling/common/view/roundprogressbar/common/RxBaseRoundProgressBar.java
View file @
5e2fb2d5
...
...
@@ -165,11 +165,7 @@ public abstract class RxBaseRoundProgressBar extends LinearLayout {
GradientDrawable
backgroundDrawable
=
createGradientDrawable
(
colorBackground
);
int
newRadius
=
radius
-
(
padding
/
2
);
backgroundDrawable
.
setCornerRadii
(
new
float
[]{
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
,
newRadius
});
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
layoutBackground
.
setBackground
(
backgroundDrawable
);
}
else
{
layoutBackground
.
setBackgroundDrawable
(
backgroundDrawable
);
}
layoutBackground
.
setBackground
(
backgroundDrawable
);
}
// Create an empty color rectangle gradient drawable
...
...
@@ -200,13 +196,11 @@ public abstract class RxBaseRoundProgressBar extends LinearLayout {
if
(
isReverse
)
{
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
// For support with RTL on API 17 or more
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_END
);
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_END
);
}
else
{
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_LEFT
);
// For support with RTL on API 17 or more
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_START
);
progressParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_START
);
}
layoutProgress
.
setLayoutParams
(
progressParams
);
}
...
...
@@ -217,15 +211,10 @@ public abstract class RxBaseRoundProgressBar extends LinearLayout {
// Remove all of relative align rule
private
void
removeLayoutParamsRule
(
RelativeLayout
.
LayoutParams
layoutParams
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
{
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_END
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_LEFT
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_START
);
}
else
{
layoutParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
,
0
);
layoutParams
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_LEFT
,
0
);
}
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_END
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_LEFT
);
layoutParams
.
removeRule
(
RelativeLayout
.
ALIGN_PARENT_START
);
}
@SuppressLint
(
"NewApi"
)
...
...
ydl-utils/src/main/java/com/yidianling/common/view/sidebar/WaveSideBarView.java
View file @
5e2fb2d5
...
...
@@ -8,7 +8,6 @@ import android.graphics.Color;
import
android.graphics.Paint
;
import
android.graphics.Path
;
import
android.graphics.RectF
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
import
android.view.View
;
...
...
@@ -293,9 +292,7 @@ public class WaveSideBarView extends View {
mBallPath
.
reset
();
mBallPath
.
addCircle
(
mBallCentreX
,
mCenterY
,
mBallRadius
,
Path
.
Direction
.
CW
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
mBallPath
.
op
(
mWavePath
,
Path
.
Op
.
DIFFERENCE
);
}
mBallPath
.
op
(
mWavePath
,
Path
.
Op
.
DIFFERENCE
);
mBallPath
.
close
();
canvas
.
drawPath
(
mBallPath
,
mWavePaint
);
...
...
ydl-webview/build.gradle
View file @
5e2fb2d5
...
...
@@ -9,12 +9,11 @@ kapt {
}
}
android
{
compileSdkVersion
28
compileSdkVersion
rootProject
.
ext
.
android
[
"compileSdkVersion"
]
defaultConfig
{
minSdkVersion
21
targetSdkVersion
28
minSdkVersion
rootProject
.
ext
.
android
[
"minSdkVersion"
]
targetSdkVersion
rootProject
.
ext
.
android
[
"targetSdkVersion"
]
versionCode
1
versionName
"1.0"
...
...
ydl-webview/src/main/java/com/ydl/utils/ProxyCheckUtils.kt
View file @
5e2fb2d5
package
com.ydl.utils
import
android.content.Context
import
android.net.Proxy
import
android.os.Build
import
android.text.TextUtils
/**
...
...
@@ -16,17 +14,10 @@ object ProxyCheckUtils {
* return 当前网络是否开启了代理
*/
fun
isWifiProxy
(
context
:
Context
):
Boolean
{
val
IS_ICS_OR_LATER
:
Boolean
=
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
ICE_CREAM_SANDWICH
val
proxyAddress
:
String
val
proxyPort
:
Int
if
(
IS_ICS_OR_LATER
)
{
proxyAddress
=
System
.
getProperty
(
"http.proxyHost"
)
?:
""
val
portStr
=
System
.
getProperty
(
"http.proxyPort"
)
proxyPort
=
(
portStr
?:
"-1"
).
toInt
()
}
else
{
proxyAddress
=
Proxy
.
getHost
(
context
)
proxyPort
=
Proxy
.
getPort
(
context
)
}
val
proxyAddress
:
String
=
System
.
getProperty
(
"http.proxyHost"
)
?:
""
val
portStr
=
System
.
getProperty
(
"http.proxyPort"
)
val
proxyPort
=
(
portStr
?:
"-1"
).
toInt
()
return
!
TextUtils
.
isEmpty
(
proxyAddress
)
&&
proxyPort
!=
-
1
}
}
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
5e2fb2d5
package
com
.
ydl
.
webview
;
import
static
android
.
view
.
View
.
GONE
;
import
static
android
.
view
.
View
.
VISIBLE
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
...
...
@@ -84,9 +87,6 @@ import in.srain.cube.views.ptr.header.MaterialHeader;
import
io.reactivex.Observable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
static
android
.
view
.
View
.
GONE
;
import
static
android
.
view
.
View
.
VISIBLE
;
/**
* 通用h5显示页面
* 跳转此h5页面,请使用唯一参数 H5ParamsBaseActivity
...
...
@@ -679,9 +679,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
setting
.
setLayoutAlgorithm
(
WebSettings
.
LayoutAlgorithm
.
NARROW_COLUMNS
);
setting
.
setLoadWithOverviewMode
(
true
);
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
setting
.
setMixedContentMode
(
WebSettings
.
LOAD_NORMAL
);
}
setting
.
setMixedContentMode
(
WebSettings
.
LOAD_NORMAL
);
wv_content
.
setScrollBarStyle
(
View
.
SCROLLBARS_INSIDE_OVERLAY
);
//滚动条风格,为0指滚动条不占用空间,直接覆盖在网页上
tb_title
.
setImageListener
(
v
->
{
if
(
h5Params
.
isSplash
())
{
...
...
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