Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
A
appzxhy
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
appzxhy
Commits
de9432a7
Commit
de9432a7
authored
Dec 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
f45603e4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
134 additions
and
0 deletions
+134
-0
build.gradle.kts
app/build.gradle.kts
+3
-0
NotificationDialog.kt
...main/java/com/base/appzxhy/ui/views/NotificationDialog.kt
+53
-0
bg_03b988_35.xml
app/src/main/res/drawable/bg_03b988_35.xml
+7
-0
dialog_notification_turn_on.xml
app/src/main/res/layout/dialog_notification_turn_on.xml
+69
-0
icon_close.png
app/src/main/res/mipmap-xxhdpi/icon_close.png
+0
-0
img_tongzhi_pop_bj.png
app/src/main/res/mipmap-xxhdpi/img_tongzhi_pop_bj.png
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/build.gradle.kts
View file @
de9432a7
...
...
@@ -63,4 +63,7 @@ dependencies {
//solar 归因
implementation
(
"com.reyun.solar.engine.oversea:solar-engine-core:1.2.8.3"
)
//第三方UI控件
implementation
(
"io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4"
)
}
\ No newline at end of file
app/src/main/java/com/base/appzxhy/ui/views/NotificationDialog.kt
0 → 100644
View file @
de9432a7
package
com.base.appzxhy.ui.views
import
android.annotation.SuppressLint
import
android.app.AlertDialog
import
android.content.Context
import
android.content.Intent
import
android.os.Build
import
android.provider.Settings
import
android.view.Gravity
import
android.view.LayoutInflater
import
com.base.appzxhy.R
import
com.base.appzxhy.databinding.DialogNotificationTurnOnBinding
import
com.base.appzxhy.utils.ActivityLauncher
object
NotificationDialog
{
@SuppressLint
(
"SetTextI18n"
)
fun
Context
.
showNotificationTurnOn
(
launcher
:
ActivityLauncher
)
{
val
dialog
=
AlertDialog
.
Builder
(
this
).
create
()
val
binding
=
DialogNotificationTurnOnBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
dialog
.
setView
(
binding
.
root
)
dialog
.
setCanceledOnTouchOutside
(
true
)
dialog
.
show
()
val
params
=
dialog
.
window
?.
attributes
// params?.width = resources.getDimensionPixelOffset(R.dimen.dp_320)
// params?.height = LinearLayout.LayoutParams.WRAP_CONTENT
params
?.
gravity
=
Gravity
.
BOTTOM
// params?.y = 50
dialog
.
window
?.
attributes
=
params
dialog
.
window
?.
setBackgroundDrawableResource
(
android
.
R
.
color
.
transparent
)
val
appName
=
resources
.
getString
(
R
.
string
.
app_name
)
binding
.
tvTip
.
text
=
"Never miss important $appName notification reminders"
binding
.
ivClose
.
setOnClickListener
{
dialog
.
dismiss
()
}
binding
.
tvTurnOn
.
setOnClickListener
{
dialog
.
dismiss
()
val
intent
=
Intent
()
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
intent
.
action
=
Settings
.
ACTION_APP_NOTIFICATION_SETTINGS
intent
.
putExtra
(
Settings
.
EXTRA_APP_PACKAGE
,
this
.
packageName
)
}
else
{
intent
.
action
=
"android.settings.APP_NOTIFICATION_SETTINGS"
intent
.
putExtra
(
"app_package"
,
this
.
packageName
)
}
launcher
.
launch
(
intent
)
}
}
}
\ No newline at end of file
app/src/main/res/drawable/bg_03b988_35.xml
0 → 100644
View file @
de9432a7
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#03B988"
/>
<corners
android:radius=
"35dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/dialog_notification_turn_on.xml
0 → 100644
View file @
de9432a7
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"324dp"
android:background=
"@mipmap/img_tongzhi_pop_bj"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<ImageView
android:id=
"@+id/iv_close"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"25dp"
android:src=
"@mipmap/icon_close"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"8dp"
android:text=
"@string/turn_on_notification"
android:textColor=
"#1A1A1A"
android:textSize=
"22sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_tip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginHorizontal=
"40dp"
android:layout_marginBottom=
"20dp"
android:gravity=
"center"
android:textColor=
"#666666"
android:textSize=
"16sp"
/>
<TextView
android:id=
"@+id/tv_turn_on"
android:layout_width=
"259dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"40dp"
android:background=
"@drawable/bg_03b988_35"
android:gravity=
"center"
android:text=
"@string/turn_on"
android:textColor=
"@color/white"
android:textSize=
"20sp"
/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/mipmap-xxhdpi/icon_close.png
0 → 100644
View file @
de9432a7
1.03 KB
app/src/main/res/mipmap-xxhdpi/img_tongzhi_pop_bj.png
0 → 100644
View file @
de9432a7
274 KB
app/src/main/res/values/strings.xml
View file @
de9432a7
...
...
@@ -2,4 +2,6 @@
<string
name=
"app_name"
>
LocalWeatherWhite
</string>
<string
name=
"facebook_app_id"
>
1324546913856392
</string>
<string
name=
"home"
>
Home
</string>
<string
name=
"turn_on_notification"
>
Turn on notification
</string>
<string
name=
"turn_on"
>
Turn on
</string>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment