Merge "MediaRecorder: Use new build system" into developers-dev
diff --git a/background/alarms/repeatingAlarm/template-params.xml b/background/alarms/repeatingAlarm/template-params.xml
index fdb96ba..b5a52bb 100644
--- a/background/alarms/repeatingAlarm/template-params.xml
+++ b/background/alarms/repeatingAlarm/template-params.xml
@@ -16,6 +16,7 @@
-->
<sample>
<name>repeatingAlarm</name>
+ <group>Background</group>
<package>com.example.android.repeatingalarm</package>
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/build.gradle b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/build.gradle
deleted file mode 100644
index 9f4459b..0000000
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/build.gradle
+++ /dev/null
@@ -1,6 +0,0 @@
-apply plugin: 'android'
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/AndroidManifest.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/AndroidManifest.xml
deleted file mode 100644
index 019d258..0000000
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright (C) 2013 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.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.bluetooth.le"
- android:versionCode="1"
- android:versionName="1.0">
- <uses-sdk android:minSdkVersion="18"
- android:targetSdkVersion="18"/>
- <!-- Declare this required feature if you want to make the app available to BLE-capable
- devices only. If you want to make your app available to devices that don't support BLE,
- you should omit this in the manifest. Instead, determine BLE capability by using
- PackageManager.hasSystemFeature(FEATURE_BLUETOOTH_LE) -->
- <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
-
- <uses-permission android:name="android.permission.BLUETOOTH"/>
- <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
-
- <application android:label="@string/app_name"
- android:icon="@drawable/ic_launcher"
- android:theme="@android:style/Theme.Holo.Light">
- <activity android:name=".DeviceScanActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- <activity android:name=".DeviceControlActivity"/>
- <service android:name=".BluetoothLeService" android:enabled="true"/>
- </application>
-</manifest>
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/.gitignore b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/proguard-project.txt
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/AndroidManifest.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..babd6df
--- /dev/null
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/AndroidManifest.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.bluetoothlegatt"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="18"
+ android:targetSdkVersion="18"/>
+ <!-- Declare this required feature if you want to make the app available to BLE-capable
+ devices only. If you want to make your app available to devices that don't support BLE,
+ you should omit this in the manifest. Instead, determine BLE capability by using
+ PackageManager.hasSystemFeature(FEATURE_BLUETOOTH_LE) -->
+ <uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/>
+
+ <uses-permission android:name="android.permission.BLUETOOTH"/>
+ <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
+
+ <application android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@android:style/Theme.Holo.Light">
+ <activity android:name=".DeviceScanActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ <activity android:name=".DeviceControlActivity"/>
+ <service android:name=".BluetoothLeService" android:enabled="true"/>
+ </application>
+
+</manifest>
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/BluetoothLeService.java b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/BluetoothLeService.java
similarity index 99%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/BluetoothLeService.java
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/BluetoothLeService.java
index 9e7aabd..694faaf 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/BluetoothLeService.java
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/BluetoothLeService.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.bluetooth.le;
+package com.example.android.bluetoothlegatt;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceControlActivity.java b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceControlActivity.java
similarity index 99%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceControlActivity.java
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceControlActivity.java
index 06b3bb4..dc2f90b 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceControlActivity.java
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceControlActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.bluetooth.le;
+package com.example.android.bluetoothlegatt;
import android.app.Activity;
import android.bluetooth.BluetoothGattCharacteristic;
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceScanActivity.java b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceScanActivity.java
similarity index 99%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceScanActivity.java
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceScanActivity.java
index 1cc954d..9b86f7a 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/DeviceScanActivity.java
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/DeviceScanActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.bluetooth.le;
+package com.example.android.bluetoothlegatt;
import android.app.Activity;
import android.app.ListActivity;
@@ -37,7 +37,6 @@
import android.widget.Toast;
import java.util.ArrayList;
-import java.util.UUID;
/**
* Activity for scanning and displaying available Bluetooth LE devices.
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/SampleGattAttributes.java b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/SampleGattAttributes.java
similarity index 96%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/SampleGattAttributes.java
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/SampleGattAttributes.java
index 255653e..e8db74c 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/java/com/example/bluetooth/le/SampleGattAttributes.java
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/java/com/example/android/bluetoothlegatt/SampleGattAttributes.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.bluetooth.le;
+package com.example.android.bluetoothlegatt;
import java.util.HashMap;
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-hdpi/ic_launcher.png b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-hdpi/ic_launcher.png
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-mdpi/ic_launcher.png b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-mdpi/ic_launcher.png
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-xhdpi/ic_launcher.png b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-xhdpi/ic_launcher.png
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-xxhdpi/ic_launcher.png b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/actionbar_indeterminate_progress.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/actionbar_indeterminate_progress.xml
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/actionbar_indeterminate_progress.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/actionbar_indeterminate_progress.xml
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/gatt_services_characteristics.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/gatt_services_characteristics.xml
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/gatt_services_characteristics.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/gatt_services_characteristics.xml
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/listitem_device.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/listitem_device.xml
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/layout/listitem_device.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/layout/listitem_device.xml
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/menu/gatt_services.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/menu/gatt_services.xml
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/menu/gatt_services.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/menu/gatt_services.xml
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/menu/main.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/menu/main.xml
similarity index 100%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/menu/main.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/menu/main.xml
diff --git a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/values/strings.xml b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/values/strings.xml
similarity index 96%
rename from connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/values/strings.xml
rename to connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/values/strings.xml
index d828aa0..19f3dce 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGatt/src/main/res/values/strings.xml
+++ b/connectivity/bluetooth/BluetoothLeGatt/BluetoothLeGattSample/src/main/res/values/strings.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<resources>
- <string name="app_name">BLE Sample</string>
<string name="ble_not_supported">BLE is not supported</string>
<string name="label_data">Data:</string>
<string name="label_device_address">Device address:</string>
diff --git a/connectivity/bluetooth/BluetoothLeGatt/build.gradle b/connectivity/bluetooth/BluetoothLeGatt/build.gradle
index 036abc8..ffb5c2f 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/build.gradle
+++ b/connectivity/bluetooth/BluetoothLeGatt/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/connectivity/bluetooth/BluetoothLeGatt/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to connectivity/bluetooth/BluetoothLeGatt/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/connectivity/bluetooth/BluetoothLeGatt/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/connectivity/bluetooth/BluetoothLeGatt/gradle/wrapper/gradle-wrapper.properties b/connectivity/bluetooth/BluetoothLeGatt/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/gradle/wrapper/gradle-wrapper.properties
+++ b/connectivity/bluetooth/BluetoothLeGatt/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/connectivity/bluetooth/BluetoothLeGatt/settings.gradle b/connectivity/bluetooth/BluetoothLeGatt/settings.gradle
index 639c5c8..05cae43 100644
--- a/connectivity/bluetooth/BluetoothLeGatt/settings.gradle
+++ b/connectivity/bluetooth/BluetoothLeGatt/settings.gradle
@@ -1 +1,4 @@
-include ':BluetoothLeGatt'
+
+
+
+include 'BluetoothLeGattSample'
diff --git a/connectivity/bluetooth/BluetoothLeGatt/template-params.xml b/connectivity/bluetooth/BluetoothLeGatt/template-params.xml
new file mode 100644
index 0000000..323e1d7
--- /dev/null
+++ b/connectivity/bluetooth/BluetoothLeGatt/template-params.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>BluetoothLeGatt</name>
+ <group>Connectivity</group>
+ <package>com.example.android.bluetoothlegatt</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>18</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how to use the Bluetooth LE Generic Attribute Profile (GATT)
+ to transmit arbitrary data between devices.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/build.gradle b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/build.gradle
deleted file mode 100644
index 10fb811..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'android'
-
-dependencies {
- compile "com.android.support:support-v4:18.0.+"
-}
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/Log.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/Log.java
deleted file mode 100644
index cf4abb7..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/Log.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-package com.example.android.common.logger;
-
-/**
- * Helper class for a list (or tree) of LoggerNodes.
- *
- * <p>When this is set as the head of the list,
- * an instance of it can function as a drop-in replacement for {@link android.util.Log}.
- * Most of the methods in this class server only to map a method call in Log to its equivalent
- * in LogNode.</p>
- */
-public class Log {
- // Grabbing the native values from Android's native logging facilities,
- // to make for easy migration and interop.
- public static final int NONE = -1;
- public static final int VERBOSE = android.util.Log.VERBOSE;
- public static final int DEBUG = android.util.Log.DEBUG;
- public static final int INFO = android.util.Log.INFO;
- public static final int WARN = android.util.Log.WARN;
- public static final int ERROR = android.util.Log.ERROR;
- public static final int ASSERT = android.util.Log.ASSERT;
-
- // Stores the beginning of the LogNode topology.
- private static LogNode mLogNode;
-
- /**
- * Returns the next LogNode in the linked list.
- */
- public static LogNode getLogNode() {
- return mLogNode;
- }
-
- /**
- * Sets the LogNode data will be sent to.
- */
- public static void setLogNode(LogNode node) {
- mLogNode = node;
- }
-
- /**
- * Instructs the LogNode to print the log data provided. Other LogNodes can
- * be chained to the end of the LogNode as desired.
- *
- * @param priority Log level of the data being logged. Verbose, Error, etc.
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void println(int priority, String tag, String msg, Throwable tr) {
- if (mLogNode != null) {
- mLogNode.println(priority, tag, msg, tr);
- }
- }
-
- /**
- * Instructs the LogNode to print the log data provided. Other LogNodes can
- * be chained to the end of the LogNode as desired.
- *
- * @param priority Log level of the data being logged. Verbose, Error, etc.
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged. The actual message to be logged.
- */
- public static void println(int priority, String tag, String msg) {
- println(priority, tag, msg, null);
- }
-
- /**
- * Prints a message at VERBOSE priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void v(String tag, String msg, Throwable tr) {
- println(VERBOSE, tag, msg, tr);
- }
-
- /**
- * Prints a message at VERBOSE priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void v(String tag, String msg) {
- v(tag, msg, null);
- }
-
-
- /**
- * Prints a message at DEBUG priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void d(String tag, String msg, Throwable tr) {
- println(DEBUG, tag, msg, tr);
- }
-
- /**
- * Prints a message at DEBUG priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void d(String tag, String msg) {
- d(tag, msg, null);
- }
-
- /**
- * Prints a message at INFO priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void i(String tag, String msg, Throwable tr) {
- println(INFO, tag, msg, tr);
- }
-
- /**
- * Prints a message at INFO priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void i(String tag, String msg) {
- i(tag, msg, null);
- }
-
- /**
- * Prints a message at WARN priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void w(String tag, String msg, Throwable tr) {
- println(WARN, tag, msg, tr);
- }
-
- /**
- * Prints a message at WARN priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void w(String tag, String msg) {
- w(tag, msg, null);
- }
-
- /**
- * Prints a message at WARN priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void w(String tag, Throwable tr) {
- w(tag, null, tr);
- }
-
- /**
- * Prints a message at ERROR priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void e(String tag, String msg, Throwable tr) {
- println(ERROR, tag, msg, tr);
- }
-
- /**
- * Prints a message at ERROR priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void e(String tag, String msg) {
- e(tag, msg, null);
- }
-
- /**
- * Prints a message at ASSERT priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void wtf(String tag, String msg, Throwable tr) {
- println(ASSERT, tag, msg, tr);
- }
-
- /**
- * Prints a message at ASSERT priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged.
- */
- public static void wtf(String tag, String msg) {
- wtf(tag, msg, null);
- }
-
- /**
- * Prints a message at ASSERT priority.
- *
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public static void wtf(String tag, Throwable tr) {
- wtf(tag, null, tr);
- }
-}
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogNode.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogNode.java
deleted file mode 100644
index bc37cab..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogNode.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-package com.example.android.common.logger;
-
-/**
- * Basic interface for a logging system that can output to one or more targets.
- * Note that in addition to classes that will output these logs in some format,
- * one can also implement this interface over a filter and insert that in the chain,
- * such that no targets further down see certain data, or see manipulated forms of the data.
- * You could, for instance, write a "ToHtmlLoggerNode" that just converted all the log data
- * it received to HTML and sent it along to the next node in the chain, without printing it
- * anywhere.
- */
-public interface LogNode {
-
- /**
- * Instructs first LogNode in the list to print the log data provided.
- * @param priority Log level of the data being logged. Verbose, Error, etc.
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged. The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- public void println(int priority, String tag, String msg, Throwable tr);
-
-}
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogView.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogView.java
deleted file mode 100644
index 953b8b1..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogView.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-package com.example.android.common.logger;
-
-import android.content.Context;
-import android.util.*;
-import android.widget.TextView;
-
-/** Simple TextView which is used to output log data received through the LogNode interface.
-*/
-public class LogView extends TextView implements LogNode {
-
- public LogView(Context context) {
- super(context);
- }
-
- public LogView(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public LogView(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-
- /**
- * Formats the log data and prints it out to the LogView.
- * @param priority Log level of the data being logged. Verbose, Error, etc.
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged. The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- @Override
- public void println(int priority, String tag, String msg, Throwable tr) {
- String priorityStr = null;
-
- // For the purposes of this View, we want to print the priority as readable text.
- switch(priority) {
- case android.util.Log.VERBOSE:
- priorityStr = "VERBOSE";
- break;
- case android.util.Log.DEBUG:
- priorityStr = "DEBUG";
- break;
- case android.util.Log.INFO:
- priorityStr = "INFO";
- break;
- case android.util.Log.WARN:
- priorityStr = "WARN";
- break;
- case android.util.Log.ERROR:
- priorityStr = "ERROR";
- break;
- case android.util.Log.ASSERT:
- priorityStr = "ASSERT";
- break;
- default:
- break;
- }
-
- // Handily, the Log class has a facility for converting a stack trace into a usable string.
- String exceptionStr = null;
- if (tr != null) {
- exceptionStr = android.util.Log.getStackTraceString(tr);
- }
-
- // Take the priority, tag, message, and exception, and concatenate as necessary
- // into one usable line of text.
- StringBuilder outputBuilder = new StringBuilder();
-
- String delimiter = "\t";
- appendIfNotNull(outputBuilder, priorityStr, delimiter);
- appendIfNotNull(outputBuilder, tag, delimiter);
- appendIfNotNull(outputBuilder, msg, delimiter);
- appendIfNotNull(outputBuilder, exceptionStr, delimiter);
-
- // Actually display the text we just generated within the LogView.
- appendToLog(outputBuilder.toString());
-
- if (mNext != null) {
- mNext.println(priority, tag, msg, tr);
- }
- }
-
- public LogNode getNext() {
- return mNext;
- }
-
- public void setNext(LogNode node) {
- mNext = node;
- }
-
- /** Takes a string and adds to it, with a separator, if the bit to be added isn't null. Since
- * the logger takes so many arguments that might be null, this method helps cut out some of the
- * agonizing tedium of writing the same 3 lines over and over.
- * @param source StringBuilder containing the text to append to.
- * @param addStr The String to append
- * @param delimiter The String to separate the source and appended strings. A tab or comma,
- * for instance.
- * @return The fully concatenated String as a StringBuilder
- */
- private StringBuilder appendIfNotNull(StringBuilder source, String addStr, String delimiter) {
- if (addStr != null) {
- if (addStr.length() == 0) {
- delimiter = "";
- }
-
- return source.append(addStr).append(delimiter);
- }
- return source;
- }
-
- // The next LogNode in the chain.
- LogNode mNext;
-
- /** Outputs the string as a new line of log data in the LogView. */
- public void appendToLog(String s) {
- append("\n" + s);
- }
-}
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogWrapper.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogWrapper.java
deleted file mode 100644
index ea8e20e..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/LogWrapper.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2012 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.
- */
-package com.example.android.common.logger;
-
-import android.util.Log;
-
-/**
- * Helper class which wraps Android's native Log utility in the Logger interface. This way
- * normal DDMS output can be one of the many targets receiving and outputting logs simultaneously.
- */
-public class LogWrapper implements LogNode {
-
- // For piping: The next node to receive Log data after this one has done its work.
- private LogNode mNext;
-
- /**
- * Returns the next LogNode in the linked list.
- */
- public LogNode getNext() {
- return mNext;
- }
-
- /**
- * Sets the LogNode data will be sent to..
- */
- public void setNext(LogNode node) {
- mNext = node;
- }
-
- /**
- * Prints data out to the console using Android's native log mechanism.
- * @param priority Log level of the data being logged. Verbose, Error, etc.
- * @param tag Tag for for the log data. Can be used to organize log statements.
- * @param msg The actual message to be logged. The actual message to be logged.
- * @param tr If an exception was thrown, this can be sent along for the logging facilities
- * to extract and print useful information.
- */
- @Override
- public void println(int priority, String tag, String msg, Throwable tr) {
- // There actually are log methods that don't take a msg parameter. For now,
- // if that's the case, just convert null to the empty string and move on.
- String useMsg = msg;
- if (useMsg == null) {
- useMsg = "";
- }
-
- // If an exeption was provided, convert that exception to a usable string and attach
- // it to the end of the msg method.
- if (tr != null) {
- msg += "\n" + Log.getStackTraceString(tr);
- }
-
- // This is functionally identical to Log.x(tag, useMsg);
- // For instance, if priority were Log.VERBOSE, this would be the same as Log.v(tag, useMsg)
- Log.println(priority, tag, useMsg);
-
- // If this isn't the last node in the chain, move things along.
- if (mNext != null) {
- mNext.println(priority, tag, msg, tr);
- }
- }
-}
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/MessageOnlyLogFilter.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/MessageOnlyLogFilter.java
deleted file mode 100644
index c57a111..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/logger/MessageOnlyLogFilter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-package com.example.android.common.logger;
-
-/**
- * Simple {@link LogNode} filter, removes everything except the message.
- * Useful for situations like on-screen log output where you don't want a lot of metadata displayed,
- * just easy-to-read message updates as they're happening.
- */
-public class MessageOnlyLogFilter implements LogNode {
-
- LogNode mNext;
-
- /**
- * Takes the "next" LogNode as a parameter, to simplify chaining.
- *
- * @param next The next LogNode in the pipeline.
- */
- public MessageOnlyLogFilter(LogNode next) {
- mNext = next;
- }
-
- public MessageOnlyLogFilter() {
- }
-
- @Override
- public void println(int priority, String tag, String msg, Throwable tr) {
- if (mNext != null) {
- getNext().println(Log.NONE, null, msg, null);
- }
- }
-
- /**
- * Returns the next LogNode in the linked list.
- */
- public LogNode getNext() {
- return mNext;
- }
-
- /**
- * Sets the LogNode data will be sent to..
- */
- public void setNext(LogNode node) {
- mNext = node;
- }
-
-}
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/LogFragment.java b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/LogFragment.java
deleted file mode 100644
index ecbe2eb..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/LogFragment.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.example.android.networkbasic;
-
-import android.support.v4.app.Fragment;
-
-import com.example.android.networkbasic.R;
-import com.example.android.common.logger.LogView;
-
-import android.os.Bundle;
-
-import android.text.Editable;
-import android.text.TextWatcher;
-
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ScrollView;
-
-/**
- * Simple fragment that contains a LogView and uses it to output log data it receives
- * through the LogNode interface.
- */
-public class LogFragment extends Fragment {
-
- private LogView mLogView;
-
- public LogFragment() {}
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
-
- View result = inflater.inflate(R.layout.log_fragment, container, false);
-
- mLogView = (LogView) result.findViewById(R.id.sample_output);
-
- // Wire up so when the text changes, the view scrolls down.
- final ScrollView scrollView =
- ((ScrollView) result.findViewById(R.id.log_scroll));
-
- mLogView.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
-
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {}
-
- @Override
- public void afterTextChanged(Editable s) {
- scrollView.fullScroll(ScrollView.FOCUS_DOWN);
- }
- });
-
- return result;
- }
-
- public LogView getLogView() {
- return mLogView;
- }
-
-}
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/log_fragment.xml b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/log_fragment.xml
deleted file mode 100644
index 6d79548..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/log_fragment.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- Copyright 2013 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.
- -->
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/log_scroll"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <com.example.android.common.logger.LogView
- android:id="@+id/sample_output"
- style="@style/Log"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:clickable="true"
- android:focusable="true"
- android:text=""
- android:gravity="bottom" />
-</ScrollView>
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-sw600dp/styles.xml b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-sw600dp/styles.xml
deleted file mode 100644
index ffcbe8a..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-sw600dp/styles.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <style name="Widget.SampleOutput">
- <item name="android:paddingTop">@dimen/margin_medium</item>
- <item name="android:paddingBottom">@dimen/margin_medium</item>
- <item name="android:paddingLeft">@dimen/margin_huge</item>
- <item name="android:paddingRight">@dimen/margin_huge</item>
- <item name="android:textAppearance">?android:textAppearanceLarge</item>
- <item name="android:lineSpacingMultiplier">1.2</item>
- </style>
-
-</resources>
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/dimens.xml b/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/dimens.xml
deleted file mode 100644
index 4f69897..0000000
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
-
- <dimen name="margin_medium">16dp</dimen>
- <dimen name="margin_huge">64dp</dimen>
-
-</resources>
diff --git a/connectivity/network/BasicNetworkDemo/README.txt b/connectivity/network/BasicNetworkDemo/README.txt
deleted file mode 100644
index 38608df..0000000
--- a/connectivity/network/BasicNetworkDemo/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Build Instructions
--------------------
-This sample uses the Gradle build system. To build this project, use the
-"gradlew build" command.
-
-To see a list of all available commands, run "gradlew tasks".
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworkDemo/build.gradle b/connectivity/network/BasicNetworkDemo/build.gradle
deleted file mode 100644
index 036abc8..0000000
--- a/connectivity/network/BasicNetworkDemo/build.gradle
+++ /dev/null
@@ -1,8 +0,0 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
-}
diff --git a/connectivity/network/BasicNetworkDemo/gradle/wrapper/gradle-wrapper.properties b/connectivity/network/BasicNetworkDemo/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 055ba6f..0000000
--- a/connectivity/network/BasicNetworkDemo/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
diff --git a/connectivity/network/BasicNetworkDemo/settings.gradle b/connectivity/network/BasicNetworkDemo/settings.gradle
deleted file mode 100644
index 4981654..0000000
--- a/connectivity/network/BasicNetworkDemo/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':BasicNetworkDemo'
diff --git a/connectivity/network/BasicNetworking/BasicNetworkingSample/.gitignore b/connectivity/network/BasicNetworking/BasicNetworkingSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/connectivity/network/BasicNetworking/BasicNetworkingSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to connectivity/network/BasicNetworking/BasicNetworkingSample/proguard-project.txt
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/AndroidManifest.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/AndroidManifest.xml
old mode 100755
new mode 100644
similarity index 92%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/AndroidManifest.xml
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/AndroidManifest.xml
index c0d3e64..48bfeac
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/AndroidManifest.xml
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/AndroidManifest.xml
@@ -16,7 +16,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.networkbasic"
+ package="com.example.android.basicnetworking"
android:versionCode="1"
android:versionName="1.0">
@@ -31,7 +31,7 @@
android:allowBackup="true">
<activity
- android:name="com.example.android.networkbasic.MainActivity"
+ android:name="com.example.android.basicnetworking.MainActivity"
android:label="@string/app_name"
android:uiOptions="splitActionBarWhenNarrow">
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/MainActivity.java b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/MainActivity.java
similarity index 96%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/MainActivity.java
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/MainActivity.java
index c2a4305..39ed4b1 100755
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/networkbasic/MainActivity.java
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/MainActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.android.networkbasic;
+package com.example.android.basicnetworking;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -25,8 +25,8 @@
import android.view.Menu;
import android.view.MenuItem;
-import com.example.android.common.SimpleTextFragment;
import com.example.android.common.logger.Log;
+import com.example.android.common.logger.LogFragment;
import com.example.android.common.logger.LogWrapper;
import com.example.android.common.logger.MessageOnlyLogFilter;
@@ -53,7 +53,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
// Initialize text fragment that displays intro text.
SimpleTextFragment introFragment = (SimpleTextFragment)
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/SimpleTextFragment.java b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/SimpleTextFragment.java
similarity index 98%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/SimpleTextFragment.java
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/SimpleTextFragment.java
index a2be93f..c6d409c 100644
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/java/com/example/android/common/SimpleTextFragment.java
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/java/com/example/android/basicnetworking/SimpleTextFragment.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.android.common;
+package com.example.android.basicnetworking;
import android.os.Bundle;
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-hdpi/ic_launcher.png b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-hdpi/ic_launcher.png
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-mdpi/ic_launcher.png b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-mdpi/ic_launcher.png
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-xhdpi/ic_launcher.png b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-xhdpi/ic_launcher.png
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-xxhdpi/ic_launcher.png b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/activity_main.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/layout/sample_main.xml
similarity index 90%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/activity_main.xml
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/layout/sample_main.xml
index d9be686..ccbe6ae 100755
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/layout/activity_main.xml
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/layout/sample_main.xml
@@ -22,7 +22,7 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
- android:name="com.example.android.common.SimpleTextFragment"
+ android:name="com.example.android.basicnetworking.SimpleTextFragment"
android:id="@+id/intro_fragment"
android:layout_weight="1"
android:layout_width="match_parent"
@@ -32,7 +32,7 @@
android:layout_height="1dp"
android:background="@android:color/darker_gray"/>
<fragment
- android:name="com.example.android.networkbasic.LogFragment"
+ android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_weight="1"
android:layout_width="match_parent"
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/menu/main.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/menu/main.xml
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/menu/main.xml
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/menu/main.xml
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/strings.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/strings.xml
similarity index 79%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/strings.xml
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/strings.xml
index d8116aa..d39460a 100755
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/strings.xml
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/strings.xml
@@ -15,12 +15,6 @@
-->
<resources>
- <string name="app_name">Basic Network Demo</string>
-
- <string name="intro_message">Welcome to Basic Network Demo!
- Click TEST to find out whether your device has a network connection, and if so, what type it is.
- </string>
-
<string name="test_text">Test</string>
<string name="clear_text">Clear</string>
<string name="wifi_connection">The active connection is wifi.</string>
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/styles.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/styles.xml
similarity index 85%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/styles.xml
rename to connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/styles.xml
index 4d9bb98..3450a54 100644
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values/styles.xml
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/src/main/res/values/styles.xml
@@ -16,16 +16,8 @@
<resources>
- <!-- Activity themes -->
-
- <style name="Theme.Base" parent="android:Theme.Light" />
-
- <style name="Theme.Sample" parent="Theme.Base" />
-
<!-- Widget styling -->
- <style name="Widget" />
-
<style name="Widget.SampleOutput">
<item name="android:padding">@dimen/margin_medium</item>
<item name="android:textAppearance">?android:textAppearanceMedium</item>
diff --git a/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/AndroidManifest.xml b/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..293c16b
--- /dev/null
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.basicnetworking.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="18"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.basicnetworking"
+ android:label="Tests for com.example.android.basicnetworking" />
+
+</manifest>
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/src/com/example/android/basicnetworking/tests/SampleTests.java b/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/src/com/example/android/basicnetworking/tests/SampleTests.java
new file mode 100644
index 0000000..0cf077e
--- /dev/null
+++ b/connectivity/network/BasicNetworking/BasicNetworkingSample/tests/src/com/example/android/basicnetworking/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* Copyright 2013 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.
+*/
+
+
+
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.basicnetworking.tests;
+
+import com.example.android.basicnetworking.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for BasicNetworking sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private BasicNetworkingFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (BasicNetworkingFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Add more tests below.
+ */
+
+}
\ No newline at end of file
diff --git a/connectivity/network/BasicNetworking/build.gradle b/connectivity/network/BasicNetworking/build.gradle
new file mode 100644
index 0000000..ffb5c2f
--- /dev/null
+++ b/connectivity/network/BasicNetworking/build.gradle
@@ -0,0 +1,11 @@
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/connectivity/network/BasicNetworking/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to connectivity/network/BasicNetworking/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/connectivity/network/BasicNetworking/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/connectivity/network/BasicNetworkDemo/gradle/wrapper/gradle-wrapper.jar b/connectivity/network/BasicNetworking/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/gradle/wrapper/gradle-wrapper.jar
rename to connectivity/network/BasicNetworking/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/connectivity/network/BasicNetworking/gradle/wrapper/gradle-wrapper.properties
similarity index 93%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
copy to connectivity/network/BasicNetworking/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/connectivity/network/BasicNetworking/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/connectivity/network/BasicNetworkDemo/gradlew b/connectivity/network/BasicNetworking/gradlew
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/gradlew
rename to connectivity/network/BasicNetworking/gradlew
diff --git a/connectivity/network/BasicNetworkDemo/gradlew.bat b/connectivity/network/BasicNetworking/gradlew.bat
similarity index 100%
rename from connectivity/network/BasicNetworkDemo/gradlew.bat
rename to connectivity/network/BasicNetworking/gradlew.bat
diff --git a/connectivity/network/BasicNetworking/settings.gradle b/connectivity/network/BasicNetworking/settings.gradle
new file mode 100644
index 0000000..453e7cd
--- /dev/null
+++ b/connectivity/network/BasicNetworking/settings.gradle
@@ -0,0 +1,4 @@
+
+
+
+include 'BasicNetworkingSample'
diff --git a/connectivity/network/BasicNetworking/template-params.xml b/connectivity/network/BasicNetworking/template-params.xml
new file mode 100644
index 0000000..3413740
--- /dev/null
+++ b/connectivity/network/BasicNetworking/template-params.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>BasicNetworking</name>
+ <group>Connectivity</group>
+ <package>com.example.android.basicnetworking</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>4</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how to use the ConnectivityManager to determine if you have
+ a network connection, and if so, what type of connection it is.
+ \n\nA "NetworkInfo" object is retrieved from the ConnectivityManager, which contains information
+ on the active connection, and then the connection type is printed to an on-screen console.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <common src="logger"/>
+
+</sample>
diff --git a/connectivity/network/NetworkConnect/NetworkConnectSample/tests/AndroidManifest.xml b/connectivity/network/NetworkConnect/NetworkConnectSample/tests/AndroidManifest.xml
index 87b785f..80fec80 100644
--- a/connectivity/network/NetworkConnect/NetworkConnectSample/tests/AndroidManifest.xml
+++ b/connectivity/network/NetworkConnect/NetworkConnectSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.networkconnect.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.networkconnect"
+ android:label="Tests for com.example.android.networkconnect" />
</manifest>
\ No newline at end of file
diff --git a/connectivity/network/NetworkConnect/_index.jd b/connectivity/network/NetworkConnect/_index.jd
deleted file mode 100644
index f9d507b..0000000
--- a/connectivity/network/NetworkConnect/_index.jd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-page.tags="NetworkConnect"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample demonstrates how to connect to the network and fetch raw HTML using
- HttpURLConnection. AsyncTask is used to perform the fetch on a background thread.
-
- </p>
diff --git a/connectivity/network/NetworkConnect/template-params.xml b/connectivity/network/NetworkConnect/template-params.xml
index 82617f8..a1d5991 100644
--- a/connectivity/network/NetworkConnect/template-params.xml
+++ b/connectivity/network/NetworkConnect/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>NetworkConnect</name>
- <group>NoGroup</group>
+ <group>Connectivity</group>
<package>com.example.android.networkconnect</package>
diff --git a/connectivity/sync/BasicSyncAdapter/BasicSyncAdapterSample/tests/AndroidManifest.xml b/connectivity/sync/BasicSyncAdapter/BasicSyncAdapterSample/tests/AndroidManifest.xml
index 87b785f..44c910a 100644
--- a/connectivity/sync/BasicSyncAdapter/BasicSyncAdapterSample/tests/AndroidManifest.xml
+++ b/connectivity/sync/BasicSyncAdapter/BasicSyncAdapterSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicsyncadapter.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicsyncadapter"
+ android:label="Tests for com.example.android.basicsyncadapter" />
</manifest>
\ No newline at end of file
diff --git a/connectivity/sync/BasicSyncAdapter/template-params.xml b/connectivity/sync/BasicSyncAdapter/template-params.xml
index ba1feff..7fba138 100644
--- a/connectivity/sync/BasicSyncAdapter/template-params.xml
+++ b/connectivity/sync/BasicSyncAdapter/template-params.xml
@@ -14,11 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicSyncAdapter</name>
+ <group>Connectivity</group>
<package>com.example.android.basicsyncadapter</package>
diff --git a/content/LoaderCursor/loadercursor.jd b/content/LoaderCursor/loadercursor.jd
deleted file mode 100644
index dba0a0f..0000000
--- a/content/LoaderCursor/loadercursor.jd
+++ /dev/null
@@ -1,14 +0,0 @@
-page.title=LoaderCursor Sample
-@jd:body
-
-<p>This sample demonstrates the use of the
-<pre><a href="http://developer.android.com/reference/android/app/LoaderManager.html">LoaderManager
-</a></pre> to retrieve data from a
-<pre><a href="http://developer.android.com/reference/android/database/Cursor.html">Cursor</a></pre>
-.</p>
-
-<p>Here, a list of contacts is displayed in a
-<pre><a href="http://developer.android.com/reference/android/app/ListFragment.html">ListFragment
-</a></pre> and filtered using a
-<pre><a href="http://developer.android.com/reference/android/widget/SearchView.html">SearchView
-</a></pre> ActionBar item.</p>
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/BasicContactables/build.gradle b/content/contacts/BasicContactables/BasicContactables/build.gradle
deleted file mode 100644
index 10fb811..0000000
--- a/content/contacts/BasicContactables/BasicContactables/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'android'
-
-dependencies {
- compile "com.android.support:support-v4:18.0.+"
-}
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png
deleted file mode 100755
index 22ce606..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png
deleted file mode 100755
index f21e17b..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png
deleted file mode 100755
index 64b8059..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png
deleted file mode 100755
index 6b4434a..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml
deleted file mode 100644
index 886b05f..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/dimens.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
- <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
- screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml
deleted file mode 100644
index 2bbb45f..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw600dp/styles.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <style name="Widget.SampleOutput">
- <item name="android:paddingTop">@dimen/margin_medium</item>
- <item name="android:paddingBottom">@dimen/margin_medium</item>
- <item name="android:paddingLeft">@dimen/margin_huge</item>
- <item name="android:paddingRight">@dimen/margin_huge</item>
- <item name="android:textAppearance">?android:textAppearanceLarge</item>
- <item name="android:lineSpacingMultiplier">1.2</item>
- </style>
-
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml
deleted file mode 100644
index 00059fc..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-sw720dp-land/dimens.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<resources>
- <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
- screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
- <dimen name="activity_horizontal_margin">128dp</dimen>
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml
deleted file mode 100644
index a83b995..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
-
- <dimen name="margin_tiny">4dp</dimen>
- <dimen name="margin_small">8dp</dimen>
- <dimen name="margin_medium">16dp</dimen>
- <dimen name="margin_large">32dp</dimen>
- <dimen name="margin_huge">64dp</dimen>
-
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml b/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml
deleted file mode 100755
index 31ceceb..0000000
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
- <string name="app_name">Basic Contactables Query</string>
- <string name="intro_message">Welcome to <b>Basic Contactables Query</b>!\n\n
- Use the search box to enter a term, and find matching contacts in
- Android\'s contact database!
- </string>
- <string name="sample_action">Sample action</string>
- <string name="search_title">Search Contacts</string>
-</resources>
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/.gitignore b/content/contacts/BasicContactables/BasicContactablesSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/content/contacts/BasicContactables/BasicContactablesSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to content/contacts/BasicContactables/BasicContactablesSample/proguard-project.txt
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
similarity index 67%
rename from content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
index b008e84..62b9812 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/AndroidManifest.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/AndroidManifest.xml
@@ -1,9 +1,25 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.basiccontactables"
android:versionCode="1"
android:versionName="1.0" >
-
+
<!-- BEGIN_INCLUDE(contacts_permission) -->
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<!-- END_INCLUDE(contacts_permission) -->
@@ -21,7 +37,7 @@
android:name="com.example.android.basiccontactables.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop">
- <meta-data
+ <meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
<intent-filter>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
similarity index 89%
rename from content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
index c583dac..4fc4da7 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/ContactablesLoaderCallbacks.java
@@ -23,7 +23,6 @@
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
-import android.provider.ContactsContract;
import android.provider.ContactsContract.CommonDataKinds;
import android.util.Log;
import android.widget.TextView;
@@ -55,17 +54,17 @@
// BEGIN_INCLUDE(uri_with_query)
String query = args.getString(QUERY_KEY);
Uri uri = Uri.withAppendedPath(
- ContactsContract.CommonDataKinds.Contactables.CONTENT_FILTER_URI, query);
+ CommonDataKinds.Contactables.CONTENT_FILTER_URI, query);
// END_INCLUDE(uri_with_query)
// BEGIN_INCLUDE(cursor_loader)
// Easy way to limit the query to contacts with phone numbers.
String selection =
- ContactsContract.CommonDataKinds.Contactables.HAS_PHONE_NUMBER + " = " + 1;
+ CommonDataKinds.Contactables.HAS_PHONE_NUMBER + " = " + 1;
// Sort results such that rows for the same contact stay together.
- String sortBy = ContactsContract.CommonDataKinds.Contactables.LOOKUP_KEY;
+ String sortBy = CommonDataKinds.Contactables.LOOKUP_KEY;
return new CursorLoader(
mContext, // Context
@@ -80,6 +79,13 @@
@Override
public void onLoadFinished(Loader<Cursor> arg0, Cursor cursor) {
TextView tv = (TextView) ((Activity)mContext).findViewById(R.id.sample_output);
+ if(tv == null) {
+ Log.e(TAG, "TextView is null?!");
+ } else if (mContext == null) {
+ Log.e(TAG, "Context is null?");
+ } else {
+ Log.e(TAG, "Nothing is null?!");
+ }
// Reset text in case of a previous query
tv.setText(mContext.getText(R.string.intro_message) + "\n\n");
@@ -115,9 +121,9 @@
// BEGIN_INCLUDE(retrieve_data)
// The data type can be determined using the mime type column.
String mimeType = cursor.getString(typeColumnIndex);
- if (mimeType.equals(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
+ if (mimeType.equals(CommonDataKinds.Phone.CONTENT_ITEM_TYPE)) {
tv.append("\tPhone Number: " + cursor.getString(phoneColumnIndex) + "\n");
- } else if (mimeType.equals(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
+ } else if (mimeType.equals(CommonDataKinds.Email.CONTENT_ITEM_TYPE)) {
tv.append("\tEmail Address: " + cursor.getString(emailColumnIndex) + "\n");
}
// END_INCLUDE(retrieve_data)
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
similarity index 98%
rename from content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
index 9448ada..b8b074e 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/java/com/example/android/basiccontactables/MainActivity.java
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/java/com/example/android/basiccontactables/MainActivity.java
@@ -37,7 +37,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
if (getIntent() != null) {
handleIntent(getIntent());
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
copy to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-hdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
copy to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-mdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
copy to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xhdpi/ic_search_api_holo_light.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
copy to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/layout/activity_main.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/layout/activity_main.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/layout/sample_main.xml
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/menu/main.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/menu/main.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/menu/main.xml
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
old mode 100644
new mode 100755
similarity index 85%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
index 2ba754c..a499fd2
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values-v11/styles.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/strings.xml
@@ -16,5 +16,6 @@
-->
<resources>
- <style name="Theme.Base" parent="android:Theme.Holo.Light" />
+ <string name="sample_action">Sample action</string>
+ <string name="search_title">Search Contacts</string>
</resources>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
similarity index 84%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
index 1c0e5aa..c3a400d 100644
--- a/content/contacts/BasicContactables/BasicContactables/src/main/res/values/styles.xml
+++ b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/values/styles.xml
@@ -16,17 +16,8 @@
-->
<resources>
-
- <!-- Activity themes -->
-
- <style name="Theme.Base" parent="android:Theme.Light" />
-
- <style name="Theme.Sample" parent="Theme.Base" />
-
<!-- Widget styling -->
- <style name="Widget" />
-
<style name="Widget.SampleOutput">
<item name="android:padding">@dimen/margin_medium</item>
<item name="android:textAppearance">?android:textAppearanceMedium</item>
diff --git a/content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml b/content/contacts/BasicContactables/BasicContactablesSample/src/main/res/xml/searchable.xml
similarity index 100%
rename from content/contacts/BasicContactables/BasicContactables/src/main/res/xml/searchable.xml
rename to content/contacts/BasicContactables/BasicContactablesSample/src/main/res/xml/searchable.xml
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml b/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..8c4af25
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.basiccontactables.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="18"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.basiccontactables"
+ android:label="Tests for com.example.android.basiccontactables" />
+
+</manifest>
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java b/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java
new file mode 100644
index 0000000..dd48bf2
--- /dev/null
+++ b/content/contacts/BasicContactables/BasicContactablesSample/tests/src/com/example/android/basiccontactables/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* Copyright 2013 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.
+*/
+
+
+
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.basiccontactables.tests;
+
+import com.example.android.basiccontactables.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for BasicContactables sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private BasicContactablesFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (BasicContactablesFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Add more tests below.
+ */
+
+}
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/README.txt b/content/contacts/BasicContactables/README.txt
deleted file mode 100644
index 38608df..0000000
--- a/content/contacts/BasicContactables/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Build Instructions
--------------------
-This sample uses the Gradle build system. To build this project, use the
-"gradlew build" command.
-
-To see a list of all available commands, run "gradlew tasks".
\ No newline at end of file
diff --git a/content/contacts/BasicContactables/build.gradle b/content/contacts/BasicContactables/build.gradle
index 036abc8..ffb5c2f 100644
--- a/content/contacts/BasicContactables/build.gradle
+++ b/content/contacts/BasicContactables/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/content/contacts/BasicContactables/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to content/contacts/BasicContactables/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/content/contacts/BasicContactables/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties b/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
index 055ba6f..861eddc 100644
--- a/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
+++ b/content/contacts/BasicContactables/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/content/contacts/BasicContactables/settings.gradle b/content/contacts/BasicContactables/settings.gradle
index 111067c..5fec49c 100644
--- a/content/contacts/BasicContactables/settings.gradle
+++ b/content/contacts/BasicContactables/settings.gradle
@@ -1 +1,4 @@
-include ':BasicContactables'
+
+
+
+include 'BasicContactablesSample'
diff --git a/content/contacts/BasicContactables/template-params.xml b/content/contacts/BasicContactables/template-params.xml
new file mode 100644
index 0000000..ee2ba11
--- /dev/null
+++ b/content/contacts/BasicContactables/template-params.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>BasicContactables</name>
+ <group>Content</group>
+ <package>com.example.android.basiccontactables</package>
+
+
+
+ <!-- change minSdk if needed-->
+ <minSdk>18</minSdk>
+
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how to use the Contactables table to search for contacts.
+ \n\nQuery strings sent to the Contactables table will match both contact names and phone numbers,
+ reducing the number of queries your application needs to use when searching the contacts database!
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <common src="logger"/>
+
+</sample>
diff --git a/content/documentsUi/StorageClient/StorageClientSample/tests/AndroidManifest.xml b/content/documentsUi/StorageClient/StorageClientSample/tests/AndroidManifest.xml
index fc9405b..3f0a38f 100644
--- a/content/documentsUi/StorageClient/StorageClientSample/tests/AndroidManifest.xml
+++ b/content/documentsUi/StorageClient/StorageClientSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.storageclient.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.storageclient"
+ android:label="Tests for com.example.android.storageclient" />
</manifest>
\ No newline at end of file
diff --git a/content/documentsUi/StorageClient/template-params.xml b/content/documentsUi/StorageClient/template-params.xml
index 40a2139..f6843e7 100644
--- a/content/documentsUi/StorageClient/template-params.xml
+++ b/content/documentsUi/StorageClient/template-params.xml
@@ -16,8 +16,8 @@
-->
<sample>
<name>StorageClient</name>
+ <group>Content</group>
<package>com.example.android.storageclient</package>
-
<!-- change minSdk if needed-->
<minSdk>4</minSdk>
<compileSdkVersion>19</compileSdkVersion>
@@ -25,9 +25,10 @@
<strings>
<intro>
<![CDATA[
- Using the Storage Backend API,
- Introductory text that explains what the sample is intended to demonstrate. Edit
- in template-params.xml.
+ Using the OPEN_DOCUMENT intent, a client app can access a list of Document Providers
+ on the device, and choose a file from any of them.
+ \n\nTo demonstrate this, click the button below to open up the Storage Access Framework
+ interface, and choose an image on your device. It will be displayed in this app.
]]>
</intro>
<sample_action>Show Me The Image</sample_action>
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/build.gradle b/content/multiuser/AppRestrictions/AppRestrictions/build.gradle
deleted file mode 100644
index 9f4459b..0000000
--- a/content/multiuser/AppRestrictions/AppRestrictions/build.gradle
+++ /dev/null
@@ -1,6 +0,0 @@
-apply plugin: 'android'
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/AndroidManifest.xml b/content/multiuser/AppRestrictions/AppRestrictions/src/main/AndroidManifest.xml
deleted file mode 100644
index dd9fc09..0000000
--- a/content/multiuser/AppRestrictions/AppRestrictions/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2013 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- android:versionCode="1"
- android:versionName="1"
- package="com.example.android.apprestrictions">
-
- <uses-sdk android:minSdkVersion="18" />
-
- <application android:label="@string/app_name"
- android:icon="@drawable/ic_launcher">
-
- <activity android:name="MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
- <activity android:name="CustomRestrictionsActivity"
- android:label="@string/restrictions_activity_label" />
-
- <receiver android:name="GetRestrictionsReceiver">
- <intent-filter>
- <action android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
- </intent-filter>
- </receiver>
- </application>
-</manifest>
diff --git a/content/multiuser/AppRestrictions/AppRestrictionsSample/.gitignore b/content/multiuser/AppRestrictions/AppRestrictionsSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/content/multiuser/AppRestrictions/AppRestrictionsSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/content/multiuser/AppRestrictions/AppRestrictionsSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to content/multiuser/AppRestrictions/AppRestrictionsSample/proguard-project.txt
diff --git a/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/AndroidManifest.xml b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b492bbf
--- /dev/null
+++ b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/AndroidManifest.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.apprestrictions"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="18" />
+
+ <application android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher">
+
+ <activity android:name="MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name="CustomRestrictionsActivity"
+ android:label="@string/restrictions_activity_label" />
+
+ <receiver android:name="GetRestrictionsReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.GET_RESTRICTION_ENTRIES" />
+ </intent-filter>
+ </receiver>
+ </application>
+
+</manifest>
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/CustomRestrictionsActivity.java b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/CustomRestrictionsActivity.java
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/CustomRestrictionsActivity.java
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/CustomRestrictionsActivity.java
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/CustomRestrictionsFragment.java b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/CustomRestrictionsFragment.java
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/CustomRestrictionsFragment.java
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/CustomRestrictionsFragment.java
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/GetRestrictionsReceiver.java b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/GetRestrictionsReceiver.java
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/GetRestrictionsReceiver.java
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/GetRestrictionsReceiver.java
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/MainActivity.java b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/MainActivity.java
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/java/com/example/android/apprestrictions/MainActivity.java
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/java/com/example/android/apprestrictions/MainActivity.java
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-hdpi/ic_launcher.png b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-hdpi/ic_launcher.png
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-mdpi/ic_launcher.png b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-mdpi/ic_launcher.png
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-xhdpi/ic_launcher.png b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-xhdpi/ic_launcher.png
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-xxhdpi/ic_launcher.png b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/layout/main.xml b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/layout/main.xml
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/layout/main.xml
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/layout/main.xml
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/values/strings.xml b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/values/strings.xml
similarity index 97%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/values/strings.xml
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/values/strings.xml
index 2dac3b1..534edf0 100644
--- a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/values/strings.xml
+++ b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/values/strings.xml
@@ -14,7 +14,6 @@
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name">App Restrictions Demo</string>
<string name="restrictions_activity_label">Custom app restrictions</string>
<string name="boolean_entry_title">Test boolean type</string>
<string name="choice_entry_title">Test choice type</string>
diff --git a/content/multiuser/AppRestrictions/AppRestrictions/src/main/res/xml/custom_prefs.xml b/content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/xml/custom_prefs.xml
similarity index 100%
rename from content/multiuser/AppRestrictions/AppRestrictions/src/main/res/xml/custom_prefs.xml
rename to content/multiuser/AppRestrictions/AppRestrictionsSample/src/main/res/xml/custom_prefs.xml
diff --git a/content/multiuser/AppRestrictions/build.gradle b/content/multiuser/AppRestrictions/build.gradle
index 036abc8..ffb5c2f 100644
--- a/content/multiuser/AppRestrictions/build.gradle
+++ b/content/multiuser/AppRestrictions/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/content/multiuser/AppRestrictions/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to content/multiuser/AppRestrictions/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/content/multiuser/AppRestrictions/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/content/multiuser/AppRestrictions/gradle/wrapper/gradle-wrapper.properties b/content/multiuser/AppRestrictions/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/content/multiuser/AppRestrictions/gradle/wrapper/gradle-wrapper.properties
+++ b/content/multiuser/AppRestrictions/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/content/multiuser/AppRestrictions/settings.gradle b/content/multiuser/AppRestrictions/settings.gradle
index 41f2d03..02aef49 100644
--- a/content/multiuser/AppRestrictions/settings.gradle
+++ b/content/multiuser/AppRestrictions/settings.gradle
@@ -1 +1,4 @@
-include ':AppRestrictions'
+
+
+
+include 'AppRestrictionsSample'
diff --git a/content/multiuser/AppRestrictions/template-params.xml b/content/multiuser/AppRestrictions/template-params.xml
new file mode 100644
index 0000000..fa676b2
--- /dev/null
+++ b/content/multiuser/AppRestrictions/template-params.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>AppRestrictions</name>
+ <group>Content</group>
+ <package>com.example.android.apprestrictions</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>18</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates the use of the App Restriction feature, which is available on
+ Android 4.3 and above tablet device with the multiuser feature.
+
+ When launched under the primary User account, you can toggle between standard app restriction
+ types and custom. When launched under a restricted profile, this activity displays app
+ restriction settings, if available.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/input/gestures/BasicGestureDetect/BasicGestureDetectSample/tests/AndroidManifest.xml b/input/gestures/BasicGestureDetect/BasicGestureDetectSample/tests/AndroidManifest.xml
index 87b785f..3c5487c 100644
--- a/input/gestures/BasicGestureDetect/BasicGestureDetectSample/tests/AndroidManifest.xml
+++ b/input/gestures/BasicGestureDetect/BasicGestureDetectSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicgesturedetect.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicgesturedetect"
+ android:label="Tests for com.example.android.basicgesturedetect" />
</manifest>
\ No newline at end of file
diff --git a/input/gestures/BasicGestureDetect/template-params.xml b/input/gestures/BasicGestureDetect/template-params.xml
index 1feba01..fc8b48d 100644
--- a/input/gestures/BasicGestureDetect/template-params.xml
+++ b/input/gestures/BasicGestureDetect/template-params.xml
@@ -14,11 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicGestureDetect</name>
+ <group>Input</group>
<package>com.example.android.basicgesturedetect</package>
diff --git a/input/multitouch/BasicMultitouch/_index.jd b/input/multitouch/BasicMultitouch/_index.jd
deleted file mode 100644
index 2d7bdc5..0000000
--- a/input/multitouch/BasicMultitouch/_index.jd
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-page.tags="BasicMultitouch"
-sample.group=NoGroup
-@jd:body
-
-<p>
- This samples demonstrates the use of MotionEvent properties to keep track of individual touches
- across multiple touch events.
-</p><p>
- Touch the screen with multiple fingers to show that the pointer id
- (also represented by a colour) does not change as new touch events are received.</string>
-</p>
diff --git a/input/multitouch/BasicMultitouch/template-params.xml b/input/multitouch/BasicMultitouch/template-params.xml
index 7bd997f..7677818 100644
--- a/input/multitouch/BasicMultitouch/template-params.xml
+++ b/input/multitouch/BasicMultitouch/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicMultitouch</name>
- <group>NoGroup</group>
+ <group>Input</group>
<package>com.example.android.basicmultitouch</package>
diff --git a/media/BasicMediaDecoder/template-params.xml b/media/BasicMediaDecoder/template-params.xml
index 8d412dc..bcb01af 100644
--- a/media/BasicMediaDecoder/template-params.xml
+++ b/media/BasicMediaDecoder/template-params.xml
@@ -14,9 +14,6 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicMediaDecoder</name>
<group>Media</group>
diff --git a/media/BasicMediaRouter/BasicMediaRouterSample/tests/AndroidManifest.xml b/media/BasicMediaRouter/BasicMediaRouterSample/tests/AndroidManifest.xml
index 87b785f..8800232 100644
--- a/media/BasicMediaRouter/BasicMediaRouterSample/tests/AndroidManifest.xml
+++ b/media/BasicMediaRouter/BasicMediaRouterSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicmediarouter.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicmediarouter"
+ android:label="Tests for com.example.android.basicmediarouter" />
</manifest>
\ No newline at end of file
diff --git a/media/BasicMediaRouter/_index.jd b/media/BasicMediaRouter/_index.jd
deleted file mode 100644
index 4bba1a5..0000000
--- a/media/BasicMediaRouter/_index.jd
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-page.tags="BasicMediaRouter"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample demonstrates the use of the MediaRouter API to display
- content on a secondary display.\n\nUse the "Media Route Action Item" in the ActionBar
- to select an output device. If your device supports Miracast wireless displays,
- you may need to enable "Wireless Display" functionality in the system settings.
- Secondary screen simulation can also be enabled from the "Developer Options".\n\n
-Once connected, use the "Change Color" button to change the background color of the secondary screen.
-
- </p>
diff --git a/media/BasicMediaRouter/template-params.xml b/media/BasicMediaRouter/template-params.xml
index 4d14028..e7cbab5 100644
--- a/media/BasicMediaRouter/template-params.xml
+++ b/media/BasicMediaRouter/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicMediaRouter</name>
- <group>NoGroup</group>
+ <group>Media</group>
<package>com.example.android.basicmediarouter</package>
diff --git a/security/keystore/BasicAndroidKeyStore/BasicAndroidKeyStoreSample/tests/AndroidManifest.xml b/security/keystore/BasicAndroidKeyStore/BasicAndroidKeyStoreSample/tests/AndroidManifest.xml
index 87b785f..eb8b7b8 100644
--- a/security/keystore/BasicAndroidKeyStore/BasicAndroidKeyStoreSample/tests/AndroidManifest.xml
+++ b/security/keystore/BasicAndroidKeyStore/BasicAndroidKeyStoreSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicandroidkeystore.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicandroidkeystore"
+ android:label="Tests for com.example.android.basicandroidkeystore" />
</manifest>
\ No newline at end of file
diff --git a/security/keystore/BasicAndroidKeyStore/template-params.xml b/security/keystore/BasicAndroidKeyStore/template-params.xml
index 2498b88..d603dfa 100644
--- a/security/keystore/BasicAndroidKeyStore/template-params.xml
+++ b/security/keystore/BasicAndroidKeyStore/template-params.xml
@@ -14,11 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicAndroidKeyStore</name>
+ <group>Security</group>
<package>com.example.android.basicandroidkeystore</package>
<!-- change minSdk if needed-->
diff --git a/testing/ActivityInstrumentation/ActivityInstrumentationSample/tests/AndroidManifest.xml b/testing/ActivityInstrumentation/ActivityInstrumentationSample/tests/AndroidManifest.xml
index 87b785f..ad20a2a 100644
--- a/testing/ActivityInstrumentation/ActivityInstrumentationSample/tests/AndroidManifest.xml
+++ b/testing/ActivityInstrumentation/ActivityInstrumentationSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.activityinstrumentation.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.activityinstrumentation"
+ android:label="Tests for com.example.android.activityinstrumentation" />
</manifest>
\ No newline at end of file
diff --git a/testing/ActivityInstrumentation/template-params.xml b/testing/ActivityInstrumentation/template-params.xml
index 937e26e..4856a82 100644
--- a/testing/ActivityInstrumentation/template-params.xml
+++ b/testing/ActivityInstrumentation/template-params.xml
@@ -14,11 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>ActivityInstrumentation</name>
+ <group>Testing</group>
<package>com.example.android.com.example.android.activityinstrumentation</package>
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/.gitignore b/ui/ImmersiveMode/ImmersiveModeSample/.gitignore
deleted file mode 100644
index f52a120..0000000
--- a/ui/ImmersiveMode/ImmersiveModeSample/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-src/template/
-src/common/
-build.gradle
diff --git a/ui/ImmersiveMode/build.gradle b/ui/ImmersiveMode/build.gradle
deleted file mode 100644
index 5ed96a9..0000000
--- a/ui/ImmersiveMode/build.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-// BEGIN_EXCLUDE
-apply from: "../../../../build/build.gradle"
-samplegen {
- pathToBuild "../../../../build"
- pathToSamplesCommon "../../common"
-}
-// END_EXCLUDE
diff --git a/ui/accessibility/BasicAccessibility/BasicAccessibilitySample/tests/AndroidManifest.xml b/ui/accessibility/BasicAccessibility/BasicAccessibilitySample/tests/AndroidManifest.xml
index 87b785f..8dc47be 100644
--- a/ui/accessibility/BasicAccessibility/BasicAccessibilitySample/tests/AndroidManifest.xml
+++ b/ui/accessibility/BasicAccessibility/BasicAccessibilitySample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicaccessibility.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicaccessibility"
+ android:label="Tests for com.example.android.basicaccessibility" />
</manifest>
\ No newline at end of file
diff --git a/ui/accessibility/BasicAccessibility/template-params.xml b/ui/accessibility/BasicAccessibility/template-params.xml
index bc87c3b..af9d815 100644
--- a/ui/accessibility/BasicAccessibility/template-params.xml
+++ b/ui/accessibility/BasicAccessibility/template-params.xml
@@ -14,11 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>BasicAccessibility</name>
+ <group>UI</group>
<package>com.example.android.basicaccessibility</package>
diff --git a/ui/actionbar/DoneBar/DoneBar/build.gradle b/ui/actionbar/DoneBar/DoneBar/build.gradle
deleted file mode 100644
index 9f4459b..0000000
--- a/ui/actionbar/DoneBar/DoneBar/build.gradle
+++ /dev/null
@@ -1,6 +0,0 @@
-apply plugin: 'android'
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/AndroidManifest.xml b/ui/actionbar/DoneBar/DoneBar/src/main/AndroidManifest.xml
deleted file mode 100755
index cce4d5e..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.donebar"
- android:versionCode="1"
- android:versionName="1.0">
-
- <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
-
- <application android:label="@string/app_name"
- android:icon="@drawable/ic_launcher"
- android:theme="@style/Theme.Sample"
- android:allowBackup="true">
-
- <activity android:name=".SampleDashboardActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
- <activity android:name=".DoneBarActivity"
- android:parentActivityName=".MainActivity" />
-
- <activity android:name=".DoneButtonActivity"
- android:parentActivityName=".MainActivity" />
-
- </application>
-
-</manifest>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/big_icon.png b/ui/actionbar/DoneBar/DoneBar/src/main/big_icon.png
deleted file mode 100644
index 78bb426..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/big_icon.png
+++ /dev/null
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/SampleDashboardActivity.java b/ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/SampleDashboardActivity.java
deleted file mode 100755
index e86e6fc..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/SampleDashboardActivity.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright 2013 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.
- */
-
-package com.example.android.donebar;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AdapterView;
-import android.widget.BaseAdapter;
-import android.widget.GridView;
-import android.widget.TextView;
-
-/**
- * A simple launcher activity offering access to the individual samples in this project.
- */
-public class SampleDashboardActivity extends Activity implements AdapterView.OnItemClickListener {
- /**
- * The collection of samples that will be used to populate the 'dashboard' grid.
- */
- private Sample[] mSamples;
-
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_sample_dashboard);
-
- // Prepare list of samples in this dashboard.
- mSamples = new Sample[]{
- new Sample(R.string.done_bar_title, R.string.done_bar_description,
- DoneBarActivity.class),
- new Sample(R.string.done_button_title, R.string.done_button_description,
- DoneButtonActivity.class),
- };
-
- // Use the custom adapter in the GridView and hook up a click listener to handle
- // selection of individual samples.
- GridView gridView = (GridView) findViewById(android.R.id.list);
- gridView.setAdapter(new SampleAdapter());
- gridView.setOnItemClickListener(this);
- }
-
- @Override
- public void onItemClick(AdapterView<?> container, View view, int position, long id) {
- // A sample was selected in the dashboard; open it.
- startActivity(mSamples[position].intent);
- }
-
- /**
- * A custom array-based adapter, designed for use with a {@link GridView}.
- */
- private class SampleAdapter extends BaseAdapter {
- @Override
- public int getCount() {
- return mSamples.length;
- }
-
- @Override
- public Sample getItem(int position) {
- return mSamples[position];
- }
-
- @Override
- public long getItemId(int position) {
- // The title string ID should be unique per sample, so use it as an ID.
- return mSamples[position].titleResId;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup container) {
- if (convertView == null) {
- // If there was no re-usable view that can be simply repopulated, create
- // a new root view for this grid item.
- convertView = getLayoutInflater().inflate(
- R.layout.sample_dashboard_item, container, false);
- }
-
- // Populate the view's children with real data about this sample.
- ((TextView) convertView.findViewById(android.R.id.text1)).setText(
- mSamples[position].titleResId);
- ((TextView) convertView.findViewById(android.R.id.text2)).setText(
- mSamples[position].descriptionResId);
- return convertView;
- }
- }
-
- /**
- * A simple class that stores information about a sample: a title, description, and
- * the intent to call
- * {@link android.content.Context#startActivity(android.content.Intent) startActivity}
- * with in order to open the sample.
- */
- private class Sample {
- int titleResId;
- int descriptionResId;
- Intent intent;
-
- /**
- * Instantiate a new sample object with a title, description, and intent.
- */
- private Sample(int titleResId, int descriptionResId, Intent intent) {
- this.intent = intent;
- this.titleResId = titleResId;
- this.descriptionResId = descriptionResId;
- }
-
- /**
- * Instantiate a new sample object with a title, description, and {@link Activity}
- * subclass. An intent will automatically be created for the given activity.
- */
- private Sample(int titleResId, int descriptionResId,
- Class<? extends Activity> activityClass) {
- this(titleResId, descriptionResId,
- new Intent(SampleDashboardActivity.this, activityClass));
- }
- }
-}
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/sample_dashboard_item_background.9.png b/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/sample_dashboard_item_background.9.png
deleted file mode 100644
index 1358628..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/sample_dashboard_item_background.9.png
+++ /dev/null
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/sample_dashboard_item.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/sample_dashboard_item.xml
deleted file mode 100644
index 38987ee..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/sample_dashboard_item.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/Widget.SampleDashboard.Item"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <TextView android:id="@android:id/text1"
- style="@style/Widget.SampleDashboard.Item.Title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-
- <TextView android:id="@android:id/text2"
- style="@style/Widget.SampleDashboard.Item.Description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/dimens.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/dimens.xml
deleted file mode 100644
index 22074a2..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/dimens.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Semantic definitions -->
-
- <dimen name="horizontal_page_margin">@dimen/margin_huge</dimen>
- <dimen name="vertical_page_margin">@dimen/margin_medium</dimen>
-
-</resources>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/styles.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/styles.xml
deleted file mode 100644
index 401e7aa..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/values-sw600dp/styles.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <style name="Widget.SampleMessage">
- <item name="android:textAppearance">?android:textAppearanceLarge</item>
- <item name="android:lineSpacingMultiplier">1.2</item>
- </style>
-
-</resources>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/dimens.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/values/dimens.xml
deleted file mode 100644
index 39e710b..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
-
- <dimen name="margin_tiny">4dp</dimen>
- <dimen name="margin_small">8dp</dimen>
- <dimen name="margin_medium">16dp</dimen>
- <dimen name="margin_large">32dp</dimen>
- <dimen name="margin_huge">64dp</dimen>
-
- <!-- Semantic definitions -->
-
- <dimen name="horizontal_page_margin">@dimen/margin_medium</dimen>
- <dimen name="vertical_page_margin">@dimen/margin_medium</dimen>
-
-</resources>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/strings.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/values/strings.xml
deleted file mode 100755
index b56d75a..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
- <string name="app_name">Done Bar</string>
-
- <!-- Sample UI messages -->
- <string name="intro_message">This sample demonstrates two alternative presentations of the action bar that are well-suited for <b>simple data entry scenarios</b>.</string>
-
- <string name="done_bar_title">Done bar</string>
- <string name="done_bar_description">In this presentation, a <b>done bar</b> replaces the action bar entirely, providing two direct actions to persist or dismiss changes. This is suitable for cases where no additional view details or actions are needed in the action bar.</string>
-
- <string name="done_button_title">Done button</string>
- <string name="done_button_description">In this presentation, a <b>done button</b> replaces the action bar\'s <i>Up</i> affordance and app icon, while the cancel action is made available in the action overflow. This is well-suited to scenarios where additional view details or actions may be needed in the action bar.</string>
-
- <!-- Done bar strings -->
- <string name="done">Done</string>
- <string name="cancel">Cancel</string>
-</resources>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/styles.xml b/ui/actionbar/DoneBar/DoneBar/src/main/res/values/styles.xml
deleted file mode 100644
index f3841bd..0000000
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Activity themes -->
-
- <style name="Theme.Base" parent="android:Theme.Holo.Light" />
-
- <style name="Theme.Sample" parent="Theme.Base" />
-
- <!-- Widget styling -->
-
- <style name="Widget" />
-
- <style name="Widget.SampleContentContainer">
- <item name="android:paddingTop">@dimen/vertical_page_margin</item>
- <item name="android:paddingBottom">@dimen/vertical_page_margin</item>
- <item name="android:paddingLeft">@dimen/horizontal_page_margin</item>
- <item name="android:paddingRight">@dimen/horizontal_page_margin</item>
- </style>
-
- <style name="Widget.SampleMessage">
- <item name="android:textAppearance">?android:textAppearanceMedium</item>
- <item name="android:lineSpacingMultiplier">1.1</item>
- </style>
-
- <style name="Widget.SampleDashboard.Grid" parent="Widget">
- <item name="android:stretchMode">columnWidth</item>
- <item name="android:columnWidth">200dp</item>
- <item name="android:numColumns">auto_fit</item>
- <item name="android:drawSelectorOnTop">true</item>
- <item name="android:horizontalSpacing">@dimen/margin_medium</item>
- <item name="android:verticalSpacing">@dimen/margin_medium</item>
- </style>
-
- <style name="Widget.SampleDashboard.Item" parent="Widget">
- <item name="android:background">@drawable/sample_dashboard_item_background</item>
- <item name="android:paddingTop">@dimen/margin_small</item>
- <item name="android:paddingLeft">@dimen/margin_medium</item>
- <item name="android:paddingRight">@dimen/margin_medium</item>
- <item name="android:paddingBottom">@dimen/margin_medium</item>
- </style>
-
- <style name="Widget.SampleDashboard.Item.Title" parent="Widget">
- <item name="android:layout_marginBottom">@dimen/margin_tiny</item>
- <item name="android:textAppearance">?android:textAppearanceLarge</item>
- <item name="android:textColor">#09c</item>
- <item name="android:textStyle">bold</item>
- <item name="android:textSize">24sp</item>
- </style>
-
- <style name="Widget.SampleDashboard.Item.Description" parent="Widget">
- <item name="android:textAppearance">?android:textAppearanceSmall</item>
- <item name="android:fontFamily">sans-serif-light</item>
- </style>
-
-</resources>
diff --git a/ui/actionbar/DoneBar/DoneBarSample/.gitignore b/ui/actionbar/DoneBar/DoneBarSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/actionbar/DoneBar/DoneBarSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/actionbar/DoneBar/DoneBarSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/actionbar/DoneBar/DoneBarSample/proguard-project.txt
diff --git a/ui/actionbar/DoneBar/DoneBarSample/src/main/AndroidManifest.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..4731114
--- /dev/null
+++ b/ui/actionbar/DoneBar/DoneBarSample/src/main/AndroidManifest.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.donebar"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="17" />
+
+ <application android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/Theme.Sample"
+ android:allowBackup="true">
+
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity android:name=".DoneBarActivity"
+ android:parentActivityName=".MainActivity" />
+
+ <activity android:name=".DoneButtonActivity"
+ android:parentActivityName=".MainActivity" />
+
+ </application>
+
+</manifest>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/DoneBarActivity.java b/ui/actionbar/DoneBar/DoneBarSample/src/main/java/com/example/android/donebar/DoneBarActivity.java
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/DoneBarActivity.java
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/java/com/example/android/donebar/DoneBarActivity.java
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/DoneButtonActivity.java b/ui/actionbar/DoneBar/DoneBarSample/src/main/java/com/example/android/donebar/DoneButtonActivity.java
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/java/com/example/android/donebar/DoneButtonActivity.java
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/java/com/example/android/donebar/DoneButtonActivity.java
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_action_cancel.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_action_cancel.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_action_cancel.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_action_cancel.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_action_done.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_action_done.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_action_done.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_action_done.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_launcher.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-hdpi/ic_launcher.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_action_cancel.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_action_cancel.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_action_cancel.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_action_cancel.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_action_done.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_action_done.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_action_done.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_action_done.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_launcher.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-mdpi/ic_launcher.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_action_cancel.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_action_cancel.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_action_cancel.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_action_cancel.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_action_done.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_action_done.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_action_done.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_action_done.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xhdpi/ic_launcher.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/actionbar_custom_view_done.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/actionbar_custom_view_done.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/actionbar_custom_view_done.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/actionbar_custom_view_done.xml
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/actionbar_custom_view_done_cancel.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/actionbar_custom_view_done_cancel.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/actionbar_custom_view_done_cancel.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/actionbar_custom_view_done_cancel.xml
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_bar.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_bar.xml
similarity index 94%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_bar.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_bar.xml
index cb8980f..0d0272d 100755
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_bar.xml
+++ b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_bar.xml
@@ -26,7 +26,7 @@
<TextView style="@style/Widget.SampleMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/done_bar_description" />
+ android:text="@string/donebaractivity_description" />
</LinearLayout>
</ScrollView>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_button.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_button.xml
similarity index 94%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_button.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_button.xml
index 3e20455..7fc2274 100755
--- a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_done_button.xml
+++ b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_done_button.xml
@@ -26,7 +26,7 @@
<TextView style="@style/Widget.SampleMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/done_button_description" />
+ android:text="@string/donebuttonactivity_description" />
</LinearLayout>
</ScrollView>
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_sample_dashboard.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_sample_dashboard.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/activity_sample_dashboard.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/activity_sample_dashboard.xml
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/include_cancel_button.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/include_cancel_button.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/include_cancel_button.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/include_cancel_button.xml
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/layout/include_done_button.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/include_done_button.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/layout/include_done_button.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/layout/include_done_button.xml
diff --git a/ui/actionbar/DoneBar/DoneBar/src/main/res/menu/cancel.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/menu/cancel.xml
similarity index 100%
rename from ui/actionbar/DoneBar/DoneBar/src/main/res/menu/cancel.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/menu/cancel.xml
diff --git a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-v11/styles.xml b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/values/strings.xml
old mode 100644
new mode 100755
similarity index 84%
rename from connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-v11/styles.xml
rename to ui/actionbar/DoneBar/DoneBarSample/src/main/res/values/strings.xml
index c6c648b..df66a95
--- a/connectivity/network/BasicNetworkDemo/BasicNetworkDemo/src/main/res/values-v11/styles.xml
+++ b/ui/actionbar/DoneBar/DoneBarSample/src/main/res/values/strings.xml
@@ -15,5 +15,7 @@
-->
<resources>
- <style name="Theme.Base" parent="android:Theme.Holo.Light" />
+ <!-- Done bar strings -->
+ <string name="done">Done</string>
+ <string name="cancel">Cancel</string>
</resources>
diff --git a/ui/actionbar/DoneBar/DoneBarSample/tests/AndroidManifest.xml b/ui/actionbar/DoneBar/DoneBarSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..40eb5e1
--- /dev/null
+++ b/ui/actionbar/DoneBar/DoneBarSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.donebar.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="18"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.donebar"
+ android:label="Tests for com.example.android.donebar" />
+
+</manifest>
\ No newline at end of file
diff --git a/ui/actionbar/DoneBar/DoneBarSample/tests/src/com/example/android/donebar/tests/SampleTests.java b/ui/actionbar/DoneBar/DoneBarSample/tests/src/com/example/android/donebar/tests/SampleTests.java
new file mode 100644
index 0000000..c019ef8
--- /dev/null
+++ b/ui/actionbar/DoneBar/DoneBarSample/tests/src/com/example/android/donebar/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* Copyright 2013 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.
+*/
+
+
+
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.donebar.tests;
+
+import com.example.android.donebar.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for DoneBar sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private DoneBarFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (DoneBarFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Add more tests below.
+ */
+
+}
\ No newline at end of file
diff --git a/ui/actionbar/DoneBar/build.gradle b/ui/actionbar/DoneBar/build.gradle
index 036abc8..ffb5c2f 100644
--- a/ui/actionbar/DoneBar/build.gradle
+++ b/ui/actionbar/DoneBar/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/actionbar/DoneBar/build.xml b/ui/actionbar/DoneBar/build.xml
deleted file mode 100644
index 1f0d8a1..0000000
--- a/ui/actionbar/DoneBar/build.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="SampleDashboardActivity" default="help">
-
- <!-- The local.properties file is created and updated by the 'android' tool.
- It contains the path to the SDK. It should *NOT* be checked into
- Version Control Systems. -->
- <property file="local.properties" />
-
- <!-- The ant.properties file can be created by you. It is only edited by the
- 'android' tool to add properties to it.
- This is the place to change some Ant specific build properties.
- Here are some properties you may want to change/update:
-
- source.dir
- The name of the source directory. Default is 'src'.
- out.dir
- The name of the output directory. Default is 'bin'.
-
- For other overridable properties, look at the beginning of the rules
- files in the SDK, at tools/ant/build.xml
-
- Properties related to the SDK location or the project target should
- be updated using the 'android' tool with the 'update' action.
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems.
-
- -->
- <property file="ant.properties" />
-
- <!-- if sdk.dir was not set from one of the property file, then
- get it from the ANDROID_HOME env var.
- This must be done before we load project.properties since
- the proguard config can use sdk.dir -->
- <property environment="env" />
- <condition property="sdk.dir" value="${env.ANDROID_HOME}">
- <isset property="env.ANDROID_HOME" />
- </condition>
-
- <!-- The project.properties file is created and updated by the 'android'
- tool, as well as ADT.
-
- This contains project specific properties such as project target, and library
- dependencies. Lower level build properties are stored in ant.properties
- (or in .classpath for Eclipse projects).
-
- This file is an integral part of the build system for your
- application and should be checked into Version Control Systems. -->
- <loadproperties srcFile="project.properties" />
-
- <!-- quick check on sdk.dir -->
- <fail
- message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
- unless="sdk.dir"
- />
-
- <!--
- Import per project custom build rules if present at the root of the project.
- This is the place to put custom intermediary targets such as:
- -pre-build
- -pre-compile
- -post-compile (This is typically used for code obfuscation.
- Compiled code location: ${out.classes.absolute.dir}
- If this is not done in place, override ${out.dex.input.absolute.dir})
- -post-package
- -post-build
- -pre-clean
- -->
- <import file="custom_rules.xml" optional="true" />
-
- <!-- Import the actual build file.
-
- To customize existing targets, there are two options:
- - Customize only one target:
- - copy/paste the target into this file, *before* the
- <import> task.
- - customize it to your needs.
- - Customize the whole content of build.xml
- - copy/paste the content of the rules files (minus the top node)
- into this file, replacing the <import> task.
- - customize to your needs.
-
- ***********************
- ****** IMPORTANT ******
- ***********************
- In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
- in order to avoid having your file be overridden by tools such as "android update project"
- -->
- <!-- version-tag: 1 -->
- <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/actionbar/DoneBar/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/actionbar/DoneBar/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/actionbar/DoneBar/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/actionbar/DoneBar/gradle/wrapper/gradle-wrapper.properties b/ui/actionbar/DoneBar/gradle/wrapper/gradle-wrapper.properties
index 055ba6f..861eddc 100644
--- a/ui/actionbar/DoneBar/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/actionbar/DoneBar/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/actionbar/DoneBar/proguard-project.txt b/ui/actionbar/DoneBar/proguard-project.txt
deleted file mode 100644
index f2fe155..0000000
--- a/ui/actionbar/DoneBar/proguard-project.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# To enable ProGuard in your project, edit project.properties
-# to define the proguard.config property as described in that file.
-#
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in ${sdk.dir}/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the ProGuard
-# include property in project.properties.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# Add any project specific keep options here:
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
diff --git a/ui/actionbar/DoneBar/project.properties b/ui/actionbar/DoneBar/project.properties
deleted file mode 100644
index a3ee5ab..0000000
--- a/ui/actionbar/DoneBar/project.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system edit
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-#
-# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
-#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
-
-# Project target.
-target=android-17
diff --git a/ui/actionbar/DoneBar/settings.gradle b/ui/actionbar/DoneBar/settings.gradle
index 28b5ccd..d060dc7 100644
--- a/ui/actionbar/DoneBar/settings.gradle
+++ b/ui/actionbar/DoneBar/settings.gradle
@@ -1 +1,4 @@
-include ':DoneBar'
+
+
+
+include 'DoneBarSample'
diff --git a/ui/actionbar/DoneBar/template-params.xml b/ui/actionbar/DoneBar/template-params.xml
new file mode 100644
index 0000000..c5d1741
--- /dev/null
+++ b/ui/actionbar/DoneBar/template-params.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+<sample>
+ <name>DoneBar</name>
+ <group>UI</group>
+ <package>com.example.android.donebar</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>14</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates two alternative presentations of the
+ action bar that are well-suited for simple data entry scenarios.
+
+ In this presentation, a done bar replaces the action
+ bar entirely, providing two direct actions to persist or dismiss changes. This is
+ suitable for cases where no additional view details or actions are needed in the
+ action bar.
+ ]]>
+ </intro>
+ </strings>
+
+ <activity>
+ <class>DoneBarActivity</class>
+ <title>Done Bar</title>
+ <description>In this presentation, a done bar replaces the action bar entirely, providing
+ two direct actions to persist or dismiss changes. This is suitable for cases where no
+ additional view details or actions are needed in the action bar.</description>
+ </activity>
+
+ <activity>
+ <class>DoneButtonActivity</class>
+ <title>Done Button</title>
+ <description>In this presentation, a done button replaces the action bar\'s "Up" affordance
+ and app icon, while the cancel action is made available in the action overflow. This is
+ well-suited to scenarios where additional view details or
+ actions may be needed in the action bar.</description>
+ </activity>
+
+ <template src="base"/>
+ <template src="ActivityCards"/>
+</sample>
diff --git a/ui/actionbarcompat/Basic/BasicSample/tests/AndroidManifest.xml b/ui/actionbarcompat/Basic/BasicSample/tests/AndroidManifest.xml
index 87b785f..a2f7cfc 100644
--- a/ui/actionbarcompat/Basic/BasicSample/tests/AndroidManifest.xml
+++ b/ui/actionbarcompat/Basic/BasicSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.actionbarcompat.basic.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.actionbarcompat.basic"
+ android:label="Tests for com.example.android.actionbarcompat.basic" />
</manifest>
\ No newline at end of file
diff --git a/ui/actionbarcompat/Basic/_index.jd b/ui/actionbarcompat/Basic/_index.jd
deleted file mode 100644
index 17ddfda..0000000
--- a/ui/actionbarcompat/Basic/_index.jd
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-page.tags="Basic"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample shows you how to use ActionBarCompat to create a basic Activity which
- displays action items. It covers inflating items from a menu resource, as well as adding
- an item in code. Items that are not shown as action items on the Action Bar are
- displayed in the action bar overflow.
-
- </p>
diff --git a/ui/actionbarcompat/Basic/template-params.xml b/ui/actionbarcompat/Basic/template-params.xml
index da35301..e940d2d 100644
--- a/ui/actionbarcompat/Basic/template-params.xml
+++ b/ui/actionbarcompat/Basic/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>Basic</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.actionbarcompat.basic</package>
<dependency>com.android.support:appcompat-v7:18.0.+</dependency>
diff --git a/ui/actionbarcompat/ListPopupMenu/ListPopupMenuSample/tests/AndroidManifest.xml b/ui/actionbarcompat/ListPopupMenu/ListPopupMenuSample/tests/AndroidManifest.xml
index 87b785f..d23ab10 100644
--- a/ui/actionbarcompat/ListPopupMenu/ListPopupMenuSample/tests/AndroidManifest.xml
+++ b/ui/actionbarcompat/ListPopupMenu/ListPopupMenuSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.actionbarcompat.listpopupmenu.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.actionbarcompat.listpopupmenu"
+ android:label="Tests for com.example.android.actionbarcompat.listpopupmenu" />
</manifest>
\ No newline at end of file
diff --git a/ui/actionbarcompat/ListPopupMenu/_index.jd b/ui/actionbarcompat/ListPopupMenu/_index.jd
deleted file mode 100644
index 00e6628..0000000
--- a/ui/actionbarcompat/ListPopupMenu/_index.jd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-page.tags="ListPopupMenu"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample shows you how to use {@link android.support.v7.widget.PopupMenu PopupMenu}
- from ActionBarCompat to create a list, with each item having a dropdown menu.
-
- </p>
diff --git a/ui/actionbarcompat/ListPopupMenu/template-params.xml b/ui/actionbarcompat/ListPopupMenu/template-params.xml
index 4a67f36..0d23829 100644
--- a/ui/actionbarcompat/ListPopupMenu/template-params.xml
+++ b/ui/actionbarcompat/ListPopupMenu/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>ListPopupMenu</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.actionbarcompat.listpopupmenu</package>
<dependency>com.android.support:appcompat-v7:18.0.+</dependency>
diff --git a/ui/actionbarcompat/ShareActionProvider/ShareActionProviderSample/tests/AndroidManifest.xml b/ui/actionbarcompat/ShareActionProvider/ShareActionProviderSample/tests/AndroidManifest.xml
index 87b785f..c52949c 100644
--- a/ui/actionbarcompat/ShareActionProvider/ShareActionProviderSample/tests/AndroidManifest.xml
+++ b/ui/actionbarcompat/ShareActionProvider/ShareActionProviderSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.actionbarcompat.shareactionprovider.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.actionbarcompat.shareactionprovider"
+ android:label="Tests for com.example.android.actionbarcompat.shareactionprovider" />
</manifest>
\ No newline at end of file
diff --git a/ui/actionbarcompat/ShareActionProvider/_index.jd b/ui/actionbarcompat/ShareActionProvider/_index.jd
deleted file mode 100644
index 36784ff..0000000
--- a/ui/actionbarcompat/ShareActionProvider/_index.jd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-page.tags="ShareActionProvider"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample shows you how a provide a context-sensitive ShareActionProvider with
- ActionBarCompat, backwards compatible to API v7.
-
- </p>
diff --git a/ui/actionbarcompat/ShareActionProvider/template-params.xml b/ui/actionbarcompat/ShareActionProvider/template-params.xml
index 722e830..cf6cb88 100644
--- a/ui/actionbarcompat/ShareActionProvider/template-params.xml
+++ b/ui/actionbarcompat/ShareActionProvider/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>ShareActionProvider</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.actionbarcompat.shareactionprovider</package>
<dependency>com.android.support:appcompat-v7:18.0.+</dependency>
diff --git a/ui/actionbarcompat/Styled/StyledSample/tests/AndroidManifest.xml b/ui/actionbarcompat/Styled/StyledSample/tests/AndroidManifest.xml
index 87b785f..a990607 100644
--- a/ui/actionbarcompat/Styled/StyledSample/tests/AndroidManifest.xml
+++ b/ui/actionbarcompat/Styled/StyledSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.actionbarcompat.styled.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.actionbarcompat.styled"
+ android:label="Tests for com.example.android.actionbarcompat.styled" />
</manifest>
\ No newline at end of file
diff --git a/ui/actionbarcompat/Styled/_index.jd b/ui/actionbarcompat/Styled/_index.jd
deleted file mode 100644
index fd79264..0000000
--- a/ui/actionbarcompat/Styled/_index.jd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-page.tags="Styled"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample shows you how to use ActionBarCompat with a customized theme. It utilizes a
- split action bar when running on a device with a narrow display, and show three tabs.
-
- </p>
diff --git a/ui/actionbarcompat/Styled/template-params.xml b/ui/actionbarcompat/Styled/template-params.xml
index d602051..33577f0 100644
--- a/ui/actionbarcompat/Styled/template-params.xml
+++ b/ui/actionbarcompat/Styled/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>Styled</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.actionbarcompat.styled</package>
<dependency>com.android.support:appcompat-v7:18.0.+</dependency>
diff --git a/ui/holo/BorderlessButtons/_index.jd b/ui/holo/BorderlessButtons/_index.jd
deleted file mode 100644
index 2c17d3a..0000000
--- a/ui/holo/BorderlessButtons/_index.jd
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-page.tags="BorderlessButtons"
-sample.group=NoGroup
-@jd:body
-
-<p>
- This sample demonstrates the use of borderless buttons, bottom button bars
- (OK and Cancel) and dividers to establish visual structure.
-</p>
diff --git a/ui/holo/BorderlessButtons/template-params.xml b/ui/holo/BorderlessButtons/template-params.xml
index 555782d..c0d9aeb 100644
--- a/ui/holo/BorderlessButtons/template-params.xml
+++ b/ui/holo/BorderlessButtons/template-params.xml
@@ -14,10 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<sample>
<name>BorderlessButtons</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.borderlessbuttons</package>
<!-- change minSdk if needed-->
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/build.gradle b/ui/lists/CustomChoiceList/CustomChoiceList/build.gradle
deleted file mode 100644
index 3f765aa..0000000
--- a/ui/lists/CustomChoiceList/CustomChoiceList/build.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-
-apply plugin: 'android'
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-v11/styles.xml b/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-v11/styles.xml
deleted file mode 100644
index 3dff32a..0000000
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <style name="Theme.Base" parent="android:Theme.Holo.Light" />
-
-</resources>
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/dimens.xml b/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/dimens.xml
deleted file mode 100644
index 8bb8753..0000000
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Define standard dimensions to comply with Holo-style grids and rhythm. -->
-
- <dimen name="margin_tiny">4dp</dimen>
- <dimen name="margin_small">8dp</dimen>
- <dimen name="margin_medium">16dp</dimen>
- <dimen name="margin_large">32dp</dimen>
- <dimen name="margin_huge">64dp</dimen>
-
- <!-- Meta-dimension that switches on screen size -->
-
- <dimen name="page_margin">@dimen/margin_medium</dimen>
-
-</resources>
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/strings.xml b/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/strings.xml
deleted file mode 100755
index 54389e2..0000000
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
- <string name="app_name">Custom Choice List</string>
- <string name="intro_message">This sample demonstrates how to create <b>custom checkable layouts</b>, for use with <i>ListView</i>\'s <i>choiceMode</i> attribute.</string>
-</resources>
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/styles.xml b/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/styles.xml
deleted file mode 100644
index e0a12d3..0000000
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- Copyright 2013 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.
- -->
-
-<resources>
-
- <!-- Activity themes -->
-
- <style name="Theme.Base" parent="android:Theme.Light" />
-
- <style name="Theme.Sample" parent="Theme.Base" />
-
- <!-- Widget styling -->
-
- <style name="Widget" />
-
- <style name="Widget.DescriptionBar">
- <item name="android:background">#fb3</item>
- <item name="android:paddingTop">@dimen/margin_medium</item>
- <item name="android:paddingBottom">@dimen/margin_medium</item>
- <item name="android:paddingLeft">@dimen/page_margin</item>
- <item name="android:paddingRight">@dimen/page_margin</item>
- <item name="android:textAppearance">?android:textAppearanceMedium</item>
- <item name="android:lineSpacingMultiplier">1.1</item>
- </style>
-
-</resources>
diff --git a/ui/lists/CustomChoiceList/CustomChoiceListSample/.gitignore b/ui/lists/CustomChoiceList/CustomChoiceListSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/lists/CustomChoiceList/CustomChoiceListSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/lists/CustomChoiceList/CustomChoiceListSample/proguard-project.txt
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/AndroidManifest.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/AndroidManifest.xml
old mode 100755
new mode 100644
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/AndroidManifest.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/AndroidManifest.xml
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java
similarity index 94%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java
index 97be8cb..a30eb2a 100644
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/CheckableLinearLayout.java
@@ -24,7 +24,7 @@
import android.widget.LinearLayout;
/**
- * This is a simple wrapper for {@link LinearLayout} that implements the {@link Checkable}
+ * This is a simple wrapper for {@link android.widget.LinearLayout} that implements the {@link android.widget.Checkable}
* interface by keeping an internal 'checked' state flag.
* <p>
* This can be used as the root view for a custom list item layout for
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/Cheeses.java b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/Cheeses.java
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/Cheeses.java
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/Cheeses.java
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/MainActivity.java b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/MainActivity.java
similarity index 97%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/MainActivity.java
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/MainActivity.java
index e27ff97..e4e89f2 100755
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/java/com/example/android/customchoicelist/MainActivity.java
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/java/com/example/android/customchoicelist/MainActivity.java
@@ -31,7 +31,7 @@
public class MainActivity extends ListActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
setListAdapter(new MyAdapter());
}
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/color/hideable_text_color.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/color/hideable_text_color.xml
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/color/hideable_text_color.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/color/hideable_text_color.xml
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-hdpi/ic_launcher.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-hdpi/ic_launcher.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-mdpi/ic_launcher.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-mdpi/ic_launcher.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_hideable_item_checked.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_hideable_item_checked.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_hideable_item_checked.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_hideable_item_checked.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_hideable_item_unchecked.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_hideable_item_unchecked.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_hideable_item_unchecked.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_hideable_item_unchecked.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xhdpi/ic_launcher.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable/ic_hideable_item.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable/ic_hideable_item.xml
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/drawable/ic_hideable_item.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/drawable/ic_hideable_item.xml
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/layout/list_item.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/layout/list_item.xml
similarity index 96%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/layout/list_item.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/layout/list_item.xml
index ecbd63d..09a17ed 100644
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/layout/list_item.xml
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/layout/list_item.xml
@@ -15,7 +15,7 @@
-->
<!--
- The ListView from activity_main.xml has a choiceMode set, meaning that when a user
+ The ListView from sample_main.xml has a choiceMode set, meaning that when a user
selects a list item, the ListView will set the state for that item's root view
(this CheckableLinearLayout) to "checked". Note that this requires that the root view
implements the Checkable interface. Once the root view is checked, any children that
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/layout/activity_main.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/layout/activity_main.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/layout/sample_main.xml
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/dimens.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/dimens.xml
similarity index 84%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/dimens.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/dimens.xml
index 0e00174..c22027e 100644
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/dimens.xml
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/dimens.xml
@@ -16,6 +16,8 @@
<resources>
- <dimen name="page_margin">@dimen/margin_huge</dimen>
+ <!-- Meta-dimension that switches on screen size -->
+
+ <dimen name="page_margin">@dimen/margin_medium</dimen>
</resources>
diff --git a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/styles.xml b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/styles.xml
similarity index 92%
rename from ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/styles.xml
rename to ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/styles.xml
index 9ce5eb3..0851a81 100644
--- a/ui/lists/CustomChoiceList/CustomChoiceList/src/main/res/values-sw600dp/styles.xml
+++ b/ui/lists/CustomChoiceList/CustomChoiceListSample/src/main/res/values/styles.xml
@@ -15,15 +15,14 @@
-->
<resources>
-
<style name="Widget.DescriptionBar">
<item name="android:background">#fb3</item>
<item name="android:paddingTop">@dimen/margin_medium</item>
<item name="android:paddingBottom">@dimen/margin_medium</item>
<item name="android:paddingLeft">@dimen/page_margin</item>
<item name="android:paddingRight">@dimen/page_margin</item>
- <item name="android:textAppearance">?android:textAppearanceLarge</item>
- <item name="android:lineSpacingMultiplier">1.2</item>
+ <item name="android:textAppearance">?android:textAppearanceMedium</item>
+ <item name="android:lineSpacingMultiplier">1.1</item>
</style>
</resources>
diff --git a/ui/lists/CustomChoiceList/README.txt b/ui/lists/CustomChoiceList/README.txt
deleted file mode 100644
index 38608df..0000000
--- a/ui/lists/CustomChoiceList/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Build Instructions
--------------------
-This sample uses the Gradle build system. To build this project, use the
-"gradlew build" command.
-
-To see a list of all available commands, run "gradlew tasks".
\ No newline at end of file
diff --git a/ui/lists/CustomChoiceList/build.gradle b/ui/lists/CustomChoiceList/build.gradle
index 036abc8..ffb5c2f 100644
--- a/ui/lists/CustomChoiceList/build.gradle
+++ b/ui/lists/CustomChoiceList/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/lists/CustomChoiceList/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/lists/CustomChoiceList/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/lists/CustomChoiceList/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/lists/CustomChoiceList/gradle/wrapper/gradle-wrapper.properties b/ui/lists/CustomChoiceList/gradle/wrapper/gradle-wrapper.properties
index 055ba6f..861eddc 100644
--- a/ui/lists/CustomChoiceList/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/lists/CustomChoiceList/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/lists/CustomChoiceList/settings.gradle b/ui/lists/CustomChoiceList/settings.gradle
index 0c9c7b4..6d876cf 100644
--- a/ui/lists/CustomChoiceList/settings.gradle
+++ b/ui/lists/CustomChoiceList/settings.gradle
@@ -1 +1,4 @@
-include ':CustomChoiceList'
+
+
+
+include 'CustomChoiceListSample'
diff --git a/ui/lists/CustomChoiceList/template-params.xml b/ui/lists/CustomChoiceList/template-params.xml
new file mode 100644
index 0000000..b58c0ac
--- /dev/null
+++ b/ui/lists/CustomChoiceList/template-params.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>CustomChoiceList</name>
+ <group>UI</group>
+ <package>com.example.android.customchoicelist</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>3</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates how to create custom checkable layouts, for use with ListView\'s choiceMode
+ attribute.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <common src="logger"/>
+
+</sample>
diff --git a/ui/notifications/BasicNotifications/BasicNotificationsSample/tests/AndroidManifest.xml b/ui/notifications/BasicNotifications/BasicNotificationsSample/tests/AndroidManifest.xml
index 87b785f..62c01e8 100644
--- a/ui/notifications/BasicNotifications/BasicNotificationsSample/tests/AndroidManifest.xml
+++ b/ui/notifications/BasicNotifications/BasicNotificationsSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.basicnotifications.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.basicnotifications"
+ android:label="Tests for com.example.android.basicnotifications" />
</manifest>
\ No newline at end of file
diff --git a/ui/notifications/BasicNotifications/_index.jd b/ui/notifications/BasicNotifications/_index.jd
deleted file mode 100644
index 9556b29..0000000
--- a/ui/notifications/BasicNotifications/_index.jd
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-page.tags="BasicNotifications"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample demonstrates how to display events in the system\'s notification bar. The
- NotificationCompat API is used for compatibility with older devices, running Android
- 2.2 (Froyo) or newer.
-
- </p>
diff --git a/ui/notifications/BasicNotifications/template-params.xml b/ui/notifications/BasicNotifications/template-params.xml
index 2d8776f..7118c24 100644
--- a/ui/notifications/BasicNotifications/template-params.xml
+++ b/ui/notifications/BasicNotifications/template-params.xml
@@ -17,9 +17,8 @@
<sample>
<name>BasicNotifications</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.basicnotifications</package>
-
<!-- change minSdk if needed-->
<minSdk>8</minSdk>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/build.gradle b/ui/notifications/CustomNotifications/CustomNotifications/build.gradle
deleted file mode 100644
index a6f0afc..0000000
--- a/ui/notifications/CustomNotifications/CustomNotifications/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'android'
-
-dependencies {
- compile 'com.android.support:support-v4:18.0.+'
-}
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/AndroidManifest.xml b/ui/notifications/CustomNotifications/CustomNotifications/src/main/AndroidManifest.xml
deleted file mode 100644
index 8821b1a..0000000
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2013 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.
- -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.customnotifications"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="4"
- android:targetSdkVersion="18" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.android.customnotifications.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v11/styles.xml b/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v11/styles.xml
deleted file mode 100644
index b454dee..0000000
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
- * Copyright (C) 2013 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.
- -->
-
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v14/styles.xml b/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v14/styles.xml
deleted file mode 100644
index 1cf1112..0000000
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v14/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- * Copyright (C) 2013 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.
- -->
-
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/styles.xml b/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/styles.xml
deleted file mode 100644
index eca4340..0000000
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- * Copyright (C) 2013 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.
- -->
-
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
- <style name="NotificationContent" parent="@android:style/TextAppearance.Small">
- <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
- </style>
-
-</resources>
diff --git a/ui/notifications/CustomNotifications/CustomNotificationsSample/.gitignore b/ui/notifications/CustomNotifications/CustomNotificationsSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/notifications/CustomNotifications/CustomNotificationsSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/notifications/CustomNotifications/CustomNotificationsSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/notifications/CustomNotifications/CustomNotificationsSample/proguard-project.txt
diff --git a/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/AndroidManifest.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..b20a411
--- /dev/null
+++ b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/AndroidManifest.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.customnotifications"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="4"
+ android:targetSdkVersion="18" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name="com.example.android.customnotifications.MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/java/com/example/android/customnotifications/MainActivity.java b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/java/com/example/android/customnotifications/MainActivity.java
similarity index 91%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/java/com/example/android/customnotifications/MainActivity.java
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/java/com/example/android/customnotifications/MainActivity.java
index eae95f1..57a4315 100644
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/java/com/example/android/customnotifications/MainActivity.java
+++ b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/java/com/example/android/customnotifications/MainActivity.java
@@ -35,11 +35,11 @@
*
* <p>On API level 16 and above a big content view is also defined that is used for the
* 'expanded' notification. The notification is created by the NotificationCompat.Builder.
- * The expanded content view is set directly on the {@link Notification} once it has been build.
- * (See {@link Notification#bigContentView}.) </p>
+ * The expanded content view is set directly on the {@link android.app.Notification} once it has been build.
+ * (See {@link android.app.Notification#bigContentView}.) </p>
*
- * <p>The content views are inflated as {@link RemoteViews} directly from their XML layout
- * definitions using {@link RemoteViews#RemoteViews(String, int)}.</p>
+ * <p>The content views are inflated as {@link android.widget.RemoteViews} directly from their XML layout
+ * definitions using {@link android.widget.RemoteViews#RemoteViews(String, int)}.</p>
*/
private void createNotification() {
// BEGIN_INCLUDE(notificationCompat)
@@ -109,7 +109,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
}
/**
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi-v11/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi-v11/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi-v11/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi-v11/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi-v9/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi-v9/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi-v9/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi-v9/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi/ic_launcher.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi/ic_launcher.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-hdpi/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-hdpi/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-ldpi-v11/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-ldpi-v11/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-ldpi-v11/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-ldpi-v11/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-ldpi-v9/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-ldpi-v9/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-ldpi-v9/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-ldpi-v9/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi-v11/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi-v11/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi-v11/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi-v11/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi-v9/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi-v9/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi-v9/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi-v9/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi/ic_launcher.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi/ic_launcher.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-mdpi/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-mdpi/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi-v11/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi-v11/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi-v11/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi-v11/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi-v9/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi-v9/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi-v9/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi-v9/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/ic_launcher.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/ic_stat_custom.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/ic_stat_custom.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/ic_stat_custom.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/ic_stat_custom.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/robot.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/robot.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/robot.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/robot.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/robot_expanded.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/robot_expanded.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xhdpi/robot_expanded.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xhdpi/robot_expanded.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/notification.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/notification.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/notification.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/notification.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/notification_expanded.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/notification_expanded.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/notification_expanded.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/notification_expanded.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/activity_main.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/layout/activity_main.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/layout/sample_main.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-sw720dp-land/dimens.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values-sw720dp-land/dimens.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-sw720dp-land/dimens.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values-sw720dp-land/dimens.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v9/styles.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values-v9/styles.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-v9/styles.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values-v9/styles.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/dimens.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/dimens.xml
similarity index 100%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/dimens.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/dimens.xml
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/strings.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/strings.xml
similarity index 96%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/strings.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/strings.xml
index 3247f39..a766441 100644
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values/strings.xml
+++ b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/strings.xml
@@ -16,7 +16,6 @@
<resources>
- <string name="app_name">CustomNotifications</string>
<string name="expanded">I\'m the expanded notification.\nCollapse me!</string>
<string name="collapsed">I\'m the collapsed notification.\nCreated at: %s</string>
<string name="show_notification">Show Notification</string>
diff --git a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-sw600dp/dimens.xml b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/styles.xml
similarity index 77%
rename from ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-sw600dp/dimens.xml
rename to ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/styles.xml
index eb7d98a..1d3d45b 100644
--- a/ui/notifications/CustomNotifications/CustomNotifications/src/main/res/values-sw600dp/dimens.xml
+++ b/ui/notifications/CustomNotifications/CustomNotificationsSample/src/main/res/values/styles.xml
@@ -14,6 +14,9 @@
-->
<resources>
- <!-- Customize dimensions originally defined in res/values/dimens.xml (such as
- screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
+
+ <style name="NotificationContent" parent="@android:style/TextAppearance.Small">
+ <item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
+ </style>
+
</resources>
diff --git a/ui/notifications/CustomNotifications/build.gradle b/ui/notifications/CustomNotifications/build.gradle
index 5a6276f..ffb5c2f 100644
--- a/ui/notifications/CustomNotifications/build.gradle
+++ b/ui/notifications/CustomNotifications/build.gradle
@@ -1,13 +1,11 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
-}
-repositories {
- mavenCentral()
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/notifications/CustomNotifications/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/notifications/CustomNotifications/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/notifications/CustomNotifications/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar b/ui/notifications/CustomNotifications/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
copy to ui/notifications/CustomNotifications/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/ui/notifications/CustomNotifications/gradle/wrapper/gradle-wrapper.properties
similarity index 93%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
copy to ui/notifications/CustomNotifications/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/notifications/CustomNotifications/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/ImmersiveMode/gradlew b/ui/notifications/CustomNotifications/gradlew
similarity index 100%
copy from ui/ImmersiveMode/gradlew
copy to ui/notifications/CustomNotifications/gradlew
diff --git a/ui/ImmersiveMode/gradlew.bat b/ui/notifications/CustomNotifications/gradlew.bat
similarity index 100%
copy from ui/ImmersiveMode/gradlew.bat
copy to ui/notifications/CustomNotifications/gradlew.bat
diff --git a/ui/notifications/CustomNotifications/settings.gradle b/ui/notifications/CustomNotifications/settings.gradle
index f19c616..71d4992 100644
--- a/ui/notifications/CustomNotifications/settings.gradle
+++ b/ui/notifications/CustomNotifications/settings.gradle
@@ -1 +1,4 @@
-include ':CustomNotifications'
+
+
+
+include 'CustomNotificationsSample'
diff --git a/ui/notifications/CustomNotifications/template-params.xml b/ui/notifications/CustomNotifications/template-params.xml
new file mode 100644
index 0000000..ff90ca3
--- /dev/null
+++ b/ui/notifications/CustomNotifications/template-params.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>CustomNotifications</name>
+ <group>UI</group>
+ <package>com.example.android.customnotifications</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>4</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample demonstrates notifications with custom content views.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+
+</sample>
diff --git a/ui/views/HorizontalPaging/HorizontalPagingSample/tests/AndroidManifest.xml b/ui/views/HorizontalPaging/HorizontalPagingSample/tests/AndroidManifest.xml
index 87b785f..3f35ede 100644
--- a/ui/views/HorizontalPaging/HorizontalPagingSample/tests/AndroidManifest.xml
+++ b/ui/views/HorizontalPaging/HorizontalPagingSample/tests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="${sample.package}.tests"
+ package="com.example.android.horizontalpaging.tests"
android:versionCode="1"
android:versionName="1.0">
@@ -36,7 +36,7 @@
-->
<instrumentation
android:name="android.test.InstrumentationTestRunner"
- android:targetPackage="${sample.package}"
- android:label="Tests for ${sample.package}" />
+ android:targetPackage="com.example.android.horizontalpaging"
+ android:label="Tests for com.example.android.horizontalpaging" />
</manifest>
\ No newline at end of file
diff --git a/ui/views/HorizontalPaging/_index.jd b/ui/views/HorizontalPaging/_index.jd
deleted file mode 100644
index 160621e..0000000
--- a/ui/views/HorizontalPaging/_index.jd
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-page.tags="HorizontalPaging"
-sample.group=NoGroup
-@jd:body
-
-<p>
-
- This sample demonstrates how to implement horizontal paging between fragments in
- applications that use ActionBar, using a ViewPager widget.
-
- </p>
diff --git a/ui/views/HorizontalPaging/template-params.xml b/ui/views/HorizontalPaging/template-params.xml
index 28fc0db..e0546b1 100644
--- a/ui/views/HorizontalPaging/template-params.xml
+++ b/ui/views/HorizontalPaging/template-params.xml
@@ -14,12 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
-
<sample>
<name>HorizontalPaging</name>
- <group>NoGroup</group>
+ <group>UI</group>
<package>com.example.android.horizontalpaging</package>
<!-- change minSdk if needed-->
diff --git a/ui/views/TextSwitcher/README.txt b/ui/views/TextSwitcher/README.txt
deleted file mode 100644
index 38608df..0000000
--- a/ui/views/TextSwitcher/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Build Instructions
--------------------
-This sample uses the Gradle build system. To build this project, use the
-"gradlew build" command.
-
-To see a list of all available commands, run "gradlew tasks".
\ No newline at end of file
diff --git a/ui/views/TextSwitcher/TextSwitcher/build.gradle b/ui/views/TextSwitcher/TextSwitcher/build.gradle
deleted file mode 100644
index 10fb811..0000000
--- a/ui/views/TextSwitcher/TextSwitcher/build.gradle
+++ /dev/null
@@ -1,10 +0,0 @@
-apply plugin: 'android'
-
-dependencies {
- compile "com.android.support:support-v4:18.0.+"
-}
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/styles.xml b/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/styles.xml
deleted file mode 100644
index 27efa47..0000000
--- a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-<resources>
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
-</resources>
diff --git a/ui/views/TextSwitcher/TextSwitcherSample/.gitignore b/ui/views/TextSwitcher/TextSwitcherSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/views/TextSwitcher/TextSwitcherSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/views/TextSwitcher/TextSwitcherSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/views/TextSwitcher/TextSwitcherSample/proguard-project.txt
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/AndroidManifest.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/AndroidManifest.xml
similarity index 90%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/AndroidManifest.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/AndroidManifest.xml
index 707bfe3..7f512a3 100644
--- a/ui/views/TextSwitcher/TextSwitcher/src/main/AndroidManifest.xml
+++ b/ui/views/TextSwitcher/TextSwitcherSample/src/main/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.view.textswitcher"
+ package="com.example.android.textswitcher"
android:versionCode="1"
android:versionName="1.0" >
@@ -30,7 +30,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
- android:name="com.example.android.ui.views.textswitcher.MainActivity"
+ android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/java/com/example/android/ui/views/textswitcher/MainActivity.java b/ui/views/TextSwitcher/TextSwitcherSample/src/main/java/com/example/android/textswitcher/MainActivity.java
similarity index 83%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/java/com/example/android/ui/views/textswitcher/MainActivity.java
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/java/com/example/android/textswitcher/MainActivity.java
index 1beeb59..a8cbb5e 100644
--- a/ui/views/TextSwitcher/TextSwitcher/src/main/java/com/example/android/ui/views/textswitcher/MainActivity.java
+++ b/ui/views/TextSwitcher/TextSwitcherSample/src/main/java/com/example/android/textswitcher/MainActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.android.ui.views.textswitcher;
+package com.example.android.textswitcher;
import android.app.Activity;
import android.os.Bundle;
@@ -25,16 +25,13 @@
import android.widget.Button;
import android.widget.TextSwitcher;
import android.widget.TextView;
-import android.widget.ViewSwitcher;
import android.widget.ViewSwitcher.ViewFactory;
-import com.example.android.view.textswitcher.R;
-
/**
- * This sample shows the use of the {@link TextSwitcher} View with animations. A
- * {@link TextSwitcher} is a special type of {@link ViewSwitcher} that animates
+ * This sample shows the use of the {@link android.widget.TextSwitcher} View with animations. A
+ * {@link android.widget.TextSwitcher} is a special type of {@link android.widget.ViewSwitcher} that animates
* the current text out and new text in when
- * {@link TextSwitcher#setText(CharSequence)} is called.
+ * {@link android.widget.TextSwitcher#setText(CharSequence)} is called.
*/
public class MainActivity extends Activity {
private TextSwitcher mSwitcher;
@@ -43,7 +40,7 @@
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
// Get the TextSwitcher view from the layout
mSwitcher = (TextSwitcher) findViewById(R.id.switcher);
@@ -88,10 +85,10 @@
// BEGIN_INCLUDE(factory)
/**
- * The {@link ViewFactory} used to create {@link TextView}s that the
- * {@link TextSwitcher} will switch between.
+ * The {@link android.widget.ViewSwitcher.ViewFactory} used to create {@link android.widget.TextView}s that the
+ * {@link android.widget.TextSwitcher} will switch between.
*/
- private ViewSwitcher.ViewFactory mFactory = new ViewFactory() {
+ private ViewFactory mFactory = new ViewFactory() {
@Override
public View makeView() {
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-hdpi/ic_launcher.png b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-hdpi/ic_launcher.png
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-mdpi/ic_launcher.png b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-mdpi/ic_launcher.png
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-xhdpi/ic_launcher.png
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/layout/activity_main.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/layout/activity_main.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/layout/sample_main.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values-sw600dp/dimens.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-sw600dp/dimens.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values-sw600dp/dimens.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-sw600dp/dimens.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values-sw720dp-land/dimens.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-sw720dp-land/dimens.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values-sw720dp-land/dimens.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-sw720dp-land/dimens.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values-v11/styles.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-v11/styles.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values-v11/styles.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-v11/styles.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values-v14/styles.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-v14/styles.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values-v14/styles.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values-v14/styles.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/dimens.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values/dimens.xml
similarity index 100%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values/dimens.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values/dimens.xml
diff --git a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/strings.xml b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values/strings.xml
similarity index 94%
rename from ui/views/TextSwitcher/TextSwitcher/src/main/res/values/strings.xml
rename to ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values/strings.xml
index 6b281e6..612b6cb 100644
--- a/ui/views/TextSwitcher/TextSwitcher/src/main/res/values/strings.xml
+++ b/ui/views/TextSwitcher/TextSwitcherSample/src/main/res/values/strings.xml
@@ -17,7 +17,6 @@
<resources>
- <string name="app_name">TextSwitcherSample</string>
<string name="intro">This sample illustrates the use of a <b>TextSwitcher</b> to display text.
\n\n<b>Click the button</b> below to set new text in the TextSwitcher and observe the in and out
fade animations.</string>
diff --git a/ui/views/TextSwitcher/build.gradle b/ui/views/TextSwitcher/build.gradle
index 036abc8..ffb5c2f 100644
--- a/ui/views/TextSwitcher/build.gradle
+++ b/ui/views/TextSwitcher/build.gradle
@@ -1,8 +1,11 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/views/TextSwitcher/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/views/TextSwitcher/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/views/TextSwitcher/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/views/TextSwitcher/gradle/wrapper/gradle-wrapper.properties b/ui/views/TextSwitcher/gradle/wrapper/gradle-wrapper.properties
index 055ba6f..861eddc 100644
--- a/ui/views/TextSwitcher/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/views/TextSwitcher/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,6 @@
-#
-#Mon Jul 22 11:40:20 PDT 2013
+#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/views/TextSwitcher/settings.gradle b/ui/views/TextSwitcher/settings.gradle
index aefb871..6740a95 100644
--- a/ui/views/TextSwitcher/settings.gradle
+++ b/ui/views/TextSwitcher/settings.gradle
@@ -1 +1,4 @@
-include ':TextSwitcher'
+
+
+
+include 'TextSwitcherSample'
diff --git a/ui/views/TextSwitcher/template-params.xml b/ui/views/TextSwitcher/template-params.xml
new file mode 100644
index 0000000..365c708
--- /dev/null
+++ b/ui/views/TextSwitcher/template-params.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>TextSwitcher</name>
+ <group>UI</group>
+ <package>com.example.android.textswitcher</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>4</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample illustrates the use of a TextSwitcher to display text.
+ \n\nClick the button below to set new text in the TextSwitcher and observe the
+ in and out fade animations.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <common src="logger"/>
+
+</sample>
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/.gitignore b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/.gitignore
new file mode 100644
index 0000000..ce281ed
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/.gitignore
@@ -0,0 +1,15 @@
+# Copyright 2013 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.
+src/template/
+src/common/
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/README-singleview.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt
copy to ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/README-singleview.txt
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/build.gradle b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/build.gradle
new file mode 100644
index 0000000..03db3dd
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/build.gradle
@@ -0,0 +1,57 @@
+
+
+
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:0.6.+'
+ }
+}
+
+apply plugin: 'android'
+
+dependencies {
+ // Add the support lib that is appropriate for SDK 4
+ compile "com.android.support:support-v4:18.0.+"
+}
+
+// The sample build uses multiple directories to
+// keep boilerplate and common code separate from
+// the main sample code.
+List<String> dirs = [
+ 'main', // main sample code; look here for the interesting stuff.
+ 'common', // components that are reused by multiple samples
+ 'template'] // boilerplate code that is generated by the sample template process
+
+android {
+ compileSdkVersion 19
+ buildToolsVersion "18.0.1"
+
+ sourceSets {
+ main {
+ dirs.each { dir ->
+ java.srcDirs "src/${dir}/java"
+ res.srcDirs "src/${dir}/res"
+ }
+ }
+ instrumentTest.setRoot('tests')
+ instrumentTest.java.srcDirs = ['tests/src']
+ }
+}
+
+task preflight (dependsOn: parent.preflight) {
+ project.afterEvaluate {
+ // Inject a preflight task into each variant so we have a place to hook tasks
+ // that need to run before any of the android build tasks.
+ //
+ android.applicationVariants.each { variant ->
+ tasks.getByPath("prepare${variant.name.capitalize()}Dependencies").dependsOn preflight
+ }
+ }
+}
+
+
+
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/proguard-project.txt
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/AndroidManifest.xml b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..1d01856
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/AndroidManifest.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+<!-- the versionCode is an integer representation of this version of your application. New
+ versions get higher numbers, so the upgrade system can avoid dealing with the ambiguity
+ of "1.9" vs "1.10". versionName, on the other hand, can be whatever you want, as the code
+ that handles upgrading Android apps between versions on your device just ignores it.-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.advancedimmersivemode"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <!-- This sample is to demonstrate features released in API 19.
+ So while it would technically run on an earlier version of Android,
+ there wouldn't be much point) -->
+ <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
+ <!-- allowBackup declares if the app can be part of device-wide backups such as "adb backup" -->
+ <!-- theme is a way of applying UI decisions across your entire application. You can also
+ define it on a per-application basis. -->
+ <application
+ android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <!-- Every activity needs its own Manifest element. The intent-filter contained in the
+ element declares the intents that can be used to activate this Activity. For instance,
+ the one below flags this Activity as a "main" entry point of this app, and suitable
+ for creating a shortcut to in the Launcher. If you wanted your app to have 5
+ different Activities available in the launcher, you could just make 5 activities
+ with that intent filter. Please don't do that. Just because it's a good example
+ doesn't mean it's a good idea. -->
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name"
+ android:uiOptions="splitActionBarWhenNarrow">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/java/com/example/android/advancedimmersivemode/AdvancedImmersiveModeFragment.java b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/java/com/example/android/advancedimmersivemode/AdvancedImmersiveModeFragment.java
new file mode 100644
index 0000000..fe11ecb
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/src/main/java/com/example/android/advancedimmersivemode/AdvancedImmersiveModeFragment.java
@@ -0,0 +1,174 @@
+/*
+* Copyright (C) 2012 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.
+*/
+package com.example.android.advancedimmersivemode;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+
+import com.example.android.common.logger.Log;
+
+/**
+ * Demonstrates how to update the app's UI by toggling immersive mode.
+ * Checkboxes are also made available for toggling other UI flags which can
+ * alter the behavior of immersive mode.
+ */
+public class AdvancedImmersiveModeFragment extends Fragment {
+
+ public static final String TAG = "AdvancedImmersiveModeFragment";
+ public CheckBox mHideNavCheckbox;
+ public CheckBox mHideStatusBarCheckBox;
+ public CheckBox mImmersiveModeCheckBox;
+ public CheckBox mImmersiveModeStickyCheckBox;
+ public CheckBox mLowProfileCheckBox;
+
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ final View decorView = getActivity().getWindow().getDecorView();
+ ViewGroup parentView = (ViewGroup) getActivity().getWindow().getDecorView()
+ .findViewById(R.id.sample_main_layout);
+
+ mLowProfileCheckBox = new CheckBox(getActivity());
+ mLowProfileCheckBox.setText("Enable Low Profile mode.");
+ parentView.addView(mLowProfileCheckBox);
+
+ mHideNavCheckbox = new CheckBox(getActivity());
+ mHideNavCheckbox.setChecked(true);
+ mHideNavCheckbox.setText("Hide Navigation bar");
+ parentView.addView(mHideNavCheckbox);
+
+ mHideStatusBarCheckBox = new CheckBox(getActivity());
+ mHideStatusBarCheckBox.setChecked(true);
+ mHideStatusBarCheckBox.setText("Hide Status Bar");
+ parentView.addView(mHideStatusBarCheckBox);
+
+ mImmersiveModeCheckBox = new CheckBox(getActivity());
+ mImmersiveModeCheckBox.setText("Enable Immersive Mode.");
+ parentView.addView(mImmersiveModeCheckBox);
+
+ mImmersiveModeStickyCheckBox = new CheckBox(getActivity());
+ mImmersiveModeStickyCheckBox.setText("Enable Immersive Mode (Sticky)");
+ parentView.addView(mImmersiveModeStickyCheckBox);
+
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.sample_action) {
+ toggleImmersiveMode();
+ }
+ return true;
+ }
+
+ /**
+ * Detects and toggles immersive mode (also known as "hidey bar" mode).
+ */
+ public void toggleImmersiveMode() {
+
+ // BEGIN_INCLUDE (get_current_ui_flags)
+ // The "Decor View" is the parent view of the Activity. It's also conveniently the easiest
+ // one to find from within a fragment, since there's a handy helper method to pull it, and
+ // we don't have to bother with picking a view somewhere deeper in the hierarchy and calling
+ // "findViewById" on it.
+ View decorView = getActivity().getWindow().getDecorView();
+ int uiOptions = decorView.getSystemUiVisibility();
+ int newUiOptions = uiOptions;
+ // END_INCLUDE (get_current_ui_flags)
+
+ // BEGIN_INCLUDE (toggle_lowprofile_mode)
+ // Low profile mode doesn't resize the screen at all, but it covers the nav & status bar
+ // icons with black so they're less distracting. Unlike "full screen" and "hide nav bar,"
+ // this mode doesn't interact with immersive mode at all, but it's instructive when running
+ // this sample to observe the differences in behavior.
+ if (mLowProfileCheckBox.isChecked()) {
+ newUiOptions |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
+ } else {
+ newUiOptions &= ~View.SYSTEM_UI_FLAG_LOW_PROFILE;
+ }
+ // END_INCLUDE (toggle_lowprofile_mode)
+
+ // BEGIN_INCLUDE (toggle_fullscreen_mode)
+ // When enabled, this flag hides non-critical UI, such as the status bar,
+ // which usually shows notification icons, battery life, etc
+ // on phone-sized devices. The bar reappears when the user swipes it down. When immersive
+ // mode is also enabled, the app-drawable area expands, and when the status bar is swiped
+ // down, it appears semi-transparently and slides in over the app, instead of pushing it
+ // down.
+ if (mHideStatusBarCheckBox.isChecked()) {
+ newUiOptions |= View.SYSTEM_UI_FLAG_FULLSCREEN;
+ } else {
+ newUiOptions &= ~View.SYSTEM_UI_FLAG_FULLSCREEN;
+ }
+ // END_INCLUDE (toggle_fullscreen_mode)
+
+ // BEGIN_INCLUDE (toggle_hidenav_mode)
+ // When enabled, this flag hides the black nav bar along the bottom,
+ // where the home/back buttons are. The nav bar normally instantly reappears
+ // when the user touches the screen. When immersive mode is also enabled, the nav bar
+ // stays hidden until the user swipes it back.
+ if (mHideNavCheckbox.isChecked()) {
+ newUiOptions |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ } else {
+ newUiOptions &= ~View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ }
+ // END_INCLUDE (toggle_hidenav_mode)
+
+ // BEGIN_INCLUDE (toggle_immersive_mode)
+ // Immersive mode doesn't do anything without at least one of the previous flags
+ // enabled. When enabled, it allows the user to swipe the status and/or nav bars
+ // off-screen. When the user swipes the bars back onto the screen, the flags are cleared
+ // and immersive mode is automatically disabled.
+ if (mImmersiveModeCheckBox.isChecked()) {
+ newUiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE;
+ } else {
+ newUiOptions &= ~View.SYSTEM_UI_FLAG_IMMERSIVE;
+ }
+ // END_INCLUDE (toggle_immersive_mode)
+
+ // BEGIN_INCLUDE (toggle_immersive_mode_sticky)
+ // There's actually two forms of immersive mode, normal and "sticky". Sticky immersive mode
+ // is different in 2 key ways:
+ //
+ // * Uses semi-transparent bars for the nav and status bars
+ // * This UI flag will *not* be cleared when the user interacts with the UI.
+ // When the user swipes, the bars will temporarily appear for a few seconds and then
+ // disappear again.
+ if (mImmersiveModeStickyCheckBox.isChecked()) {
+ newUiOptions |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+ } else {
+ newUiOptions &= ~View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
+ }
+ // END_INCLUDE (toggle_immersive_mode_sticky)
+
+ // BEGIN_INCLUDE (set_ui_flags)
+ //Set the new UI flags.
+ decorView.setSystemUiVisibility(newUiOptions);
+ Log.i(TAG, "Current height: " + decorView.getHeight() + ", width: " + decorView.getWidth());
+ // END_INCLUDE (set_ui_flags)
+ }
+}
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/AndroidManifest.xml b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..7117969
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.advancedimmersivemode.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="19"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.advancedimmersivemode"
+ android:label="Tests for com.example.android.advancedimmersivemode" />
+
+</manifest>
\ No newline at end of file
diff --git a/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/src/com/example/android/advancedimmersivemode/tests/SampleTests.java b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/src/com/example/android/advancedimmersivemode/tests/SampleTests.java
new file mode 100644
index 0000000..c51a488
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/AdvancedImmersiveModeSample/tests/src/com/example/android/advancedimmersivemode/tests/SampleTests.java
@@ -0,0 +1,126 @@
+/*
+* Copyright 2013 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.
+*/
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.advancedimmersivemode.tests;
+
+import com.example.android.advancedimmersivemode.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.UiThreadTest;
+
+/**
+* Tests for AdvancedImmersiveMode sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private AdvancedImmersiveModeFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ mTestActivity = getActivity();
+ mTestFragment = (AdvancedImmersiveModeFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+
+ /**
+ * Verify that the UI flags actually changed when the toggle method is called.
+ */
+ @UiThreadTest
+ public void testFlagsChanged() {
+ int uiFlags = getActivity().getWindow().getDecorView().getSystemUiVisibility();
+ mTestFragment.mImmersiveModeCheckBox.setChecked(true);
+ mTestFragment.mHideNavCheckbox.setChecked(true);
+ mTestFragment.mHideStatusBarCheckBox.setChecked(true);
+ mTestFragment.toggleImmersiveMode();
+ int newUiFlags = getActivity().getWindow().getDecorView().getSystemUiVisibility();
+ assertTrue("UI Flags didn't toggle.", uiFlags != newUiFlags);
+ }
+
+ /**
+ * Verify that the view's height actually changed when the toggle method is called.
+ * This should result in a change in height for the DecorView.
+ */
+ public void testDecorHeightExpanded() {
+ // Grab the initial height of the DecorWindow.
+ int startingHeight = getActivity().getWindow().getDecorView().getHeight();
+
+ // In order to test that this worked: Need to toggle the immersive mode on the UI thread,
+ // wait a suitable amount of time (this test goes with 200 ms), then check to see if the
+ // height changed.
+ try {
+ Runnable testRunnable = (new Runnable() {
+ public void run() {
+ // Toggle immersive mode
+ mTestFragment.mImmersiveModeCheckBox.setChecked(true);
+ mTestFragment.mHideNavCheckbox.setChecked(true);
+ mTestFragment.mHideStatusBarCheckBox.setChecked(true);
+ mTestFragment.toggleImmersiveMode();
+ synchronized(this) {
+ // Notify any thread waiting on this runnable that it can continue
+ this.notify();
+ }
+ }
+ });
+ synchronized(testRunnable) {
+ // Since toggling immersive mode makes changes to the view hierarchy, it needs to run
+ // on the UI thread, or crashing will occur.
+ mTestActivity.runOnUiThread(testRunnable);
+ testRunnable.wait();
+
+ }
+ synchronized(this) {
+ //Wait about 200ms for the change to take place
+ wait(200L);
+ }
+ } catch (Throwable throwable) {
+ fail(throwable.getMessage());
+ }
+
+ int expandedHeight = getActivity().getWindow().getDecorView().getHeight();
+ assertTrue("Bars aren't hidden.", expandedHeight != startingHeight);
+ }
+
+}
\ No newline at end of file
diff --git a/ui/window/AdvancedImmersiveMode/build.gradle b/ui/window/AdvancedImmersiveMode/build.gradle
new file mode 100644
index 0000000..c7f6491
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/build.gradle
@@ -0,0 +1,8 @@
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/window/AdvancedImmersiveMode/buildSrc/build.gradle
similarity index 64%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/window/AdvancedImmersiveMode/buildSrc/build.gradle
index 8c294c2..7cebf71 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/window/AdvancedImmersiveMode/buildSrc/build.gradle
@@ -8,7 +8,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar b/ui/window/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
copy to ui/window/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/ui/window/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties
similarity index 94%
rename from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
rename to ui/window/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/window/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/ImmersiveMode/gradlew b/ui/window/AdvancedImmersiveMode/gradlew
similarity index 100%
copy from ui/ImmersiveMode/gradlew
copy to ui/window/AdvancedImmersiveMode/gradlew
diff --git a/ui/ImmersiveMode/gradlew.bat b/ui/window/AdvancedImmersiveMode/gradlew.bat
similarity index 100%
copy from ui/ImmersiveMode/gradlew.bat
copy to ui/window/AdvancedImmersiveMode/gradlew.bat
diff --git a/ui/window/AdvancedImmersiveMode/settings.gradle b/ui/window/AdvancedImmersiveMode/settings.gradle
new file mode 100644
index 0000000..0f7ed4b
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/settings.gradle
@@ -0,0 +1 @@
+include 'AdvancedImmersiveModeSample'
diff --git a/ui/window/AdvancedImmersiveMode/template-params.xml b/ui/window/AdvancedImmersiveMode/template-params.xml
new file mode 100644
index 0000000..0f23700
--- /dev/null
+++ b/ui/window/AdvancedImmersiveMode/template-params.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<sample>
+ <name>AdvancedImmersiveMode</name>
+ <group>UI</group>
+ <package>com.example.android.advancedimmersivemode</package>
+
+
+ <!-- change minSdk if needed-->
+ <minSdk>4</minSdk>
+ <compileSdkVersion>19</compileSdkVersion>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ \"Immersive Mode\" is a new UI mode which improves \"hide full screen\" and
+ \"hide nav bar\" modes, by letting users swipe the bars in and out. This sample
+ lets the user experiment with immersive mode by enabling it and seeing how it interacts
+ with some of the other UI flags related to full-screen apps.
+ \n\nThis sample also lets the user choose between normal immersive mode and "sticky"
+ immersive mode, which removes the status bar and nav bar
+ a few seconds after the user has swiped them back in.
+ ]]>
+ </intro>
+ <sample_action>Try these settings!</sample_action>
+ </strings>
+
+ <template src="base"/>
+ <template src="SingleView"/>
+ <common src="logger"/>
+ <common src="activities"/>
+
+</sample>
diff --git a/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/.gitignore b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/README-singleview.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/README-singleview.txt
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/proguard-project.txt
diff --git a/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/AndroidManifest.xml b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..00b4e3c
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/AndroidManifest.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.basicimmersivemode"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
+
+ <application android:allowBackup="true"
+ android:label="@string/app_name"
+ android:icon="@drawable/ic_launcher"
+ android:theme="@style/AppTheme">
+
+ <activity android:name=".MainActivity"
+ android:label="@string/app_name"
+ android:uiOptions="splitActionBarWhenNarrow">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/java/com/example/android/basicimmersivemode/BasicImmersiveModeFragment.java
similarity index 74%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/java/com/example/android/basicimmersivemode/BasicImmersiveModeFragment.java
index d9c4fb8..a675e05 100644
--- a/ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
+++ b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/java/com/example/android/basicimmersivemode/BasicImmersiveModeFragment.java
@@ -1,5 +1,5 @@
/*
-* Copyright (C) 2012 The Android Open Source Project
+* Copyright (C) 2013 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.
@@ -13,9 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.example.android.immersivemode;
+package com.example.android.basicimmersivemode;
-import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.MenuItem;
@@ -23,9 +22,9 @@
import com.example.android.common.logger.Log;
-public class ImmersiveModeFragment extends Fragment {
+public class BasicImmersiveModeFragment extends Fragment {
- public static final String TAG = "ImmersiveModeFragment";
+ public static final String TAG = "BasicImmersiveModeFragment";
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -56,10 +55,9 @@
}
/**
- * Detects and toggles immersive mode (also known as "hidey bar" mode).
+ * Detects and toggles immersive mode.
*/
public void toggleHideyBar() {
-
// BEGIN_INCLUDE (get_current_ui_flags)
// The UI options currently enabled are represented by a bitfield.
// getSystemUiVisibility() gives us that bitfield.
@@ -68,31 +66,22 @@
// END_INCLUDE (get_current_ui_flags)
// BEGIN_INCLUDE (toggle_ui_flags)
boolean isImmersiveModeEnabled =
- ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE) == uiOptions);
+ ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);
if (isImmersiveModeEnabled) {
Log.i(TAG, "Turning immersive mode mode off. ");
} else {
Log.i(TAG, "Turning immersive mode mode on.");
}
- // Navigation bar hiding: Backwards compatible to ICS.
- if (Build.VERSION.SDK_INT >= 14) {
- newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
- }
-
- // Status bar hiding: Backwards compatible to Jellybean
- if (Build.VERSION.SDK_INT >= 16) {
- newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
- }
-
- // Immersive mode: Backward compatible to KitKat.
+ // Immersive mode: Backward compatible to KitKat (API 19).
// Note that this flag doesn't do anything by itself, it only augments the behavior
// of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample
// all three flags are being toggled together.
- if (Build.VERSION.SDK_INT >= 18) {
- newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE;
- }
-
+ // This sample uses the "sticky" form of immersive mode, which will let the user swipe
+ // the bars back in again, but will automatically make them disappear a few seconds later.
+ newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
+ newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;
+ newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
getActivity().getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
//END_INCLUDE (set_ui_flags)
}
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
copy to ui/window/BasicImmersiveMode/BasicImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/AndroidManifest.xml b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..070368c
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.basicimmersivemode.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="19"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.basicimmersivemode"
+ android:label="Tests for com.example.android.basicimmersivemode" />
+
+</manifest>
\ No newline at end of file
diff --git a/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/src/com/example/android/basicimmersivemode/tests/SampleTests.java b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/src/com/example/android/basicimmersivemode/tests/SampleTests.java
new file mode 100644
index 0000000..31c25bb
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/BasicImmersiveModeSample/tests/src/com/example/android/basicimmersivemode/tests/SampleTests.java
@@ -0,0 +1,124 @@
+/*
+* Copyright 2013 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.
+*/
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.basicimmersivemode.tests;
+
+import com.example.android.basicimmersivemode.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+import android.test.UiThreadTest;
+
+/**
+* Tests for immersive mode sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private BasicImmersiveModeFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (BasicImmersiveModeFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Verify that the UI flags actually changed when the toggle method is called.
+ */
+ @UiThreadTest
+ public void testFlagsChanged() {
+ int uiFlags = getActivity().getWindow().getDecorView().getSystemUiVisibility();
+ mTestFragment.toggleHideyBar();
+ int newUiFlags = getActivity().getWindow().getDecorView().getSystemUiVisibility();
+ assertTrue("UI Flags didn't toggle.", uiFlags != newUiFlags);
+ }
+
+ /**
+ * Verify that the view's height actually changed when the toggle method is called.
+ * This should result in a change in height for the DecorView.
+ */
+ public void testDecorHeightExpanded() {
+ // Grab the initial height of the DecorWindow.
+ int startingHeight = getActivity().getWindow().getDecorView().getHeight();
+
+ // In order to test that this worked: Need to toggle the immersive mode on the UI thread,
+ // wait a suitable amount of time (this test goes with 200 ms), then check to see if the
+ // height changed.
+ try {
+ Runnable testRunnable = (new Runnable() {
+ public void run() {
+ // Toggle immersive mode
+ mTestFragment.toggleHideyBar();
+ synchronized(this) {
+ // Notify any thread waiting on this runnable that it can continue
+ this.notify();
+ }
+ }
+ });
+ synchronized(testRunnable) {
+ // Since toggling immersive mode makes changes to the view heirarchy, it needs to run
+ // on the UI thread, or crashing will occur.
+ mTestActivity.runOnUiThread(testRunnable);
+ testRunnable.wait();
+
+ }
+ synchronized(this) {
+ //Wait about 200ms for the change to take place
+ wait(200L);
+ }
+ } catch (Throwable throwable) {
+ fail(throwable.getMessage());
+ }
+
+ int expandedHeight = getActivity().getWindow().getDecorView().getHeight();
+ assertTrue("Bars aren't hidden.", expandedHeight != startingHeight);
+ }
+}
\ No newline at end of file
diff --git a/ui/window/BasicImmersiveMode/build.gradle b/ui/window/BasicImmersiveMode/build.gradle
new file mode 100644
index 0000000..ffb5c2f
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/build.gradle
@@ -0,0 +1,11 @@
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/window/BasicImmersiveMode/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/window/BasicImmersiveMode/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/window/BasicImmersiveMode/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar b/ui/window/BasicImmersiveMode/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
copy to ui/window/BasicImmersiveMode/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/ui/window/BasicImmersiveMode/gradle/wrapper/gradle-wrapper.properties
similarity index 94%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
copy to ui/window/BasicImmersiveMode/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/window/BasicImmersiveMode/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/ImmersiveMode/gradlew b/ui/window/BasicImmersiveMode/gradlew
similarity index 100%
copy from ui/ImmersiveMode/gradlew
copy to ui/window/BasicImmersiveMode/gradlew
diff --git a/ui/ImmersiveMode/gradlew.bat b/ui/window/BasicImmersiveMode/gradlew.bat
similarity index 100%
copy from ui/ImmersiveMode/gradlew.bat
copy to ui/window/BasicImmersiveMode/gradlew.bat
diff --git a/ui/window/BasicImmersiveMode/settings.gradle b/ui/window/BasicImmersiveMode/settings.gradle
new file mode 100644
index 0000000..8dda383
--- /dev/null
+++ b/ui/window/BasicImmersiveMode/settings.gradle
@@ -0,0 +1,4 @@
+
+
+
+include 'BasicImmersiveModeSample'
diff --git a/ui/ImmersiveMode/template-params.xml b/ui/window/BasicImmersiveMode/template-params.xml
similarity index 60%
copy from ui/ImmersiveMode/template-params.xml
copy to ui/window/BasicImmersiveMode/template-params.xml
index 9ee55ae..1335908 100644
--- a/ui/ImmersiveMode/template-params.xml
+++ b/ui/window/BasicImmersiveMode/template-params.xml
@@ -15,23 +15,25 @@
limitations under the License.
-->
<sample>
- <name>ImmersiveMode</name>
- <package>com.example.android.immersivemode</package>
- <compileSdkVersion>"android-KeyLimePie"</compileSdkVersion>
+ <name>BasicImmersiveMode</name>
+ <group>UI</group>
+ <package>com.example.android.basicimmersivemode</package>
+
- <!--TODO: change minSdk if needed-->
- <minSdk>4</minSdk>
+ <!-- change minSdk if needed-->
+ <minSdk>19</minSdk>
+ <compileSdkVersion>19</compileSdkVersion>
<strings>
<intro>
<![CDATA[
- One of the features introduced in KitKat is "immersive mode". Immersive mode gives the
- user the ability to show/hide the status bar and navigation bar with a swipe. To try,
- click the "Toggle immersive mode" button, then try swiping the bar in and out!
+ \"Immersive Mode\" is a new UI mode which improves \"hide full screen\" and
+ \"hide nav bar\" modes, by letting users swipe the bars in and out. This sample
+ demonstrates how to enable and disable immersive mode programmatically.
]]>
</intro>
- <sample_action>Toggle immersive mode!</sample_action>
+ <sample_action>Toggle Immersive Mode!</sample_action>
</strings>
<template src="base"/>
diff --git a/ui/window/ImmersiveMode/ImmersiveModeSample/.gitignore b/ui/window/ImmersiveMode/ImmersiveModeSample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/ui/window/ImmersiveMode/ImmersiveModeSample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt b/ui/window/ImmersiveMode/ImmersiveModeSample/README-singleview.txt
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/README-singleview.txt
rename to ui/window/ImmersiveMode/ImmersiveModeSample/README-singleview.txt
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/ui/window/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
rename to ui/window/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/AndroidManifest.xml b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/AndroidManifest.xml
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/AndroidManifest.xml
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/AndroidManifest.xml
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
similarity index 88%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
index d9c4fb8..8a7255c 100644
--- a/ui/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
+++ b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/java/com/example/android/immersivemode/ImmersiveModeFragment.java
@@ -68,7 +68,7 @@
// END_INCLUDE (get_current_ui_flags)
// BEGIN_INCLUDE (toggle_ui_flags)
boolean isImmersiveModeEnabled =
- ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE) == uiOptions);
+ ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);
if (isImmersiveModeEnabled) {
Log.i(TAG, "Turning immersive mode mode off. ");
} else {
@@ -89,8 +89,12 @@
// Note that this flag doesn't do anything by itself, it only augments the behavior
// of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample
// all three flags are being toggled together.
+ // Note that there are two immersive mode UI flags, one of which is referred to as "sticky".
+ // Sticky immersive mode differs in that it makes the navigation and status bars
+ // semi-transparent, and the UI flag does not get cleared when the user interacts with
+ // the screen.
if (Build.VERSION.SDK_INT >= 18) {
- newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE;
+ newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
}
getActivity().getWindow().getDecorView().setSystemUiVisibility(newUiOptions);
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to ui/window/ImmersiveMode/ImmersiveModeSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/tests/AndroidManifest.xml b/ui/window/ImmersiveMode/ImmersiveModeSample/tests/AndroidManifest.xml
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/tests/AndroidManifest.xml
rename to ui/window/ImmersiveMode/ImmersiveModeSample/tests/AndroidManifest.xml
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/ImmersiveModeSampleTests.java b/ui/window/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/ImmersiveModeSampleTests.java
similarity index 100%
rename from ui/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/ImmersiveModeSampleTests.java
rename to ui/window/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/ImmersiveModeSampleTests.java
diff --git a/ui/window/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/SampleTests.java b/ui/window/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/SampleTests.java
new file mode 100644
index 0000000..162b3bd
--- /dev/null
+++ b/ui/window/ImmersiveMode/ImmersiveModeSample/tests/src/com/example/android/immersivemode/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* Copyright 2013 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.
+*/
+
+
+
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.immersivemode.tests;
+
+import com.example.android.immersivemode.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for ImmersiveMode sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private ImmersiveModeFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (ImmersiveModeFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Add more tests below.
+ */
+
+}
\ No newline at end of file
diff --git a/ui/window/ImmersiveMode/build.gradle b/ui/window/ImmersiveMode/build.gradle
new file mode 100644
index 0000000..ffb5c2f
--- /dev/null
+++ b/ui/window/ImmersiveMode/build.gradle
@@ -0,0 +1,11 @@
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/ui/window/ImmersiveMode/buildSrc/build.gradle
similarity index 63%
copy from ui/ImmersiveMode/buildSrc/build.gradle
copy to ui/window/ImmersiveMode/buildSrc/build.gradle
index 8c294c2..e344a8c 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/ui/window/ImmersiveMode/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
@@ -8,7 +11,7 @@
sourceSets {
main {
groovy {
- srcDir new File(rootDir, "../../../../../build/buildSrc/src/main/groovy")
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
}
}
}
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar b/ui/window/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
rename to ui/window/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/ui/window/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
similarity index 94%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
copy to ui/window/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/ui/window/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/ImmersiveMode/gradlew b/ui/window/ImmersiveMode/gradlew
similarity index 100%
rename from ui/ImmersiveMode/gradlew
rename to ui/window/ImmersiveMode/gradlew
diff --git a/ui/ImmersiveMode/gradlew.bat b/ui/window/ImmersiveMode/gradlew.bat
similarity index 100%
rename from ui/ImmersiveMode/gradlew.bat
rename to ui/window/ImmersiveMode/gradlew.bat
diff --git a/ui/ImmersiveMode/settings.gradle b/ui/window/ImmersiveMode/settings.gradle
similarity index 90%
rename from ui/ImmersiveMode/settings.gradle
rename to ui/window/ImmersiveMode/settings.gradle
index 409c461..d13a7a1 100644
--- a/ui/ImmersiveMode/settings.gradle
+++ b/ui/window/ImmersiveMode/settings.gradle
@@ -1 +1,4 @@
+
+
+
include 'ImmersiveModeSample'
diff --git a/ui/ImmersiveMode/template-params.xml b/ui/window/ImmersiveMode/template-params.xml
similarity index 94%
rename from ui/ImmersiveMode/template-params.xml
rename to ui/window/ImmersiveMode/template-params.xml
index 9ee55ae..e053d26 100644
--- a/ui/ImmersiveMode/template-params.xml
+++ b/ui/window/ImmersiveMode/template-params.xml
@@ -16,8 +16,10 @@
-->
<sample>
<name>ImmersiveMode</name>
+ <group>UI</group>
<package>com.example.android.immersivemode</package>
- <compileSdkVersion>"android-KeyLimePie"</compileSdkVersion>
+
+ <compileSdkVersion>19</compileSdkVersion>
<!--TODO: change minSdk if needed-->
<minSdk>4</minSdk>
diff --git a/views/TextLinkify/AndroidManifest.xml b/views/TextLinkify/AndroidManifest.xml
deleted file mode 100644
index 0bf9b97..0000000
--- a/views/TextLinkify/AndroidManifest.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2013 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.views.textlinkify"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="4"
- android:targetSdkVersion="17" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.android.views.textlinkify.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
diff --git a/views/TextLinkify/TextLinkify/build.gradle b/views/TextLinkify/TextLinkify/build.gradle
deleted file mode 100644
index ae56fea..0000000
--- a/views/TextLinkify/TextLinkify/build.gradle
+++ /dev/null
@@ -1,18 +0,0 @@
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:0.5.+'
- }
-}
-apply plugin: 'android'
-
-dependencies {
- compile "com.android.support:support-v4:18.0.+"
-}
-
-android {
- compileSdkVersion 18
- buildToolsVersion "18.0.1"
-}
diff --git a/views/TextLinkify/TextLinkify/src/main/AndroidManifest.xml b/views/TextLinkify/TextLinkify/src/main/AndroidManifest.xml
deleted file mode 100644
index 0bf9b97..0000000
--- a/views/TextLinkify/TextLinkify/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright 2013 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.
--->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.example.android.views.textlinkify"
- android:versionCode="1"
- android:versionName="1.0" >
-
- <uses-sdk
- android:minSdkVersion="4"
- android:targetSdkVersion="17" />
-
- <application
- android:allowBackup="true"
- android:icon="@drawable/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme" >
- <activity
- android:name="com.example.android.views.textlinkify.MainActivity"
- android:label="@string/app_name" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values-v11/styles.xml b/views/TextLinkify/TextLinkify/src/main/res/values-v11/styles.xml
deleted file mode 100644
index 91f4523..0000000
--- a/views/TextLinkify/TextLinkify/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Holo.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values/styles.xml b/views/TextLinkify/TextLinkify/src/main/res/values/styles.xml
deleted file mode 100644
index 91da12c..0000000
--- a/views/TextLinkify/TextLinkify/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<!--
- Copyright 2013 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.
--->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-
- <!--
- Base application theme, dependent on API level. This theme is replaced
- by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
- -->
- <style name="AppBaseTheme" parent="android:Theme.Light">
- <!--
- Theme customizations available in newer API levels can go in
- res/values-vXX/styles.xml, while customizations related to
- backward-compatibility can go here.
- -->
- </style>
-
- <!-- Application theme. -->
- <style name="AppTheme" parent="AppBaseTheme">
- <!-- All customizations that are NOT specific to a particular API-level can go here. -->
- </style>
-
- <style name="LinkText">
- <item name="android:paddingTop">9dp</item>
- <item name="android:paddingBottom">9dp</item>
- </style>
-</resources>
diff --git a/views/TextLinkify/TextLinkifySample/.gitignore b/views/TextLinkify/TextLinkifySample/.gitignore
new file mode 100644
index 0000000..6eb878d
--- /dev/null
+++ b/views/TextLinkify/TextLinkifySample/.gitignore
@@ -0,0 +1,16 @@
+# Copyright 2013 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.
+src/template/
+src/common/
+build.gradle
diff --git a/ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt b/views/TextLinkify/TextLinkifySample/proguard-project.txt
similarity index 100%
copy from ui/ImmersiveMode/ImmersiveModeSample/proguard-project.txt
copy to views/TextLinkify/TextLinkifySample/proguard-project.txt
diff --git a/views/TextLinkify/TextLinkifySample/src/main/AndroidManifest.xml b/views/TextLinkify/TextLinkifySample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..49b4eae
--- /dev/null
+++ b/views/TextLinkify/TextLinkifySample/src/main/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.textlinkify"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="4"
+ android:targetSdkVersion="17" />
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".MainActivity"
+ android:label="@string/app_name" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/views/TextLinkify/TextLinkify/src/main/java/com/example/android/views/textlinkify/MainActivity.java b/views/TextLinkify/TextLinkifySample/src/main/java/com/example/android/textlinkify/MainActivity.java
similarity index 96%
rename from views/TextLinkify/TextLinkify/src/main/java/com/example/android/views/textlinkify/MainActivity.java
rename to views/TextLinkify/TextLinkifySample/src/main/java/com/example/android/textlinkify/MainActivity.java
index 9e5a7c9..c9325a9 100644
--- a/views/TextLinkify/TextLinkify/src/main/java/com/example/android/views/textlinkify/MainActivity.java
+++ b/views/TextLinkify/TextLinkifySample/src/main/java/com/example/android/textlinkify/MainActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.example.android.views.textlinkify;
+package com.example.android.textlinkify;
import android.app.Activity;
import android.graphics.Typeface;
@@ -29,7 +29,7 @@
/**
* This sample demonstrates how clickable links can be added to a
- * {@link TextView}.
+ * {@link android.widget.TextView}.
*
* <p>This can be done in three ways:
* <ul>
@@ -38,7 +38,7 @@
* {@link android.widget.TextView#setAutoLinkMask(int)} using an option from
* {@link android.text.util.Linkify}</li>
*
- * <li><b>Parsing a String as HTML:</b> See {@link Html#fromHtml(String)})</li>
+ * <li><b>Parsing a String as HTML:</b> See {@link android.text.Html#fromHtml(String)})</li>
*
* <li><b>Manually by constructing a {@link android.text.SpannableString}:</b> Consisting of
* {@link android.text.style.StyleSpan} and {@link android.text.style.URLSpan} objects that
@@ -52,7 +52,7 @@
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
+ setContentView(R.layout.sample_main);
// BEGIN_INCLUDE(text_auto_linkify)
/*
diff --git a/views/TextLinkify/TextLinkify/src/main/res/drawable-hdpi/ic_launcher.png b/views/TextLinkify/TextLinkifySample/src/main/res/drawable-hdpi/ic_launcher.png
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/drawable-hdpi/ic_launcher.png
rename to views/TextLinkify/TextLinkifySample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/views/TextLinkify/TextLinkify/src/main/res/drawable-mdpi/ic_launcher.png b/views/TextLinkify/TextLinkifySample/src/main/res/drawable-mdpi/ic_launcher.png
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/drawable-mdpi/ic_launcher.png
rename to views/TextLinkify/TextLinkifySample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/views/TextLinkify/TextLinkify/src/main/res/drawable-xhdpi/ic_launcher.png b/views/TextLinkify/TextLinkifySample/src/main/res/drawable-xhdpi/ic_launcher.png
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/drawable-xhdpi/ic_launcher.png
rename to views/TextLinkify/TextLinkifySample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/views/TextLinkify/TextLinkify/src/main/res/drawable-xxhdpi/ic_launcher.png b/views/TextLinkify/TextLinkifySample/src/main/res/drawable-xxhdpi/ic_launcher.png
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/drawable-xxhdpi/ic_launcher.png
rename to views/TextLinkify/TextLinkifySample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/views/TextLinkify/TextLinkify/src/main/res/layout/activity_main.xml b/views/TextLinkify/TextLinkifySample/src/main/res/layout/sample_main.xml
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/layout/activity_main.xml
rename to views/TextLinkify/TextLinkifySample/src/main/res/layout/sample_main.xml
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values-sw720dp-land/dimens.xml b/views/TextLinkify/TextLinkifySample/src/main/res/values-sw720dp-land/dimens.xml
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/values-sw720dp-land/dimens.xml
rename to views/TextLinkify/TextLinkifySample/src/main/res/values-sw720dp-land/dimens.xml
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values/dimens.xml b/views/TextLinkify/TextLinkifySample/src/main/res/values/dimens.xml
similarity index 100%
rename from views/TextLinkify/TextLinkify/src/main/res/values/dimens.xml
rename to views/TextLinkify/TextLinkifySample/src/main/res/values/dimens.xml
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values/strings.xml b/views/TextLinkify/TextLinkifySample/src/main/res/values/strings.xml
similarity index 97%
rename from views/TextLinkify/TextLinkify/src/main/res/values/strings.xml
rename to views/TextLinkify/TextLinkifySample/src/main/res/values/strings.xml
index 371ee69..c50774e 100644
--- a/views/TextLinkify/TextLinkify/src/main/res/values/strings.xml
+++ b/views/TextLinkify/TextLinkifySample/src/main/res/values/strings.xml
@@ -17,7 +17,6 @@
<resources>
- <string name="app_name">TextLinkify Sample</string>
<string name="intro">This sample illustrates how links can be added to a TextView.
\nThis can be done either automatically by setting the <i>autoLink</i> property
or explicitly.</string>
diff --git a/views/TextLinkify/TextLinkify/src/main/res/values-sw600dp/dimens.xml b/views/TextLinkify/TextLinkifySample/src/main/res/values/styles.xml
similarity index 73%
rename from views/TextLinkify/TextLinkify/src/main/res/values-sw600dp/dimens.xml
rename to views/TextLinkify/TextLinkifySample/src/main/res/values/styles.xml
index 686fe89..29c4230 100644
--- a/views/TextLinkify/TextLinkify/src/main/res/values-sw600dp/dimens.xml
+++ b/views/TextLinkify/TextLinkifySample/src/main/res/values/styles.xml
@@ -14,11 +14,9 @@
limitations under the License.
-->
-<resources>
-
- <!--
- Customize dimensions originally defined in res/values/dimens.xml (such as
- screen margins) for sw600dp devices (e.g. 7" tablets) here.
- -->
-
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+ <style name="LinkText">
+ <item name="android:paddingTop">9dp</item>
+ <item name="android:paddingBottom">9dp</item>
+ </style>
</resources>
diff --git a/views/TextLinkify/TextLinkifySample/tests/AndroidManifest.xml b/views/TextLinkify/TextLinkifySample/tests/AndroidManifest.xml
new file mode 100644
index 0000000..e368f05
--- /dev/null
+++ b/views/TextLinkify/TextLinkifySample/tests/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2013 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.
+ -->
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.textlinkify.tests"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="18"
+ android:targetSdkVersion="19" />
+
+ <!-- We add an application tag here just so that we can indicate that
+ this package needs to link against the android.test library,
+ which is needed when building test cases. -->
+ <application>
+ <uses-library android:name="android.test.runner" />
+ </application>
+
+ <!--
+ Specifies the instrumentation test runner used to run the tests.
+ -->
+ <instrumentation
+ android:name="android.test.InstrumentationTestRunner"
+ android:targetPackage="com.example.android.textlinkify"
+ android:label="Tests for com.example.android.textlinkify" />
+
+</manifest>
\ No newline at end of file
diff --git a/views/TextLinkify/TextLinkifySample/tests/src/com/example/android/textlinkify/tests/SampleTests.java b/views/TextLinkify/TextLinkifySample/tests/src/com/example/android/textlinkify/tests/SampleTests.java
new file mode 100644
index 0000000..90a91cc
--- /dev/null
+++ b/views/TextLinkify/TextLinkifySample/tests/src/com/example/android/textlinkify/tests/SampleTests.java
@@ -0,0 +1,79 @@
+/*
+* Copyright 2013 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.
+*/
+
+
+
+/*
+* Copyright (C) 2013 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.
+*/
+package com.example.android.textlinkify.tests;
+
+import com.example.android.textlinkify.*;
+
+import android.test.ActivityInstrumentationTestCase2;
+
+/**
+* Tests for TextLinkify sample.
+*/
+public class SampleTests extends ActivityInstrumentationTestCase2<MainActivity> {
+
+ private MainActivity mTestActivity;
+ private TextLinkifyFragment mTestFragment;
+
+ public SampleTests() {
+ super(MainActivity.class);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // Starts the activity under test using the default Intent with:
+ // action = {@link Intent#ACTION_MAIN}
+ // flags = {@link Intent#FLAG_ACTIVITY_NEW_TASK}
+ // All other fields are null or empty.
+ mTestActivity = getActivity();
+ mTestFragment = (TextLinkifyFragment)
+ mTestActivity.getSupportFragmentManager().getFragments().get(1);
+ }
+
+ /**
+ * Test if the test fixture has been set up correctly.
+ */
+ public void testPreconditions() {
+ //Try to add a message to add context to your assertions. These messages will be shown if
+ //a tests fails and make it easy to understand why a test failed
+ assertNotNull("mTestActivity is null", mTestActivity);
+ assertNotNull("mTestFragment is null", mTestFragment);
+ }
+
+ /**
+ * Add more tests below.
+ */
+
+}
\ No newline at end of file
diff --git a/views/TextLinkify/build.gradle b/views/TextLinkify/build.gradle
index 495c503..c886d80 100644
--- a/views/TextLinkify/build.gradle
+++ b/views/TextLinkify/build.gradle
@@ -1 +1,11 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+
+
+
+// BEGIN_EXCLUDE
+apply from: "../../../../build/build.gradle"
+samplegen {
+ pathToBuild "../../../../build"
+ pathToSamplesCommon "../../common"
+}
+// END_EXCLUDE
diff --git a/ui/ImmersiveMode/buildSrc/build.gradle b/views/TextLinkify/buildSrc/build.gradle
similarity index 98%
rename from ui/ImmersiveMode/buildSrc/build.gradle
rename to views/TextLinkify/buildSrc/build.gradle
index 8c294c2..29282af 100644
--- a/ui/ImmersiveMode/buildSrc/build.gradle
+++ b/views/TextLinkify/buildSrc/build.gradle
@@ -1,3 +1,6 @@
+
+
+
repositories {
mavenCentral()
}
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar b/views/TextLinkify/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.jar
copy to views/TextLinkify/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/views/TextLinkify/gradle/wrapper/gradle-wrapper.properties
similarity index 93%
copy from ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
copy to views/TextLinkify/gradle/wrapper/gradle-wrapper.properties
index 5c22dec..861eddc 100644
--- a/ui/ImmersiveMode/gradle/wrapper/gradle-wrapper.properties
+++ b/views/TextLinkify/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.6-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
diff --git a/ui/ImmersiveMode/gradlew b/views/TextLinkify/gradlew
similarity index 100%
copy from ui/ImmersiveMode/gradlew
copy to views/TextLinkify/gradlew
diff --git a/ui/ImmersiveMode/gradlew.bat b/views/TextLinkify/gradlew.bat
similarity index 100%
copy from ui/ImmersiveMode/gradlew.bat
copy to views/TextLinkify/gradlew.bat
diff --git a/views/TextLinkify/settings.gradle b/views/TextLinkify/settings.gradle
index 2042982..38e7ddd 100644
--- a/views/TextLinkify/settings.gradle
+++ b/views/TextLinkify/settings.gradle
@@ -1,2 +1,4 @@
-include ':TextLinkify'
+
+
+include 'TextLinkifySample'
diff --git a/views/TextLinkify/template-params.xml b/views/TextLinkify/template-params.xml
new file mode 100644
index 0000000..c703b8b
--- /dev/null
+++ b/views/TextLinkify/template-params.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 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.
+-->
+
+<sample>
+ <name>TextLinkify</name>
+ <group>Views</group>
+ <package>com.example.android.textlinkify</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>4</minSdk>
+
+ <strings>
+ <intro>
+ <![CDATA[
+ This sample illustrates how links can be added to a TextView. This can be done either
+ automatically by setting the "autoLink" property or explicitly.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <common src="logger"/>
+
+</sample>
diff --git a/views/TextLinkify/textLinkify.jd b/views/TextLinkify/textLinkify.jd
deleted file mode 100644
index ca39b7b..0000000
--- a/views/TextLinkify/textLinkify.jd
+++ /dev/null
@@ -1,15 +0,0 @@
-page.title=Linkify Sample
-@jd:body
-<p>This sample demonstrates how clickable links can be added to a
- <a href="http://developer.android.com/reference/android/widget/TextView.html">TextView</a>.
- This can be done automatically (see
- <a href="http://developer.android.com/reference/android/widget/TextView.html#setAutoLinkMask(int)">
-TextView#setAutoLinkMask(int)</a>), explicitly by parsing a String as
- HTML (see
- <a href="http://developer.android.com/reference/android/text/Html.html#fromHtml(java.lang.String)">
- Html#fromHtml(String)</a>) or using a
- <a href="http://developer.android.com/reference/android/text/SpannableString.html">SpannableString
-</a> consisting of
- <a href="http://developer.android.com/reference/android/text/style/StyleSpan.html">StyleSpan</a>
- and <a href="http://developer.android.com/reference/android/text/style/URLSpan.html">URLSpan</a>
- objects. </p>
\ No newline at end of file