Created
May 17, 2012 00:47
-
-
Save killerswan/2715258 to your computer and use it in GitHub Desktop.
android-scripting full screen ui demo 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android | |
| from full_screen_ui_wrapper import full_screen_ui_wrapper | |
| droid = android.Android() | |
| class main_screen(full_screen_ui_wrapper): | |
| def __init__(self,droid): | |
| xml = """<?xml version="1.0" encoding="utf-8"?> | |
| <ScrollView | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:id="@+id/ScrollView01" | |
| android:layout_width="fill_parent" | |
| android:layout_height="fill_parent" | |
| android:scrollbars="vertical" | |
| android:background="#FF191919" | |
| > | |
| <LinearLayout | |
| android:layout_width="fill_parent" | |
| android:orientation="vertical" | |
| android:layout_height="fill_parent"> | |
| <EditText | |
| android:id="@+id/EditTextName" | |
| android:layout_height="wrap_content" | |
| android:hint="field one" | |
| android:inputType="textPersonName" | |
| android:layout_width="fill_parent"></EditText> | |
| <EditText | |
| android:id="@+id/EditTextEmail" | |
| android:layout_height="wrap_content" | |
| android:hint="field two" | |
| android:inputType="textEmailAddress" | |
| android:layout_width="fill_parent"></EditText> | |
| <Button | |
| android:id="@+id/ButtonSendFeedback" | |
| android:layout_height="wrap_content" | |
| android:text="submit" | |
| android:onClick="sendFeedback" | |
| android:layout_width="fill_parent"></Button> | |
| </LinearLayout> | |
| </ScrollView> | |
| """ | |
| self.initialize(xml,droid) | |
| self.add_event_handler(("key","key","4"), self.leave) | |
| # self.add_event_handler(("click", "id", "but_exit"), self.on_but_exit_click) | |
| def leave(self, event): | |
| self.close() | |
| def main(): | |
| main_screen(droid).show() | |
| if __name__ == '__main__': | |
| main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment