inital commit of a working example of a widget
This commit is contained in:
BIN
HelloWidget/res/drawable/icon.png
Normal file
BIN
HelloWidget/res/drawable/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
HelloWidget/res/drawable/widget_bg_normal.9.png
Normal file
BIN
HelloWidget/res/drawable/widget_bg_normal.9.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 268 B |
17
HelloWidget/res/layout/main.xml
Normal file
17
HelloWidget/res/layout/main.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/widget_bg_normal"
|
||||
android:layout_gravity="center"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView android:id="@+id/widget_textview"
|
||||
android:text="@string/widget_text"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center_horizontal|center"
|
||||
android:layout_marginTop="5dip"
|
||||
android:padding="10dip"
|
||||
android:textColor="@android:color/black" android:clickable="true"/>
|
||||
</LinearLayout>
|
||||
5
HelloWidget/res/values/strings.xml
Normal file
5
HelloWidget/res/values/strings.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="widget_text">Hello Widget!</string>
|
||||
<string name="app_name">Hello Widget</string>
|
||||
</resources>
|
||||
14
HelloWidget/res/xml/hello_widget_provider.xml
Normal file
14
HelloWidget/res/xml/hello_widget_provider.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
AppWidget default settings:
|
||||
- setting width and hight
|
||||
- setting update periode to 1 second
|
||||
- setting the initialLayout to layout/widget_text.xml
|
||||
-->
|
||||
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:minWidth="146dip"
|
||||
android:minHeight="72dip"
|
||||
android:updatePeriodMillis="10000"
|
||||
android:initialLayout="@layout/main"
|
||||
/>
|
||||
Reference in New Issue
Block a user