Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Simple-Sms
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangchengbo
Simple-Sms
Commits
2f3b994a
Commit
2f3b994a
authored
Jun 16, 2025
by
zhangchengbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:新增消息内容弹窗(呼叫,发送短信,添加通讯录等);
parent
9c0fe25b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
226 additions
and
2 deletions
+226
-2
TipPopup.kt
app/src/main/kotlin/com/secspace/sms/popup/TipPopup.kt
+84
-0
cancel_btn_background.xml
app/src/main/res/drawable/cancel_btn_background.xml
+10
-0
tips_background.xml
app/src/main/res/drawable/tips_background.xml
+10
-0
d_ui_tips_popup.xml
app/src/main/res/layout/d_ui_tips_popup.xml
+119
-0
Context.kt
...otlin/com/simplemobiletools/commons/extensions/Context.kt
+2
-2
dimens.xml
commons/src/main/res/values/dimens.xml
+1
-0
No files found.
app/src/main/kotlin/com/secspace/sms/popup/TipPopup.kt
0 → 100644
View file @
2f3b994a
package
com.secspace.sms.popup
import
android.content.Context
import
android.view.Gravity
import
android.view.animation.Animation
import
android.widget.TextView
import
com.secspace.sms.R
import
razerdp.basepopup.BasePopupWindow
import
razerdp.util.animation.AnimationHelper
import
razerdp.util.animation.Direction
import
razerdp.util.animation.TranslationConfig
class
TipPopup
(
mContext
:
Context
,
private
val
sureResult
:
(
Int
,
String
)
->
Unit
)
:
BasePopupWindow
(
mContext
)
{
private
val
tvPhoneNumber
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_phone_number
)
}
private
val
tvCallPhone
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_call_phone
)
}
private
val
tvCallPhoneEdit
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_call_phone_edit
)
}
private
val
tvSendSms
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_send_sms
)
}
private
val
tvCopy
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_copy_phone_number
)
}
private
val
tvAddContacts
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_add_contacts
)
}
private
val
tvCancel
by
lazy
{
findViewById
<
TextView
>(
R
.
id
.
tv_cancel_pop
)
}
private
var
phoneNumbers
:
String
=
""
init
{
setContentView
(
R
.
layout
.
d_ui_tips_popup
)
setBlurBackgroundEnable
(
false
)
setOutSideDismiss
(
false
)
setBackPressEnable
(
false
)
popupGravity
=
Gravity
.
BOTTOM
tvCancel
.
setOnClickListener
{
dismiss
()
}
tvCallPhone
.
setOnClickListener
{
sureResult
.
invoke
(
1
,
phoneNumbers
)
dismiss
()
}
tvCallPhoneEdit
.
setOnClickListener
{
sureResult
.
invoke
(
2
,
phoneNumbers
)
dismiss
()
}
tvSendSms
.
setOnClickListener
{
sureResult
.
invoke
(
3
,
phoneNumbers
)
dismiss
()
}
tvCopy
.
setOnClickListener
{
sureResult
.
invoke
(
4
,
phoneNumbers
)
dismiss
()
}
tvAddContacts
.
setOnClickListener
{
sureResult
.
invoke
(
5
,
phoneNumbers
)
dismiss
()
}
}
fun
setPhoneNumberData
(
phoneNumber
:
String
)
{
tvPhoneNumber
.
text
=
phoneNumber
phoneNumbers
=
phoneNumber
}
override
fun
onCreateShowAnimation
():
Animation
{
return
AnimationHelper
.
asAnimation
()
.
withTranslation
(
TranslationConfig
()
.
from
(
Direction
.
BOTTOM
)
.
to
(
Direction
.
IDLE
)
)
.
toShow
()
}
/* override fun onCreateDismissAnimation(): Animation {
return AnimationHelper.asAnimation()
.withTranslation(
TranslationConfig()
.from(Direction.TOP)
.to(Direction.IDLE)
)
.toShow()
}*/
}
app/src/main/res/drawable/cancel_btn_background.xml
0 → 100644
View file @
2f3b994a
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@color/md_blue_grey_300"
/>
<corners
android:radius=
"20dp"
/>
</shape>
app/src/main/res/drawable/tips_background.xml
0 → 100644
View file @
2f3b994a
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"@android:color/white"
/>
<corners
android:radius=
"18dp"
/>
</shape>
app/src/main/res/layout/d_ui_tips_popup.xml
0 → 100644
View file @
2f3b994a
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:background=
"@drawable/tips_background"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_phone_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"20dp"
android:text=
"XXX"
android:textColor=
"@color/md_grey_black"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_call_phone"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginBottom=
"5dp"
android:minHeight=
"30dp"
android:text=
"呼叫"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divider_height"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@color/divider_grey"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_call_phone_edit"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"5dp"
android:minHeight=
"30dp"
android:text=
"呼叫前编辑"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divider_height"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@color/divider_grey"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_send_sms"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"5dp"
android:minHeight=
"30dp"
android:text=
"发送短信"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divider_height"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@color/divider_grey"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_copy_phone_number"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"5dp"
android:minHeight=
"30dp"
android:text=
"复制到剪贴板"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/divider_height"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"15dp"
android:background=
"@color/divider_grey"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_add_contacts"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"10dp"
android:minHeight=
"35dp"
android:text=
"新建联系人"
android:textColor=
"@color/md_grey_black"
android:textSize=
"16sp"
/>
<androidx.appcompat.widget.AppCompatTextView
android:id=
"@+id/tv_cancel_pop"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:gravity=
"center"
android:minHeight=
"50dp"
android:text=
"取消"
android:textColor=
"@color/md_blue"
android:textSize=
"18sp"
/>
</LinearLayout>
commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context.kt
View file @
2f3b994a
...
@@ -1005,9 +1005,9 @@ fun Context.getCornerRadius() = resources.getDimension(R.dimen.rounded_corner_ra
...
@@ -1005,9 +1005,9 @@ fun Context.getCornerRadius() = resources.getDimension(R.dimen.rounded_corner_ra
// we need the Default Dialer functionality only in Simple Dialer and in Simple Contacts for now
// we need the Default Dialer functionality only in Simple Dialer and in Simple Contacts for now
fun
Context
.
isDefaultDialer
():
Boolean
{
fun
Context
.
isDefaultDialer
():
Boolean
{
return
if
(!
packageName
.
startsWith
(
"com.secspace.contacts"
)
&&
!
packageName
.
startsWith
(
"com.secspace.dialer"
))
{
return
if
(!
packageName
.
startsWith
(
Const
.
PACKAGE_CONTACTS
)
&&
!
packageName
.
startsWith
(
Const
.
PACKAGE_DIALER
))
{
true
true
}
else
if
((
packageName
.
startsWith
(
"com.secspace.contacts"
)
||
packageName
.
startsWith
(
"com.secspace.dialer"
))
&&
isQPlus
())
{
}
else
if
((
packageName
.
startsWith
(
Const
.
PACKAGE_CONTACTS
)
||
packageName
.
startsWith
(
Const
.
PACKAGE_DIALER
))
&&
isQPlus
())
{
val
roleManager
=
getSystemService
(
RoleManager
::
class
.
java
)
val
roleManager
=
getSystemService
(
RoleManager
::
class
.
java
)
roleManager
!!
.
isRoleAvailable
(
RoleManager
.
ROLE_DIALER
)
&&
roleManager
.
isRoleHeld
(
RoleManager
.
ROLE_DIALER
)
roleManager
!!
.
isRoleAvailable
(
RoleManager
.
ROLE_DIALER
)
&&
roleManager
.
isRoleHeld
(
RoleManager
.
ROLE_DIALER
)
}
else
{
}
else
{
...
...
commons/src/main/res/values/dimens.xml
View file @
2f3b994a
...
@@ -61,6 +61,7 @@
...
@@ -61,6 +61,7 @@
<dimen
name=
"cab_item_min_width"
>
85dp
</dimen>
<dimen
name=
"cab_item_min_width"
>
85dp
</dimen>
<dimen
name=
"popup_menu_elevation"
>
4dp
</dimen>
<dimen
name=
"popup_menu_elevation"
>
4dp
</dimen>
<dimen
name=
"divider_height"
>
2px
</dimen>
<dimen
name=
"divider_height"
>
2px
</dimen>
<dimen
name=
"divider_height_one"
>
1px
</dimen>
<dimen
name=
"contact_grid_item_max_size"
>
100dp
</dimen>
<dimen
name=
"contact_grid_item_max_size"
>
100dp
</dimen>
</resources>
</resources>
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