- {registration_date}
- сообщений: {posts}
- {tel_link}
1 | # -*- coding: utf-8 -*- |
2 | import android |
3 | import sys |
4 | droid = android.Android() |
5 |
6 | layout = '''<?xml version="1.0" encoding="utf-8"?> |
7 | <LinearLayout |
8 | xmlns:android="https://schemas.android.com/apk/res/android" |
9 | android:id="@+id/cloth" |
10 | android:layout_width="fill_parent" |
11 | android:layout_height="fill_parent" |
12 | android:orientation="vertical"> |
13 |
14 | <!-- Логотип HeaTPlaY --> |
15 |
16 | <View |
17 | android:id="@+id/up_bar" |
18 | android:layout_width="fill_parent" |
19 | android:layout_weight="1" |
20 | android:layout_height="0dp"/> |
21 |
22 | <!-- Background верхней панели кнопок --> |
23 |
24 | <LinearLayout |
25 | android:orientation="horizontal" |
26 | android:layout_height="wrap_content" |
27 | android:layout_width="fill_parent"> |
28 |
29 | <!-- Кнопки верхней панели --> |
30 |
31 | <ImageButton |
32 | android:id="@+id/ic_menu_agenda" |
33 | android:layout_weight="1" |
34 | android:layout_width="0dp" |
35 | android:layout_height="48dp" |
36 | android:src="@android:drawable/ic_menu_agenda"/> |
37 | <ImageButton |
38 | android:id="@+id/ic_menu_rotate" |
39 | android:layout_weight="1" |
40 | android:layout_width="0dp" |
41 | android:layout_height="48dp" |
42 | android:src="@android:drawable/ic_menu_rotate"/> |
43 | <ImageButton |
44 | android:id="@+id/ic_menu_recent_history" |
45 | android:layout_weight="1" |
46 | android:layout_width="0dp" |
47 | android:layout_height="48dp" |
48 | android:src="@android:drawable/ic_menu_recent_history"/> |
49 | <ImageButton |
50 | android:id="@+id/ic_menu_search" |
51 | android:layout_weight="1" |
52 | android:layout_width="0dp" |
53 | android:layout_height="48dp" |
54 | android:src="@android:drawable/ic_menu_search"/> |
55 |
56 | </LinearLayout> |
57 |
58 | <!-- ListView для списка медиа контента --> |
59 |
60 | <ListView |
61 | android:id="@+id/music_list" |
62 | android:layout_width="fill_parent" |
63 | android:layout_height="0dp" |
64 | android:layout_weight="2"/> |
65 |
66 | <!-- Background нижней панели кнопок --> |
67 |
68 | <LinearLayout |
69 | android:layout_below="@id/body" |
70 | android:orientation="horizontal" |
71 | android:layout_height="wrap_content" |
72 | android:layout_width="fill_parent"> |
73 |
74 | <!-- Кнопки нижней панели --> |
75 |
76 | <ImageButton |
77 | android:id="@+id/ic_media_previous" |
78 | android:layout_weight="1" |
79 | android:layout_width="0dp" |
80 | android:layout_height="48dp" |
81 | android:src="@android:drawable/ic_media_previous"/> |
82 | <ImageButton |
83 | android:id="@+id/ic_media_rew" |
84 | android:layout_weight="1" |
85 | android:layout_width="0dp" |
86 | android:layout_height="48dp" |
87 | android:src="@android:drawable/ic_media_rew"/> |
88 | <ImageButton |
89 | android:id="@+id/ic_media_play" |
90 | android:layout_weight="1" |
91 | android:layout_width="0dp" |
92 | android:layout_height="48dp" |
93 | android:src="@android:drawable/ic_media_play"/> |
94 | <ImageButton |
95 | android:id="@+id/ic_media_ff" |
96 | android:layout_weight="1" |
97 | android:layout_width="0dp" |
98 | android:layout_height="48dp" |
99 | android:src="@android:drawable/ic_media_ff"/> |
100 | <ImageButton |
101 | android:id="@+id/ic_media_next" |
102 | android:layout_weight="1" |
103 | android:layout_width="0dp" |
104 | android:layout_height="48dp" |
105 | android:src="@android:drawable/ic_media_next"/> |
106 |
107 | </LinearLayout> |
108 |
109 | </LinearLayout>''' |
110 |
111 |
112 |
113 | def main(): |
114 | droid.fullShow(layout) |
115 | droid.fullSetList( 'music_list' , [ '1' ] * 20 ) |
116 | while True : |
117 | signal = droid.eventWait().result |
118 | if signal[ "name" ] = = "key" and signal[ "data" ][ "key" ] = = "4" : |
119 | droid.fullDismiss() |
120 | sys.exit() |
121 | main() |
вот накидал, глянь
ответ опубликован:
Рейтинг: 5
голосов: 2
- 5
- 1
- 2
- 3
- 4
- 5