Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
石璀亮
/
turingos
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a834e3c7
authored
Aug 19, 2019
by
cuiliang.shi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
播报内容可滚动修复
1 parent
2ff2e069
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
global_dialog/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java
global_dialog/src/main/res/layout/alert_dialog.xml
global_dialog/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java
View file @
a834e3c
...
...
@@ -6,6 +6,7 @@ import android.content.Context;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.view.animation.AlphaAnimation
;
...
...
@@ -135,6 +136,17 @@ public class SweetAlertDialog extends Dialog implements View.OnClickListener {
mOverlayOutAnim
.
setDuration
(
120
);
}
@Override
public
boolean
dispatchKeyEvent
(
KeyEvent
event
)
{
if
(
isShowing
()
&&
event
.
getAction
()
==
KeyEvent
.
ACTION_DOWN
&&
event
.
getKeyCode
()
==
KeyEvent
.
KEYCODE_DPAD_CENTER
){
findViewById
(
R
.
id
.
confirm_button
).
callOnClick
();
}
return
super
.
dispatchKeyEvent
(
event
);
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
alert_dialog
);
...
...
global_dialog/src/main/res/layout/alert_dialog.xml
View file @
a834e3c
...
...
@@ -127,16 +127,21 @@
android:singleLine=
"true"
android:text=
"@string/dialog_default_title"
/>
<TextView
android:id=
"@+id/content_text"
android:layout_marginTop=
"10dp"
<ScrollView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"19sp"
android:textAlignment=
"center"
android:gravity=
"center"
android:textColor=
"#797979"
android:visibility=
"gone"
/>
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/content_text"
android:layout_marginTop=
"10dp"
android:paddingBottom=
"4dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"19sp"
android:textAlignment=
"center"
android:gravity=
"center"
android:textColor=
"#797979"
android:visibility=
"gone"
/>
</ScrollView>
<LinearLayout
android:layout_marginTop=
"10dp"
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment