Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser White
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Browser White
Commits
a7501d9b
Commit
a7501d9b
authored
Aug 29, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
2e4405e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
15 deletions
+64
-15
MainActivity.kt
...in/java/com/base/browserwhite/ui/activity/MainActivity.kt
+2
-0
Splash2Activity.kt
...m/base/browserwhite/ui/activity/splash/Splash2Activity.kt
+10
-10
PermissionDialog.kt
...n/java/com/base/browserwhite/ui/views/PermissionDialog.kt
+3
-0
BrowserAppWidget.kt
.../java/com/base/browserwhite/ui/widget/BrowserAppWidget.kt
+44
-1
browser_app_widget.xml
app/src/main/res/layout/browser_app_widget.xml
+5
-4
No files found.
app/src/main/java/com/base/browserwhite/ui/activity/MainActivity.kt
View file @
a7501d9b
...
...
@@ -162,4 +162,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
}
}
\ No newline at end of file
app/src/main/java/com/base/browserwhite/ui/activity/splash/Splash2Activity.kt
View file @
a7501d9b
...
...
@@ -86,7 +86,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
fun
startPbAnimation
(
callback
:
()
->
Unit
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
pb
,
8
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
pb
,
4
00
,
null
)
{
callback
.
invoke
()
}
}
...
...
@@ -120,23 +120,23 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
else
->
R
.
mipmap
.
d_qing
}
binding
.
ivWeather
.
setImageResource
(
icon
)
AnimationUtils
.
startAlphaAnimation
(
binding
.
ivWeather
,
8
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
tvDate
,
8
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
tvTemperature
,
8
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
ivWeather
,
4
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
tvDate
,
4
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
tvTemperature
,
4
00
,
null
)
{
if
(
isAgree
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
pb
,
8
00
,
null
)
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
pb
,
4
00
,
null
)
{
callback
.
invoke
()
}
}
else
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
idTvStart
,
12
00
,
{
AnimationUtils
.
startAlphaAnimation
(
binding
.
idTvStart
,
4
00
,
{
val
set1
=
AnimatorSet
()
// 创建缩放动画的ObjectAnimator
val
scaleUpAnimator1
=
ObjectAnimator
.
ofFloat
(
binding
.
idTvStart
,
"scaleX"
,
1f
,
0.95f
,
1.05f
)
val
scaleUpAnimator2
=
ObjectAnimator
.
ofFloat
(
binding
.
idTvStart
,
"scaleY"
,
1f
,
0.95f
,
1.05f
)
scaleUpAnimator1
.
duration
=
12
00
// 动画持续500毫秒
scaleUpAnimator1
.
duration
=
4
00
// 动画持续500毫秒
scaleUpAnimator1
.
repeatCount
=
1
// 重复次数
scaleUpAnimator1
.
repeatMode
=
ValueAnimator
.
REVERSE
// 反向重复,实现缩小效果
scaleUpAnimator2
.
duration
=
12
00
// 动画持续500毫秒
scaleUpAnimator2
.
duration
=
4
00
// 动画持续500毫秒
scaleUpAnimator2
.
repeatCount
=
1
// 重复次数
set1
.
playTogether
(
scaleUpAnimator1
,
scaleUpAnimator2
)
set1
.
start
()
...
...
@@ -159,10 +159,10 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
// 创建缩放动画的ObjectAnimator
val
scaleUpAnimator1
=
ObjectAnimator
.
ofFloat
(
binding
.
idTvStart
,
"scaleX"
,
1f
,
0.95f
,
1.05f
)
val
scaleUpAnimator2
=
ObjectAnimator
.
ofFloat
(
binding
.
idTvStart
,
"scaleY"
,
1f
,
0.95f
,
1.05f
)
scaleUpAnimator1
.
duration
=
12
00
// 动画持续500毫秒
scaleUpAnimator1
.
duration
=
4
00
// 动画持续500毫秒
scaleUpAnimator1
.
repeatCount
=
1
// 重复次数
scaleUpAnimator1
.
repeatMode
=
ValueAnimator
.
REVERSE
// 反向重复,实现缩小效果
scaleUpAnimator2
.
duration
=
12
00
// 动画持续500毫秒
scaleUpAnimator2
.
duration
=
4
00
// 动画持续500毫秒
scaleUpAnimator2
.
repeatCount
=
1
// 重复次数
set1
.
playTogether
(
scaleUpAnimator1
,
scaleUpAnimator2
)
set1
.
start
()
...
...
app/src/main/java/com/base/browserwhite/ui/views/PermissionDialog.kt
View file @
a7501d9b
...
...
@@ -81,5 +81,8 @@ object PermissionDialog {
}
})
}
binding
.
tvLater
.
setOnClickListener
{
dialog
.
dismiss
()
}
}
}
\ No newline at end of file
app/src/main/java/com/base/browserwhite/ui/widget/BrowserAppWidget.kt
View file @
a7501d9b
package
com.base.browserwhite.ui.widget
import
android.app.PendingIntent
import
android.appwidget.AppWidgetManager
import
android.appwidget.AppWidgetProvider
import
android.content.Context
import
android.content.Intent
import
android.widget.RemoteViews
import
com.base.browserwhite.R
import
com.base.browserwhite.bean.ConstObject
import
com.base.browserwhite.ui.activity.splash.Splash2Activity
import
kotlin.random.Random
/**
* Implementation of App Widget functionality.
...
...
@@ -31,7 +36,45 @@ internal fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManage
val
views
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
browser_app_widget
)
views
.
setTextViewText
(
R
.
id
.
tv_app_name
,
context
.
resources
.
getString
(
R
.
string
.
app_name
))
views
.
setTextViewText
(
R
.
id
.
tv_percent
,
"80%"
)
views
.
setTextViewText
(
R
.
id
.
tv_percent
,
"88%..."
)
//清理
val
requestCode1
=
Random
.
nextInt
(
1800
)
val
intent1
=
Intent
(
context
,
Splash2Activity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_JUNK_CLEANER
)
}
val
pendingIntent1
=
PendingIntent
.
getActivity
(
context
,
requestCode1
,
intent1
,
PendingIntent
.
FLAG_IMMUTABLE
)
views
.
setOnClickPendingIntent
(
R
.
id
.
tv_clean
,
pendingIntent1
)
//进程
val
requestCode2
=
Random
.
nextInt
(
1800
)
val
intent2
=
Intent
(
context
,
Splash2Activity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_APP_PROCESS
)
}
val
pendingIntent2
=
PendingIntent
.
getActivity
(
context
,
requestCode2
,
intent2
,
PendingIntent
.
FLAG_IMMUTABLE
)
views
.
setOnClickPendingIntent
(
R
.
id
.
ll_process
,
pendingIntent2
)
//新闻
val
requestCode3
=
Random
.
nextInt
(
1800
)
val
intent3
=
Intent
(
context
,
Splash2Activity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_NEWS
)
}
val
pendingIntent3
=
PendingIntent
.
getActivity
(
context
,
requestCode3
,
intent3
,
PendingIntent
.
FLAG_IMMUTABLE
)
views
.
setOnClickPendingIntent
(
R
.
id
.
ll_news
,
pendingIntent3
)
//扫描
val
requestCode4
=
Random
.
nextInt
(
1800
)
val
intent4
=
Intent
(
context
,
Splash2Activity
::
class
.
java
).
apply
{
putExtra
(
"actionId"
,
ConstObject
.
ID_SCAN_CODE
)
}
val
pendingIntent4
=
PendingIntent
.
getActivity
(
context
,
requestCode4
,
intent4
,
PendingIntent
.
FLAG_IMMUTABLE
)
views
.
setOnClickPendingIntent
(
R
.
id
.
ll_scanqr
,
pendingIntent4
)
// Instruct the widget manager to update the widget
...
...
app/src/main/res/layout/browser_app_widget.xml
View file @
a7501d9b
...
...
@@ -79,10 +79,11 @@
<LinearLayout
android:layout_width=
"180dp"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
tools:ignore=
"DisableBaselineAlignment"
>
<LinearLayout
android:id=
"@+id/ll_
4
"
android:id=
"@+id/ll_
process
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
...
...
@@ -109,7 +110,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_
2
"
android:id=
"@+id/ll_
news
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
...
...
@@ -135,7 +136,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_
3
"
android:id=
"@+id/ll_
scanqr
"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
...
...
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