This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge "Making StackWidget sample code stand alone as opposed to bundl…
…ed with HoneycombGallery" into honeycomb
- Loading branch information
Showing
22 changed files
with
329 additions
and
246 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file not shown.
19 changes: 0 additions & 19 deletions
19
samples/HoneycombGallery/res/drawable/widget_item_background.xml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
136 changes: 0 additions & 136 deletions
136
samples/HoneycombGallery/src/com/example/android/hcgallery/widget/WidgetService.java
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
LOCAL_PATH:= $(call my-dir) | ||
include $(CLEAR_VARS) | ||
|
||
LOCAL_MODULE_TAGS := tests | ||
|
||
# Only compile source java files in this apk. | ||
LOCAL_SRC_FILES := $(call all-java-files-under, src) | ||
|
||
LOCAL_PACKAGE_NAME := StackWidget | ||
|
||
LOCAL_SDK_VERSION := current | ||
|
||
include $(BUILD_PACKAGE) | ||
|
||
# Use the following include to make our test apk. | ||
include $(call all-makefiles-under,$(LOCAL_PATH)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright (C) 2011 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
<!-- Declare the contents of this Android application. The namespace | ||
attribute brings in the Android platform namespace, and the package | ||
supplies a unique name for the application. When writing your | ||
own application, the package name must be changed from "com.example.*" | ||
to come from a domain that you own or have control over. --> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.example.android.stackwidget"> | ||
<uses-sdk android:targetSdkVersion="11" android:minSdkVersion="11"/> | ||
<application android:label="StackWidget"> | ||
<receiver android:name="StackWidgetProvider"> | ||
<intent-filter> | ||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | ||
</intent-filter> | ||
<meta-data android:name="android.appwidget.provider" | ||
android:resource="@xml/stackwidgetinfo" /> | ||
</receiver> | ||
|
||
<service android:name="StackWidgetService" | ||
android:permission="android.permission.BIND_REMOTEVIEWS" | ||
android:exported="false" /> | ||
</application> | ||
</manifest> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<p> | ||
This sample shows how to construct a simple collection widget. This particular example shows how | ||
to create a widget containing a <a href="../../../reference/android/widget/StackView.html"><code>StackView</code></a> | ||
; however, only minimal changes are required to include | ||
a <a href="../../../reference/android/widget/ListView.html"><code>ListView</code></a>, | ||
<a href="../../../reference/android/widget/GridView.html"><code>GridView</code></a> or | ||
<a href="../../../reference/android/widget/AdapterViewFlipper.html"><code>AdapterViewFlipper</code></a> instead. | ||
</p> | ||
<p> | ||
The sample demonstrates the following: | ||
</p> | ||
<ul> | ||
<li> | ||
The pattern for creating and wiring a <a href="../../../reference/android/widget/RemoteViewsService.html"><code>RemoteViewsService</code></a> | ||
and <a href="../../../reference/android/widget/RemoteViewsService.RemoteViewsFactory.html"><code>RemoteViewsFactory</code></a> which | ||
serve the function of an adapter for the widget collection. | ||
</li> | ||
<li> | ||
The pattern for setting an intent template and fill-in intents in order to | ||
provide children of the collection with click behaviour. | ||
</li> | ||
<li> | ||
How to make a widget with a <a href="../../../reference/android/widget/StackView.html"><code>StackView</code></a> | ||
(or <a href="../../../reference/android/widget/AdapterViewFlipper.html"><code>AdapterViewFlipper</code></a>) auto-advance. | ||
</li> | ||
<li> | ||
How to set a widget preview image. | ||
</li> | ||
</ul> | ||
<img alt="The widget." | ||
src="../images/StackWidget.png"/> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
samples/StackWidget/res/drawable-nodpi/widget_item_background.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright (C) 2011 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | ||
<gradient android:startColor="#ff666666" android:endColor="#ff333333" android:angle="270" /> | ||
</shape> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright (C) 2011 The Android Open Source Project | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/widget_item" | ||
android:layout_width="120dp" | ||
android:layout_height="120dp" | ||
android:gravity="center" | ||
android:background="@drawable/widget_item_background" | ||
android:textColor="#ffffff" | ||
android:textStyle="bold" | ||
android:textSize="44sp" /> |
Oops, something went wrong.