Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
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
Android Widget
Widget
Commits
d5272cd9
Commit
d5272cd9
authored
Aug 28, 2019
by
王韦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[new] alertdialog封装
parent
2d294d30
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
369 additions
and
55 deletions
+369
-55
AlertDialogActivity.java
...in/java/com/qimai/android/widget/AlertDialogActivity.java
+33
-0
CommomPopActivity.kt
...c/main/java/com/qimai/android/widget/CommomPopActivity.kt
+31
-14
popitem.xml
app/src/main/res/layout/popitem.xml
+2
-1
CommonPopWindow.kt
...java/com/qimai/android/widgetlib/popup/CommonPopWindow.kt
+43
-22
QMBasePopup.kt
...ain/java/com/qimai/android/widgetlib/popup/QMBasePopup.kt
+23
-18
QmAlertDialog.kt
...n/java/com/qimai/android/widgetlib/popup/QmAlertDialog.kt
+158
-0
shape_alert_bg.xml
widgetlib/src/main/res/drawable/shape_alert_bg.xml
+6
-0
shape_alert_cancel.xml
widgetlib/src/main/res/drawable/shape_alert_cancel.xml
+6
-0
shape_alert_confirm.xml
widgetlib/src/main/res/drawable/shape_alert_confirm.xml
+5
-0
qm_alert_content.xml
widgetlib/src/main/res/layout/qm_alert_content.xml
+60
-0
colors.xml
widgetlib/src/main/res/values/colors.xml
+2
-0
No files found.
app/src/main/java/com/qimai/android/widget/AlertDialogActivity.java
0 → 100644
View file @
d5272cd9
package
com
.
qimai
.
android
.
widget
;
import
android.os.Bundle
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.app.AppCompatActivity
;
import
com.qimai.android.widgetlib.popup.QmAlertDialog
;
import
kotlin.jvm.functions.Function1
;
/**
* created by wangwei ON 2019-08-28 email:wangwei_5521@163.com
*
* @version 1.1.1
* @Description
**/
public
class
AlertDialogActivity
extends
AppCompatActivity
{
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
new
QmAlertDialog
.
Builder
().
withContext
(
this
).
withTitle
(
new
Function1
<
QmAlertDialog
.
Builder
,
String
>()
{
@Override
public
String
invoke
(
QmAlertDialog
.
Builder
builder
)
{
return
""
;
}
});
}
}
app/src/main/java/com/qimai/android/widget/CommomPopActivity.kt
View file @
d5272cd9
package
com.qimai.android.widget
package
com.qimai.android.widget
import
android.os.Bundle
import
android.os.Bundle
import
android.view.Gravity
import
android.view.LayoutInflater
import
android.widget.Button
import
android.widget.Button
import
android.widget.Toast
import
androidx.appcompat.app.AppCompatActivity
import
androidx.appcompat.app.AppCompatActivity
import
com.qimai.android.widgetlib.popup.
CommonPopWindow
import
com.qimai.android.widgetlib.popup.
QmAlertDialog
class
CommomPopActivity
:
AppCompatActivity
()
{
class
CommomPopActivity
:
AppCompatActivity
()
{
...
@@ -14,19 +13,37 @@ class CommomPopActivity : AppCompatActivity() {
...
@@ -14,19 +13,37 @@ class CommomPopActivity : AppCompatActivity() {
setContentView
(
R
.
layout
.
activity_commom_pop
)
setContentView
(
R
.
layout
.
activity_commom_pop
)
findViewById
<
Button
>(
R
.
id
.
center
).
setOnClickListener
{
findViewById
<
Button
>(
R
.
id
.
center
).
setOnClickListener
{
// val commonPopWindow = CommonPopWindow(CommomPopActivity@ this)
// val commonPopWindow = CommonPopWindow(CommomPopActivity@ this)
val
contentView
=
// val contentView =
LayoutInflater
.
from
(
CommomPopActivity
@
this
).
inflate
(
R
.
layout
.
popitem
,
null
)
// LayoutInflater.from(CommomPopActivity@ this).inflate(R.layout.popitem, null)
// commonPopWindow.setContentView(contentView)
//// commonPopWindow.setContentView(contentView)
//// commonPopWindow.show(findViewById(R.id.root))
//// commonPopWindow.dimBehind(0.5f)
//
// val commonPopWindow = CommonPopWindow.Builder()
// .configContentView(contentView = contentView)
// .configGravity(Gravity.CENTER)
// .build()
// commonPopWindow.show(findViewById(R.id.root))
// commonPopWindow.show(findViewById(R.id.root))
// commonPopWindow.dimBehind(0.5f)
// commonPopWindow.dimBehind(0.5f)
//
val
commonPopWindow
=
CommonPopWindow
.
Builder
()
.
configContentView
(
contentView
=
contentView
)
QmAlertDialog
.
Builder
()
.
configGravity
(
Gravity
.
CENTER
)
.
withContext
(
this
)
.
build
().
showWindow
(
findViewById
(
R
.
id
.
root
))
.
withLeftButton
(
leftButtonText
=
{
"取消"
},
clickListener
=
{
Toast
.
makeText
(
this
,
"取消"
,
Toast
.
LENGTH_SHORT
).
show
()
commonPopWindow
.
dimBehind
(
0.5f
)
})
.
withRightButton
(
init
=
{
"确定"
},
clickListener
=
{
Toast
.
makeText
(
this
,
"确定"
,
Toast
.
LENGTH_SHORT
).
show
()
}).
withRootView
{
findViewById
(
R
.
id
.
root
)
}
.
withTitle
{
"订单1111"
}
.
withSubTitle
{
"子标题"
}
.
build
()
.
show
()
}
}
...
...
app/src/main/res/layout/popitem.xml
View file @
d5272cd9
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"
match_parent
"
android:layout_width=
"
200dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@color/colorAccent"
android:background=
"@color/colorAccent"
android:layout_gravity=
"center_horizontal"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
...
...
widgetlib/src/main/java/com/qimai/android/widgetlib/popup/CommonPopWindow.kt
View file @
d5272cd9
...
@@ -4,59 +4,80 @@ import android.content.Context
...
@@ -4,59 +4,80 @@ import android.content.Context
import
android.graphics.Point
import
android.graphics.Point
import
android.view.Gravity
import
android.view.Gravity
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.widget.PopupWindow
import
com.qimai.android.tools.dipTopx
import
com.qimai.android.tools.getScreenWidth
/**
/**
* created by wangwei ON 2019-08-28 email:wangwei_5521@163.com
* created by wangwei ON 2019-08-28 email:wangwei_5521@163.com
* @version 1.1.1
* @version 1.1.1
* @Description
* @Description
**/
**/
class
CommonPopWindow
(
context
:
Context
)
:
QMBasePopup
(
context
)
{
class
CommonPopWindow
private
constructor
(
override
var
context
:
Context
,
private
val
contentView
:
View
,
fun
showWindow
(
parent
:
View
):
CommonPopWindow
{
private
var
animationStyle
:
Int
,
super
.
show
(
parent
)
override
var
gravity
:
Int
,
return
this
override
var
mDismissListener
:
PopupWindow
.
OnDismissListener
?
)
:
QMBasePopup
(
context
)
{
private
constructor
(
builder
:
Builder
)
:
this
(
context
=
builder
.
mContentView
.
context
,
contentView
=
builder
.
mContentView
,
animationStyle
=
builder
.
animationStyle
,
gravity
=
builder
.
gravity
,
mDismissListener
=
builder
.
dismissListener
)
{
this
.
setContentView
(
contentView
)
this
.
setAnimatonStyle
(
animationStyle
)
setWindowWidth
(
getScreenWidth
(
contentView
.
context
)
-
dipTopx
(
context
,
30.0f
))
}
}
class
Builder
{
class
Builder
{
private
var
mContentView
:
View
?
=
null
internal
lateinit
var
mContentView
:
View
internal
var
gravity
=
Gravity
.
NO_GRAVITY
private
var
gravity
=
Gravity
.
NO_GRAVITY
internal
var
animationStyle
=
-
1
private
var
animationStyle
=
-
1
internal
var
dismissListener
:
PopupWindow
.
OnDismissListener
?
=
null
internal
var
windowWidth
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
internal
var
windowHeight
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
fun
configContentView
(
contentView
:
View
)
=
apply
{
fun
configContentView
(
contentView
:
View
)
=
apply
{
this
.
mContentView
=
contentView
this
.
mContentView
=
contentView
}
}
fun
configGravity
(
gravity
:
Int
)
=
apply
{
fun
configGravity
(
gravity
:
Int
)
=
apply
{
this
.
gravity
=
gravity
this
.
gravity
=
gravity
}
}
fun
configAnimationStyle
(
style
:
Int
)
{
fun
configAnimationStyle
(
style
:
Int
)
=
apply
{
this
.
animationStyle
=
style
this
.
animationStyle
=
style
}
}
fun
dismissListener
(
dismissListener
:
PopupWindow
.
OnDismissListener
)
=
apply
{
this
.
dismissListener
=
dismissListener
}
fun
build
():
CommonPopWindow
{
fun
build
():
CommonPopWindow
{
val
commonPopWindow
=
CommonPopWindow
(
mContentView
!!
.
context
)
return
CommonPopWindow
(
this
)
commonPopWindow
.
gravity
=
gravity
commonPopWindow
.
setAnimatonStyle
(
style
=
animationStyle
)
return
commonPopWindow
}
}
}
}
override
fun
onShowBegin
(
parent
:
View
,
attachedView
:
View
?):
Point
{
override
fun
onShowBegin
(
parent
:
View
,
attachedView
:
View
?):
Point
=
Point
(
0
,
0
)
return
Point
(
0
,
0
)
}
}
}
\ No newline at end of file
widgetlib/src/main/java/com/qimai/android/widgetlib/popup/QMBasePopup.kt
View file @
d5272cd9
...
@@ -16,19 +16,28 @@ import androidx.core.view.ViewCompat
...
@@ -16,19 +16,28 @@ import androidx.core.view.ViewCompat
* @version 1.1.1
* @version 1.1.1
* @Description
* @Description
**/
**/
abstract
class
QMBasePopup
(
var
context
:
Context
)
{
abstract
class
QMBasePopup
(
open
var
context
:
Context
)
{
private
var
mWindow
=
PopupWindow
()
private
var
mWindow
=
PopupWindow
()
lateinit
var
mRootViewWrapper
:
FrameLayout
private
lateinit
var
mRootViewWrapper
:
FrameLayout
var
mBackground
:
Drawable
?
=
null
private
var
mBackground
:
Drawable
?
=
null
var
mWindowManager
=
context
.
getSystemService
(
Context
.
WINDOW_SERVICE
)
as
WindowManager
private
lateinit
var
mWindowManager
:
WindowManager
var
mWindowWidth
=
0
private
var
mWindowWidth
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
var
mWindowHeight
=
0
private
var
mWindowHeight
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
var
gravity
=
Gravity
.
NO_GRAVITY
open
var
gravity
=
Gravity
.
NO_GRAVITY
protected
var
mDismissListener
:
PopupWindow
.
OnDismissListener
?
=
null
protected
open
var
mDismissListener
:
PopupWindow
.
OnDismissListener
?
=
null
fun
setWindowWidth
(
windowWidth
:
Int
)
{
this
.
mWindowWidth
=
windowWidth
}
fun
setWindowHeight
(
windowHeight
:
Int
)
{
this
.
mWindowHeight
=
windowHeight
}
fun
setAnimatonStyle
(
style
:
Int
)
{
fun
setAnimatonStyle
(
style
:
Int
)
{
mWindow
.
animationStyle
=
style
mWindow
.
animationStyle
=
style
...
@@ -40,6 +49,8 @@ abstract class QMBasePopup(var context: Context) {
...
@@ -40,6 +49,8 @@ abstract class QMBasePopup(var context: Context) {
}
}
fun
dimBehind
(
dim
:
Float
)
{
fun
dimBehind
(
dim
:
Float
)
{
if
(!
::
mWindowManager
.
isInitialized
)
mWindowManager
=
context
.
getSystemService
(
Context
.
WINDOW_SERVICE
)
as
WindowManager
if
(!
isShowing
())
{
if
(!
isShowing
())
{
throw
RuntimeException
(
"should call after method show() or in onShowEnd()"
)
throw
RuntimeException
(
"should call after method show() or in onShowEnd()"
)
}
}
...
@@ -61,23 +72,16 @@ abstract class QMBasePopup(var context: Context) {
...
@@ -61,23 +72,16 @@ abstract class QMBasePopup(var context: Context) {
mWindow
.
dismiss
()
mWindow
.
dismiss
()
}
}
fun
show
(
parent
:
View
)
{
protected
fun
show
(
parent
:
View
)
{
show
(
parent
,
null
)
show
(
parent
,
null
)
}
}
fun
show
(
parent
:
View
,
anchorView
:
View
?)
{
fun
show
(
parent
:
View
,
anchorView
:
View
?)
{
if
(
anchorView
!=
null
&&
!
ViewCompat
.
isAttachedToWindow
(
anchorView
!!
))
{
if
(
anchorView
!=
null
&&
!
ViewCompat
.
isAttachedToWindow
(
anchorView
))
{
return
return
}
}
if
(
mWindowWidth
==
0
||
mWindowHeight
==
0
)
{
mWindowWidth
=
ViewGroup
.
LayoutParams
.
MATCH_PARENT
mWindowHeight
=
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
}
mWindow
.
width
=
mWindowWidth
mWindow
.
width
=
mWindowWidth
mWindow
.
height
=
mWindowHeight
mWindow
.
height
=
mWindowHeight
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP_MR1
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP_MR1
)
{
...
@@ -118,12 +122,13 @@ abstract class QMBasePopup(var context: Context) {
...
@@ -118,12 +122,13 @@ abstract class QMBasePopup(var context: Context) {
}
}
fun
setContentView
(
root
:
View
)
{
fun
setContentView
(
root
:
View
)
{
mRootViewWrapper
=
FrameLayout
(
context
)
mRootViewWrapper
=
FrameLayout
(
root
.
context
)
mRootViewWrapper
.
layoutParams
=
ViewGroup
.
LayoutParams
(
mRootViewWrapper
.
layoutParams
=
ViewGroup
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
)
mRootViewWrapper
.
addView
(
root
)
mRootViewWrapper
.
addView
(
root
)
mWindow
.
contentView
=
mRootViewWrapper
onShowConfig
()
onShowConfig
()
mWindow
.
setTouchInterceptor
(
View
.
OnTouchListener
{
v
,
event
->
mWindow
.
setTouchInterceptor
(
View
.
OnTouchListener
{
v
,
event
->
...
...
widgetlib/src/main/java/com/qimai/android/widgetlib/popup/QmAlertDialog.kt
0 → 100644
View file @
d5272cd9
package
com.qimai.android.widgetlib.popup
import
android.content.Context
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.PopupWindow
import
android.widget.TextView
import
com.qimai.android.widgetlib.R
/**
* created by wangwei ON 2019-08-28 email:wangwei_5521@163.com
* @version 1.1.1
* @Description
**/
class
QmAlertDialog
private
constructor
(
private
val
title
:
CharSequence
,
private
val
subTitle
:
CharSequence
,
private
val
leftButtonText
:
String
,
private
val
rightButtonText
:
String
,
private
val
leftButtonClickListener
:
()
->
Unit
,
private
val
rightButtonClickListener
:
()
->
Unit
,
private
val
rootView
:
ViewGroup
,
private
val
dismissListener
:
PopupWindow
.
OnDismissListener
?
)
{
private
lateinit
var
commonPopWindow
:
CommonPopWindow
constructor
(
builder
:
Builder
)
:
this
(
title
=
builder
.
title
,
subTitle
=
builder
.
subTitle
,
leftButtonText
=
builder
.
leftButtonText
,
rightButtonText
=
builder
.
rightButtonText
,
leftButtonClickListener
=
builder
.
leftButtonClick
,
rightButtonClickListener
=
builder
.
rightButtonClick
,
rootView
=
builder
.
rootView
,
dismissListener
=
builder
.
dismissListener
)
fun
show
()
{
if
(!
::
commonPopWindow
.
isInitialized
)
{
val
contentView
=
LayoutInflater
.
from
(
rootView
.
context
)
.
inflate
(
R
.
layout
.
qm_alert_content
,
rootView
,
false
)
val
titleView
=
contentView
.
findViewById
<
TextView
>(
R
.
id
.
alert_title
)
val
subTitleView
=
contentView
.
findViewById
<
TextView
>(
R
.
id
.
alert_subtitle
)
val
cancel
=
contentView
.
findViewById
<
TextView
>(
R
.
id
.
alert_cancel
)
val
confirm
=
contentView
.
findViewById
<
TextView
>(
R
.
id
.
alert_confirm
)
if
(!
TextUtils
.
isEmpty
(
title
))
{
titleView
.
text
=
title
}
else
{
titleView
.
visibility
=
View
.
GONE
}
if
(!
TextUtils
.
isEmpty
(
subTitle
))
{
subTitleView
.
text
=
subTitle
}
else
{
subTitleView
.
visibility
=
View
.
GONE
}
cancel
.
text
=
leftButtonText
confirm
.
text
=
rightButtonText
cancel
.
setOnClickListener
{
this
.
leftButtonClickListener
.
invoke
()
}
confirm
.
setOnClickListener
{
this
.
rightButtonClickListener
.
invoke
()
}
commonPopWindow
=
CommonPopWindow
.
Builder
()
.
configGravity
(
Gravity
.
CENTER
)
.
configContentView
(
contentView
)
.
dismissListener
(
PopupWindow
.
OnDismissListener
{
dismissListener
?.
onDismiss
()
})
.
build
()
}
commonPopWindow
.
show
(
rootView
)
commonPopWindow
.
dimBehind
(
0.5f
)
}
fun
dismiss
()
{
if
(
::
commonPopWindow
.
isInitialized
)
{
commonPopWindow
.
dismiss
()
}
}
class
Builder
()
{
internal
var
title
:
CharSequence
=
""
internal
var
subTitle
:
CharSequence
=
""
internal
var
leftButtonText
=
"取消"
internal
var
rightButtonText
=
"确定"
internal
lateinit
var
leftButtonClick
:
()
->
Unit
internal
lateinit
var
rightButtonClick
:
()
->
Unit
private
lateinit
var
context
:
Context
internal
lateinit
var
rootView
:
ViewGroup
internal
var
dismissListener
:
PopupWindow
.
OnDismissListener
?
=
null
constructor
(
init
:
Builder
.()
->
Unit
)
:
this
()
{
init
()
}
fun
withTitle
(
init
:
Builder
.()
->
String
)
=
apply
{
this
.
title
=
init
()
}
fun
withDismissListener
(
init
:
Builder
.()
->
PopupWindow
.
OnDismissListener
)
=
apply
{
this
.
dismissListener
=
init
()
}
fun
withContext
(
context
:
Context
)
=
apply
{
this
.
context
=
context
}
fun
withSubTitle
(
init
:
Builder
.()
->
CharSequence
)
=
apply
{
this
.
subTitle
=
init
()
}
fun
withRootView
(
init
:
Builder
.()
->
ViewGroup
)
=
apply
{
this
.
rootView
=
init
()
}
fun
build
():
QmAlertDialog
{
return
QmAlertDialog
(
this
)
}
fun
withLeftButton
(
leftButtonText
:
Builder
.()
->
String
,
clickListener
:
()
->
Unit
)
=
apply
{
this
.
leftButtonText
=
leftButtonText
()
leftButtonClick
=
clickListener
}
fun
withRightButton
(
init
:
Builder
.()
->
String
,
clickListener
:
()
->
Unit
)
=
apply
{
this
.
rightButtonText
=
init
()
this
.
rightButtonClick
=
clickListener
}
}
}
\ No newline at end of file
widgetlib/src/main/res/drawable/shape_alert_bg.xml
0 → 100644
View file @
d5272cd9
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#ffffff"
/>
<corners
android:radius=
"5dp"
/>
</shape>
\ No newline at end of file
widgetlib/src/main/res/drawable/shape_alert_cancel.xml
0 → 100644
View file @
d5272cd9
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#E5E5E5"
/>
<corners
android:bottomLeftRadius=
"5dp"
/>
</shape>
\ No newline at end of file
widgetlib/src/main/res/drawable/shape_alert_confirm.xml
0 → 100644
View file @
d5272cd9
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#FFC809"
/>
<corners
android:bottomRightRadius=
"5dp"
/>
</shape>
\ No newline at end of file
widgetlib/src/main/res/layout/qm_alert_content.xml
0 → 100644
View file @
d5272cd9
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_alert_bg"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/alert_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"37dp"
android:gravity=
"center"
android:textColor=
"@color/color_222222"
android:textSize=
"19sp"
tools:text=
"标题"
/>
<TextView
android:id=
"@+id/alert_subtitle"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"14dp"
android:gravity=
"center"
android:textColor=
"@color/color_222222"
android:textSize=
"17sp"
tools:text=
"子标题"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"51dp"
android:layout_marginTop=
"39dp"
>
<TextView
android:id=
"@+id/alert_cancel"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
android:background=
"@drawable/shape_alert_cancel"
android:gravity=
"center"
android:text=
"取消"
android:textColor=
"@color/color_777777"
android:textSize=
"17sp"
/>
<TextView
android:id=
"@+id/alert_confirm"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
android:background=
"@drawable/shape_alert_confirm"
android:gravity=
"center"
android:text=
"确定"
android:textColor=
"@color/QmTopBar_color_000000"
android:textSize=
"17sp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
widgetlib/src/main/res/values/colors.xml
View file @
d5272cd9
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
<color
name=
"QmTopBar_color_FFFFFFF"
>
#FFFFFF
</color>
<color
name=
"QmTopBar_color_FFFFFFF"
>
#FFFFFF
</color>
<color
name=
"QmTopBar_color_3333333"
>
#333333
</color>
<color
name=
"QmTopBar_color_3333333"
>
#333333
</color>
<color
name=
"QmTopBar_color_000000"
>
#000000
</color>
<color
name=
"QmTopBar_color_000000"
>
#000000
</color>
<color
name=
"color_777777"
>
#777777
</color>
<color
name=
"color_222222"
>
#222222
</color>
</resources>
</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