background image

自定义

dialog 之屏幕右边选择时间

先是弹窗的样式

0 <!-- 弹窗样式 -->
1

 

<

style 

name

="dialog"

 

parent

="@android:style/Theme.Dialog">

2

   

<

item 

name

="android:windowFrame">

@null

</

item

>

3

   

<

item 

name

="android:windowIsFloating">

true

</

item

>

4

   

<

item 

name

="android:windowIsTranslucent">

false

</

item

>

5

   

<

item 

name

="android:background">

@android:color/transparent

</

item

>

6

   

<

item 

name

="android:windowBackground">

@android:color/transparent

</

item

>

7

   

<

item 

name

="android:windowNoTitle">

true

</

item

>

8  

 

<

item 

name

="android:backgroundDimEnabled">

false

</

item

>

9

 

</

style

>

 

然后是

java 代码

 1

 

/**

 

 2

 

* 弹出时间选择控件

 3

 

 

 4

 

* @Description:从右边弹出时间选择控件

 5

 

@author

 

sleep

 6

 

* @date create date 2013 年 12 月 24 日

 

 7

 

@version

V1.0

 8

 

*/

 

 9

 

public

 

class

 PopDateWindow 

extends

 Dialog

 

10

 {

11

 

private

 Window window = 

null

;

 

12

 

private

 Context context = 

null

;

13

 

private

ListView list;

14

 

private

 ArrayList<String> dates;

15

 

 

16

 

public

 PopDateWindow(Context context, ArrayList<String> dates)

17

 {

 

18

 

super

(context, R.style.dialog);

 

19

 

this

.context = context;