Merge "Fix lint warnings in TextViewCompat." into oc-mr1-dev
diff --git a/api/26.1.0-SNAPSHOT.txt b/api/26.1.0-SNAPSHOT.txt
index 338e280..a6d52b1 100644
--- a/api/26.1.0-SNAPSHOT.txt
+++ b/api/26.1.0-SNAPSHOT.txt
@@ -7017,10 +7017,6 @@
method public static java.lang.String[] matchesMany(java.lang.String[], java.lang.String);
}
- public final deprecated class ParallelExecutorCompat {
- method public static deprecated java.util.concurrent.Executor getParallelExecutor();
- }
-
public final class PermissionChecker {
method public static int checkCallingOrSelfPermission(android.content.Context, java.lang.String);
method public static int checkCallingPermission(android.content.Context, java.lang.String, java.lang.String);
@@ -7089,9 +7085,6 @@
public final class ConfigurationHelper {
method public static int getDensityDpi(android.content.res.Resources);
- method public static deprecated int getScreenHeightDp(android.content.res.Resources);
- method public static deprecated int getScreenWidthDp(android.content.res.Resources);
- method public static deprecated int getSmallestScreenWidthDp(android.content.res.Resources);
}
public final class ResourcesCompat {
@@ -8185,7 +8178,6 @@
public final class TextUtilsCompat {
method public static int getLayoutDirectionFromLocale(java.util.Locale);
method public static java.lang.String htmlEncode(java.lang.String);
- field public static final deprecated java.util.Locale ROOT;
}
}
diff --git a/app-toolkit/core-testing/src/main/AndroidManifest.xml b/app-toolkit/core-testing/src/main/AndroidManifest.xml
index 83e0d83..2d55b39 100644
--- a/app-toolkit/core-testing/src/main/AndroidManifest.xml
+++ b/app-toolkit/core-testing/src/main/AndroidManifest.xml
@@ -14,5 +14,10 @@
~ limitations under the License.
-->
-<manifest package="android.arch.core.testing">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="android.arch.core.testing">
+ <application>
+ <meta-data android:name="android.arch.core.testing.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/app-toolkit/dependencies.gradle b/app-toolkit/dependencies.gradle
index ab62b15..c9e3dea 100644
--- a/app-toolkit/dependencies.gradle
+++ b/app-toolkit/dependencies.gradle
@@ -84,5 +84,4 @@
ext.tools.current_sdk = gradle.ext.currentSdk
ext.tools.build_tools_version = rootProject.ext.buildToolsVersion
ext.flatfoot = [:]
-ext.flatfoot.release_version = "1.0.0-alpha7"
ext.flatfoot.min_sdk = 14
diff --git a/app-toolkit/gradle/wrapper/gradle-wrapper.properties b/app-toolkit/gradle/wrapper/gradle-wrapper.properties
index 1b987ef..54575d6 100644
--- a/app-toolkit/gradle/wrapper/gradle-wrapper.properties
+++ b/app-toolkit/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=../../../../../tools/external/gradle/gradle-4.1-milestone-1-bin.zip
+distributionUrl=../../../../../tools/external/gradle/gradle-4.1-rc-2-bin.zip
diff --git a/app-toolkit/init.gradle b/app-toolkit/init.gradle
index fab8e17..fe32308 100644
--- a/app-toolkit/init.gradle
+++ b/app-toolkit/init.gradle
@@ -13,6 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+import android.support.LibraryVersions
import org.gradle.internal.os.OperatingSystem
def root = ext.supportRootFolder
@@ -20,7 +22,6 @@
if (ext.inAppToolkitProject) {
apply from: "${ext.supportRootFolder}/buildSrc/init.gradle"
- init.loadDefaultVersions()
init.setSdkInLocalPropertiesFile()
}
@@ -91,7 +92,7 @@
def zipFlatfootDocsTask = rootProject.tasks.create(name : "createFlatfootDocsArchive", type : Zip) {
from rootProject.docsDir
destinationDir distDir
- baseName = String.format("flatfoot-docs-%s", rootProject.ext.flatfoot.release_version)
+ baseName = String.format("flatfoot-docs-%s", LibraryVersions.FLATFOOT.toString())
}
buildServerAnchorTask.dependsOn zipFlatfootDocsTask
@@ -125,7 +126,7 @@
}
project.group = finalGroup
if (!project.version) {
- project.version = flatfoot.release_version
+ project.version = LibraryVersions.FLATFOOT.toString()
}
if (project.getPath().contains("integration-tests")) {
@@ -182,6 +183,10 @@
project.artifacts {
archives sourcesTask
}
+ project.android.defaultConfig {
+ // Update the version meta-data in each Manifest.
+ addManifestPlaceholders(["version" : project.version])
+ }
} else if(isJavaLibrary && project.name == "common") {
// it is a shared lib, enable sources.
def sourcesTask = project.tasks.create(name: "sourcesJar", type : Jar) {
diff --git a/app-toolkit/runtime/src/main/AndroidManifest.xml b/app-toolkit/runtime/src/main/AndroidManifest.xml
index 3f40068..a5660ce 100644
--- a/app-toolkit/runtime/src/main/AndroidManifest.xml
+++ b/app-toolkit/runtime/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.core">
+ <application>
+ <meta-data android:name="android.arch.core.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/build.gradle b/build.gradle
index 360ec02..8c32175 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,7 +19,6 @@
apply from: 'buildSrc/repos.gradle'
apply from: 'buildSrc/init.gradle'
- init.loadDefaultVersions()
init.setSdkInLocalPropertiesFile()
repos.addMavenRepositories(repositories)
diff --git a/buildSrc/dependencies.gradle b/buildSrc/dependencies.gradle
index 0dcf0f2..4946de2 100644
--- a/buildSrc/dependencies.gradle
+++ b/buildSrc/dependencies.gradle
@@ -32,7 +32,7 @@
libs.gradle = 'com.android.tools.build:gradle:' + androidPluginVersionOverride
} else {
// Keep gradle plugin version in sync with ub_supportlib-master manifest.
- libs.gradle = 'com.android.tools.build:gradle:3.0.0-alpha7'
+ libs.gradle = 'com.android.tools.build:gradle:3.0.0-alpha9'
}
// Other dependencies
diff --git a/buildSrc/diff_and_docs.gradle b/buildSrc/diff_and_docs.gradle
index 3011092..2c94849 100644
--- a/buildSrc/diff_and_docs.gradle
+++ b/buildSrc/diff_and_docs.gradle
@@ -14,20 +14,15 @@
* limitations under the License.
*/
+import android.support.LibraryVersions
+import android.support.Version
import android.support.checkapi.ApiXmlConversionTask
import android.support.checkapi.CheckApiTask
import android.support.checkapi.UpdateApiTask
import android.support.doclava.DoclavaTask
import android.support.jdiff.JDiffTask
-import android.support.Version
-
-import org.gradle.api.InvalidUserDataException
-
import groovy.io.FileType
-import groovy.transform.Field;
-
-import java.util.regex.Matcher
-import java.util.regex.Pattern
+import groovy.transform.Field
// Set up platform API files for federation.
if (project.androidApiTxt != null) {
@@ -490,7 +485,7 @@
}
if (hasApiFolder(rootProject)) {
- rootProject.version = rootProject.supportVersion
+ rootProject.version = LibraryVersions.SUPPORT_LIBRARY.toString();
initializeApiChecksForProject(rootProject)
}
diff --git a/buildSrc/init.gradle b/buildSrc/init.gradle
index b35123c..b9f85d3 100644
--- a/buildSrc/init.gradle
+++ b/buildSrc/init.gradle
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+import android.support.LibraryVersions
import com.android.build.gradle.internal.coverage.JacocoPlugin
import com.android.build.gradle.internal.coverage.JacocoReportTask
import com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask
@@ -38,10 +39,6 @@
dataname: "SUPPORT_DATA"
]
-def loadDefaultVersions() {
- apply from: "${supportRootFolder}/buildSrc/versions.gradle"
-}
-
def enableDoclavaAndJDiff(p) {
p.configurations {
doclava
@@ -170,7 +167,7 @@
project.ext.currentSdk = gradle.ext.currentSdk
apply plugin: 'maven'
- version = rootProject.ext.supportVersion
+ version = LibraryVersions.SUPPORT_LIBRARY.toString();
group = 'com.android.support'
project.plugins.whenPluginAdded { plugin ->
@@ -361,6 +358,5 @@
ext.init.setSdkInLocalPropertiesFile = this.&setSdkInLocalPropertiesFile
ext.init.setupRepoOutAndBuildNumber = this.&setupRepoOutAndBuildNumber
ext.init.setupRelease = this.&setupRelease
-ext.init.loadDefaultVersions = this.&loadDefaultVersions
ext.init.configureSubProjects = this.&configureSubProjects
ext.init.configureBuildOnServer = this.&configureBuildOnServer
diff --git a/buildSrc/src/main/groovy/android/support/SupportLibraryPlugin.groovy b/buildSrc/src/main/groovy/android/support/SupportLibraryPlugin.groovy
index 382b5b7..7ebef19 100644
--- a/buildSrc/src/main/groovy/android/support/SupportLibraryPlugin.groovy
+++ b/buildSrc/src/main/groovy/android/support/SupportLibraryPlugin.groovy
@@ -52,7 +52,7 @@
library.defaultConfig {
// Update the version meta-data in each Manifest.
- addManifestPlaceholders(["support-version": project.rootProject.supportVersion,
+ addManifestPlaceholders(["support-version": LibraryVersions.SUPPORT_LIBRARY.toString(),
"target-sdk-version": project.currentSdk])
// Set test related options.
diff --git a/buildSrc/src/main/java/android/support/LibraryVersions.java b/buildSrc/src/main/java/android/support/LibraryVersions.java
new file mode 100644
index 0000000..6b15a48
--- /dev/null
+++ b/buildSrc/src/main/java/android/support/LibraryVersions.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 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 android.support;
+
+/**
+ * The list of versions codes of all the libraries in this project.
+ */
+public class LibraryVersions {
+ /**
+ * Version code of the support library components.
+ */
+ public static final Version SUPPORT_LIBRARY = new Version("26.1.0-SNAPSHOT");
+
+ /**
+ * Version code of the flatfoot libraries.
+ */
+ public static final Version FLATFOOT = new Version("1.0.0-alpha8");
+
+ /**
+ * Version code of the lifecycles library.
+ */
+ public static final Version LIFECYCLES = new Version("1.0.0-SNAPSHOT");
+}
diff --git a/buildSrc/src/main/java/android/support/Version.java b/buildSrc/src/main/java/android/support/Version.java
index 1338a1d..b88d8cf 100644
--- a/buildSrc/src/main/java/android/support/Version.java
+++ b/buildSrc/src/main/java/android/support/Version.java
@@ -68,4 +68,9 @@
public String getExtra() {
return mExtra;
}
+
+ @Override
+ public String toString() {
+ return mMajor + "." + mMinor + "." + mPatch + (mExtra != null ? mExtra : "");
+ }
}
diff --git a/buildSrc/versions.gradle b/buildSrc/versions.gradle
deleted file mode 100644
index 43caec7..0000000
--- a/buildSrc/versions.gradle
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-// Version code of the support library components.
-ext.supportVersion = "26.1.0-SNAPSHOT"
-
diff --git a/compat/AndroidManifest.xml b/compat/AndroidManifest.xml
index 09383ee..cba2f24 100644
--- a/compat/AndroidManifest.xml
+++ b/compat/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.compat">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.compat"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.compat.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/compat/api/26.1.0-SNAPSHOT.txt b/compat/api/26.1.0-SNAPSHOT.txt
index b3b5173..a975912 100644
--- a/compat/api/26.1.0-SNAPSHOT.txt
+++ b/compat/api/26.1.0-SNAPSHOT.txt
@@ -655,10 +655,6 @@
field public static final deprecated int FLAG_ACTIVITY_TASK_ON_HOME = 16384; // 0x4000
}
- public final deprecated class ParallelExecutorCompat {
- method public static deprecated java.util.concurrent.Executor getParallelExecutor();
- }
-
public final class SharedPreferencesCompat {
}
@@ -711,9 +707,6 @@
public final class ConfigurationHelper {
method public static int getDensityDpi(android.content.res.Resources);
- method public static deprecated int getScreenHeightDp(android.content.res.Resources);
- method public static deprecated int getScreenWidthDp(android.content.res.Resources);
- method public static deprecated int getSmallestScreenWidthDp(android.content.res.Resources);
}
public final class ResourcesCompat {
@@ -1042,7 +1035,6 @@
public final class TextUtilsCompat {
method public static int getLayoutDirectionFromLocale(java.util.Locale);
method public static java.lang.String htmlEncode(java.lang.String);
- field public static final deprecated java.util.Locale ROOT;
}
}
diff --git a/compat/java/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.java b/compat/java/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.java
index 3c17fda..f810253 100644
--- a/compat/java/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.java
+++ b/compat/java/android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.java
@@ -21,58 +21,12 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
-import android.support.annotation.RequiresApi;
import android.view.View;
/**
* Helper for accessing features in {@link android.accessibilityservice.AccessibilityService}.
*/
public final class AccessibilityServiceInfoCompat {
-
- static class AccessibilityServiceInfoBaseImpl {
- public int getCapabilities(AccessibilityServiceInfo info) {
- if (getCanRetrieveWindowContent(info)) {
- return CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT;
- }
- return 0;
- }
-
- public String loadDescription(AccessibilityServiceInfo info, PackageManager pm) {
- return null;
- }
- }
-
- @RequiresApi(16)
- static class AccessibilityServiceInfoApi16Impl extends AccessibilityServiceInfoBaseImpl {
- @Override
- public String loadDescription(AccessibilityServiceInfo info, PackageManager pm) {
- return info.loadDescription(pm);
- }
- }
-
- @RequiresApi(18)
- static class AccessibilityServiceInfoApi18Impl
- extends AccessibilityServiceInfoApi16Impl {
- @Override
- public int getCapabilities(AccessibilityServiceInfo info) {
- return info.getCapabilities();
- }
- }
-
- static {
- if (Build.VERSION.SDK_INT >= 18) { // JellyBean MR2
- IMPL = new AccessibilityServiceInfoApi18Impl();
- } else if (Build.VERSION.SDK_INT >= 16) { // JB
- IMPL = new AccessibilityServiceInfoApi16Impl();
- } else {
- IMPL = new AccessibilityServiceInfoBaseImpl();
- }
- }
-
- // Capabilities
-
- private static final AccessibilityServiceInfoBaseImpl IMPL;
-
/**
* Capability: This accessibility service can retrieve the active window content.
*/
@@ -330,7 +284,12 @@
*/
public static String loadDescription(
AccessibilityServiceInfo info, PackageManager packageManager) {
- return IMPL.loadDescription(info, packageManager);
+ if (Build.VERSION.SDK_INT >= 16) {
+ return info.loadDescription(packageManager);
+ } else {
+ //noinspection deprecation
+ return info.getDescription();
+ }
}
/**
@@ -412,7 +371,15 @@
* @see #CAPABILITY_CAN_FILTER_KEY_EVENTS
*/
public static int getCapabilities(AccessibilityServiceInfo info) {
- return IMPL.getCapabilities(info);
+ if (Build.VERSION.SDK_INT >= 18) {
+ return info.getCapabilities();
+ } else {
+ //noinspection deprecation
+ if (info.getCanRetrieveWindowContent()) {
+ return CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT;
+ }
+ return 0;
+ }
}
/**
diff --git a/compat/java/android/support/v4/content/ParallelExecutorCompat.java b/compat/java/android/support/v4/content/ParallelExecutorCompat.java
deleted file mode 100644
index 4dc4168..0000000
--- a/compat/java/android/support/v4/content/ParallelExecutorCompat.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2015 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 android.support.v4.content;
-
-import android.os.AsyncTask;
-
-import java.util.concurrent.Executor;
-
-/**
- * Helper for accessing a shared parallel Executor instance.
- *
- * @deprecated Use {@link AsyncTask} directly.
- */
-@Deprecated
-public final class ParallelExecutorCompat {
-
- /**
- * @deprecated Use {@link AsyncTask#THREAD_POOL_EXECUTOR} directly.
- */
- @Deprecated
- public static Executor getParallelExecutor() {
- return AsyncTask.THREAD_POOL_EXECUTOR;
- }
-
- private ParallelExecutorCompat() {}
-}
diff --git a/compat/java/android/support/v4/content/res/ConfigurationHelper.java b/compat/java/android/support/v4/content/res/ConfigurationHelper.java
index a337671..39b0e4a 100644
--- a/compat/java/android/support/v4/content/res/ConfigurationHelper.java
+++ b/compat/java/android/support/v4/content/res/ConfigurationHelper.java
@@ -31,45 +31,6 @@
}
/**
- * Returns the current height of the available screen space, in dp units.
- *
- * <p>Uses {@code Configuration.screenHeightDp} when available, otherwise an approximation
- * is computed and returned.</p>
- *
- * @deprecated Use {@link Configuration#screenHeightDp} directly.
- */
- @Deprecated
- public static int getScreenHeightDp(@NonNull Resources resources) {
- return resources.getConfiguration().screenHeightDp;
- }
-
- /**
- * Returns the current width of the available screen space, in dp units.
- *
- * <p>Uses {@code Configuration.screenWidthDp} when available, otherwise an approximation
- * is computed and returned.</p>
- *
- * @deprecated Use {@link Configuration#screenWidthDp} directly.
- */
- @Deprecated
- public static int getScreenWidthDp(@NonNull Resources resources) {
- return resources.getConfiguration().screenWidthDp;
- }
-
- /**
- * Returns The smallest screen size an application will see in normal operation, in dp units.
- *
- * <p>Uses {@code Configuration.smallestScreenWidthDp} when available, otherwise an
- * approximation is computed and returned.</p>
- *
- * @deprecated Use {@link Configuration#smallestScreenWidthDp} directly.
- */
- @Deprecated
- public static int getSmallestScreenWidthDp(@NonNull Resources resources) {
- return resources.getConfiguration().smallestScreenWidthDp;
- }
-
- /**
* Returns the target screen density being rendered to.
*
* <p>Uses {@code Configuration.densityDpi} when available, otherwise an approximation
diff --git a/compat/java/android/support/v4/net/ConnectivityManagerCompat.java b/compat/java/android/support/v4/net/ConnectivityManagerCompat.java
index 5a39586..cdddb68 100644
--- a/compat/java/android/support/v4/net/ConnectivityManagerCompat.java
+++ b/compat/java/android/support/v4/net/ConnectivityManagerCompat.java
@@ -32,7 +32,6 @@
import android.net.NetworkInfo;
import android.os.Build;
import android.support.annotation.IntDef;
-import android.support.annotation.RequiresApi;
import android.support.annotation.RequiresPermission;
import android.support.annotation.RestrictTo;
@@ -43,14 +42,6 @@
* Helper for accessing features in {@link ConnectivityManager}.
*/
public final class ConnectivityManagerCompat {
-
- interface ConnectivityManagerCompatImpl {
- boolean isActiveNetworkMetered(ConnectivityManager cm);
-
- @RestrictBackgroundStatus
- int getRestrictBackgroundStatus(ConnectivityManager cm);
- }
-
/** @hide */
@RestrictTo(LIBRARY_GROUP)
@Retention(RetentionPolicy.SOURCE)
@@ -85,10 +76,25 @@
*/
public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3;
- static class ConnectivityManagerCompatBaseImpl implements ConnectivityManagerCompatImpl {
- @SuppressWarnings("deprecation")
- @Override
- public boolean isActiveNetworkMetered(ConnectivityManager cm) {
+ /**
+ * Returns if the currently active data network is metered. A network is
+ * classified as metered when the user is sensitive to heavy data usage on
+ * that connection due to monetary costs, data limitations or
+ * battery/performance issues. You should check this before doing large
+ * data transfers, and warn the user or delay the operation until another
+ * network is available.
+ * <p>This method requires the caller to hold the permission
+ * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
+ *
+ * @return {@code true} if large transfers should be avoided, otherwise
+ * {@code false}.
+ */
+ @SuppressWarnings("deprecation")
+ @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
+ public static boolean isActiveNetworkMetered(ConnectivityManager cm) {
+ if (Build.VERSION.SDK_INT >= 16) {
+ return cm.isActiveNetworkMetered();
+ } else {
final NetworkInfo info = cm.getActiveNetworkInfo();
if (info == null) {
// err on side of caution
@@ -113,58 +119,6 @@
return true;
}
}
-
- @Override
- public int getRestrictBackgroundStatus(ConnectivityManager cm) {
- return RESTRICT_BACKGROUND_STATUS_ENABLED;
- }
- }
-
- @RequiresApi(16)
- static class ConnectivityManagerCompatApi16Impl extends ConnectivityManagerCompatBaseImpl {
- @Override
- public boolean isActiveNetworkMetered(ConnectivityManager cm) {
- return cm.isActiveNetworkMetered();
- }
- }
-
- @RequiresApi(24)
- static class ConnectivityManagerCompatApi24Impl extends ConnectivityManagerCompatApi16Impl {
- @Override
- public int getRestrictBackgroundStatus(ConnectivityManager cm) {
- //noinspection ResourceType
- return cm.getRestrictBackgroundStatus();
- }
- }
-
- private static final ConnectivityManagerCompatImpl IMPL;
-
- static {
- if (Build.VERSION.SDK_INT >= 24) {
- IMPL = new ConnectivityManagerCompatApi24Impl();
- } else if (Build.VERSION.SDK_INT >= 16) {
- IMPL = new ConnectivityManagerCompatApi16Impl();
- } else {
- IMPL = new ConnectivityManagerCompatBaseImpl();
- }
- }
-
- /**
- * Returns if the currently active data network is metered. A network is
- * classified as metered when the user is sensitive to heavy data usage on
- * that connection due to monetary costs, data limitations or
- * battery/performance issues. You should check this before doing large
- * data transfers, and warn the user or delay the operation until another
- * network is available.
- * <p>This method requires the caller to hold the permission
- * {@link android.Manifest.permission#ACCESS_NETWORK_STATE}.
- *
- * @return {@code true} if large transfers should be avoided, otherwise
- * {@code false}.
- */
- @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
- public static boolean isActiveNetworkMetered(ConnectivityManager cm) {
- return IMPL.isActiveNetworkMetered(cm);
}
/**
@@ -174,6 +128,7 @@
* potentially-stale value from
* {@link ConnectivityManager#EXTRA_NETWORK_INFO}. May be {@code null}.
*/
+ @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
public static NetworkInfo getNetworkInfoFromBroadcast(ConnectivityManager cm, Intent intent) {
final NetworkInfo info = intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
if (info != null) {
@@ -193,7 +148,11 @@
*/
@RestrictBackgroundStatus
public static int getRestrictBackgroundStatus(ConnectivityManager cm) {
- return IMPL.getRestrictBackgroundStatus(cm);
+ if (Build.VERSION.SDK_INT >= 24) {
+ return cm.getRestrictBackgroundStatus();
+ } else {
+ return RESTRICT_BACKGROUND_STATUS_ENABLED;
+ }
}
private ConnectivityManagerCompat() {}
diff --git a/compat/java/android/support/v4/text/TextUtilsCompat.java b/compat/java/android/support/v4/text/TextUtilsCompat.java
index 2a77e7e..ee58ab0 100644
--- a/compat/java/android/support/v4/text/TextUtilsCompat.java
+++ b/compat/java/android/support/v4/text/TextUtilsCompat.java
@@ -29,13 +29,7 @@
* Backwards compatible version of {@link TextUtils}.
*/
public final class TextUtilsCompat {
- /**
- * @deprecated This was never meant to be public. You can create your own empty {@code Locale}
- * by calling the constructor with empty strings.
- */
- @Deprecated
- public static final Locale ROOT = new Locale("", "");
-
+ private static final Locale ROOT = new Locale("", "");
private static final String ARAB_SCRIPT_SUBTAG = "Arab";
private static final String HEBR_SCRIPT_SUBTAG = "Hebr";
@@ -132,6 +126,5 @@
}
}
-
private TextUtilsCompat() {}
}
diff --git a/compat/java/android/support/v4/view/ViewGroupCompat.java b/compat/java/android/support/v4/view/ViewGroupCompat.java
index 528d70e..445a587 100644
--- a/compat/java/android/support/v4/view/ViewGroupCompat.java
+++ b/compat/java/android/support/v4/view/ViewGroupCompat.java
@@ -19,6 +19,7 @@
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
+import android.support.compat.R;
import android.support.v4.view.ViewCompat.ScrollAxis;
import android.view.View;
import android.view.ViewGroup;
@@ -55,10 +56,14 @@
}
public void setTransitionGroup(ViewGroup group, boolean isTransitionGroup) {
+ group.setTag(R.id.tag_transition_group, isTransitionGroup);
}
public boolean isTransitionGroup(ViewGroup group) {
- return false;
+ Boolean explicit = (Boolean) group.getTag(R.id.tag_transition_group);
+ return (explicit != null && explicit)
+ || group.getBackground() != null
+ || ViewCompat.getTransitionName(group) != null;
}
public int getNestedScrollAxes(ViewGroup group) {
diff --git a/compat/java/android/support/v4/view/accessibility/AccessibilityEventCompat.java b/compat/java/android/support/v4/view/accessibility/AccessibilityEventCompat.java
index 924b482..cb77fd5 100644
--- a/compat/java/android/support/v4/view/accessibility/AccessibilityEventCompat.java
+++ b/compat/java/android/support/v4/view/accessibility/AccessibilityEventCompat.java
@@ -17,7 +17,6 @@
package android.support.v4.view.accessibility;
import android.os.Build;
-import android.support.annotation.RequiresApi;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityRecord;
@@ -25,79 +24,6 @@
* Helper for accessing features in {@link AccessibilityEvent}.
*/
public final class AccessibilityEventCompat {
-
- static class AccessibilityEventCompatBaseImpl {
- public void setContentChangeTypes(AccessibilityEvent event, int types) {
- }
-
- public int getContentChangeTypes(AccessibilityEvent event) {
- return 0;
- }
-
- public void setMovementGranularity(AccessibilityEvent event, int granularity) {
- }
-
- public int getMovementGranularity(AccessibilityEvent event) {
- return 0;
- }
-
- public void setAction(AccessibilityEvent event, int action) {
- }
-
- public int getAction(AccessibilityEvent event) {
- return 0;
- }
- }
-
- @RequiresApi(16)
- static class AccessibilityEventCompatApi16Impl extends AccessibilityEventCompatBaseImpl {
- @Override
- public void setMovementGranularity(AccessibilityEvent event, int granularity) {
- event.setMovementGranularity(granularity);
- }
-
- @Override
- public int getMovementGranularity(AccessibilityEvent event) {
- return event.getMovementGranularity();
- }
-
- @Override
- public void setAction(AccessibilityEvent event, int action) {
- event.setAction(action);
- }
-
- @Override
- public int getAction(AccessibilityEvent event) {
- return event.getAction();
- }
- }
-
- @RequiresApi(19)
- static class AccessibilityEventCompatApi19Impl extends AccessibilityEventCompatApi16Impl {
-
- @Override
- public void setContentChangeTypes(AccessibilityEvent event, int types) {
- event.setContentChangeTypes(types);
- }
-
- @Override
- public int getContentChangeTypes(AccessibilityEvent event) {
- return event.getContentChangeTypes();
- }
- }
-
- private static final AccessibilityEventCompatBaseImpl IMPL;
-
- static {
- if (Build.VERSION.SDK_INT >= 19) { // KitKat
- IMPL = new AccessibilityEventCompatApi19Impl();
- } else if (Build.VERSION.SDK_INT >= 16) { // Jellybean
- IMPL = new AccessibilityEventCompatApi16Impl();
- } else {
- IMPL = new AccessibilityEventCompatBaseImpl();
- }
- }
-
/**
* Represents the event of a hover enter over a {@link android.view.View}.
* @deprecated Use {@link AccessibilityEvent#TYPE_VIEW_HOVER_ENTER} directly.
@@ -335,7 +261,9 @@
* @see #getContentChangeTypes(AccessibilityEvent)
*/
public static void setContentChangeTypes(AccessibilityEvent event, int changeTypes) {
- IMPL.setContentChangeTypes(event, changeTypes);
+ if (Build.VERSION.SDK_INT >= 19) {
+ event.setContentChangeTypes(changeTypes);
+ }
}
/**
@@ -352,7 +280,11 @@
* </ul>
*/
public static int getContentChangeTypes(AccessibilityEvent event) {
- return IMPL.getContentChangeTypes(event);
+ if (Build.VERSION.SDK_INT >= 19) {
+ return event.getContentChangeTypes();
+ } else {
+ return 0;
+ }
}
/**
@@ -363,7 +295,9 @@
* @throws IllegalStateException If called from an AccessibilityService.
*/
public void setMovementGranularity(AccessibilityEvent event, int granularity) {
- IMPL.setMovementGranularity(event, granularity);
+ if (Build.VERSION.SDK_INT >= 16) {
+ event.setMovementGranularity(granularity);
+ }
}
/**
@@ -372,7 +306,11 @@
* @return The granularity.
*/
public int getMovementGranularity(AccessibilityEvent event) {
- return IMPL.getMovementGranularity(event);
+ if (Build.VERSION.SDK_INT >= 16) {
+ return event.getMovementGranularity();
+ } else {
+ return 0;
+ }
}
/**
@@ -393,7 +331,9 @@
* @see AccessibilityNodeInfoCompat#performAction(int)
*/
public void setAction(AccessibilityEvent event, int action) {
- IMPL.setAction(event, action);
+ if (Build.VERSION.SDK_INT >= 16) {
+ event.setAction(action);
+ }
}
/**
@@ -402,6 +342,10 @@
* @return The action.
*/
public int getAction(AccessibilityEvent event) {
- return IMPL.getAction(event);
+ if (Build.VERSION.SDK_INT >= 16) {
+ return event.getAction();
+ } else {
+ return 0;
+ }
}
}
diff --git a/compat/java/android/support/v4/view/accessibility/AccessibilityRecordCompat.java b/compat/java/android/support/v4/view/accessibility/AccessibilityRecordCompat.java
index 395af49..ce5d024 100644
--- a/compat/java/android/support/v4/view/accessibility/AccessibilityRecordCompat.java
+++ b/compat/java/android/support/v4/view/accessibility/AccessibilityRecordCompat.java
@@ -19,7 +19,6 @@
import android.os.Build;
import android.os.Parcelable;
import android.support.annotation.NonNull;
-import android.support.annotation.RequiresApi;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityRecord;
@@ -30,69 +29,6 @@
* Helper for accessing {@link AccessibilityRecord}.
*/
public class AccessibilityRecordCompat {
-
- static class AccessibilityRecordCompatBaseImpl {
- public int getMaxScrollX(AccessibilityRecord record) {
- return 0;
- }
-
- public int getMaxScrollY(AccessibilityRecord record) {
- return 0;
- }
-
- public void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
- }
-
- public void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
- }
-
- public void setSource(AccessibilityRecord record, View root, int virtualDescendantId) {
- }
- }
-
- @RequiresApi(15)
- static class AccessibilityRecordCompatApi15Impl extends AccessibilityRecordCompatBaseImpl {
- @Override
- public int getMaxScrollX(AccessibilityRecord record) {
- return record.getMaxScrollX();
- }
-
- @Override
- public int getMaxScrollY(AccessibilityRecord record) {
- return record.getMaxScrollY();
- }
-
- @Override
- public void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
- record.setMaxScrollX(maxScrollX);
- }
-
- @Override
- public void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
- record.setMaxScrollY(maxScrollY);
- }
- }
-
- @RequiresApi(16)
- static class AccessibilityRecordCompatApi16Impl extends AccessibilityRecordCompatApi15Impl {
- @Override
- public void setSource(AccessibilityRecord record, View root, int virtualDescendantId) {
- record.setSource(root, virtualDescendantId);
- }
- }
-
- static {
- if (Build.VERSION.SDK_INT >= 16) { // JellyBean
- IMPL = new AccessibilityRecordCompatApi16Impl();
- } else if (Build.VERSION.SDK_INT >= 15) { // ICS MR1
- IMPL = new AccessibilityRecordCompatApi15Impl();
- } else {
- IMPL = new AccessibilityRecordCompatBaseImpl();
- }
- }
-
- private static final AccessibilityRecordCompatBaseImpl IMPL;
-
private final AccessibilityRecord mRecord;
/**
@@ -197,7 +133,9 @@
*/
public static void setSource(@NonNull AccessibilityRecord record, View root,
int virtualDescendantId) {
- IMPL.setSource(record, root, virtualDescendantId);
+ if (Build.VERSION.SDK_INT >= 16) {
+ record.setSource(root, virtualDescendantId);
+ }
}
/**
@@ -538,7 +476,11 @@
* @return The max scroll.
*/
public static int getMaxScrollX(AccessibilityRecord record) {
- return IMPL.getMaxScrollX(record);
+ if (Build.VERSION.SDK_INT >= 15) {
+ return record.getMaxScrollX();
+ } else {
+ return 0;
+ }
}
/**
@@ -560,7 +502,9 @@
* @param maxScrollX The max scroll.
*/
public static void setMaxScrollX(AccessibilityRecord record, int maxScrollX) {
- IMPL.setMaxScrollX(record, maxScrollX);
+ if (Build.VERSION.SDK_INT >= 15) {
+ record.setMaxScrollX(maxScrollX);
+ }
}
/**
@@ -582,7 +526,11 @@
* @return The max scroll.
*/
public static int getMaxScrollY(AccessibilityRecord record) {
- return IMPL.getMaxScrollY(record);
+ if (Build.VERSION.SDK_INT >= 15) {
+ return record.getMaxScrollY();
+ } else {
+ return 0;
+ }
}
/**
@@ -604,7 +552,9 @@
* @param maxScrollY The max scroll.
*/
public static void setMaxScrollY(AccessibilityRecord record, int maxScrollY) {
- IMPL.setMaxScrollY(record, maxScrollY);
+ if (Build.VERSION.SDK_INT >= 15) {
+ record.setMaxScrollY(maxScrollY);
+ }
}
/**
diff --git a/compat/lint-baseline.xml b/compat/lint-baseline.xml
index 3919eba..e961253 100644
--- a/compat/lint-baseline.xml
+++ b/compat/lint-baseline.xml
@@ -1,37 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="4" by="lint 3.0.0-alpha7">
- <issue
- id="MissingPermission"
- message="Missing permissions required by ConnectivityManager.getActiveNetworkInfo: android.permission.ACCESS_NETWORK_STATE"
- errorLine1=" final NetworkInfo info = cm.getActiveNetworkInfo();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="java/android/support/v4/net/ConnectivityManagerCompat.java"
- line="92"
- column="38"/>
- </issue>
-
- <issue
- id="MissingPermission"
- message="Missing permissions required by ConnectivityManager.isActiveNetworkMetered: android.permission.ACCESS_NETWORK_STATE"
- errorLine1=" return cm.isActiveNetworkMetered();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="java/android/support/v4/net/ConnectivityManagerCompat.java"
- line="127"
- column="20"/>
- </issue>
-
- <issue
- id="MissingPermission"
- message="Missing permissions required by ConnectivityManager.getNetworkInfo: android.permission.ACCESS_NETWORK_STATE"
- errorLine1=" return cm.getNetworkInfo(info.getType());"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="java/android/support/v4/net/ConnectivityManagerCompat.java"
- line="180"
- column="20"/>
- </issue>
-
</issues>
diff --git a/compat/res/values/ids.xml b/compat/res/values/ids.xml
index e83d5f9..ac6fddb 100644
--- a/compat/res/values/ids.xml
+++ b/compat/res/values/ids.xml
@@ -20,4 +20,5 @@
<item type="id" name="text2"/>
<item type="id" name="line1"/>
<item type="id" name="line3"/>
+ <item name="tag_transition_group" type="id"/>
</resources>
diff --git a/compat/tests/java/android/support/v4/view/ViewGroupCompatTest.java b/compat/tests/java/android/support/v4/view/ViewGroupCompatTest.java
new file mode 100644
index 0000000..b8d48fc
--- /dev/null
+++ b/compat/tests/java/android/support/v4/view/ViewGroupCompatTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2017 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 android.support.v4.view;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.app.Activity;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.support.compat.test.R;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.MediumTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.support.v4.BaseInstrumentationTestCase;
+import android.view.ViewGroup;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+@RunWith(AndroidJUnit4.class)
+@MediumTest
+public class ViewGroupCompatTest extends BaseInstrumentationTestCase<ViewCompatActivity> {
+
+ private ViewGroup mViewGroup;
+
+ public ViewGroupCompatTest() {
+ super(ViewCompatActivity.class);
+ }
+
+ @Before
+ public void setUp() {
+ final Activity activity = mActivityTestRule.getActivity();
+ mViewGroup = activity.findViewById(R.id.container);
+ }
+
+ @Test
+ public void isTransitionGroup() {
+ assertFalse(ViewGroupCompat.isTransitionGroup(mViewGroup));
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ ViewCompat.setBackground(mViewGroup, new ColorDrawable(Color.GRAY));
+ }
+ });
+ assertTrue(ViewGroupCompat.isTransitionGroup(mViewGroup));
+ }
+
+ @Test
+ public void setTransitionGroup() {
+ assertFalse(ViewGroupCompat.isTransitionGroup(mViewGroup));
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ ViewGroupCompat.setTransitionGroup(mViewGroup, true);
+ }
+ });
+ assertTrue(ViewGroupCompat.isTransitionGroup(mViewGroup));
+ InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ ViewGroupCompat.setTransitionGroup(mViewGroup, false);
+ }
+ });
+ assertFalse(ViewGroupCompat.isTransitionGroup(mViewGroup));
+ }
+
+}
diff --git a/content/AndroidManifest.xml b/content/AndroidManifest.xml
index 5f2a29e..8304504 100644
--- a/content/AndroidManifest.xml
+++ b/content/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.content">
<uses-sdk android:minSdkVersion="14" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.content.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/content/build.gradle b/content/build.gradle
index 5d6dc58..93ef5f8 100644
--- a/content/build.gradle
+++ b/content/build.gradle
@@ -17,8 +17,8 @@
apply plugin: android.support.SupportLibraryPlugin
dependencies {
- compile project(':support-annotations')
- compile project(':support-compat')
+ api project(':support-annotations')
+ api project(':support-compat')
androidTestImplementation libs.junit
androidTestImplementation libs.test_runner, { exclude module: 'support-annotations' }
diff --git a/core-ui/AndroidManifest.xml b/core-ui/AndroidManifest.xml
index b952b5e..715f92c 100644
--- a/core-ui/AndroidManifest.xml
+++ b/core-ui/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.coreui">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.coreui"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.coreui.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/core-ui/java/android/support/v4/widget/SlidingPaneLayout.java b/core-ui/java/android/support/v4/widget/SlidingPaneLayout.java
index e3f2462..602df70 100644
--- a/core-ui/java/android/support/v4/widget/SlidingPaneLayout.java
+++ b/core-ui/java/android/support/v4/widget/SlidingPaneLayout.java
@@ -994,7 +994,7 @@
protected boolean drawChild(Canvas canvas, View child, long drawingTime) {
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
boolean result;
- final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);
+ final int save = canvas.save();
if (mCanSlide && !lp.slideable && mSlideableView != null) {
// Clip against the slider; no sense drawing what will immediately be covered.
diff --git a/core-ui/lint-baseline.xml b/core-ui/lint-baseline.xml
index 8961812..1062fea 100644
--- a/core-ui/lint-baseline.xml
+++ b/core-ui/lint-baseline.xml
@@ -12,15 +12,4 @@
column="47"/>
</issue>
- <issue
- id="WrongConstant"
- message="Must be one or more of: Canvas.ALL_SAVE_FLAG"
- errorLine1=" final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="java/android/support/v4/widget/SlidingPaneLayout.java"
- line="997"
- column="38"/>
- </issue>
-
</issues>
diff --git a/core-utils/AndroidManifest.xml b/core-utils/AndroidManifest.xml
index 5c10a5b..c24e023 100644
--- a/core-utils/AndroidManifest.xml
+++ b/core-utils/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.coreutils">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.coreutils"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.coreutils.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/customtabs/AndroidManifest.xml b/customtabs/AndroidManifest.xml
index 4069dae..6a25c8a 100644
--- a/customtabs/AndroidManifest.xml
+++ b/customtabs/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.customtabs">
<uses-sdk android:minSdkVersion="15"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.customtabs.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/design/AndroidManifest.xml b/design/AndroidManifest.xml
index afae16e..aa02181 100644
--- a/design/AndroidManifest.xml
+++ b/design/AndroidManifest.xml
@@ -14,11 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.design">
- <uses-sdk android:minSdkVersion="14"
- tools:overrideLibrary="android.support.transition"/>
+ <uses-sdk android:minSdkVersion="14" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.design.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/design/res/values/styles.xml b/design/res/values/styles.xml
index f7624ec..93fb7eb 100644
--- a/design/res/values/styles.xml
+++ b/design/res/values/styles.xml
@@ -115,7 +115,6 @@
</style>
<style name="Widget.Design.AppBarLayout" parent="Base.Widget.Design.AppBarLayout">
- <item name="android:paddingLeft">300px</item>
</style>
<style name="Widget.Design.CoordinatorLayout" parent="android:Widget">
diff --git a/design/src/android/support/design/widget/BottomSheetBehavior.java b/design/src/android/support/design/widget/BottomSheetBehavior.java
index a28d3be..aaa9b80 100644
--- a/design/src/android/support/design/widget/BottomSheetBehavior.java
+++ b/design/src/android/support/design/widget/BottomSheetBehavior.java
@@ -312,7 +312,9 @@
if (mState == STATE_DRAGGING && action == MotionEvent.ACTION_DOWN) {
return true;
}
- mViewDragHelper.processTouchEvent(event);
+ if (mViewDragHelper != null) {
+ mViewDragHelper.processTouchEvent(event);
+ }
// Record the velocity
if (action == MotionEvent.ACTION_DOWN) {
reset();
diff --git a/design/src/android/support/design/widget/CoordinatorLayout.java b/design/src/android/support/design/widget/CoordinatorLayout.java
index 818e3a6..d97d4e6 100644
--- a/design/src/android/support/design/widget/CoordinatorLayout.java
+++ b/design/src/android/support/design/widget/CoordinatorLayout.java
@@ -232,7 +232,7 @@
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
- resetTouchBehaviors();
+ resetTouchBehaviors(false);
if (mNeedsPreDrawListener) {
if (mOnPreDrawListener == null) {
mOnPreDrawListener = new OnPreDrawListener();
@@ -251,7 +251,7 @@
@Override
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
- resetTouchBehaviors();
+ resetTouchBehaviors(false);
if (mNeedsPreDrawListener && mOnPreDrawListener != null) {
final ViewTreeObserver vto = getViewTreeObserver();
vto.removeOnPreDrawListener(mOnPreDrawListener);
@@ -373,20 +373,25 @@
* in response to an UP or CANCEL event, when intercept is request-disallowed
* and similar cases where an event stream in progress will be aborted.
*/
- private void resetTouchBehaviors() {
- if (mBehaviorTouchView != null) {
- final Behavior b = ((LayoutParams) mBehaviorTouchView.getLayoutParams()).getBehavior();
+ private void resetTouchBehaviors(boolean notifyOnInterceptTouchEvent) {
+ final int childCount = getChildCount();
+ for (int i = 0; i < childCount; i++) {
+ final View child = getChildAt(i);
+ final LayoutParams lp = (LayoutParams) child.getLayoutParams();
+ final Behavior b = lp.getBehavior();
if (b != null) {
final long now = SystemClock.uptimeMillis();
final MotionEvent cancelEvent = MotionEvent.obtain(now, now,
MotionEvent.ACTION_CANCEL, 0.0f, 0.0f, 0);
- b.onTouchEvent(this, mBehaviorTouchView, cancelEvent);
+ if (notifyOnInterceptTouchEvent) {
+ b.onInterceptTouchEvent(this, child, cancelEvent);
+ } else {
+ b.onTouchEvent(this, child, cancelEvent);
+ }
cancelEvent.recycle();
}
- mBehaviorTouchView = null;
}
- final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = getChildAt(i);
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
@@ -493,7 +498,7 @@
// Make sure we reset in case we had missed a previous important event.
if (action == MotionEvent.ACTION_DOWN) {
- resetTouchBehaviors();
+ resetTouchBehaviors(true);
}
final boolean intercepted = performIntercept(ev, TYPE_ON_INTERCEPT);
@@ -503,7 +508,7 @@
}
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
- resetTouchBehaviors();
+ resetTouchBehaviors(true);
}
return intercepted;
@@ -548,7 +553,7 @@
}
if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) {
- resetTouchBehaviors();
+ resetTouchBehaviors(false);
}
return handled;
@@ -558,7 +563,7 @@
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
super.requestDisallowInterceptTouchEvent(disallowIntercept);
if (disallowIntercept && !mDisallowInterceptReset) {
- resetTouchBehaviors();
+ resetTouchBehaviors(false);
mDisallowInterceptReset = true;
}
}
diff --git a/design/tests/AndroidManifest.xml b/design/tests/AndroidManifest.xml
index c4673b3..756d7c1 100755
--- a/design/tests/AndroidManifest.xml
+++ b/design/tests/AndroidManifest.xml
@@ -89,6 +89,10 @@
android:name="android.support.design.widget.AppBarWithScrollbarsActivity"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"/>
+ <activity
+ android:name="android.support.design.widget.AppBarHorizontalScrollingActivity"
+ android:theme="@style/Theme.AppCompat.NoActionBar"/>
+
</application>
</manifest>
diff --git a/design/tests/res/layout/design_appbar_horizontal_scrolling.xml b/design/tests/res/layout/design_appbar_horizontal_scrolling.xml
new file mode 100644
index 0000000..131a07e
--- /dev/null
+++ b/design/tests/res/layout/design_appbar_horizontal_scrolling.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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.
+ -->
+
+<android.support.design.widget.CoordinatorLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true">
+
+ <android.support.design.widget.AppBarLayout
+ android:id="@+id/app_bar"
+ android:layout_width="match_parent"
+ android:layout_height="200dp"
+ android:fitsSystemWindows="true">
+
+ <android.support.design.widget.CollapsingToolbarLayout
+ android:id="@+id/toolbar_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true"
+ app:contentScrim="?attr/colorPrimary"
+ app:layout_scrollFlags="scroll|exitUntilCollapsed">
+
+ <HorizontalScrollView
+ android:id="@+id/hsv"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <View
+ android:layout_width="200dp"
+ android:layout_height="200dp"
+ android:background="#ff0000"/>
+
+ <View
+ android:layout_width="900dp"
+ android:layout_height="200dp"
+ android:background="#00ff00"/>
+
+ <View
+ android:layout_width="900dp"
+ android:layout_height="200dp"
+ android:background="#0000ff"/>
+ </LinearLayout>
+ </HorizontalScrollView>
+
+ <android.support.v7.widget.Toolbar
+ android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ app:layout_collapseMode="pin"/>
+
+ </android.support.design.widget.CollapsingToolbarLayout>
+ </android.support.design.widget.AppBarLayout>
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior">
+
+ <Button
+ android:id="@+id/button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="24dp"
+ android:text="@string/text1"/>
+
+ </FrameLayout>
+
+</android.support.design.widget.CoordinatorLayout>
diff --git a/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingActivity.java b/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingActivity.java
new file mode 100644
index 0000000..960dbd9
--- /dev/null
+++ b/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingActivity.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 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 android.support.design.widget;
+
+import android.os.Bundle;
+import android.support.design.test.R;
+import android.support.v7.widget.Toolbar;
+
+public class AppBarHorizontalScrollingActivity extends BaseTestActivity {
+ @Override
+ protected int getContentViewLayoutResId() {
+ return R.layout.design_appbar_horizontal_scrolling;
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ }
+}
diff --git a/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingTest.java b/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingTest.java
new file mode 100644
index 0000000..ccda8b0
--- /dev/null
+++ b/design/tests/src/android/support/design/widget/AppBarHorizontalScrollingTest.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2017 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 android.support.design.widget;
+
+import static android.support.test.espresso.Espresso.onView;
+import static android.support.test.espresso.action.ViewActions.swipeLeft;
+import static android.support.test.espresso.matcher.ViewMatchers.withId;
+
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
+
+import android.app.Activity;
+import android.app.Instrumentation;
+import android.os.SystemClock;
+import android.support.design.test.R;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.LargeTest;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.HorizontalScrollView;
+
+import org.junit.Test;
+
+/**
+ * Testing that if we have a {@link AppBarLayout} child that intercepts touch events (such as
+ * {@link HorizontalScrollView} that handles horizontal swipes), that does not interfere with
+ * event handling after the event sequence is no longer being intercepted by that child.
+ */
+@LargeTest
+public class AppBarHorizontalScrollingTest extends
+ BaseInstrumentationTestCase<AppBarHorizontalScrollingActivity> {
+
+ public AppBarHorizontalScrollingTest() {
+ super(AppBarHorizontalScrollingActivity.class);
+ }
+
+ @Test
+ public void testScrollAndClick() throws Throwable {
+ final Activity activity = mActivityTestRule.getActivity();
+ final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+
+ final Button button = activity.findViewById(R.id.button);
+ final View.OnClickListener mockClickListener = mock(View.OnClickListener.class);
+ button.setOnClickListener(mockClickListener);
+
+ // Emulate a click on the button to verify that the registered listener is invoked
+ // prior to performing a horizontal swipe across the app bar
+ final int[] buttonXY = new int[2];
+ button.getLocationOnScreen(buttonXY);
+ final int buttonWidth = button.getWidth();
+ final int buttonHeight = button.getHeight();
+ final float emulatedTapX = buttonXY[0] + buttonWidth / 2.0f;
+ final float emulatedTapY = buttonXY[1] + buttonHeight / 2.0f;
+
+ emulateButtonClick(instrumentation, emulatedTapX, emulatedTapY);
+ verify(mockClickListener).onClick(button);
+ reset(mockClickListener);
+
+ final HorizontalScrollView hsv = activity.findViewById(R.id.hsv);
+ final int scrollXBefore = hsv.getScrollX();
+ // Now scroll / swipe horizontally across our scrollable content in the app bar
+ onView(withId(R.id.app_bar)).perform(swipeLeft());
+ assertTrue("Horizontal scroll performed", hsv.getScrollX() > scrollXBefore);
+
+ // And emulate another click on the button to verify that the registered listener is still
+ // invoked immediately after performing the horizontal swipe across the app bar
+ emulateButtonClick(instrumentation, emulatedTapX, emulatedTapY);
+ verify(mockClickListener).onClick(button);
+ }
+
+ private void emulateButtonClick(Instrumentation instrumentation, float emulatedTapX,
+ float emulatedTapY) {
+ // Note that the reason to not use Espresso's click() view action is so that we can
+ // faithfully emulate what was happening in the reported bug. We don't want the events
+ // to be sent directly to the button, but rather be processed by the parent coordinator
+ // layout, so that we reproduce what is happening as the events are processed at the level
+ // of that parent.
+
+ // Inject DOWN event
+ long downTime = SystemClock.uptimeMillis();
+ MotionEvent eventDown = MotionEvent.obtain(
+ downTime, downTime, MotionEvent.ACTION_DOWN, emulatedTapX, emulatedTapY, 1);
+ instrumentation.sendPointerSync(eventDown);
+
+ // Inject MOVE event
+ long moveTime = SystemClock.uptimeMillis();
+ MotionEvent eventMove = MotionEvent.obtain(
+ moveTime, moveTime, MotionEvent.ACTION_MOVE, emulatedTapX, emulatedTapY, 1);
+ instrumentation.sendPointerSync(eventMove);
+
+ // Inject UP event
+ long upTime = SystemClock.uptimeMillis();
+ MotionEvent eventUp = MotionEvent.obtain(
+ upTime, upTime, MotionEvent.ACTION_UP, emulatedTapX, emulatedTapY, 1);
+ instrumentation.sendPointerSync(eventUp);
+
+ // Wait for the system to process all events in the queue
+ instrumentation.waitForIdleSync();
+ }
+}
diff --git a/design/tests/src/android/support/design/widget/BaseTestActivity.java b/design/tests/src/android/support/design/widget/BaseTestActivity.java
index bdeb231..4662001 100755
--- a/design/tests/src/android/support/design/widget/BaseTestActivity.java
+++ b/design/tests/src/android/support/design/widget/BaseTestActivity.java
@@ -17,6 +17,7 @@
package android.support.design.widget;
import android.os.Bundle;
+import android.support.annotation.LayoutRes;
import android.support.design.testutils.RecreatedAppCompatActivity;
import android.view.WindowManager;
@@ -44,6 +45,7 @@
overridePendingTransition(0, 0);
}
+ @LayoutRes
protected abstract int getContentViewLayoutResId();
protected void onContentViewSet() {}
diff --git a/dynamic-animation/AndroidManifest.xml b/dynamic-animation/AndroidManifest.xml
index f818402..a46ea43 100644
--- a/dynamic-animation/AndroidManifest.xml
+++ b/dynamic-animation/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.dynamicanimation">
<uses-sdk android:minSdkVersion="16"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.dynamicanimation.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/emoji/appcompat/AndroidManifest.xml b/emoji/appcompat/AndroidManifest.xml
index b44bda7..8261137 100644
--- a/emoji/appcompat/AndroidManifest.xml
+++ b/emoji/appcompat/AndroidManifest.xml
@@ -18,6 +18,7 @@
package="android.support.text.emoji.appcompat">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.text.emoji.appcompat.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/emoji/bundled/AndroidManifest.xml b/emoji/bundled/AndroidManifest.xml
index 3d3a684..a2b14cf 100644
--- a/emoji/bundled/AndroidManifest.xml
+++ b/emoji/bundled/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.text.emoji.bundled">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.text.emoji.bundled.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
\ No newline at end of file
diff --git a/emoji/core/AndroidManifest.xml b/emoji/core/AndroidManifest.xml
index 1a7b7f4..1143f40 100644
--- a/emoji/core/AndroidManifest.xml
+++ b/emoji/core/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.text.emoji">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.text.emoji.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/exifinterface/AndroidManifest.xml b/exifinterface/AndroidManifest.xml
index 344b99b..8c449f7 100644
--- a/exifinterface/AndroidManifest.xml
+++ b/exifinterface/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.exifinterface">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.exifinterface.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/fragment/AndroidManifest.xml b/fragment/AndroidManifest.xml
index 725fe43..4d532bd 100644
--- a/fragment/AndroidManifest.xml
+++ b/fragment/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.fragment">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.fragment"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.fragment.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/fragment/build.gradle b/fragment/build.gradle
index 5d6538a..b484bc4 100644
--- a/fragment/build.gradle
+++ b/fragment/build.gradle
@@ -4,6 +4,7 @@
api project(':support-compat')
api project(':support-core-ui')
api project(':support-core-utils')
+ api project(':support-annotations')
androidTestImplementation libs.test_runner, { exclude module: 'support-annotations' }
androidTestImplementation libs.espresso_core, { exclude module: 'support-annotations' }
diff --git a/fragment/java/android/support/v4/app/BackStackRecord.java b/fragment/java/android/support/v4/app/BackStackRecord.java
index 5f99d06..c2272c3 100644
--- a/fragment/java/android/support/v4/app/BackStackRecord.java
+++ b/fragment/java/android/support/v4/app/BackStackRecord.java
@@ -16,7 +16,6 @@
package android.support.v4.app;
-import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.v4.util.LogWriter;
@@ -174,7 +173,6 @@
final class BackStackRecord extends FragmentTransaction implements
FragmentManager.BackStackEntry, FragmentManagerImpl.OpGenerator {
static final String TAG = FragmentManagerImpl.TAG;
- static final boolean SUPPORTS_TRANSITIONS = Build.VERSION.SDK_INT >= 21;
final FragmentManagerImpl mManager;
@@ -507,7 +505,7 @@
@Override
public FragmentTransaction addSharedElement(View sharedElement, String name) {
- if (SUPPORTS_TRANSITIONS) {
+ if (FragmentTransition.supportsTransition()) {
String transitionName = ViewCompat.getTransitionName(sharedElement);
if (transitionName == null) {
throw new IllegalArgumentException("Unique transitionNames are required for all" +
diff --git a/fragment/java/android/support/v4/app/FragmentTransition.java b/fragment/java/android/support/v4/app/FragmentTransition.java
index c5485d7..fae3b52 100644
--- a/fragment/java/android/support/v4/app/FragmentTransition.java
+++ b/fragment/java/android/support/v4/app/FragmentTransition.java
@@ -17,7 +17,6 @@
import android.graphics.Rect;
import android.os.Build;
-import android.support.annotation.RequiresApi;
import android.support.v4.util.ArrayMap;
import android.support.v4.view.ViewCompat;
import android.util.SparseArray;
@@ -53,6 +52,24 @@
BackStackRecord.OP_SET_PRIMARY_NAV, // inverse of OP_UNSET_PRIMARY_NAV
};
+ private static final FragmentTransitionImpl PLATFORM_IMPL = Build.VERSION.SDK_INT >= 21
+ ? new FragmentTransitionCompat21()
+ : null;
+
+ private static final FragmentTransitionImpl SUPPORT_IMPL = resolveSupportImpl();
+
+ private static FragmentTransitionImpl resolveSupportImpl() {
+ try {
+ @SuppressWarnings("unchecked")
+ Class<FragmentTransitionImpl> impl = (Class<FragmentTransitionImpl>) Class.forName(
+ "android.support.transition.FragmentTransitionSupport");
+ return impl.getDeclaredConstructor().newInstance();
+ } catch (Exception ignored) {
+ // support-transition is not loaded; ignore
+ }
+ return null;
+ }
+
/**
* The main entry point for Fragment Transitions, this starts the transitions
* set on the leaving Fragment's {@link Fragment#getExitTransition()}, the
@@ -87,37 +104,35 @@
return;
}
- if (Build.VERSION.SDK_INT >= 21) {
- SparseArray<FragmentContainerTransition> transitioningFragments =
- new SparseArray<>();
- for (int i = startIndex; i < endIndex; i++) {
- final BackStackRecord record = records.get(i);
- final boolean isPop = isRecordPop.get(i);
- if (isPop) {
- calculatePopFragments(record, transitioningFragments, isReordered);
- } else {
- calculateFragments(record, transitioningFragments, isReordered);
- }
+ SparseArray<FragmentContainerTransition> transitioningFragments =
+ new SparseArray<>();
+ for (int i = startIndex; i < endIndex; i++) {
+ final BackStackRecord record = records.get(i);
+ final boolean isPop = isRecordPop.get(i);
+ if (isPop) {
+ calculatePopFragments(record, transitioningFragments, isReordered);
+ } else {
+ calculateFragments(record, transitioningFragments, isReordered);
}
+ }
- if (transitioningFragments.size() != 0) {
- final View nonExistentView = new View(fragmentManager.mHost.getContext());
- final int numContainers = transitioningFragments.size();
- for (int i = 0; i < numContainers; i++) {
- int containerId = transitioningFragments.keyAt(i);
- ArrayMap<String, String> nameOverrides = calculateNameOverrides(containerId,
- records, isRecordPop, startIndex, endIndex);
+ if (transitioningFragments.size() != 0) {
+ final View nonExistentView = new View(fragmentManager.mHost.getContext());
+ final int numContainers = transitioningFragments.size();
+ for (int i = 0; i < numContainers; i++) {
+ int containerId = transitioningFragments.keyAt(i);
+ ArrayMap<String, String> nameOverrides = calculateNameOverrides(containerId,
+ records, isRecordPop, startIndex, endIndex);
- FragmentContainerTransition containerTransition =
- transitioningFragments.valueAt(i);
+ FragmentContainerTransition containerTransition =
+ transitioningFragments.valueAt(i);
- if (isReordered) {
- configureTransitionsReordered(fragmentManager, containerId,
- containerTransition, nonExistentView, nameOverrides);
- } else {
- configureTransitionsOrdered(fragmentManager, containerId,
- containerTransition, nonExistentView, nameOverrides);
- }
+ if (isReordered) {
+ configureTransitionsReordered(fragmentManager, containerId,
+ containerTransition, nonExistentView, nameOverrides);
+ } else {
+ configureTransitionsOrdered(fragmentManager, containerId,
+ containerTransition, nonExistentView, nameOverrides);
}
}
}
@@ -189,7 +204,6 @@
* the final fragment's Views as given in
* {@link FragmentTransaction#addSharedElement(View, String)}.
*/
- @RequiresApi(21)
private static void configureTransitionsReordered(FragmentManagerImpl fragmentManager,
int containerId, FragmentContainerTransition fragments,
View nonExistentView, ArrayMap<String, String> nameOverrides) {
@@ -202,15 +216,19 @@
}
final Fragment inFragment = fragments.lastIn;
final Fragment outFragment = fragments.firstOut;
+ final FragmentTransitionImpl impl = chooseImpl(outFragment, inFragment);
+ if (impl == null) {
+ return;
+ }
final boolean inIsPop = fragments.lastInIsPop;
final boolean outIsPop = fragments.firstOutIsPop;
ArrayList<View> sharedElementsIn = new ArrayList<>();
ArrayList<View> sharedElementsOut = new ArrayList<>();
- Object enterTransition = getEnterTransition(inFragment, inIsPop);
- Object exitTransition = getExitTransition(outFragment, outIsPop);
+ Object enterTransition = getEnterTransition(impl, inFragment, inIsPop);
+ Object exitTransition = getExitTransition(impl, outFragment, outIsPop);
- Object sharedElementTransition = configureSharedElementsReordered(sceneRoot,
+ Object sharedElementTransition = configureSharedElementsReordered(impl, sceneRoot,
nonExistentView, nameOverrides, fragments, sharedElementsOut, sharedElementsIn,
enterTransition, exitTransition);
@@ -219,29 +237,29 @@
return; // no transitions!
}
- ArrayList<View> exitingViews = configureEnteringExitingViews(exitTransition,
+ ArrayList<View> exitingViews = configureEnteringExitingViews(impl, exitTransition,
outFragment, sharedElementsOut, nonExistentView);
- ArrayList<View> enteringViews = configureEnteringExitingViews(enterTransition,
+ ArrayList<View> enteringViews = configureEnteringExitingViews(impl, enterTransition,
inFragment, sharedElementsIn, nonExistentView);
setViewVisibility(enteringViews, View.INVISIBLE);
- Object transition = mergeTransitions(enterTransition, exitTransition,
+ Object transition = mergeTransitions(impl, enterTransition, exitTransition,
sharedElementTransition, inFragment, inIsPop);
if (transition != null) {
- replaceHide(exitTransition, outFragment, exitingViews);
+ replaceHide(impl, exitTransition, outFragment, exitingViews);
ArrayList<String> inNames =
- FragmentTransitionCompat21.prepareSetNameOverridesReordered(sharedElementsIn);
- FragmentTransitionCompat21.scheduleRemoveTargets(transition,
+ impl.prepareSetNameOverridesReordered(sharedElementsIn);
+ impl.scheduleRemoveTargets(transition,
enterTransition, enteringViews, exitTransition, exitingViews,
sharedElementTransition, sharedElementsIn);
- FragmentTransitionCompat21.beginDelayedTransition(sceneRoot, transition);
- FragmentTransitionCompat21.setNameOverridesReordered(sceneRoot, sharedElementsOut,
+ impl.beginDelayedTransition(sceneRoot, transition);
+ impl.setNameOverridesReordered(sceneRoot, sharedElementsOut,
sharedElementsIn, inNames, nameOverrides);
setViewVisibility(enteringViews, View.VISIBLE);
- FragmentTransitionCompat21.swapSharedElementTargets(sharedElementTransition,
+ impl.swapSharedElementTargets(sharedElementTransition,
sharedElementsOut, sharedElementsIn);
}
}
@@ -251,13 +269,13 @@
* the entire fragment's view GONE, make each exiting view INVISIBLE. At the end of the
* transition, make the fragment's view GONE.
*/
- @RequiresApi(21)
- private static void replaceHide(Object exitTransition, Fragment exitingFragment,
+ private static void replaceHide(FragmentTransitionImpl impl,
+ Object exitTransition, Fragment exitingFragment,
final ArrayList<View> exitingViews) {
if (exitingFragment != null && exitTransition != null && exitingFragment.mAdded
&& exitingFragment.mHidden && exitingFragment.mHiddenChanged) {
exitingFragment.setHideReplaced(true);
- FragmentTransitionCompat21.scheduleHideFragmentView(exitTransition,
+ impl.scheduleHideFragmentView(exitTransition,
exitingFragment.getView(), exitingViews);
final ViewGroup container = exitingFragment.mContainer;
OneShotPreDrawListener.add(container, new Runnable() {
@@ -271,7 +289,7 @@
/**
* Configures a transition for a single fragment container for which the transaction was
- * ordrered. That means that the transaction has not been executed yet, so incoming
+ * ordered. That means that the transaction has not been executed yet, so incoming
* Views are not yet known.
*
* @param fragmentManager The executing FragmentManagerImpl
@@ -284,7 +302,6 @@
* the final fragment's Views as given in
* {@link FragmentTransaction#addSharedElement(View, String)}.
*/
- @RequiresApi(21)
private static void configureTransitionsOrdered(FragmentManagerImpl fragmentManager,
int containerId, FragmentContainerTransition fragments,
View nonExistentView, ArrayMap<String, String> nameOverrides) {
@@ -297,16 +314,20 @@
}
final Fragment inFragment = fragments.lastIn;
final Fragment outFragment = fragments.firstOut;
+ final FragmentTransitionImpl impl = chooseImpl(outFragment, inFragment);
+ if (impl == null) {
+ return;
+ }
final boolean inIsPop = fragments.lastInIsPop;
final boolean outIsPop = fragments.firstOutIsPop;
- Object enterTransition = getEnterTransition(inFragment, inIsPop);
- Object exitTransition = getExitTransition(outFragment, outIsPop);
+ Object enterTransition = getEnterTransition(impl, inFragment, inIsPop);
+ Object exitTransition = getExitTransition(impl, outFragment, outIsPop);
ArrayList<View> sharedElementsOut = new ArrayList<>();
ArrayList<View> sharedElementsIn = new ArrayList<>();
- Object sharedElementTransition = configureSharedElementsOrdered(sceneRoot,
+ Object sharedElementTransition = configureSharedElementsOrdered(impl, sceneRoot,
nonExistentView, nameOverrides, fragments, sharedElementsOut, sharedElementsIn,
enterTransition, exitTransition);
@@ -315,7 +336,7 @@
return; // no transitions!
}
- ArrayList<View> exitingViews = configureEnteringExitingViews(exitTransition,
+ ArrayList<View> exitingViews = configureEnteringExitingViews(impl, exitTransition,
outFragment, sharedElementsOut, nonExistentView);
if (exitingViews == null || exitingViews.isEmpty()) {
@@ -324,24 +345,22 @@
// Ensure the entering transition doesn't target anything until the views are made
// visible
- FragmentTransitionCompat21.addTarget(enterTransition, nonExistentView);
+ impl.addTarget(enterTransition, nonExistentView);
- Object transition = mergeTransitions(enterTransition, exitTransition,
+ Object transition = mergeTransitions(impl, enterTransition, exitTransition,
sharedElementTransition, inFragment, fragments.lastInIsPop);
if (transition != null) {
final ArrayList<View> enteringViews = new ArrayList<>();
- FragmentTransitionCompat21.scheduleRemoveTargets(transition,
+ impl.scheduleRemoveTargets(transition,
enterTransition, enteringViews, exitTransition, exitingViews,
sharedElementTransition, sharedElementsIn);
- scheduleTargetChange(sceneRoot, inFragment, nonExistentView, sharedElementsIn,
+ scheduleTargetChange(impl, sceneRoot, inFragment, nonExistentView, sharedElementsIn,
enterTransition, enteringViews, exitTransition, exitingViews);
- FragmentTransitionCompat21.setNameOverridesOrdered(sceneRoot, sharedElementsIn,
- nameOverrides);
+ impl.setNameOverridesOrdered(sceneRoot, sharedElementsIn, nameOverrides);
- FragmentTransitionCompat21.beginDelayedTransition(sceneRoot, transition);
- FragmentTransitionCompat21.scheduleNameReset(sceneRoot, sharedElementsIn,
- nameOverrides);
+ impl.beginDelayedTransition(sceneRoot, transition);
+ impl.scheduleNameReset(sceneRoot, sharedElementsIn, nameOverrides);
}
}
@@ -362,8 +381,8 @@
* @param exitTransition The exit transition of the outgoing fragment
* @param exitingViews The exiting views of the outgoing fragment
*/
- @RequiresApi(21)
- private static void scheduleTargetChange(final ViewGroup sceneRoot,
+ private static void scheduleTargetChange(final FragmentTransitionImpl impl,
+ final ViewGroup sceneRoot,
final Fragment inFragment, final View nonExistentView,
final ArrayList<View> sharedElementsIn,
final Object enterTransition, final ArrayList<View> enteringViews,
@@ -372,9 +391,9 @@
@Override
public void run() {
if (enterTransition != null) {
- FragmentTransitionCompat21.removeTarget(enterTransition,
+ impl.removeTarget(enterTransition,
nonExistentView);
- ArrayList<View> views = configureEnteringExitingViews(
+ ArrayList<View> views = configureEnteringExitingViews(impl,
enterTransition, inFragment, sharedElementsIn, nonExistentView);
enteringViews.addAll(views);
}
@@ -383,7 +402,7 @@
if (exitTransition != null) {
ArrayList<View> tempExiting = new ArrayList<>();
tempExiting.add(nonExistentView);
- FragmentTransitionCompat21.replaceTargets(exitTransition, exitingViews,
+ impl.replaceTargets(exitTransition, exitingViews,
tempExiting);
}
exitingViews.clear();
@@ -394,6 +413,66 @@
}
/**
+ * Chooses the appropriate implementation depending on the Transition instances hold by the
+ * Fragments.
+ */
+ private static FragmentTransitionImpl chooseImpl(Fragment outFragment, Fragment inFragment) {
+ // Collect all transition instances
+ final ArrayList<Object> transitions = new ArrayList<>();
+ if (outFragment != null) {
+ final Object exitTransition = outFragment.getExitTransition();
+ if (exitTransition != null) {
+ transitions.add(exitTransition);
+ }
+ final Object returnTransition = outFragment.getReturnTransition();
+ if (returnTransition != null) {
+ transitions.add(returnTransition);
+ }
+ final Object sharedReturnTransition = outFragment.getSharedElementReturnTransition();
+ if (sharedReturnTransition != null) {
+ transitions.add(sharedReturnTransition);
+ }
+ }
+ if (inFragment != null) {
+ final Object enterTransition = inFragment.getEnterTransition();
+ if (enterTransition != null) {
+ transitions.add(enterTransition);
+ }
+ final Object reenterTransition = inFragment.getReenterTransition();
+ if (reenterTransition != null) {
+ transitions.add(reenterTransition);
+ }
+ final Object sharedEnterTransition = inFragment.getSharedElementEnterTransition();
+ if (sharedEnterTransition != null) {
+ transitions.add(sharedEnterTransition);
+ }
+ }
+ if (transitions.isEmpty()) {
+ return null; // No transition to run
+ }
+ // Pick the implementation that can handle all the transitions
+ if (PLATFORM_IMPL != null && canHandleAll(PLATFORM_IMPL, transitions)) {
+ return PLATFORM_IMPL;
+ }
+ if (SUPPORT_IMPL != null && canHandleAll(SUPPORT_IMPL, transitions)) {
+ return SUPPORT_IMPL;
+ }
+ if (PLATFORM_IMPL != null || SUPPORT_IMPL != null) {
+ throw new IllegalArgumentException("Invalid Transition types");
+ }
+ return null;
+ }
+
+ private static boolean canHandleAll(FragmentTransitionImpl impl, List<Object> transitions) {
+ for (int i = 0, size = transitions.size(); i < size; i++) {
+ if (!impl.canHandle(transitions.get(i))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
* Returns a TransitionSet containing the shared element transition. The wrapping TransitionSet
* targets all shared elements to ensure that no other Views are targeted. The shared element
* transition can then target any or all shared elements without worrying about accidentally
@@ -405,27 +484,26 @@
* @return A TransitionSet wrapping the shared element transition or null if no such transition
* exists.
*/
- @RequiresApi(21)
- private static Object getSharedElementTransition(Fragment inFragment,
- Fragment outFragment, boolean isPop) {
+ private static Object getSharedElementTransition(FragmentTransitionImpl impl,
+ Fragment inFragment, Fragment outFragment, boolean isPop) {
if (inFragment == null || outFragment == null) {
return null;
}
- Object transition = FragmentTransitionCompat21.cloneTransition(isPop
+ Object transition = impl.cloneTransition(isPop
? outFragment.getSharedElementReturnTransition()
: inFragment.getSharedElementEnterTransition());
- return FragmentTransitionCompat21.wrapTransitionInSet(transition);
+ return impl.wrapTransitionInSet(transition);
}
/**
* Returns a clone of the enter transition or null if no such transition exists.
*/
- @RequiresApi(21)
- private static Object getEnterTransition(Fragment inFragment, boolean isPop) {
+ private static Object getEnterTransition(FragmentTransitionImpl impl,
+ Fragment inFragment, boolean isPop) {
if (inFragment == null) {
return null;
}
- return FragmentTransitionCompat21.cloneTransition(isPop
+ return impl.cloneTransition(isPop
? inFragment.getReenterTransition()
: inFragment.getEnterTransition());
}
@@ -433,12 +511,12 @@
/**
* Returns a clone of the exit transition or null if no such transition exists.
*/
- @RequiresApi(21)
- private static Object getExitTransition(Fragment outFragment, boolean isPop) {
+ private static Object getExitTransition(FragmentTransitionImpl impl,
+ Fragment outFragment, boolean isPop) {
if (outFragment == null) {
return null;
}
- return FragmentTransitionCompat21.cloneTransition(isPop
+ return impl.cloneTransition(isPop
? outFragment.getReturnTransition()
: outFragment.getExitTransition());
}
@@ -470,8 +548,8 @@
* epicenter
* @return The shared element transition or null if no shared elements exist
*/
- @RequiresApi(21)
- private static Object configureSharedElementsReordered(final ViewGroup sceneRoot,
+ private static Object configureSharedElementsReordered(final FragmentTransitionImpl impl,
+ final ViewGroup sceneRoot,
final View nonExistentView, final ArrayMap<String, String> nameOverrides,
final FragmentContainerTransition fragments,
final ArrayList<View> sharedElementsOut,
@@ -488,13 +566,13 @@
final boolean inIsPop = fragments.lastInIsPop;
Object sharedElementTransition = nameOverrides.isEmpty() ? null
- : getSharedElementTransition(inFragment, outFragment, inIsPop);
+ : getSharedElementTransition(impl, inFragment, outFragment, inIsPop);
- final ArrayMap<String, View> outSharedElements = captureOutSharedElements(nameOverrides,
- sharedElementTransition, fragments);
+ final ArrayMap<String, View> outSharedElements = captureOutSharedElements(impl,
+ nameOverrides, sharedElementTransition, fragments);
- final ArrayMap<String, View> inSharedElements = captureInSharedElements(nameOverrides,
- sharedElementTransition, fragments);
+ final ArrayMap<String, View> inSharedElements = captureInSharedElements(impl,
+ nameOverrides, sharedElementTransition, fragments);
if (nameOverrides.isEmpty()) {
sharedElementTransition = null;
@@ -522,17 +600,17 @@
final View epicenterView;
if (sharedElementTransition != null) {
sharedElementsIn.add(nonExistentView);
- FragmentTransitionCompat21.setSharedElementTargets(sharedElementTransition,
+ impl.setSharedElementTargets(sharedElementTransition,
nonExistentView, sharedElementsOut);
final boolean outIsPop = fragments.firstOutIsPop;
final BackStackRecord outTransaction = fragments.firstOutTransaction;
- setOutEpicenter(sharedElementTransition, exitTransition, outSharedElements, outIsPop,
- outTransaction);
+ setOutEpicenter(impl, sharedElementTransition, exitTransition, outSharedElements,
+ outIsPop, outTransaction);
epicenter = new Rect();
epicenterView = getInEpicenterView(inSharedElements, fragments,
enterTransition, inIsPop);
if (epicenterView != null) {
- FragmentTransitionCompat21.setEpicenter(enterTransition, epicenter);
+ impl.setEpicenter(enterTransition, epicenter);
}
} else {
epicenter = null;
@@ -545,7 +623,7 @@
callSharedElementStartEnd(inFragment, outFragment, inIsPop,
inSharedElements, false);
if (epicenterView != null) {
- FragmentTransitionCompat21.getBoundsOnScreen(epicenterView, epicenter);
+ impl.getBoundsOnScreen(epicenterView, epicenter);
}
}
});
@@ -599,8 +677,8 @@
* epicenter
* @return The shared element transition or null if no shared elements exist
*/
- @RequiresApi(21)
- private static Object configureSharedElementsOrdered(final ViewGroup sceneRoot,
+ private static Object configureSharedElementsOrdered(final FragmentTransitionImpl impl,
+ final ViewGroup sceneRoot,
final View nonExistentView, final ArrayMap<String, String> nameOverrides,
final FragmentContainerTransition fragments,
final ArrayList<View> sharedElementsOut,
@@ -615,9 +693,9 @@
final boolean inIsPop = fragments.lastInIsPop;
Object sharedElementTransition = nameOverrides.isEmpty() ? null
- : getSharedElementTransition(inFragment, outFragment, inIsPop);
+ : getSharedElementTransition(impl, inFragment, outFragment, inIsPop);
- ArrayMap<String, View> outSharedElements = captureOutSharedElements(nameOverrides,
+ ArrayMap<String, View> outSharedElements = captureOutSharedElements(impl, nameOverrides,
sharedElementTransition, fragments);
if (nameOverrides.isEmpty()) {
@@ -636,14 +714,14 @@
final Rect inEpicenter;
if (sharedElementTransition != null) {
inEpicenter = new Rect();
- FragmentTransitionCompat21.setSharedElementTargets(sharedElementTransition,
+ impl.setSharedElementTargets(sharedElementTransition,
nonExistentView, sharedElementsOut);
final boolean outIsPop = fragments.firstOutIsPop;
final BackStackRecord outTransaction = fragments.firstOutTransaction;
- setOutEpicenter(sharedElementTransition, exitTransition, outSharedElements, outIsPop,
- outTransaction);
+ setOutEpicenter(impl, sharedElementTransition, exitTransition, outSharedElements,
+ outIsPop, outTransaction);
if (enterTransition != null) {
- FragmentTransitionCompat21.setEpicenter(enterTransition, inEpicenter);
+ impl.setEpicenter(enterTransition, inEpicenter);
}
} else {
inEpicenter = null;
@@ -654,7 +732,7 @@
OneShotPreDrawListener.add(sceneRoot, new Runnable() {
@Override
public void run() {
- ArrayMap<String, View> inSharedElements = captureInSharedElements(
+ ArrayMap<String, View> inSharedElements = captureInSharedElements(impl,
nameOverrides, finalSharedElementTransition, fragments);
if (inSharedElements != null) {
@@ -665,14 +743,14 @@
callSharedElementStartEnd(inFragment, outFragment, inIsPop,
inSharedElements, false);
if (finalSharedElementTransition != null) {
- FragmentTransitionCompat21.swapSharedElementTargets(
+ impl.swapSharedElementTargets(
finalSharedElementTransition, sharedElementsOut,
sharedElementsIn);
final View inEpicenterView = getInEpicenterView(inSharedElements,
fragments, enterTransition, inIsPop);
if (inEpicenterView != null) {
- FragmentTransitionCompat21.getBoundsOnScreen(inEpicenterView,
+ impl.getBoundsOnScreen(inEpicenterView,
inEpicenter);
}
}
@@ -696,8 +774,7 @@
* @return The mapping of shared element names to the Views in the hierarchy or null
* if there is no shared element transition.
*/
- @RequiresApi(21)
- private static ArrayMap<String, View> captureOutSharedElements(
+ private static ArrayMap<String, View> captureOutSharedElements(FragmentTransitionImpl impl,
ArrayMap<String, String> nameOverrides, Object sharedElementTransition,
FragmentContainerTransition fragments) {
if (nameOverrides.isEmpty() || sharedElementTransition == null) {
@@ -706,7 +783,7 @@
}
final Fragment outFragment = fragments.firstOut;
final ArrayMap<String, View> outSharedElements = new ArrayMap<>();
- FragmentTransitionCompat21.findNamedViews(outSharedElements, outFragment.getView());
+ impl.findNamedViews(outSharedElements, outFragment.getView());
final SharedElementCallback sharedElementCallback;
final ArrayList<String> names;
@@ -752,8 +829,7 @@
* @return The mapping of shared element names to the Views in the hierarchy or null
* if there is no shared element transition.
*/
- @RequiresApi(21)
- private static ArrayMap<String, View> captureInSharedElements(
+ private static ArrayMap<String, View> captureInSharedElements(FragmentTransitionImpl impl,
ArrayMap<String, String> nameOverrides, Object sharedElementTransition,
FragmentContainerTransition fragments) {
Fragment inFragment = fragments.lastIn;
@@ -763,7 +839,7 @@
return null;
}
final ArrayMap<String, View> inSharedElements = new ArrayMap<>();
- FragmentTransitionCompat21.findNamedViews(inSharedElements, fragmentView);
+ impl.findNamedViews(inSharedElements, fragmentView);
final SharedElementCallback sharedElementCallback;
final ArrayList<String> names;
@@ -848,8 +924,7 @@
* @param outIsPop Is the outgoing fragment being removed as a pop transaction?
* @param outTransaction The transaction that caused the fragment to be removed.
*/
- @RequiresApi(21)
- private static void setOutEpicenter(Object sharedElementTransition,
+ private static void setOutEpicenter(FragmentTransitionImpl impl, Object sharedElementTransition,
Object exitTransition, ArrayMap<String, View> outSharedElements, boolean outIsPop,
BackStackRecord outTransaction) {
if (outTransaction.mSharedElementSourceNames != null
@@ -858,10 +933,10 @@
? outTransaction.mSharedElementTargetNames.get(0)
: outTransaction.mSharedElementSourceNames.get(0);
final View outEpicenterView = outSharedElements.get(sourceName);
- FragmentTransitionCompat21.setEpicenter(sharedElementTransition, outEpicenterView);
+ impl.setEpicenter(sharedElementTransition, outEpicenterView);
if (exitTransition != null) {
- FragmentTransitionCompat21.setEpicenter(exitTransition, outEpicenterView);
+ impl.setEpicenter(exitTransition, outEpicenterView);
}
}
}
@@ -913,22 +988,22 @@
}
}
- @RequiresApi(21)
- private static ArrayList<View> configureEnteringExitingViews(Object transition,
+ private static ArrayList<View> configureEnteringExitingViews(FragmentTransitionImpl impl,
+ Object transition,
Fragment fragment, ArrayList<View> sharedElements, View nonExistentView) {
ArrayList<View> viewList = null;
if (transition != null) {
viewList = new ArrayList<>();
View root = fragment.getView();
if (root != null) {
- FragmentTransitionCompat21.captureTransitioningViews(viewList, root);
+ impl.captureTransitioningViews(viewList, root);
}
if (sharedElements != null) {
viewList.removeAll(sharedElements);
}
if (!viewList.isEmpty()) {
viewList.add(nonExistentView);
- FragmentTransitionCompat21.addTargets(transition, viewList);
+ impl.addTargets(transition, viewList);
}
}
return viewList;
@@ -951,8 +1026,7 @@
* Merges exit, shared element, and enter transitions so that they act together or
* sequentially as defined in the fragments.
*/
- @RequiresApi(21)
- private static Object mergeTransitions(Object enterTransition,
+ private static Object mergeTransitions(FragmentTransitionImpl impl, Object enterTransition,
Object exitTransition, Object sharedElementTransition, Fragment inFragment,
boolean isPop) {
boolean overlap = true;
@@ -968,12 +1042,12 @@
Object transition;
if (overlap) {
// Regular transition -- do it all together
- transition = FragmentTransitionCompat21.mergeTransitionsTogether(exitTransition,
+ transition = impl.mergeTransitionsTogether(exitTransition,
enterTransition, sharedElementTransition);
} else {
// First do exit, then enter, but allow shared element transition to happen
// during both.
- transition = FragmentTransitionCompat21.mergeTransitionsInSequence(exitTransition,
+ transition = impl.mergeTransitionsInSequence(exitTransition,
enterTransition, sharedElementTransition);
}
return transition;
@@ -1017,6 +1091,10 @@
}
}
+ static boolean supportsTransition() {
+ return PLATFORM_IMPL != null || SUPPORT_IMPL != null;
+ }
+
/**
* Examines the {@code command} and may set the first out or last in fragment for the fragment's
* container.
diff --git a/fragment/java/android/support/v4/app/FragmentTransitionCompat21.java b/fragment/java/android/support/v4/app/FragmentTransitionCompat21.java
index 600b1b8..7021912 100644
--- a/fragment/java/android/support/v4/app/FragmentTransitionCompat21.java
+++ b/fragment/java/android/support/v4/app/FragmentTransitionCompat21.java
@@ -26,15 +26,17 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
@RequiresApi(21)
-class FragmentTransitionCompat21 {
+class FragmentTransitionCompat21 extends FragmentTransitionImpl {
- /**
- * Returns a clone of a transition or null if it is null
- */
- public static Object cloneTransition(Object transition) {
+ @Override
+ public boolean canHandle(Object transition) {
+ return transition instanceof Transition;
+ }
+
+ @Override
+ public Object cloneTransition(Object transition) {
Transition copy = null;
if (transition != null) {
copy = ((Transition) transition).clone();
@@ -42,11 +44,8 @@
return copy;
}
- /**
- * Wraps a transition in a TransitionSet and returns the set. If transition is null, null is
- * returned.
- */
- public static Object wrapTransitionInSet(Object transition) {
+ @Override
+ public Object wrapTransitionInSet(Object transition) {
if (transition == null) {
return null;
}
@@ -55,13 +54,8 @@
return transitionSet;
}
- /**
- * Finds all children of the shared elements and sets the wrapping TransitionSet
- * targets to point to those. It also limits transitions that have no targets to the
- * specific shared elements. This allows developers to target child views of the
- * shared elements specifically, but this doesn't happen by default.
- */
- public static void setSharedElementTargets(Object transitionObj,
+ @Override
+ public void setSharedElementTargets(Object transitionObj,
View nonExistentView, ArrayList<View> sharedViews) {
TransitionSet transition = (TransitionSet) transitionObj;
final List<View> views = transition.getTargets();
@@ -76,48 +70,8 @@
addTargets(transition, sharedViews);
}
- /**
- * Uses a breadth-first scheme to add startView and all of its children to views.
- * It won't add a child if it is already in views.
- */
- private static void bfsAddViewChildren(final List<View> views, final View startView) {
- final int startIndex = views.size();
- if (containedBeforeIndex(views, startView, startIndex)) {
- return; // This child is already in the list, so all its children are also.
- }
- views.add(startView);
- for (int index = startIndex; index < views.size(); index++) {
- final View view = views.get(index);
- if (view instanceof ViewGroup) {
- ViewGroup viewGroup = (ViewGroup) view;
- final int childCount = viewGroup.getChildCount();
- for (int childIndex = 0; childIndex < childCount; childIndex++) {
- final View child = viewGroup.getChildAt(childIndex);
- if (!containedBeforeIndex(views, child, startIndex)) {
- views.add(child);
- }
- }
- }
- }
- }
-
- /**
- * Does a linear search through views for view, limited to maxIndex.
- */
- private static boolean containedBeforeIndex(final List<View> views, final View view,
- final int maxIndex) {
- for (int i = 0; i < maxIndex; i++) {
- if (views.get(i) == view) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Sets a transition epicenter to the rectangle of a given View.
- */
- public static void setEpicenter(Object transitionObj, View view) {
+ @Override
+ public void setEpicenter(Object transitionObj, View view) {
if (view != null) {
Transition transition = (Transition) transitionObj;
final Rect epicenter = new Rect();
@@ -132,25 +86,8 @@
}
}
- /**
- * Replacement for view.getBoundsOnScreen because that is not public. This returns a rect
- * containing the bounds relative to the screen that the view is in.
- */
- public static void getBoundsOnScreen(View view, Rect epicenter) {
- int[] loc = new int[2];
- view.getLocationOnScreen(loc);
- epicenter.set(loc[0], loc[1], loc[0] + view.getWidth(), loc[1] + view.getHeight());
- }
-
- /**
- * This method adds views as targets to the transition, but only if the transition
- * doesn't already have a target. It is best for views to contain one View object
- * that does not exist in the view hierarchy (state.nonExistentView) so that
- * when they are removed later, a list match will suffice to remove the targets.
- * Otherwise, if you happened to have targeted the exact views for the transition,
- * the replaceTargets call will remove them unexpectedly.
- */
- public static void addTargets(Object transitionObj, ArrayList<View> views) {
+ @Override
+ public void addTargets(Object transitionObj, ArrayList<View> views) {
Transition transition = (Transition) transitionObj;
if (transition == null) {
return;
@@ -183,19 +120,8 @@
|| !isNullOrEmpty(transition.getTargetTypes());
}
- /**
- * Simple utility to detect if a list is null or has no elements.
- */
- private static boolean isNullOrEmpty(List list) {
- return list == null || list.isEmpty();
- }
-
- /**
- * Creates a TransitionSet that plays all passed transitions together. Any null
- * transitions passed will not be added to the set. If all are null, then an empty
- * TransitionSet will be returned.
- */
- public static Object mergeTransitionsTogether(Object transition1, Object transition2,
+ @Override
+ public Object mergeTransitionsTogether(Object transition1, Object transition2,
Object transition3) {
TransitionSet transitionSet = new TransitionSet();
if (transition1 != null) {
@@ -210,11 +136,8 @@
return transitionSet;
}
- /**
- * After the transition completes, the fragment's view is set to GONE and the exiting
- * views are set to VISIBLE.
- */
- public static void scheduleHideFragmentView(Object exitTransitionObj, final View fragmentView,
+ @Override
+ public void scheduleHideFragmentView(Object exitTransitionObj, final View fragmentView,
final ArrayList<View> exitingViews) {
Transition exitTransition = (Transition) exitTransitionObj;
exitTransition.addListener(new Transition.TransitionListener() {
@@ -246,16 +169,8 @@
});
}
- /**
- * Combines enter, exit, and shared element transition so that they play in the proper
- * sequence. First the exit transition plays along with the shared element transition.
- * When the exit transition completes, the enter transition starts. The shared element
- * transition can continue running while the enter transition plays.
- *
- * @return A TransitionSet with all of enter, exit, and shared element transitions in
- * it (modulo null values), ordered such that they play in the proper sequence.
- */
- public static Object mergeTransitionsInSequence(Object exitTransitionObj,
+ @Override
+ public Object mergeTransitionsInSequence(Object exitTransitionObj,
Object enterTransitionObj, Object sharedElementTransitionObj) {
// First do exit, then enter, but allow shared element transition to happen
// during both.
@@ -285,154 +200,13 @@
}
}
- /**
- * Calls {@link TransitionManager#beginDelayedTransition(ViewGroup, Transition)}.
- */
- public static void beginDelayedTransition(ViewGroup sceneRoot, Object transition) {
+ @Override
+ public void beginDelayedTransition(ViewGroup sceneRoot, Object transition) {
TransitionManager.beginDelayedTransition(sceneRoot, (Transition) transition);
}
- /**
- * Prepares for setting the shared element names by gathering the names of the incoming
- * shared elements and clearing them. {@link #setNameOverridesReordered(View, ArrayList,
- * ArrayList, ArrayList, Map)} must be called after this to complete setting the shared element
- * name overrides. This must be called before
- * {@link #beginDelayedTransition(ViewGroup, Object)}.
- */
- public static ArrayList<String> prepareSetNameOverridesReordered(
- final ArrayList<View> sharedElementsIn) {
- final ArrayList<String> names = new ArrayList<>();
- final int numSharedElements = sharedElementsIn.size();
- for (int i = 0; i < numSharedElements; i++) {
- final View view = sharedElementsIn.get(i);
- names.add(view.getTransitionName());
- view.setTransitionName(null);
- }
- return names;
- }
-
- /**
- * Changes the shared element names for the incoming shared eleemnts to match those of the
- * outgoing shared elements. This also temporarily clears the shared element names of the
- * outgoing shared elements. Must be called after
- * {@link #beginDelayedTransition(ViewGroup, Object)}.
- */
- public static void setNameOverridesReordered(final View sceneRoot,
- final ArrayList<View> sharedElementsOut, final ArrayList<View> sharedElementsIn,
- final ArrayList<String> inNames, final Map<String, String> nameOverrides) {
- final int numSharedElements = sharedElementsIn.size();
- final ArrayList<String> outNames = new ArrayList<>();
-
- for (int i = 0; i < numSharedElements; i++) {
- final View view = sharedElementsOut.get(i);
- final String name = view.getTransitionName();
- outNames.add(name);
- if (name == null) {
- continue;
- }
- view.setTransitionName(null);
- final String inName = nameOverrides.get(name);
- for (int j = 0; j < numSharedElements; j++) {
- if (inName.equals(inNames.get(j))) {
- sharedElementsIn.get(j).setTransitionName(name);
- break;
- }
- }
- }
-
- OneShotPreDrawListener.add(sceneRoot, new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < numSharedElements; i++) {
- sharedElementsIn.get(i).setTransitionName(inNames.get(i));
- sharedElementsOut.get(i).setTransitionName(outNames.get(i));
- }
- }
- });
- }
-
- /**
- * Gets the Views in the hierarchy affected by entering and exiting Activity Scene transitions.
- * @param transitioningViews This View will be added to transitioningViews if it is VISIBLE and
- * a normal View or a ViewGroup with
- * {@link android.view.ViewGroup#isTransitionGroup()} true.
- * @param view The base of the view hierarchy to look in.
- */
- public static void captureTransitioningViews(ArrayList<View> transitioningViews, View view) {
- if (view.getVisibility() == View.VISIBLE) {
- if (view instanceof ViewGroup) {
- ViewGroup viewGroup = (ViewGroup) view;
- if (viewGroup.isTransitionGroup()) {
- transitioningViews.add(viewGroup);
- } else {
- int count = viewGroup.getChildCount();
- for (int i = 0; i < count; i++) {
- View child = viewGroup.getChildAt(i);
- captureTransitioningViews(transitioningViews, child);
- }
- }
- } else {
- transitioningViews.add(view);
- }
- }
- }
-
- /**
- * Finds all views that have transition names in the hierarchy under the given view and
- * stores them in {@code namedViews} map with the name as the key.
- */
- public static void findNamedViews(Map<String, View> namedViews, View view) {
- if (view.getVisibility() == View.VISIBLE) {
- String transitionName = view.getTransitionName();
- if (transitionName != null) {
- namedViews.put(transitionName, view);
- }
- if (view instanceof ViewGroup) {
- ViewGroup viewGroup = (ViewGroup) view;
- int count = viewGroup.getChildCount();
- for (int i = 0; i < count; i++) {
- View child = viewGroup.getChildAt(i);
- findNamedViews(namedViews, child);
- }
- }
- }
- }
-
- public static void setNameOverridesOrdered(final View sceneRoot,
- final ArrayList<View> sharedElementsIn, final Map<String, String> nameOverrides) {
- OneShotPreDrawListener.add(sceneRoot, new Runnable() {
- @Override
- public void run() {
- final int numSharedElements = sharedElementsIn.size();
- for (int i = 0; i < numSharedElements; i++) {
- View view = sharedElementsIn.get(i);
- String name = view.getTransitionName();
- if (name != null) {
- String inName = findKeyForValue(nameOverrides, name);
- view.setTransitionName(inName);
- }
- }
- }
- });
- }
-
- /**
- * Utility to find the String key in {@code map} that maps to {@code value}.
- */
- private static String findKeyForValue(Map<String, String> map, String value) {
- for (Map.Entry<String, String> entry : map.entrySet()) {
- if (value.equals(entry.getValue())) {
- return entry.getKey();
- }
- }
- return null;
- }
-
- /**
- * After the transition has started, remove all targets that we added to the transitions
- * so that the transitions are left in a clean state.
- */
- public static void scheduleRemoveTargets(final Object overallTransitionObj,
+ @Override
+ public void scheduleRemoveTargets(final Object overallTransitionObj,
final Object enterTransition, final ArrayList<View> enteringViews,
final Object exitTransition, final ArrayList<View> exitingViews,
final Object sharedElementTransition, final ArrayList<View> sharedElementsIn) {
@@ -469,11 +243,8 @@
});
}
- /**
- * Swap the targets for the shared element transition from those Views in sharedElementsOut
- * to those in sharedElementsIn
- */
- public static void swapSharedElementTargets(Object sharedElementTransitionObj,
+ @Override
+ public void swapSharedElementTargets(Object sharedElementTransitionObj,
ArrayList<View> sharedElementsOut, ArrayList<View> sharedElementsIn) {
TransitionSet sharedElementTransition = (TransitionSet) sharedElementTransitionObj;
if (sharedElementTransition != null) {
@@ -483,14 +254,8 @@
}
}
-
- /**
- * This method removes the views from transitions that target ONLY those views and
- * replaces them with the new targets list.
- * The views list should match those added in addTargets and should contain
- * one view that is not in the view hierarchy (state.nonExistentView).
- */
- public static void replaceTargets(Object transitionObj, ArrayList<View> oldTargets,
+ @Override
+ public void replaceTargets(Object transitionObj, ArrayList<View> oldTargets,
ArrayList<View> newTargets) {
Transition transition = (Transition) transitionObj;
if (transition instanceof TransitionSet) {
@@ -516,31 +281,24 @@
}
}
- /**
- * Adds a View target to a transition. If transitionObj is null, nothing is done.
- */
- public static void addTarget(Object transitionObj, View view) {
+ @Override
+ public void addTarget(Object transitionObj, View view) {
if (transitionObj != null) {
Transition transition = (Transition) transitionObj;
transition.addTarget(view);
}
}
- /**
- * Remove a View target to a transition. If transitionObj is null, nothing is done.
- */
- public static void removeTarget(Object transitionObj, View view) {
+ @Override
+ public void removeTarget(Object transitionObj, View view) {
if (transitionObj != null) {
Transition transition = (Transition) transitionObj;
transition.removeTarget(view);
}
}
- /**
- * Sets the epicenter of a transition to a rect object. The object can be modified until
- * the transition runs.
- */
- public static void setEpicenter(Object transitionObj, final Rect epicenter) {
+ @Override
+ public void setEpicenter(Object transitionObj, final Rect epicenter) {
if (transitionObj != null) {
Transition transition = (Transition) transitionObj;
transition.setEpicenterCallback(new Transition.EpicenterCallback() {
@@ -555,19 +313,4 @@
}
}
- public static void scheduleNameReset(final ViewGroup sceneRoot,
- final ArrayList<View> sharedElementsIn, final Map<String, String> nameOverrides) {
- OneShotPreDrawListener.add(sceneRoot, new Runnable() {
- @Override
- public void run() {
- final int numSharedElements = sharedElementsIn.size();
- for (int i = 0; i < numSharedElements; i++) {
- final View view = sharedElementsIn.get(i);
- final String name = view.getTransitionName();
- final String inName = nameOverrides.get(name);
- view.setTransitionName(inName);
- }
- }
- });
- }
}
diff --git a/fragment/java/android/support/v4/app/FragmentTransitionImpl.java b/fragment/java/android/support/v4/app/FragmentTransitionImpl.java
new file mode 100644
index 0000000..b90e7fe
--- /dev/null
+++ b/fragment/java/android/support/v4/app/FragmentTransitionImpl.java
@@ -0,0 +1,363 @@
+/*
+ * Copyright (C) 2017 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 android.support.v4.app;
+
+import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.graphics.Rect;
+import android.support.annotation.RestrictTo;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.view.ViewGroupCompat;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * @hide
+ */
+@RestrictTo(LIBRARY_GROUP)
+public abstract class FragmentTransitionImpl {
+
+ /**
+ * Returns {@code true} if this implementation can handle the specified {@link transition}.
+ */
+ public abstract boolean canHandle(Object transition);
+
+ /**
+ * Returns a clone of a transition or null if it is null
+ */
+ public abstract Object cloneTransition(Object transition);
+
+ /**
+ * Wraps a transition in a TransitionSet and returns the set. If transition is null, null is
+ * returned.
+ */
+ public abstract Object wrapTransitionInSet(Object transition);
+
+ /**
+ * Finds all children of the shared elements and sets the wrapping TransitionSet
+ * targets to point to those. It also limits transitions that have no targets to the
+ * specific shared elements. This allows developers to target child views of the
+ * shared elements specifically, but this doesn't happen by default.
+ */
+ public abstract void setSharedElementTargets(Object transitionObj,
+ View nonExistentView, ArrayList<View> sharedViews);
+
+ /**
+ * Sets a transition epicenter to the rectangle of a given View.
+ */
+ public abstract void setEpicenter(Object transitionObj, View view);
+
+ /**
+ * Replacement for view.getBoundsOnScreen because that is not public. This returns a rect
+ * containing the bounds relative to the screen that the view is in.
+ */
+ protected void getBoundsOnScreen(View view, Rect epicenter) {
+ int[] loc = new int[2];
+ view.getLocationOnScreen(loc);
+ epicenter.set(loc[0], loc[1], loc[0] + view.getWidth(), loc[1] + view.getHeight());
+ }
+
+ /**
+ * This method adds views as targets to the transition, but only if the transition
+ * doesn't already have a target. It is best for views to contain one View object
+ * that does not exist in the view hierarchy (state.nonExistentView) so that
+ * when they are removed later, a list match will suffice to remove the targets.
+ * Otherwise, if you happened to have targeted the exact views for the transition,
+ * the replaceTargets call will remove them unexpectedly.
+ */
+ public abstract void addTargets(Object transitionObj, ArrayList<View> views);
+
+ /**
+ * Creates a TransitionSet that plays all passed transitions together. Any null
+ * transitions passed will not be added to the set. If all are null, then an empty
+ * TransitionSet will be returned.
+ */
+ public abstract Object mergeTransitionsTogether(Object transition1, Object transition2,
+ Object transition3);
+
+ /**
+ * After the transition completes, the fragment's view is set to GONE and the exiting
+ * views are set to VISIBLE.
+ */
+ public abstract void scheduleHideFragmentView(Object exitTransitionObj, View fragmentView,
+ ArrayList<View> exitingViews);
+
+ /**
+ * Combines enter, exit, and shared element transition so that they play in the proper
+ * sequence. First the exit transition plays along with the shared element transition.
+ * When the exit transition completes, the enter transition starts. The shared element
+ * transition can continue running while the enter transition plays.
+ *
+ * @return A TransitionSet with all of enter, exit, and shared element transitions in
+ * it (modulo null values), ordered such that they play in the proper sequence.
+ */
+ public abstract Object mergeTransitionsInSequence(Object exitTransitionObj,
+ Object enterTransitionObj, Object sharedElementTransitionObj);
+
+ /**
+ * Calls {@code TransitionManager#beginDelayedTransition(ViewGroup, Transition)}.
+ */
+ public abstract void beginDelayedTransition(ViewGroup sceneRoot, Object transition);
+
+ /**
+ * Prepares for setting the shared element names by gathering the names of the incoming
+ * shared elements and clearing them. {@link #setNameOverridesReordered(View, ArrayList,
+ * ArrayList, ArrayList, Map)} must be called after this to complete setting the shared element
+ * name overrides. This must be called before
+ * {@link #beginDelayedTransition(ViewGroup, Object)}.
+ */
+ ArrayList<String> prepareSetNameOverridesReordered(ArrayList<View> sharedElementsIn) {
+ final ArrayList<String> names = new ArrayList<>();
+ final int numSharedElements = sharedElementsIn.size();
+ for (int i = 0; i < numSharedElements; i++) {
+ final View view = sharedElementsIn.get(i);
+ names.add(ViewCompat.getTransitionName(view));
+ ViewCompat.setTransitionName(view, null);
+ }
+ return names;
+ }
+
+ /**
+ * Changes the shared element names for the incoming shared elements to match those of the
+ * outgoing shared elements. This also temporarily clears the shared element names of the
+ * outgoing shared elements. Must be called after
+ * {@link #beginDelayedTransition(ViewGroup, Object)}.
+ */
+ void setNameOverridesReordered(final View sceneRoot,
+ final ArrayList<View> sharedElementsOut, final ArrayList<View> sharedElementsIn,
+ final ArrayList<String> inNames, final Map<String, String> nameOverrides) {
+ final int numSharedElements = sharedElementsIn.size();
+ final ArrayList<String> outNames = new ArrayList<>();
+
+ for (int i = 0; i < numSharedElements; i++) {
+ final View view = sharedElementsOut.get(i);
+ final String name = ViewCompat.getTransitionName(view);
+ outNames.add(name);
+ if (name == null) {
+ continue;
+ }
+ ViewCompat.setTransitionName(view, null);
+ final String inName = nameOverrides.get(name);
+ for (int j = 0; j < numSharedElements; j++) {
+ if (inName.equals(inNames.get(j))) {
+ ViewCompat.setTransitionName(sharedElementsIn.get(j), name);
+ break;
+ }
+ }
+ }
+
+ OneShotPreDrawListener.add(sceneRoot, new Runnable() {
+ @Override
+ public void run() {
+ for (int i = 0; i < numSharedElements; i++) {
+ ViewCompat.setTransitionName(sharedElementsIn.get(i), inNames.get(i));
+ ViewCompat.setTransitionName(sharedElementsOut.get(i), outNames.get(i));
+ }
+ }
+ });
+ }
+
+ /**
+ * Gets the Views in the hierarchy affected by entering and exiting Activity Scene transitions.
+ *
+ * @param transitioningViews This View will be added to transitioningViews if it is VISIBLE and
+ * a normal View or a ViewGroup with
+ * {@link android.view.ViewGroup#isTransitionGroup()} true.
+ * @param view The base of the view hierarchy to look in.
+ */
+ void captureTransitioningViews(ArrayList<View> transitioningViews, View view) {
+ if (view.getVisibility() == View.VISIBLE) {
+ if (view instanceof ViewGroup) {
+ ViewGroup viewGroup = (ViewGroup) view;
+ if (ViewGroupCompat.isTransitionGroup(viewGroup)) {
+ transitioningViews.add(viewGroup);
+ } else {
+ int count = viewGroup.getChildCount();
+ for (int i = 0; i < count; i++) {
+ View child = viewGroup.getChildAt(i);
+ captureTransitioningViews(transitioningViews, child);
+ }
+ }
+ } else {
+ transitioningViews.add(view);
+ }
+ }
+ }
+
+ /**
+ * Finds all views that have transition names in the hierarchy under the given view and
+ * stores them in {@code namedViews} map with the name as the key.
+ */
+ void findNamedViews(Map<String, View> namedViews, View view) {
+ if (view.getVisibility() == View.VISIBLE) {
+ String transitionName = ViewCompat.getTransitionName(view);
+ if (transitionName != null) {
+ namedViews.put(transitionName, view);
+ }
+ if (view instanceof ViewGroup) {
+ ViewGroup viewGroup = (ViewGroup) view;
+ int count = viewGroup.getChildCount();
+ for (int i = 0; i < count; i++) {
+ View child = viewGroup.getChildAt(i);
+ findNamedViews(namedViews, child);
+ }
+ }
+ }
+ }
+
+ /**
+ *Applies the prepared {@code nameOverrides} to the view hierarchy.
+ */
+ void setNameOverridesOrdered(final View sceneRoot,
+ final ArrayList<View> sharedElementsIn, final Map<String, String> nameOverrides) {
+ OneShotPreDrawListener.add(sceneRoot, new Runnable() {
+ @Override
+ public void run() {
+ final int numSharedElements = sharedElementsIn.size();
+ for (int i = 0; i < numSharedElements; i++) {
+ View view = sharedElementsIn.get(i);
+ String name = ViewCompat.getTransitionName(view);
+ if (name != null) {
+ String inName = findKeyForValue(nameOverrides, name);
+ ViewCompat.setTransitionName(view, inName);
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * After the transition has started, remove all targets that we added to the transitions
+ * so that the transitions are left in a clean state.
+ */
+ public abstract void scheduleRemoveTargets(Object overallTransitionObj,
+ Object enterTransition, ArrayList<View> enteringViews,
+ Object exitTransition, ArrayList<View> exitingViews,
+ Object sharedElementTransition, ArrayList<View> sharedElementsIn);
+
+ /**
+ * Swap the targets for the shared element transition from those Views in sharedElementsOut
+ * to those in sharedElementsIn
+ */
+ public abstract void swapSharedElementTargets(Object sharedElementTransitionObj,
+ ArrayList<View> sharedElementsOut, ArrayList<View> sharedElementsIn);
+
+ /**
+ * This method removes the views from transitions that target ONLY those views and
+ * replaces them with the new targets list.
+ * The views list should match those added in addTargets and should contain
+ * one view that is not in the view hierarchy (state.nonExistentView).
+ */
+ public abstract void replaceTargets(Object transitionObj, ArrayList<View> oldTargets,
+ ArrayList<View> newTargets);
+
+ /**
+ * Adds a View target to a transition. If transitionObj is null, nothing is done.
+ */
+ public abstract void addTarget(Object transitionObj, View view);
+
+ /**
+ * Remove a View target to a transition. If transitionObj is null, nothing is done.
+ */
+ public abstract void removeTarget(Object transitionObj, View view);
+
+ /**
+ * Sets the epicenter of a transition to a rect object. The object can be modified until
+ * the transition runs.
+ */
+ public abstract void setEpicenter(Object transitionObj, Rect epicenter);
+
+ void scheduleNameReset(final ViewGroup sceneRoot,
+ final ArrayList<View> sharedElementsIn, final Map<String, String> nameOverrides) {
+ OneShotPreDrawListener.add(sceneRoot, new Runnable() {
+ @Override
+ public void run() {
+ final int numSharedElements = sharedElementsIn.size();
+ for (int i = 0; i < numSharedElements; i++) {
+ final View view = sharedElementsIn.get(i);
+ final String name = ViewCompat.getTransitionName(view);
+ final String inName = nameOverrides.get(name);
+ ViewCompat.setTransitionName(view, inName);
+ }
+ }
+ });
+ }
+
+ /**
+ * Uses a breadth-first scheme to add startView and all of its children to views.
+ * It won't add a child if it is already in views.
+ */
+ protected static void bfsAddViewChildren(final List<View> views, final View startView) {
+ final int startIndex = views.size();
+ if (containedBeforeIndex(views, startView, startIndex)) {
+ return; // This child is already in the list, so all its children are also.
+ }
+ views.add(startView);
+ for (int index = startIndex; index < views.size(); index++) {
+ final View view = views.get(index);
+ if (view instanceof ViewGroup) {
+ ViewGroup viewGroup = (ViewGroup) view;
+ final int childCount = viewGroup.getChildCount();
+ for (int childIndex = 0; childIndex < childCount; childIndex++) {
+ final View child = viewGroup.getChildAt(childIndex);
+ if (!containedBeforeIndex(views, child, startIndex)) {
+ views.add(child);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Does a linear search through views for view, limited to maxIndex.
+ */
+ private static boolean containedBeforeIndex(final List<View> views, final View view,
+ final int maxIndex) {
+ for (int i = 0; i < maxIndex; i++) {
+ if (views.get(i) == view) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Simple utility to detect if a list is null or has no elements.
+ */
+ protected static boolean isNullOrEmpty(List list) {
+ return list == null || list.isEmpty();
+ }
+
+ /**
+ * Utility to find the String key in {@code map} that maps to {@code value}.
+ */
+ @SuppressWarnings("WeakerAccess")
+ static String findKeyForValue(Map<String, String> map, String value) {
+ for (Map.Entry<String, String> entry : map.entrySet()) {
+ if (value.equals(entry.getValue())) {
+ return entry.getKey();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 2a386c4..4e68a5b 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=../../../../tools/external/gradle/gradle-4.1-milestone-1-bin.zip
+distributionUrl=../../../../tools/external/gradle/gradle-4.1-rc-2-bin.zip
diff --git a/graphics/drawable/animated/AndroidManifest.xml b/graphics/drawable/animated/AndroidManifest.xml
index b59fa47..ec4a4a6 100644
--- a/graphics/drawable/animated/AndroidManifest.xml
+++ b/graphics/drawable/animated/AndroidManifest.xml
@@ -17,6 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.graphics.drawable.animated">
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.graphics.drawable.animated.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/graphics/drawable/static/AndroidManifest.xml b/graphics/drawable/static/AndroidManifest.xml
index 14821a8..d8427ca 100644
--- a/graphics/drawable/static/AndroidManifest.xml
+++ b/graphics/drawable/static/AndroidManifest.xml
@@ -17,6 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.graphics.drawable">
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.graphics.drawable.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/lifecycle/common/build.gradle b/lifecycle/common/build.gradle
index 1b64d9d..d237d30 100644
--- a/lifecycle/common/build.gradle
+++ b/lifecycle/common/build.gradle
@@ -1,3 +1,5 @@
+import android.support.LibraryVersions
+
apply plugin: 'java'
apply plugin: 'maven'
@@ -10,4 +12,4 @@
}
createAndroidCheckstyle(project)
-version = "1.0.0-SNAPSHOT"
\ No newline at end of file
+version = LibraryVersions.LIFECYCLES.toString()
\ No newline at end of file
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/ErrorMessages.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/ErrorMessages.kt
new file mode 100644
index 0000000..8dac863
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/ErrorMessages.kt
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle
+
+object ErrorMessages {
+ const val TOO_MANY_ARGS = "callback method cannot have more than 2 parameters"
+ const val TOO_MANY_ARGS_NOT_ON_ANY = "only callback annotated with ON_ANY " +
+ "can have 2 parameters"
+ const val INVALID_SECOND_ARGUMENT = "2nd argument of a callback method" +
+ " must be Lifecycle.Event and represent the current event"
+ const val INVALID_FIRST_ARGUMENT = "1st argument of a callback method must be " +
+ "a LifecycleOwner which represents the source of the event"
+ const val INVALID_METHOD_MODIFIER = "method marked with OnLifecycleEvent annotation can " +
+ "not be private"
+ const val INVALID_CLASS_MODIFIER = "class containing OnLifecycleEvent methods can not be " +
+ "private"
+ const val INVALID_STATE_OVERRIDE_METHOD = "overridden method must handle the same " +
+ "onState changes as original method"
+ const val INVALID_ENCLOSING_ELEMENT =
+ "Parent of OnLifecycleEvent should be a class or interface"
+ const val INVALID_ANNOTATED_ELEMENT = "OnLifecycleEvent can only be added to methods"
+
+}
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/LifecycleProcessor.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/LifecycleProcessor.kt
index 30aaa3e..81bcc95 100644
--- a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/LifecycleProcessor.kt
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/LifecycleProcessor.kt
@@ -16,360 +16,20 @@
package android.arch.lifecycle
-import com.google.auto.common.MoreElements
-import com.google.auto.common.MoreTypes
-import com.squareup.javapoet.ClassName
-import com.squareup.javapoet.FieldSpec
-import com.squareup.javapoet.JavaFile
-import com.squareup.javapoet.MethodSpec
-import com.squareup.javapoet.ParameterSpec
-import com.squareup.javapoet.TypeName
-import com.squareup.javapoet.TypeSpec
-import java.util.LinkedList
-import javax.annotation.processing.*
+import javax.annotation.processing.AbstractProcessor
+import javax.annotation.processing.RoundEnvironment
+import javax.annotation.processing.SupportedAnnotationTypes
+import javax.annotation.processing.SupportedSourceVersion
import javax.lang.model.SourceVersion
-import javax.lang.model.element.*
-import javax.lang.model.element.Modifier.PRIVATE
-import javax.lang.model.element.Modifier.PROTECTED
-import javax.lang.model.element.Modifier.PUBLIC
-import javax.lang.model.type.NoType
-import javax.lang.model.type.TypeMirror
-import javax.tools.Diagnostic
-
-fun Element.getPackage(): PackageElement = MoreElements.getPackage(this)
-fun Element.getPackageQName() = getPackage().qualifiedName.toString()
-fun ExecutableElement.name() = simpleName.toString()
-fun ExecutableElement.isPackagePrivate() = !modifiers.any {
- it == PUBLIC || it == PROTECTED || it == PRIVATE
-}
-
-fun ExecutableElement.isProtected() = modifiers.contains(PROTECTED)
+import javax.lang.model.element.TypeElement
@SupportedAnnotationTypes("android.arch.lifecycle.OnLifecycleEvent")
@SupportedSourceVersion(SourceVersion.RELEASE_7)
class LifecycleProcessor : AbstractProcessor() {
- companion object ErrorMessages {
- const val TOO_MANY_ARGS = "callback method cannot have more than 2 parameters"
- const val TOO_MANY_ARGS_NOT_ON_ANY = "only callback annotated with ON_ANY " +
- "can have 2 parameters"
- const val INVALID_SECOND_ARGUMENT = "2nd argument of a callback method" +
- " must be Lifecycle.Event and represent the current event"
- const val INVALID_FIRST_ARGUMENT = "1st argument of a callback method must be " +
- "a LifecycleOwner which represents the source of the event"
- const val INVALID_METHOD_MODIFIER = "method marked with OnLifecycleEvent annotation can " +
- "not be private"
- const val INVALID_CLASS_MODIFIER = "class containing OnLifecycleEvent methods can not be " +
- "private"
- const val INVALID_STATE_OVERRIDE_METHOD = "overridden method must handle the same " +
- "onState changes as original method"
- }
-
- private val LIFECYCLE_OWNER = ClassName.get(LifecycleOwner::class.java)
- private val JAVA_LIFECYCLE_EVENT = Lifecycle.Event::class.java
- private val T = "\$T"
- private val N = "\$N"
- private val L = "\$L"
-
- private fun printErrorMessage(msg: CharSequence, elem: Element) {
- processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, msg, elem)
- }
-
- private fun validateParam(param: VariableElement,
- expectedType: Class<*>, errorMsg: String): Boolean {
- if (!MoreTypes.isTypeOf(expectedType, param.asType())) {
- printErrorMessage(errorMsg, param)
- return false
- }
- return true
- }
-
- private fun validateMethod(method: ExecutableElement, event: Lifecycle.Event): Boolean {
- if (PRIVATE in method.modifiers) {
- printErrorMessage(INVALID_METHOD_MODIFIER, method)
- return false
- }
- val params = method.parameters
- if ((params.size > 2)) {
- printErrorMessage(TOO_MANY_ARGS, method)
- return false
- }
-
- if (params.size == 2 && event != Lifecycle.Event.ON_ANY) {
- printErrorMessage(TOO_MANY_ARGS_NOT_ON_ANY, method)
- return false
- }
-
- if (params.size == 2 && !validateParam(params[1], JAVA_LIFECYCLE_EVENT,
- INVALID_SECOND_ARGUMENT)) {
- return false
- }
-
- if (params.size > 0) {
- return validateParam(params[0], LifecycleOwner::class.java,
- INVALID_FIRST_ARGUMENT)
- }
- return true
- }
-
- private fun validateClass(classElement: Element): Boolean {
- if (classElement.kind != ElementKind.CLASS && classElement.kind != ElementKind.INTERFACE) {
- printErrorMessage("Parent of OnLifecycleEvent should be a class or interface",
- classElement)
- return false
- }
- if (PRIVATE in classElement.modifiers) {
- printErrorMessage(INVALID_CLASS_MODIFIER, classElement)
- return false
- }
- return true
- }
-
override fun process(annotations: MutableSet<out TypeElement>,
roundEnv: RoundEnvironment): Boolean {
- val world = roundEnv.getElementsAnnotatedWith(OnLifecycleEvent::class.java).map { elem ->
- if (elem.kind != ElementKind.METHOD) {
- printErrorMessage("OnLifecycleEvent can only be added to methods", elem)
- null
- } else {
- val enclosingElement = elem.enclosingElement
- val onState = elem.getAnnotation(OnLifecycleEvent::class.java)
- val method = MoreElements.asExecutable(elem)
- if (validateClass(enclosingElement) && validateMethod(method, onState.value)) {
- StateMethod(method, onState)
- } else {
- null
- }
- }
- }
- .filterNotNull()
- .groupBy { MoreElements.asType(it.method.enclosingElement) }
- .mapValues { entry -> LifecycleObserverInfo(entry.key, entry.value) }
-
-
- flattenObserverInfos(world).forEach {
- writeAdapter(it)
- }
-
+ val input = collectAndVerifyInput(processingEnv, roundEnv)
+ writeModels(transformToOutput(processingEnv, input), processingEnv.filer)
return true
}
-
- private fun superObservers(world: Map<TypeElement, LifecycleObserverInfo>,
- observer: LifecycleObserverInfo): List<LifecycleObserverInfo> {
- val stack = LinkedList<TypeMirror>()
- stack += observer.type.interfaces.reversed()
- stack += observer.type.superclass
- val result = mutableListOf<LifecycleObserverInfo>()
- while (stack.isNotEmpty()) {
- val typeMirror = stack.removeLast()
- if (typeMirror is NoType) {
- continue
- }
- val type = MoreTypes.asTypeElement(typeMirror)
- val currentObserver = world[type]
- if (currentObserver != null) {
- result.add(currentObserver)
- } else {
- stack += type.interfaces.reversed()
- stack += type.superclass
- }
- }
- return result
- }
-
- private fun mergeAndVerifyMethods(classMethods: List<StateMethod>,
- parentMethods: List<StateMethod>): List<StateMethod> {
- return parentMethods + classMethods.filter { currentMethod ->
- val baseMethod = parentMethods.find { m ->
- currentMethod.method.simpleName == m.method.simpleName
- && currentMethod.method.parameters.size == m.method.parameters.size
- }
- if (baseMethod != null
- && baseMethod.onLifecycleEvent != currentMethod.onLifecycleEvent) {
- printErrorMessage(INVALID_STATE_OVERRIDE_METHOD, currentMethod.method)
- }
- baseMethod == null
- }
-
- }
-
- private fun flattenObserverInfos(
- world: Map<TypeElement, LifecycleObserverInfo>): List<LifecycleObserverInfo> {
- val superObservers = world.mapValues { superObservers(world, it.value) }
- val packagePrivateMethods = world.mapValues { observer ->
- if (observer.value.type.kind.isInterface) {
- emptyList()
- } else {
- observer.value.methods.filter {
- it.method.isPackagePrivate() || it.method.isProtected()
- }.map { it.method }
- }
- }
-
- val ppMethodsToType = packagePrivateMethods.entries.fold(
- mapOf<ExecutableElement, TypeElement>(), { map, entry ->
- map + entry.value.associate { it to entry.key }
- })
-
- world.values.forEach {
- val observers = superObservers[it.type]!!
- val currentPackage = it.type.getPackageQName()
- observers.filter { superObserver ->
- superObserver.type.getPackageQName() != currentPackage
- && packagePrivateMethods[superObserver.type]!!.isNotEmpty()
- }.forEach { it.syntheticMethods.addAll(packagePrivateMethods[it.type]!!) }
- }
-
-
- val flattened: MutableMap<LifecycleObserverInfo, LifecycleObserverInfo> = mutableMapOf()
- fun traverse(observer: LifecycleObserverInfo) {
- if (observer in flattened) {
- return
- }
- val observers = superObservers[observer.type]!!
- if (observers.isEmpty()) {
- flattened[observer] = observer
- return
- }
- observers.filter { it !in flattened }.forEach(::traverse)
- val currentPackage = observer.type.getPackageQName()
- val methods = observers.fold(emptyList<StateMethod>(),
- { list, observer -> mergeAndVerifyMethods(observer.methods, list) }).map {
- val packageName = ppMethodsToType[it.method]?.getPackageQName()
- if (packageName == null || packageName == currentPackage) {
- it
- } else {
- StateMethod(it.method, it.onLifecycleEvent, ppMethodsToType[it.method])
- }
- }
-
- flattened[observer] = LifecycleObserverInfo(observer.type,
- mergeAndVerifyMethods(observer.methods, methods), observer.syntheticMethods)
- }
-
- world.values.forEach(::traverse)
- return flattened.values.toList()
- }
-
- private fun writeAdapter(observer: LifecycleObserverInfo) {
- val ownerParam = ParameterSpec.builder(LIFECYCLE_OWNER, "owner").build()
- val eventParam = ParameterSpec.builder(ClassName.get(JAVA_LIFECYCLE_EVENT), "event").build()
- val receiverName = "mReceiver"
- val receiverField = FieldSpec.builder(ClassName.get(observer.type), receiverName,
- Modifier.FINAL).build()
-
- val dispatchMethodBuilder = MethodSpec.methodBuilder("onStateChanged")
- .returns(TypeName.VOID)
- .addParameter(ownerParam)
- .addParameter(eventParam)
- .addModifiers(PUBLIC)
- .addAnnotation(Override::class.java)
- val dispatchMethod = dispatchMethodBuilder.apply {
- observer.methods
- .groupBy { stateMethod -> stateMethod.onLifecycleEvent.value }
- .forEach { entry ->
- val event = entry.key
- val methods = entry.value
- if (event == Lifecycle.Event.ON_ANY) {
- writeMethodCalls(eventParam, methods, ownerParam, receiverField)
- } else {
- beginControlFlow("if ($N == $T.$L)", eventParam, JAVA_LIFECYCLE_EVENT, event)
- .writeMethodCalls(eventParam, methods, ownerParam, receiverField)
- endControlFlow()
- }
- }
- }.build()
-
- @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
- val getWrappedMethod = MethodSpec.methodBuilder("getReceiver")
- .returns(ClassName.get(Object::class.java))
- .addModifiers(PUBLIC)
- .addStatement("return $N", receiverField)
- .build()
-
- val receiverParam = ParameterSpec.builder(ClassName.get(observer.type), "receiver").build()
-
- val syntheticMethods = observer.syntheticMethods.map {
- val method = MethodSpec.methodBuilder(syntheticName(it))
- .returns(TypeName.VOID)
- .addModifiers(PUBLIC)
- .addModifiers(Modifier.STATIC)
- .addParameter(receiverParam)
- if (it.parameters.size >= 1) {
- method.addParameter(ownerParam)
- }
- if (it.parameters.size == 2) {
- method.addParameter(eventParam)
- }
-
- val count = it.parameters.size
- val paramString = generateParamString(count)
- method.addStatement("$N.$L($paramString)", receiverParam, it.name(),
- *takeParams(count, ownerParam, eventParam))
- method.build()
- }
-
- val constructor = MethodSpec.constructorBuilder()
- .addParameter(receiverParam)
- .addStatement("this.$N = $N", receiverField, receiverParam)
- .build()
-
- val adapterName = getAdapterName(observer.type)
- val adapter = TypeSpec.classBuilder(adapterName)
- .addModifiers(PUBLIC)
- .addSuperinterface(ClassName.get(GenericLifecycleObserver::class.java))
- .addField(receiverField)
- .addMethod(constructor)
- .addMethod(dispatchMethod)
- .addMethod(getWrappedMethod)
- .addMethods(syntheticMethods)
- .build()
- JavaFile.builder(observer.type.getPackageQName(), adapter)
- .build().writeTo(processingEnv.filer)
- }
-
- private fun MethodSpec.Builder.writeMethodCalls(eventParam: ParameterSpec,
- methods: List<StateMethod>,
- ownerParam: ParameterSpec,
- receiverField: FieldSpec) {
- methods.forEach { method ->
- val count = method.method.parameters.size
- if (method.syntheticAccess == null) {
- val paramString = generateParamString(count)
- addStatement("$N.$L($paramString)", receiverField,
- method.method.name(),
- *takeParams(count, ownerParam, eventParam))
-
- } else {
- val originalType = method.syntheticAccess
- val paramString = generateParamString(count + 1)
- val className = ClassName.get(originalType.getPackageQName(),
- getAdapterName(originalType))
- addStatement("$T.$L($paramString)", className,
- syntheticName(method.method),
- *takeParams(count + 1, receiverField, ownerParam,
- eventParam))
- }
- }
- }
-
- private fun syntheticName(method: ExecutableElement) = "__synthetic_" + method.simpleName
-
- private fun takeParams(count: Int, vararg params: Any) = params.take(count).toTypedArray()
-
- private fun generateParamString(count: Int) = (0..(count - 1)).joinToString(",") { N }
-
- private fun getAdapterName(type: TypeElement): String {
- val packageElement = type.getPackage()
- val qName = type.qualifiedName.toString()
- val partialName = if (packageElement.isUnnamed) qName else qName.substring(
- packageElement.qualifiedName.toString().length + 1)
- return Lifecycling.getAdapterName(partialName)
- }
-
- data class StateMethod(val method: ExecutableElement, val onLifecycleEvent: OnLifecycleEvent,
- val syntheticAccess: TypeElement? = null)
-
- data class LifecycleObserverInfo(val type: TypeElement, val methods: List<StateMethod>,
- var syntheticMethods:
- MutableSet<ExecutableElement> = mutableSetOf())
}
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/elements_ext.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/elements_ext.kt
new file mode 100644
index 0000000..eedb3af
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/elements_ext.kt
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle
+
+import com.google.auto.common.MoreElements
+import javax.lang.model.element.Element
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.Modifier
+import javax.lang.model.element.PackageElement
+
+fun Element.getPackage(): PackageElement = MoreElements.getPackage(this)
+
+fun Element.getPackageQName() = getPackage().qualifiedName.toString()
+
+fun ExecutableElement.name() = simpleName.toString()
+
+fun ExecutableElement.isPackagePrivate() = !modifiers.any {
+ it == Modifier.PUBLIC || it == Modifier.PROTECTED || it == Modifier.PRIVATE
+}
+
+fun ExecutableElement.isProtected() = modifiers.contains(Modifier.PROTECTED)
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/input_collector.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/input_collector.kt
new file mode 100644
index 0000000..5183df5
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/input_collector.kt
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle
+
+import android.arch.lifecycle.model.EventMethod
+import android.arch.lifecycle.model.LifecycleObserverInfo
+import com.google.auto.common.MoreElements
+import com.google.auto.common.MoreTypes
+import javax.annotation.processing.ProcessingEnvironment
+import javax.annotation.processing.RoundEnvironment
+import javax.lang.model.element.Element
+import javax.lang.model.element.ElementKind
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.Modifier
+import javax.lang.model.element.TypeElement
+import javax.lang.model.element.VariableElement
+import javax.tools.Diagnostic
+
+fun collectAndVerifyInput(processingEnv: ProcessingEnvironment,
+ roundEnv: RoundEnvironment): Map<TypeElement, LifecycleObserverInfo> {
+ val validator = Validator(processingEnv)
+
+ return roundEnv.getElementsAnnotatedWith(OnLifecycleEvent::class.java).map { elem ->
+ if (elem.kind != ElementKind.METHOD) {
+ validator.printErrorMessage(ErrorMessages.INVALID_ANNOTATED_ELEMENT, elem)
+ null
+ } else {
+ val enclosingElement = elem.enclosingElement
+ val onState = elem.getAnnotation(OnLifecycleEvent::class.java)
+ val method = MoreElements.asExecutable(elem)
+ if (validator.validateClass(enclosingElement)
+ && validator.validateMethod(method, onState.value)) {
+ EventMethod(method, onState, MoreElements.asType(enclosingElement))
+ } else {
+ null
+ }
+ }
+ }
+ .filterNotNull()
+ .groupBy { MoreElements.asType(it.method.enclosingElement) }
+ .mapValues { entry -> LifecycleObserverInfo(entry.key, entry.value) }
+
+}
+
+class Validator(val processingEnv: ProcessingEnvironment) {
+
+ fun printErrorMessage(msg: CharSequence, elem: Element) {
+ processingEnv.messager.printMessage(Diagnostic.Kind.ERROR, msg, elem)
+ }
+
+ fun validateParam(param: VariableElement,
+ expectedType: Class<*>, errorMsg: String): Boolean {
+ if (!MoreTypes.isTypeOf(expectedType, param.asType())) {
+ printErrorMessage(errorMsg, param)
+ return false
+ }
+ return true
+ }
+
+ fun validateMethod(method: ExecutableElement, event: Lifecycle.Event): Boolean {
+ if (Modifier.PRIVATE in method.modifiers) {
+ printErrorMessage(ErrorMessages.INVALID_METHOD_MODIFIER, method)
+ return false
+ }
+ val params = method.parameters
+ if ((params.size > 2)) {
+ printErrorMessage(ErrorMessages.TOO_MANY_ARGS, method)
+ return false
+ }
+
+ if (params.size == 2 && event != Lifecycle.Event.ON_ANY) {
+ printErrorMessage(ErrorMessages.TOO_MANY_ARGS_NOT_ON_ANY, method)
+ return false
+ }
+
+ if (params.size == 2 && !validateParam(params[1], Lifecycle.Event::class.java,
+ ErrorMessages.INVALID_SECOND_ARGUMENT)) {
+ return false
+ }
+
+ if (params.size > 0) {
+ return validateParam(params[0], LifecycleOwner::class.java,
+ ErrorMessages.INVALID_FIRST_ARGUMENT)
+ }
+ return true
+ }
+
+ fun validateClass(classElement: Element): Boolean {
+ if (classElement.kind != ElementKind.CLASS && classElement.kind != ElementKind.INTERFACE) {
+ printErrorMessage(ErrorMessages.INVALID_ENCLOSING_ELEMENT, classElement)
+ return false
+ }
+ if (Modifier.PRIVATE in classElement.modifiers) {
+ printErrorMessage(ErrorMessages.INVALID_CLASS_MODIFIER, classElement)
+ return false
+ }
+ return true
+ }
+}
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/AdapterClass.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/AdapterClass.kt
new file mode 100644
index 0000000..1e76fa8
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/AdapterClass.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle.model
+
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.TypeElement
+
+data class AdapterClass(val type: TypeElement,
+ val calls: List<EventMethodCall>,
+ val syntheticMethods: Set<ExecutableElement>)
\ No newline at end of file
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/EventMethod.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/EventMethod.kt
new file mode 100644
index 0000000..a3d4712
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/EventMethod.kt
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle.model
+
+import android.arch.lifecycle.OnLifecycleEvent
+import android.arch.lifecycle.getPackageQName
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.TypeElement
+
+data class EventMethod(val method: ExecutableElement,
+ val onLifecycleEvent: OnLifecycleEvent,
+ val type: TypeElement) {
+
+ fun packageName() = type.getPackageQName()
+}
+
+data class EventMethodCall(val method: EventMethod, val syntheticAccess: TypeElement? = null)
\ No newline at end of file
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/LifecycleObserverInfo.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/LifecycleObserverInfo.kt
new file mode 100644
index 0000000..d8bc364
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/model/LifecycleObserverInfo.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle.model
+
+import javax.lang.model.element.TypeElement
+
+data class LifecycleObserverInfo(
+ val type: TypeElement,
+ val methods: List<EventMethod>)
\ No newline at end of file
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/transformation.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/transformation.kt
new file mode 100644
index 0000000..66fabf7
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/transformation.kt
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle
+
+import android.arch.lifecycle.model.AdapterClass
+import android.arch.lifecycle.model.EventMethod
+import android.arch.lifecycle.model.EventMethodCall
+import android.arch.lifecycle.model.LifecycleObserverInfo
+import com.google.auto.common.MoreTypes
+import com.google.common.collect.HashMultimap
+import java.util.LinkedList
+import javax.annotation.processing.ProcessingEnvironment
+import javax.lang.model.element.TypeElement
+import javax.lang.model.type.NoType
+import javax.lang.model.type.TypeMirror
+import javax.tools.Diagnostic
+
+
+private fun superObservers(world: Map<TypeElement, LifecycleObserverInfo>,
+ observer: LifecycleObserverInfo): List<LifecycleObserverInfo> {
+ val stack = LinkedList<TypeMirror>()
+ stack += observer.type.interfaces.reversed()
+ stack += observer.type.superclass
+ val result = mutableListOf<LifecycleObserverInfo>()
+ while (stack.isNotEmpty()) {
+ val typeMirror = stack.removeLast()
+ if (typeMirror is NoType) {
+ continue
+ }
+ val type = MoreTypes.asTypeElement(typeMirror)
+ val currentObserver = world[type]
+ if (currentObserver != null) {
+ result.add(currentObserver)
+ } else {
+ stack += type.interfaces.reversed()
+ stack += type.superclass
+ }
+ }
+ return result
+}
+
+private fun mergeAndVerifyMethods(processingEnv: ProcessingEnvironment,
+ type: TypeElement,
+ classMethods: List<EventMethod>,
+ parentMethods: List<EventMethod>): List<EventMethod> {
+ // need to update parent methods like that because:
+ // 1. visibility can be expanded
+ // 2. we want to preserve order
+ val updatedParentMethods = parentMethods.map { parentMethod ->
+ val overrideMethod = classMethods.find { (method) ->
+ processingEnv.elementUtils.overrides(method, parentMethod.method, type)
+ }
+ if (overrideMethod != null) {
+ if (overrideMethod.onLifecycleEvent != parentMethod.onLifecycleEvent) {
+ processingEnv.messager.printMessage(Diagnostic.Kind.ERROR,
+ ErrorMessages.INVALID_STATE_OVERRIDE_METHOD, overrideMethod.method)
+ }
+ overrideMethod
+ } else {
+ parentMethod
+ }
+ }
+ return updatedParentMethods + classMethods.filterNot { updatedParentMethods.contains(it) }
+}
+
+fun flattenObservers(processingEnv: ProcessingEnvironment,
+ world: Map<TypeElement, LifecycleObserverInfo>): List<LifecycleObserverInfo> {
+ val flattened: MutableMap<LifecycleObserverInfo, LifecycleObserverInfo> = mutableMapOf()
+ val superObservers = world.mapValues { superObservers(world, it.value) }
+
+ fun traverse(observer: LifecycleObserverInfo) {
+ if (observer in flattened) {
+ return
+ }
+ val observers = superObservers[observer.type]!!
+ if (observers.isEmpty()) {
+ flattened[observer] = observer
+ return
+ }
+ observers.filter { it !in flattened }.forEach(::traverse)
+ val methods = observers
+ .map(flattened::get)
+ .fold(emptyList<EventMethod>()) { list, parentObserver ->
+ mergeAndVerifyMethods(processingEnv, observer.type, parentObserver!!.methods, list)
+ }
+
+ flattened[observer] = LifecycleObserverInfo(observer.type,
+ mergeAndVerifyMethods(processingEnv, observer.type, observer.methods, methods))
+ }
+
+ world.values.forEach(::traverse)
+ return flattened.values.toList()
+}
+
+fun transformToOutput(processingEnv: ProcessingEnvironment,
+ world: Map<TypeElement, LifecycleObserverInfo>): List<AdapterClass> {
+ val flatObservers = flattenObservers(processingEnv, world)
+ val syntheticMethods = HashMultimap.create<TypeElement, EventMethodCall>()
+ val adapterCalls = flatObservers.map { (type, methods) ->
+ val calls = methods.map { eventMethod ->
+ val executable = eventMethod.method
+ if (type.getPackageQName() != eventMethod.packageName()
+ && (executable.isPackagePrivate() || executable.isProtected())) {
+ EventMethodCall(eventMethod, eventMethod.type)
+ } else {
+ EventMethodCall(eventMethod)
+ }
+ }
+ calls.filter { it.syntheticAccess != null }.forEach { eventMethod ->
+ syntheticMethods.put(eventMethod.method.type, eventMethod)
+ }
+ type to calls
+ }.toMap()
+
+ return adapterCalls.map { (type, calls) ->
+ val methods = syntheticMethods.get(type) ?: setOf()
+ val synthetic = methods.map { eventMethod -> eventMethod!!.method.method }.toSet()
+ AdapterClass(type, calls, synthetic)
+ }
+}
diff --git a/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/writer.kt b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/writer.kt
new file mode 100644
index 0000000..1cd20ed
--- /dev/null
+++ b/lifecycle/compiler/src/main/kotlin/android/arch/lifecycle/writer.kt
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2017 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 android.arch.lifecycle
+
+import android.arch.lifecycle.model.AdapterClass
+import android.arch.lifecycle.model.EventMethodCall
+import com.squareup.javapoet.ClassName
+import com.squareup.javapoet.FieldSpec
+import com.squareup.javapoet.JavaFile
+import com.squareup.javapoet.MethodSpec
+import com.squareup.javapoet.ParameterSpec
+import com.squareup.javapoet.TypeName
+import com.squareup.javapoet.TypeSpec
+import javax.annotation.processing.Filer
+import javax.lang.model.element.ExecutableElement
+import javax.lang.model.element.Modifier
+import javax.lang.model.element.TypeElement
+
+fun writeModels(infos: List<AdapterClass>, filer: Filer) {
+ infos.forEach({ adapter -> writeAdapter(adapter, filer) })
+}
+
+private val LIFECYCLE_OWNER = ClassName.get(LifecycleOwner::class.java)
+private val LIFECYCLE_EVENT = Lifecycle.Event::class.java
+
+private val T = "\$T"
+private val N = "\$N"
+private val L = "\$L"
+
+private fun writeAdapter(adapter: AdapterClass, filer: Filer) {
+ val ownerParam = ParameterSpec.builder(LIFECYCLE_OWNER, "owner").build()
+ val eventParam = ParameterSpec.builder(ClassName.get(LIFECYCLE_EVENT), "event").build()
+ val receiverName = "mReceiver"
+ val receiverField = FieldSpec.builder(ClassName.get(adapter.type), receiverName,
+ Modifier.FINAL).build()
+
+ val dispatchMethodBuilder = MethodSpec.methodBuilder("onStateChanged")
+ .returns(TypeName.VOID)
+ .addParameter(ownerParam)
+ .addParameter(eventParam)
+ .addModifiers(Modifier.PUBLIC)
+ .addAnnotation(Override::class.java)
+ val dispatchMethod = dispatchMethodBuilder.apply {
+ adapter.calls
+ .groupBy { (eventMethod) -> eventMethod.onLifecycleEvent.value }
+ .forEach { entry ->
+ val event = entry.key
+ val calls = entry.value
+ if (event == Lifecycle.Event.ON_ANY) {
+ writeMethodCalls(eventParam, calls, ownerParam, receiverField)
+ } else {
+ beginControlFlow("if ($N == $T.$L)", eventParam, LIFECYCLE_EVENT, event)
+ .writeMethodCalls(eventParam, calls, ownerParam, receiverField)
+ endControlFlow()
+ }
+ }
+ }.build()
+
+ @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
+ val getWrappedMethod = MethodSpec.methodBuilder("getReceiver")
+ .returns(ClassName.get(Object::class.java))
+ .addModifiers(Modifier.PUBLIC)
+ .addStatement("return $N", receiverField)
+ .build()
+
+ val receiverParam = ParameterSpec.builder(
+ ClassName.get(adapter.type), "receiver").build()
+
+ val syntheticMethods = adapter.syntheticMethods.map {
+ val method = MethodSpec.methodBuilder(syntheticName(it))
+ .returns(TypeName.VOID)
+ .addModifiers(Modifier.PUBLIC)
+ .addModifiers(Modifier.STATIC)
+ .addParameter(receiverParam)
+ if (it.parameters.size >= 1) {
+ method.addParameter(ownerParam)
+ }
+ if (it.parameters.size == 2) {
+ method.addParameter(eventParam)
+ }
+
+ val count = it.parameters.size
+ val paramString = generateParamString(count)
+ method.addStatement("$N.$L($paramString)", receiverParam, it.name(),
+ *takeParams(count, ownerParam, eventParam))
+ method.build()
+ }
+
+ val constructor = MethodSpec.constructorBuilder()
+ .addParameter(receiverParam)
+ .addStatement("this.$N = $N", receiverField, receiverParam)
+ .build()
+
+ val adapterName = getAdapterName(adapter.type)
+ val adapterTypeSpec = TypeSpec.classBuilder(adapterName)
+ .addModifiers(Modifier.PUBLIC)
+ .addSuperinterface(ClassName.get(GenericLifecycleObserver::class.java))
+ .addField(receiverField)
+ .addMethod(constructor)
+ .addMethod(dispatchMethod)
+ .addMethod(getWrappedMethod)
+ .addMethods(syntheticMethods)
+ .build()
+ JavaFile.builder(adapter.type.getPackageQName(), adapterTypeSpec)
+ .build().writeTo(filer)
+}
+
+private fun MethodSpec.Builder.writeMethodCalls(eventParam: ParameterSpec,
+ calls: List<EventMethodCall>,
+ ownerParam: ParameterSpec,
+ receiverField: FieldSpec) {
+ calls.forEach { (method, syntheticAccess) ->
+ val count = method.method.parameters.size
+ if (syntheticAccess == null) {
+ val paramString = generateParamString(count)
+ addStatement("$N.$L($paramString)", receiverField,
+ method.method.name(),
+ *takeParams(count, ownerParam, eventParam))
+
+ } else {
+ val originalType = syntheticAccess
+ val paramString = generateParamString(count + 1)
+ val className = ClassName.get(originalType.getPackageQName(),
+ getAdapterName(originalType))
+ addStatement("$T.$L($paramString)", className,
+ syntheticName(method.method),
+ *takeParams(count + 1, receiverField, ownerParam,
+ eventParam))
+ }
+ }
+}
+
+private fun syntheticName(method: ExecutableElement) = "__synthetic_" + method.simpleName
+
+private fun takeParams(count: Int, vararg params: Any) = params.take(count).toTypedArray()
+
+private fun generateParamString(count: Int) = (0..(count - 1)).joinToString(",") { N }
+
+private fun getAdapterName(type: TypeElement): String {
+ val packageElement = type.getPackage()
+ val qName = type.qualifiedName.toString()
+ val partialName = if (packageElement.isUnnamed) qName else qName.substring(
+ packageElement.qualifiedName.toString().length + 1)
+ return Lifecycling.getAdapterName(partialName)
+}
diff --git a/lifecycle/compiler/src/tests/kotlin/android/arch/lifecycle/InvalidCasesTest.kt b/lifecycle/compiler/src/tests/kotlin/android/arch/lifecycle/InvalidCasesTest.kt
index 000e1bd..3e502d3 100644
--- a/lifecycle/compiler/src/tests/kotlin/android/arch/lifecycle/InvalidCasesTest.kt
+++ b/lifecycle/compiler/src/tests/kotlin/android/arch/lifecycle/InvalidCasesTest.kt
@@ -27,18 +27,18 @@
@JvmStatic
@Parameterized.Parameters(name = "failingCase({0})")
fun data() : Collection<Array<Any>> = listOf(
- arrayOf<Any>("foo.InvalidFirstArg1", LifecycleProcessor.INVALID_FIRST_ARGUMENT),
- arrayOf<Any>("foo.InvalidFirstArg2", LifecycleProcessor.INVALID_FIRST_ARGUMENT),
- arrayOf<Any>("foo.InvalidSecondArg", LifecycleProcessor.INVALID_SECOND_ARGUMENT),
- arrayOf<Any>("foo.TooManyArgs1", LifecycleProcessor.TOO_MANY_ARGS),
- arrayOf<Any>("foo.TooManyArgs2", LifecycleProcessor.TOO_MANY_ARGS_NOT_ON_ANY),
+ arrayOf<Any>("foo.InvalidFirstArg1", ErrorMessages.INVALID_FIRST_ARGUMENT),
+ arrayOf<Any>("foo.InvalidFirstArg2", ErrorMessages.INVALID_FIRST_ARGUMENT),
+ arrayOf<Any>("foo.InvalidSecondArg", ErrorMessages.INVALID_SECOND_ARGUMENT),
+ arrayOf<Any>("foo.TooManyArgs1", ErrorMessages.TOO_MANY_ARGS),
+ arrayOf<Any>("foo.TooManyArgs2", ErrorMessages.TOO_MANY_ARGS_NOT_ON_ANY),
arrayOf<Any>("foo.InvalidMethodModifier",
- LifecycleProcessor.INVALID_METHOD_MODIFIER),
- arrayOf<Any>("foo.InvalidClassModifier", LifecycleProcessor.INVALID_CLASS_MODIFIER),
+ ErrorMessages.INVALID_METHOD_MODIFIER),
+ arrayOf<Any>("foo.InvalidClassModifier", ErrorMessages.INVALID_CLASS_MODIFIER),
arrayOf<Any>("foo.InvalidInheritance1",
- LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD),
+ ErrorMessages.INVALID_STATE_OVERRIDE_METHOD),
arrayOf<Any>("foo.InvalidInheritance2",
- LifecycleProcessor.INVALID_STATE_OVERRIDE_METHOD)
+ ErrorMessages.INVALID_STATE_OVERRIDE_METHOD)
)
}
diff --git a/lifecycle/reactivestreams/src/main/AndroidManifest.xml b/lifecycle/reactivestreams/src/main/AndroidManifest.xml
index 2210041..c7b09a2 100644
--- a/lifecycle/reactivestreams/src/main/AndroidManifest.xml
+++ b/lifecycle/reactivestreams/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.lifecycle.reactivestreams">
+ <application>
+ <meta-data android:name="android.arch.lifecycle.reactivestreams.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/lifecycle/runtime/build.gradle b/lifecycle/runtime/build.gradle
index 36d9126..926b9a2 100644
--- a/lifecycle/runtime/build.gradle
+++ b/lifecycle/runtime/build.gradle
@@ -1,3 +1,5 @@
+import android.support.LibraryVersions
+
apply plugin: 'com.android.library'
apply plugin: 'maven'
@@ -44,4 +46,4 @@
}
createAndroidCheckstyle(project)
-version = "1.0.0-SNAPSHOT"
+version = LibraryVersions.LIFECYCLES.toString()
diff --git a/lifecycle/runtime/src/main/AndroidManifest.xml b/lifecycle/runtime/src/main/AndroidManifest.xml
index 274a076..5641eac 100644
--- a/lifecycle/runtime/src/main/AndroidManifest.xml
+++ b/lifecycle/runtime/src/main/AndroidManifest.xml
@@ -17,4 +17,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.lifecycle">
+ <application>
+ <meta-data android:name="android.arch.lifecycle.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/media-compat/AndroidManifest.xml b/media-compat/AndroidManifest.xml
index f5e74a2..8a65eba 100644
--- a/media-compat/AndroidManifest.xml
+++ b/media-compat/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.mediacompat">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.mediacompat"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.mediacompat.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/paging/runtime/src/main/AndroidManifest.xml b/paging/runtime/src/main/AndroidManifest.xml
index 95247e5..75dcf2c 100644
--- a/paging/runtime/src/main/AndroidManifest.xml
+++ b/paging/runtime/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.util.paging.runtime">
+ <application>
+ <meta-data android:name="android.arch.util.paging.runtime.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/percent/AndroidManifest.xml b/percent/AndroidManifest.xml
index 58eebfe..db8dfa2 100644
--- a/percent/AndroidManifest.xml
+++ b/percent/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.percent">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.percent.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/recommendation/AndroidManifest.xml b/recommendation/AndroidManifest.xml
index 09017e0..031e250 100644
--- a/recommendation/AndroidManifest.xml
+++ b/recommendation/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.recommendation">
<uses-sdk android:minSdkVersion="21"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.recommendation.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/room/compiler/src/main/kotlin/android/arch/persistence/room/ext/element_ext.kt b/room/compiler/src/main/kotlin/android/arch/persistence/room/ext/element_ext.kt
index 87846e3..09b6221 100644
--- a/room/compiler/src/main/kotlin/android/arch/persistence/room/ext/element_ext.kt
+++ b/room/compiler/src/main/kotlin/android/arch/persistence/room/ext/element_ext.kt
@@ -41,6 +41,11 @@
return MoreElements.isAnnotationPresent(this, klass.java)
}
+fun Element.isNonNull() =
+ asType().kind.isPrimitive
+ || hasAnnotation(android.support.annotation.NonNull::class)
+ || hasAnnotation(org.jetbrains.annotations.NotNull::class)
+
/**
* Checks if it has all of the annotations
*/
diff --git a/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/EmbeddedField.kt b/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/EmbeddedField.kt
index c6af79a..55e9cc4 100644
--- a/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/EmbeddedField.kt
+++ b/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/EmbeddedField.kt
@@ -42,4 +42,8 @@
return parent.isDescendantOf(other)
}
}
+
+ fun isNonNullRecursively(): Boolean {
+ return field.nonNull && (parent == null || parent.isNonNullRecursively())
+ }
}
diff --git a/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/Field.kt b/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/Field.kt
index 1bfeaee..ee6f8a1 100644
--- a/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/Field.kt
+++ b/room/compiler/src/main/kotlin/android/arch/persistence/room/vo/Field.kt
@@ -16,6 +16,7 @@
package android.arch.persistence.room.vo
+import android.arch.persistence.room.ext.isNonNull
import android.arch.persistence.room.ext.typeName
import android.arch.persistence.room.migration.bundle.FieldBundle
import android.arch.persistence.room.parser.SQLTypeAffinity
@@ -41,6 +42,9 @@
var cursorValueReader: CursorValueReader? = null
val typeName: TypeName by lazy { type.typeName() }
+ /** Whether the table column for this field should be NOT NULL */
+ val nonNull = element.isNonNull() && (parent == null || parent.isNonNullRecursively())
+
/**
* Used when reporting errors on duplicate names
*/
@@ -106,15 +110,17 @@
* definition to be used in create query
*/
fun databaseDefinition(autoIncrementPKey : Boolean) : String {
- val columnSpec = if (autoIncrementPKey) {
- " PRIMARY KEY AUTOINCREMENT"
- } else {
- ""
+ val columnSpec = StringBuilder("")
+ if (autoIncrementPKey) {
+ columnSpec.append(" PRIMARY KEY AUTOINCREMENT")
+ }
+ if (nonNull) {
+ columnSpec.append(" NOT NULL")
}
return "`$columnName` ${(affinity ?: SQLTypeAffinity.TEXT).name}$columnSpec"
}
fun toBundle(): FieldBundle = FieldBundle(pathWithDotNotation, columnName,
- affinity?.name ?: SQLTypeAffinity.TEXT.name
+ affinity?.name ?: SQLTypeAffinity.TEXT.name, nonNull
)
}
diff --git a/room/compiler/src/main/kotlin/android/arch/persistence/room/writer/TableInfoValidationWriter.kt b/room/compiler/src/main/kotlin/android/arch/persistence/room/writer/TableInfoValidationWriter.kt
index 8da4c12..e27600a 100644
--- a/room/compiler/src/main/kotlin/android/arch/persistence/room/writer/TableInfoValidationWriter.kt
+++ b/room/compiler/src/main/kotlin/android/arch/persistence/room/writer/TableInfoValidationWriter.kt
@@ -45,10 +45,11 @@
addStatement("final $T $L = new $T($L)", columnListType, columnListVar,
columnListType, entity.fields.size)
entity.fields.forEachIndexed { index, field ->
- addStatement("$L.put($S, new $T($S, $S, $L))",
+ addStatement("$L.put($S, new $T($S, $S, $L, $L))",
columnListVar, field.columnName, RoomTypeNames.TABLE_INFO_COLUMN,
/*name*/ field.columnName,
/*type*/ field.affinity?.name ?: SQLTypeAffinity.TEXT.name,
+ /*nonNull*/ field.nonNull,
/*pkeyPos*/ entity.primaryKey.fields.indexOf(field) + 1)
}
diff --git a/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java b/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
index 8ed676b..0846dff 100644
--- a/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
+++ b/room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
@@ -23,9 +23,9 @@
protected SupportSQLiteOpenHelper createOpenHelper(DatabaseConfiguration configuration) {
final SupportSQLiteOpenHelper.Callback _openCallback = new RoomOpenHelper(configuration, new RoomOpenHelper.Delegate() {
public void createAllTables(SupportSQLiteDatabase _db) {
- _db.execSQL("CREATE TABLE IF NOT EXISTS `User` (`uid` INTEGER, `name` TEXT, `lastName` TEXT, `ageColumn` INTEGER, PRIMARY KEY(`uid`))");
+ _db.execSQL("CREATE TABLE IF NOT EXISTS `User` (`uid` INTEGER NOT NULL, `name` TEXT, `lastName` TEXT, `ageColumn` INTEGER NOT NULL, PRIMARY KEY(`uid`))");
_db.execSQL("CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)");
- _db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"d4b1d59e1344d0db40fe2cd3fe64d02f\")");
+ _db.execSQL("INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"6773601c5bcf94c71ee4eb0de04f21a4\")");
}
public void dropAllTables(SupportSQLiteDatabase _db) {
@@ -52,10 +52,10 @@
protected void validateMigration(SupportSQLiteDatabase _db) {
final HashMap<String, TableInfo.Column> _columnsUser = new HashMap<String, TableInfo.Column>(4);
- _columnsUser.put("uid", new TableInfo.Column("uid", "INTEGER", 1));
- _columnsUser.put("name", new TableInfo.Column("name", "TEXT", 0));
- _columnsUser.put("lastName", new TableInfo.Column("lastName", "TEXT", 0));
- _columnsUser.put("ageColumn", new TableInfo.Column("ageColumn", "INTEGER", 0));
+ _columnsUser.put("uid", new TableInfo.Column("uid", "INTEGER", true, 1));
+ _columnsUser.put("name", new TableInfo.Column("name", "TEXT", false, 0));
+ _columnsUser.put("lastName", new TableInfo.Column("lastName", "TEXT", false, 0));
+ _columnsUser.put("ageColumn", new TableInfo.Column("ageColumn", "INTEGER", true, 0));
final HashSet<TableInfo.ForeignKey> _foreignKeysUser = new HashSet<TableInfo.ForeignKey>(0);
final TableInfo _infoUser = new TableInfo("User", _columnsUser, _foreignKeysUser);
final TableInfo _existingUser = TableInfo.read(_db, "User");
@@ -65,7 +65,7 @@
+ " Found:\n" + _existingUser);
}
}
- }, "d4b1d59e1344d0db40fe2cd3fe64d02f");
+ }, "6773601c5bcf94c71ee4eb0de04f21a4");
final SupportSQLiteOpenHelper.Configuration _sqliteConfig = SupportSQLiteOpenHelper.Configuration.builder(configuration.context)
.name(configuration.name)
.version(1923)
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/BaseEntityParserTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/BaseEntityParserTest.kt
index d00ff0c..9bfc0e7 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/BaseEntityParserTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/BaseEntityParserTest.kt
@@ -33,6 +33,7 @@
const val ENTITY_PREFIX = """
package foo.bar;
import android.arch.persistence.room.*;
+ import android.support.annotation.NonNull;
@Entity%s
public class MyEntity %s {
"""
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/EntityProcessorTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/EntityProcessorTest.kt
index 798b0be..34c522e 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/EntityProcessorTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/EntityProcessorTest.kt
@@ -323,6 +323,21 @@
}.compilesWithoutError().withWarningCount(0)
}
+ @Test
+ fun notNull() {
+ singleEntity(
+ """
+ @PrimaryKey int id;
+ @NonNull public String name;
+ """
+ ) { entity, _ ->
+ val field = fieldsByName(entity, "name").first()
+ assertThat(field.name, `is`("name"))
+ assertThat(field.columnName, `is`("name"))
+ assertThat(field.nonNull, `is`(true))
+ }.compilesWithoutError()
+ }
+
private fun fieldsByName(entity : Pojo, vararg fieldNames : String) : List<Field> {
return fieldNames
.map { name -> entity.fields.find { it.name == name } }
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/PojoProcessorTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/PojoProcessorTest.kt
index b21903c..0a5026a 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/PojoProcessorTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/PojoProcessorTest.kt
@@ -45,6 +45,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
+import org.mockito.Mockito.doReturn
import org.mockito.Mockito.mock
import simpleRun
import javax.lang.model.element.Element
@@ -431,10 +432,13 @@
FieldProcessor.BindingScope.TWO_WAY, null).process()
assertThat(pojo5, sameInstance(pojo4))
+ val type = invocation.context.COMMON_TYPES.STRING
+ val mockElement = mock(Element::class.java)
+ doReturn(type).`when`(mockElement).asType()
val fakeField = Field(
- element = mock(Element::class.java),
+ element = mockElement,
name = "foo",
- type = invocation.context.COMMON_TYPES.STRING,
+ type = type,
affinity = SQLTypeAffinity.TEXT,
columnName = "foo",
parent = null,
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/QueryMethodProcessorTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/QueryMethodProcessorTest.kt
index 3474441..f7affbc 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/QueryMethodProcessorTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/processor/QueryMethodProcessorTest.kt
@@ -46,6 +46,7 @@
import com.squareup.javapoet.TypeName
import com.squareup.javapoet.TypeVariableName
import createVerifierFromEntities
+import mockElementAndType
import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.CoreMatchers.instanceOf
import org.hamcrest.CoreMatchers.notNullValue
@@ -55,7 +56,6 @@
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.mockito.Mockito
-import javax.lang.model.element.Element
import javax.lang.model.type.DeclaredType
import javax.lang.model.type.TypeKind.INT
import javax.lang.model.type.TypeMirror
@@ -77,10 +77,11 @@
fun getParams() = arrayOf(true, false)
fun createField(name: String, columnName: String? = null): Field {
+ val (element, type) = mockElementAndType()
return Field(
- element = Mockito.mock(Element::class.java),
+ element = element,
name = name,
- type = Mockito.mock(TypeMirror::class.java),
+ type = type,
columnName = columnName ?: name,
affinity = null
)
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/testing/test_util.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/testing/test_util.kt
index 89cea44..cd30c21 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/testing/test_util.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/testing/test_util.kt
@@ -31,18 +31,19 @@
import android.arch.persistence.room.testing.TestProcessor
import android.arch.persistence.room.verifier.DatabaseVerifier
import android.arch.persistence.room.writer.ClassWriter
-import android.arch.persistence.room.writer.EntityCursorConverterWriter
import com.google.auto.common.MoreElements
import com.google.common.truth.Truth
import com.google.testing.compile.CompileTester
import com.google.testing.compile.JavaFileObjects
import com.google.testing.compile.JavaSourcesSubjectFactory
import com.squareup.javapoet.ClassName
-import com.squareup.javapoet.TypeSpec
import org.mockito.Mockito
+import org.mockito.Mockito.doReturn
+import org.mockito.Mockito.mock
import java.io.File
import javax.lang.model.element.Element
-import javax.lang.model.element.Modifier
+import javax.lang.model.type.TypeKind
+import javax.lang.model.type.TypeMirror
import javax.tools.JavaFileObject
object COMMON {
@@ -126,3 +127,15 @@
return DatabaseVerifier.create(invocation.context, Mockito.mock(Element::class.java),
entities)!!
}
+
+/**
+ * Create mocks of [Element] and [TypeMirror] so that they can be used for instantiating a fake
+ * [android.arch.persistence.room.vo.Field].
+ */
+fun mockElementAndType(): Pair<Element, TypeMirror> {
+ val element = mock(Element::class.java)
+ val type = mock(TypeMirror::class.java)
+ doReturn(TypeKind.DECLARED).`when`(type).kind
+ doReturn(type).`when`(element).asType()
+ return element to type
+}
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/verifier/DatabaseVerifierTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/verifier/DatabaseVerifierTest.kt
index df8afce..604c50f 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/verifier/DatabaseVerifierTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/verifier/DatabaseVerifierTest.kt
@@ -36,6 +36,7 @@
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
+import org.mockito.Mockito.doReturn
import org.mockito.Mockito.mock
import simpleRun
import java.sql.Connection
@@ -203,8 +204,10 @@
}
private fun field(name: String, type: TypeMirror, affinity: SQLTypeAffinity): Field {
+ val element = mock(Element::class.java)
+ doReturn(type).`when`(element).asType()
val f = Field(
- element = mock(Element::class.java),
+ element = element,
name = name,
type = type,
columnName = name,
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/vo/IndexTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/vo/IndexTest.kt
index 29d82d8..c1ac029 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/vo/IndexTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/vo/IndexTest.kt
@@ -17,14 +17,12 @@
package android.arch.persistence.room.vo
import android.arch.persistence.room.parser.SQLTypeAffinity
+import mockElementAndType
import org.hamcrest.CoreMatchers
import org.hamcrest.MatcherAssert
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-import org.mockito.Mockito.mock
-import javax.lang.model.element.Element
-import javax.lang.model.type.TypeMirror
@RunWith(JUnit4::class)
class IndexTest {
@@ -45,11 +43,12 @@
}
private fun mockField(columnName : String): Field {
+ val (element, type) = mockElementAndType()
return Field(
- element = mock(Element::class.java),
+ element = element,
name = columnName + "_field",
affinity = SQLTypeAffinity.TEXT,
- type = mock(TypeMirror::class.java),
+ type = type,
columnName = columnName
)
}
diff --git a/room/compiler/src/test/kotlin/android/arch/persistence/room/writer/SQLiteOpenHelperWriterTest.kt b/room/compiler/src/test/kotlin/android/arch/persistence/room/writer/SQLiteOpenHelperWriterTest.kt
index b3fe832..26efb4b 100644
--- a/room/compiler/src/test/kotlin/android/arch/persistence/room/writer/SQLiteOpenHelperWriterTest.kt
+++ b/room/compiler/src/test/kotlin/android/arch/persistence/room/writer/SQLiteOpenHelperWriterTest.kt
@@ -63,7 +63,8 @@
val query = SQLiteOpenHelperWriter(database)
.createQuery(database.entities.first())
assertThat(query, `is`("CREATE TABLE IF NOT EXISTS" +
- " `MyEntity` (`uuid` TEXT, `name` TEXT, `age` INTEGER, PRIMARY KEY(`uuid`))"))
+ " `MyEntity` (`uuid` TEXT, `name` TEXT, `age` INTEGER NOT NULL," +
+ " PRIMARY KEY(`uuid`))"))
}.compilesWithoutError()
}
@@ -79,7 +80,7 @@
val query = SQLiteOpenHelperWriter(database)
.createQuery(database.entities.first())
assertThat(query, `is`("CREATE TABLE IF NOT EXISTS" +
- " `MyEntity` (`uuid` TEXT, `name` TEXT, `age` INTEGER," +
+ " `MyEntity` (`uuid` TEXT, `name` TEXT, `age` INTEGER NOT NULL," +
" PRIMARY KEY(`uuid`, `name`))"))
}.compilesWithoutError()
}
@@ -97,8 +98,8 @@
val query = SQLiteOpenHelperWriter(database)
.createQuery(database.entities.first())
assertThat(query, `is`("CREATE TABLE IF NOT EXISTS" +
- " `MyEntity` (`uuid` INTEGER PRIMARY KEY AUTOINCREMENT," +
- " `name` TEXT, `age` INTEGER)"))
+ " `MyEntity` (`uuid` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL," +
+ " `name` TEXT, `age` INTEGER NOT NULL)"))
}.compilesWithoutError()
}
diff --git a/room/db-impl/src/main/AndroidManifest.xml b/room/db-impl/src/main/AndroidManifest.xml
index 9350b90..89d09af 100644
--- a/room/db-impl/src/main/AndroidManifest.xml
+++ b/room/db-impl/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.persistence.db.framework">
+ <application>
+ <meta-data android:name="android.arch.persistence.db.framework.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/room/db/src/main/AndroidManifest.xml b/room/db/src/main/AndroidManifest.xml
index 8a27324..5894255 100644
--- a/room/db/src/main/AndroidManifest.xml
+++ b/room/db/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.persistence.db">
+ <application>
+ <meta-data android:name="android.arch.persistence.db.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.BooksDatabase/1.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.BooksDatabase/1.json
index 7f4ab82..dd056e2 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.BooksDatabase/1.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.BooksDatabase/1.json
@@ -2,26 +2,29 @@
"formatVersion": 1,
"database": {
"version": 1,
- "identityHash": "4ea44fe58127a3ea1d2b0d9f6155e91d",
+ "identityHash": "64fa560604c57044726b190dadbd8258",
"entities": [
{
"tableName": "Book",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT, `title` TEXT, `bookPublisherId` TEXT, PRIMARY KEY(`bookId`), FOREIGN KEY(`bookPublisherId`) REFERENCES `Publisher`(`publisherId`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT NOT NULL, `title` TEXT NOT NULL, `bookPublisherId` TEXT NOT NULL, PRIMARY KEY(`bookId`), FOREIGN KEY(`bookPublisherId`) REFERENCES `Publisher`(`publisherId`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "bookId",
"columnName": "bookId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
},
{
"fieldPath": "bookPublisherId",
"columnName": "bookPublisherId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
}
],
"primaryKey": {
@@ -47,17 +50,19 @@
},
{
"tableName": "Author",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`authorId` TEXT, `name` TEXT, PRIMARY KEY(`authorId`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`authorId` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`authorId`))",
"fields": [
{
"fieldPath": "authorId",
"columnName": "authorId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
}
],
"primaryKey": {
@@ -71,17 +76,19 @@
},
{
"tableName": "Publisher",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`publisherId` TEXT, `name` TEXT, PRIMARY KEY(`publisherId`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`publisherId` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`publisherId`))",
"fields": [
{
"fieldPath": "publisherId",
"columnName": "publisherId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
}
],
"primaryKey": {
@@ -95,17 +102,19 @@
},
{
"tableName": "BookAuthor",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT, `authorId` TEXT, PRIMARY KEY(`bookId`, `authorId`), FOREIGN KEY(`bookId`) REFERENCES `Book`(`bookId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(`authorId`) REFERENCES `Author`(`authorId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT NOT NULL, `authorId` TEXT NOT NULL, PRIMARY KEY(`bookId`, `authorId`), FOREIGN KEY(`bookId`) REFERENCES `Book`(`bookId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(`authorId`) REFERENCES `Author`(`authorId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "bookId",
"columnName": "bookId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
},
{
"fieldPath": "authorId",
"columnName": "authorId",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": true
}
],
"primaryKey": {
@@ -144,7 +153,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
- "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"4ea44fe58127a3ea1d2b0d9f6155e91d\")"
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"64fa560604c57044726b190dadbd8258\")"
]
}
}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json
index fba47c4..e05f095 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/1.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json
index db6af46..8982d4f 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/2.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,17 +31,19 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json
index 4d9dcb3..3bf0f03 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/3.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,22 +31,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json
index 7bc6842..e899a02 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/4.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,22 +31,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -62,17 +67,20 @@
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "removedInV5",
"columnName": "removedInV5",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json
index c7d2dd1..801fdb5 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/5.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,22 +31,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -57,17 +62,19 @@
},
{
"tableName": "Entity3",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json
index a31ad21..a6fdf5b 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/6.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,22 +31,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json
index 33a7d1f..78ce189 100644
--- a/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json
+++ b/room/integration-tests/kotlintestapp/schemas/android.arch.persistence.room.integration.kotlintestapp.migration.MigrationDbKotlin/7.json
@@ -2,21 +2,23 @@
"formatVersion": 1,
"database": {
"version": 7,
- "identityHash": "885b872dd8718be5726ae37479ad74e0",
+ "identityHash": "5653c29453937d8e34dc031af1ab4c7d",
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -39,22 +41,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -68,17 +73,19 @@
},
{
"tableName": "Entity4",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -105,7 +112,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
- "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"885b872dd8718be5726ae37479ad74e0\")"
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"5653c29453937d8e34dc031af1ab4c7d\")"
]
}
}
\ No newline at end of file
diff --git a/room/integration-tests/kotlintestapp/src/androidTest/java/android/arch/persistence/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt b/room/integration-tests/kotlintestapp/src/androidTest/java/android/arch/persistence/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
index d55178c..eb1a9b8 100644
--- a/room/integration-tests/kotlintestapp/src/androidTest/java/android/arch/persistence/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
+++ b/room/integration-tests/kotlintestapp/src/androidTest/java/android/arch/persistence/room/integration/kotlintestapp/migration/MigrationKotlinTest.kt
@@ -247,7 +247,7 @@
internal val MIGRATION_1_2: Migration = object : Migration(1, 2) {
override fun migrate(database: SupportSQLiteDatabase) {
- database.execSQL("CREATE TABLE IF NOT EXISTS `Entity2` (`id` INTEGER,"
+ database.execSQL("CREATE TABLE IF NOT EXISTS `Entity2` (`id` INTEGER NOT NULL,"
+ " `name` TEXT, PRIMARY KEY(`id`))")
}
}
@@ -261,14 +261,14 @@
internal val MIGRATION_3_4: Migration = object : Migration(3, 4) {
override fun migrate(database: SupportSQLiteDatabase) {
- database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3` (`id` INTEGER,"
+ database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3` (`id` INTEGER NOT NULL,"
+ " `removedInV5` TEXT, `name` TEXT, PRIMARY KEY(`id`))")
}
}
internal val MIGRATION_4_5: Migration = object : Migration(4, 5) {
override fun migrate(database: SupportSQLiteDatabase) {
- database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3_New` (`id` INTEGER,"
+ database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3_New` (`id` INTEGER NOT NULL,"
+ " `name` TEXT, PRIMARY KEY(`id`))")
database.execSQL("INSERT INTO Entity3_New(`id`, `name`) "
+ "SELECT `id`, `name` FROM Entity3")
@@ -287,7 +287,7 @@
override fun migrate(database: SupportSQLiteDatabase) {
database.execSQL("CREATE TABLE IF NOT EXISTS "
+ MigrationDbKotlin.Entity4.TABLE_NAME
- + " (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`),"
+ + " (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`),"
+ " FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`)"
+ " ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)")
}
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/1.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/1.json
index fba47c4..e05f095 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/1.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/1.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/2.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/2.json
index db6af46..fc5a1b6 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/2.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/2.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,26 +31,29 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
- "autoGenerate": false
+ "autoGenerate": true
},
- "indices": []
+ "indices": [],
+ "foreignKeys": []
}
],
"setupQueries": [
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/3.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/3.json
index 4d9dcb3..f4629da 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/3.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/3.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,31 +31,35 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
- "autoGenerate": false
+ "autoGenerate": true
},
- "indices": []
+ "indices": [],
+ "foreignKeys": []
}
],
"setupQueries": [
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/4.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/4.json
index 7bc6842..b5a0794 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/4.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/4.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,50 +31,57 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
- "autoGenerate": false
+ "autoGenerate": true
},
- "indices": []
+ "indices": [],
+ "foreignKeys": []
},
{
"tableName": "Entity3",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `removedInV5` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `removedInV5` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "removedInV5",
"columnName": "removedInV5",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/5.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/5.json
index c7d2dd1..367b1f2 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/5.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/5.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,45 +31,51 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
- "autoGenerate": false
+ "autoGenerate": true
},
- "indices": []
+ "indices": [],
+ "foreignKeys": []
},
{
"tableName": "Entity3",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/6.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/6.json
index a31ad21..3468f5b 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/6.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/6.json
@@ -6,17 +6,19 @@
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -29,31 +31,35 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `addedInV3` TEXT, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
- "autoGenerate": false
+ "autoGenerate": true
},
- "indices": []
+ "indices": [],
+ "foreignKeys": []
}
],
"setupQueries": [
diff --git a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/7.json b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/7.json
index 14a8707..93a9682 100644
--- a/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/7.json
+++ b/room/integration-tests/testapp/schemas/android.arch.persistence.room.integration.testapp.migration.MigrationDb/7.json
@@ -2,21 +2,23 @@
"formatVersion": 1,
"database": {
"version": 7,
- "identityHash": "3e20645b9e4557e60301d30835f0d706",
+ "identityHash": "03ff272b825e27b5c15545c85fe1b845",
"entities": [
{
"tableName": "Entity1",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`))",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -39,22 +41,25 @@
},
{
"tableName": "Entity2",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `addedInV3` TEXT, `name` TEXT)",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `addedInV3` TEXT, `name` TEXT)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "addedInV3",
"columnName": "addedInV3",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -68,17 +73,19 @@
},
{
"tableName": "Entity4",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
+ "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
- "affinity": "INTEGER"
+ "affinity": "INTEGER",
+ "notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
- "affinity": "TEXT"
+ "affinity": "TEXT",
+ "notNull": false
}
],
"primaryKey": {
@@ -105,7 +112,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
- "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"3e20645b9e4557e60301d30835f0d706\")"
+ "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"03ff272b825e27b5c15545c85fe1b845\")"
]
}
}
\ No newline at end of file
diff --git a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/TestDatabase.java b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/TestDatabase.java
index 5c9bcc7..e573de1 100644
--- a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/TestDatabase.java
+++ b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/TestDatabase.java
@@ -23,6 +23,7 @@
import android.arch.persistence.room.integration.testapp.dao.BlobEntityDao;
import android.arch.persistence.room.integration.testapp.dao.PetCoupleDao;
import android.arch.persistence.room.integration.testapp.dao.PetDao;
+import android.arch.persistence.room.integration.testapp.dao.ProductDao;
import android.arch.persistence.room.integration.testapp.dao.SchoolDao;
import android.arch.persistence.room.integration.testapp.dao.ToyDao;
import android.arch.persistence.room.integration.testapp.dao.UserDao;
@@ -30,6 +31,7 @@
import android.arch.persistence.room.integration.testapp.vo.BlobEntity;
import android.arch.persistence.room.integration.testapp.vo.Pet;
import android.arch.persistence.room.integration.testapp.vo.PetCouple;
+import android.arch.persistence.room.integration.testapp.vo.Product;
import android.arch.persistence.room.integration.testapp.vo.School;
import android.arch.persistence.room.integration.testapp.vo.Toy;
import android.arch.persistence.room.integration.testapp.vo.User;
@@ -37,7 +39,7 @@
import java.util.Date;
@Database(entities = {User.class, Pet.class, School.class, PetCouple.class, Toy.class,
- BlobEntity.class},
+ BlobEntity.class, Product.class},
version = 1, exportSchema = false)
@TypeConverters(TestDatabase.Converters.class)
public abstract class TestDatabase extends RoomDatabase {
@@ -48,6 +50,7 @@
public abstract PetCoupleDao getPetCoupleDao();
public abstract ToyDao getToyDao();
public abstract BlobEntityDao getBlobEntityDao();
+ public abstract ProductDao getProductDao();
@SuppressWarnings("unused")
public static class Converters {
diff --git a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/dao/ProductDao.java b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/dao/ProductDao.java
new file mode 100644
index 0000000..417fb72
--- /dev/null
+++ b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/dao/ProductDao.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 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 android.arch.persistence.room.integration.testapp.dao;
+
+import android.arch.persistence.room.Dao;
+import android.arch.persistence.room.Insert;
+import android.arch.persistence.room.integration.testapp.vo.Product;
+import android.support.annotation.NonNull;
+
+@Dao
+public interface ProductDao {
+
+ @Insert
+ long insert(@NonNull Product product);
+
+}
diff --git a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/migration/MigrationTest.java b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/migration/MigrationTest.java
index 7b03e43..aa297ed 100644
--- a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/migration/MigrationTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/migration/MigrationTest.java
@@ -201,8 +201,8 @@
7, false, new Migration(6, 7) {
@Override
public void migrate(SupportSQLiteDatabase database) {
- database.execSQL("CREATE TABLE Entity4 (`id` INTEGER, `name` TEXT,"
- + " PRIMARY KEY(`id`))");
+ database.execSQL("CREATE TABLE Entity4 (`id` INTEGER NOT NULL,"
+ + " `name` TEXT, PRIMARY KEY(`id`))");
}
});
} catch (Throwable t) {
@@ -271,7 +271,7 @@
@Override
public void migrate(SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE IF NOT EXISTS `Entity2` ("
- + "`id` INTEGER PRIMARY KEY AUTOINCREMENT,"
+ + "`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
+ " `name` TEXT)");
}
};
@@ -287,7 +287,7 @@
private static final Migration MIGRATION_3_4 = new Migration(3, 4) {
@Override
public void migrate(SupportSQLiteDatabase database) {
- database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3` (`id` INTEGER,"
+ database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3` (`id` INTEGER NOT NULL,"
+ " `removedInV5` TEXT, `name` TEXT, PRIMARY KEY(`id`))");
}
};
@@ -295,7 +295,7 @@
private static final Migration MIGRATION_4_5 = new Migration(4, 5) {
@Override
public void migrate(SupportSQLiteDatabase database) {
- database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3_New` (`id` INTEGER,"
+ database.execSQL("CREATE TABLE IF NOT EXISTS `Entity3_New` (`id` INTEGER NOT NULL,"
+ " `name` TEXT, PRIMARY KEY(`id`))");
database.execSQL("INSERT INTO Entity3_New(`id`, `name`) "
+ "SELECT `id`, `name` FROM Entity3");
@@ -315,7 +315,7 @@
@Override
public void migrate(SupportSQLiteDatabase database) {
database.execSQL("CREATE TABLE IF NOT EXISTS " + MigrationDb.Entity4.TABLE_NAME
- + " (`id` INTEGER, `name` TEXT, PRIMARY KEY(`id`),"
+ + " (`id` INTEGER NOT NULL, `name` TEXT, PRIMARY KEY(`id`),"
+ " FOREIGN KEY(`name`) REFERENCES `Entity1`(`name`)"
+ " ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)");
}
diff --git a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
index d0daf44..2b4a0e9 100644
--- a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
+++ b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/test/SimpleEntityReadWriteTest.java
@@ -17,11 +17,13 @@
package android.arch.persistence.room.integration.testapp.test;
import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasSize;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -29,10 +31,12 @@
import android.arch.persistence.room.integration.testapp.TestDatabase;
import android.arch.persistence.room.integration.testapp.dao.BlobEntityDao;
import android.arch.persistence.room.integration.testapp.dao.PetDao;
+import android.arch.persistence.room.integration.testapp.dao.ProductDao;
import android.arch.persistence.room.integration.testapp.dao.UserDao;
import android.arch.persistence.room.integration.testapp.dao.UserPetDao;
import android.arch.persistence.room.integration.testapp.vo.BlobEntity;
import android.arch.persistence.room.integration.testapp.vo.Pet;
+import android.arch.persistence.room.integration.testapp.vo.Product;
import android.arch.persistence.room.integration.testapp.vo.User;
import android.arch.persistence.room.integration.testapp.vo.UserAndAllPets;
import android.content.Context;
@@ -63,6 +67,7 @@
private BlobEntityDao mBlobEntityDao;
private PetDao mPetDao;
private UserPetDao mUserPetDao;
+ private ProductDao mProductDao;
@Before
public void createDb() {
@@ -72,6 +77,7 @@
mPetDao = db.getPetDao();
mUserPetDao = db.getUserPetDao();
mBlobEntityDao = db.getBlobEntityDao();
+ mProductDao = db.getProductDao();
}
@Test
@@ -84,6 +90,20 @@
}
@Test
+ public void insertNull() throws Exception {
+ @SuppressWarnings("ConstantConditions")
+ Product product = new Product(1, null);
+ Throwable throwable = null;
+ try {
+ mProductDao.insert(product);
+ } catch (Throwable t) {
+ throwable = t;
+ }
+ assertNotNull("Was expecting an exception", throwable);
+ assertThat(throwable, instanceOf(SQLiteConstraintException.class));
+ }
+
+ @Test
public void insertDifferentEntities() throws Exception {
User user1 = TestUtil.createUser(3);
user1.setName("george");
diff --git a/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/vo/Product.java b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/vo/Product.java
new file mode 100644
index 0000000..a395aea
--- /dev/null
+++ b/room/integration-tests/testapp/src/androidTest/java/android/arch/persistence/room/integration/testapp/vo/Product.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 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 android.arch.persistence.room.integration.testapp.vo;
+
+import android.arch.persistence.room.Entity;
+import android.arch.persistence.room.PrimaryKey;
+import android.support.annotation.NonNull;
+
+@Entity(tableName = "products")
+public class Product {
+
+ @PrimaryKey(autoGenerate = true)
+ public final int id;
+
+ @NonNull
+ public final String name;
+
+ public Product(int id, @NonNull String name) {
+ this.id = id;
+ this.name = name;
+ }
+}
diff --git a/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/EntityBundle.java b/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/EntityBundle.java
index fc39a6a..8980a3b 100644
--- a/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/EntityBundle.java
+++ b/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/EntityBundle.java
@@ -166,7 +166,7 @@
}
/**
- * @return Creates the list of SQL queries that are necessary to create this entitiy.
+ * @return Creates the list of SQL queries that are necessary to create this entity.
*/
public Collection<String> buildCreateQueries() {
List<String> result = new ArrayList<>();
diff --git a/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/FieldBundle.java b/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/FieldBundle.java
index 3e8fd97..eb73d81 100644
--- a/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/FieldBundle.java
+++ b/room/migration/src/main/java/android/arch/persistence/room/migration/bundle/FieldBundle.java
@@ -34,11 +34,14 @@
private String mColumnName;
@SerializedName("affinity")
private String mAffinity;
+ @SerializedName("notNull")
+ private boolean mNonNull;
- public FieldBundle(String fieldPath, String columnName, String affinity) {
+ public FieldBundle(String fieldPath, String columnName, String affinity, boolean nonNull) {
mFieldPath = fieldPath;
mColumnName = columnName;
mAffinity = affinity;
+ mNonNull = nonNull;
}
public String getFieldPath() {
@@ -52,4 +55,8 @@
public String getAffinity() {
return mAffinity;
}
+
+ public boolean isNonNull() {
+ return mNonNull;
+ }
}
diff --git a/room/runtime/src/androidTest/java/android/arch/persistence/room/migration/TableInfoTest.java b/room/runtime/src/androidTest/java/android/arch/persistence/room/migration/TableInfoTest.java
index 76effde..c6eade5 100644
--- a/room/runtime/src/androidTest/java/android/arch/persistence/room/migration/TableInfoTest.java
+++ b/room/runtime/src/androidTest/java/android/arch/persistence/room/migration/TableInfoTest.java
@@ -56,8 +56,8 @@
+ "name TEXT)");
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo("foo",
- toMap(new TableInfo.Column("id", "INTEGER", 1),
- new TableInfo.Column("name", "TEXT", 0)),
+ toMap(new TableInfo.Column("id", "INTEGER", false, 1),
+ new TableInfo.Column("name", "TEXT", false, 0)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
@@ -68,8 +68,8 @@
+ "name TEXT, PRIMARY KEY(name, id))");
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo("foo",
- toMap(new TableInfo.Column("id", "INTEGER", 2),
- new TableInfo.Column("name", "TEXT", 1)),
+ toMap(new TableInfo.Column("id", "INTEGER", false, 2),
+ new TableInfo.Column("name", "TEXT", false, 1)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
@@ -81,9 +81,9 @@
mDb.execSQL("ALTER TABLE foo ADD COLUMN added REAL;");
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo("foo",
- toMap(new TableInfo.Column("id", "INTEGER", 0),
- new TableInfo.Column("name", "TEXT", 1),
- new TableInfo.Column("added", "REAL", 0)),
+ toMap(new TableInfo.Column("id", "INTEGER", false, 0),
+ new TableInfo.Column("name", "TEXT", false, 1),
+ new TableInfo.Column("added", "REAL", false, 0)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
@@ -93,7 +93,7 @@
"CREATE TABLE foo (name TEXT NOT NULL)");
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo("foo",
- toMap(new TableInfo.Column("name", "TEXT", 0)),
+ toMap(new TableInfo.Column("name", "TEXT", true, 0)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
@@ -104,7 +104,7 @@
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo(
"foo",
- toMap(new TableInfo.Column("name", "TEXT", 0)),
+ toMap(new TableInfo.Column("name", "TEXT", false, 0)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
@@ -175,7 +175,7 @@
TableInfo info = TableInfo.read(mDb, "foo");
assertThat(info, is(new TableInfo(
"foo",
- toMap(new TableInfo.Column("n", "INTEGER", 0)),
+ toMap(new TableInfo.Column("n", "INTEGER", false, 0)),
Collections.<TableInfo.ForeignKey>emptySet())));
}
diff --git a/room/runtime/src/main/AndroidManifest.xml b/room/runtime/src/main/AndroidManifest.xml
index 54a5b36..79ffb93 100644
--- a/room/runtime/src/main/AndroidManifest.xml
+++ b/room/runtime/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.persistence.room">
+ <application>
+ <meta-data android:name="android.arch.persistence.room.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/room/runtime/src/main/java/android/arch/persistence/room/util/TableInfo.java b/room/runtime/src/main/java/android/arch/persistence/room/util/TableInfo.java
index c9d2021..bcd2e9e 100644
--- a/room/runtime/src/main/java/android/arch/persistence/room/util/TableInfo.java
+++ b/room/runtime/src/main/java/android/arch/persistence/room/util/TableInfo.java
@@ -150,13 +150,15 @@
if (cursor.getColumnCount() > 0) {
int nameIndex = cursor.getColumnIndex("name");
int typeIndex = cursor.getColumnIndex("type");
+ int notNullIndex = cursor.getColumnIndex("notnull");
int pkIndex = cursor.getColumnIndex("pk");
while (cursor.moveToNext()) {
final String name = cursor.getString(nameIndex);
final String type = cursor.getString(typeIndex);
+ final boolean notNull = 0 != cursor.getInt(notNullIndex);
final int primaryKeyPosition = cursor.getInt(pkIndex);
- columns.put(name, new Column(name, type, primaryKeyPosition));
+ columns.put(name, new Column(name, type, notNull, primaryKeyPosition));
}
}
} finally {
@@ -209,6 +211,10 @@
*/
public final String type;
/**
+ * Whether or not the column can be NULL.
+ */
+ public final boolean notNull;
+ /**
* The position of the column in the list of primary keys, 0 if the column is not part
* of the primary key.
* <p>
@@ -224,9 +230,10 @@
public final int primaryKeyPosition;
// if you change this constructor, you must change TableInfoWriter.kt
- public Column(String name, String type, int primaryKeyPosition) {
+ public Column(String name, String type, boolean notNull, int primaryKeyPosition) {
this.name = name;
this.type = type;
+ this.notNull = notNull;
this.primaryKeyPosition = primaryKeyPosition;
}
@@ -242,8 +249,9 @@
if (isPrimaryKey() != column.isPrimaryKey()) return false;
}
- //noinspection SimplifiableIfStatement
if (!name.equals(column.name)) return false;
+ //noinspection SimplifiableIfStatement
+ if (notNull != column.notNull) return false;
return type != null ? type.equalsIgnoreCase(column.type) : column.type == null;
}
@@ -260,6 +268,7 @@
public int hashCode() {
int result = name.hashCode();
result = 31 * result + (type != null ? type.hashCode() : 0);
+ result = 31 * result + (notNull ? 1231 : 1237);
result = 31 * result + primaryKeyPosition;
return result;
}
@@ -269,6 +278,7 @@
return "Column{"
+ "name='" + name + '\''
+ ", type='" + type + '\''
+ + ", notNull=" + notNull
+ ", primaryKeyPosition=" + primaryKeyPosition
+ '}';
}
diff --git a/room/rxjava2/src/main/AndroidManifest.xml b/room/rxjava2/src/main/AndroidManifest.xml
index 33279c6..958f331 100644
--- a/room/rxjava2/src/main/AndroidManifest.xml
+++ b/room/rxjava2/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.persistence.room.rxjava2">
+ <application>
+ <meta-data android:name="android.arch.persistence.room.rxjava2.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/room/testing/src/main/AndroidManifest.xml b/room/testing/src/main/AndroidManifest.xml
index 594f016..3e6414c 100644
--- a/room/testing/src/main/AndroidManifest.xml
+++ b/room/testing/src/main/AndroidManifest.xml
@@ -16,4 +16,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.arch.persistence.room.testing">
+ <application>
+ <meta-data android:name="android.arch.persistence.room.testing.VERSION"
+ android:value="${version}" />
+ </application>
</manifest>
diff --git a/room/testing/src/main/java/android/arch/persistence/room/testing/MigrationTestHelper.java b/room/testing/src/main/java/android/arch/persistence/room/testing/MigrationTestHelper.java
index 16df7f1..aea3e96 100644
--- a/room/testing/src/main/java/android/arch/persistence/room/testing/MigrationTestHelper.java
+++ b/room/testing/src/main/java/android/arch/persistence/room/testing/MigrationTestHelper.java
@@ -315,7 +315,7 @@
private static TableInfo.Column toColumn(EntityBundle entity, FieldBundle field) {
return new TableInfo.Column(field.getColumnName(), field.getAffinity(),
- findPrimaryKeyPosition(entity, field));
+ field.isNonNull(), findPrimaryKeyPosition(entity, field));
}
private static int findPrimaryKeyPosition(EntityBundle entity, FieldBundle field) {
diff --git a/samples-flatfoot/ApiReviewDemo/.gitignore b/samples-flatfoot/ApiReviewDemo/.gitignore
deleted file mode 100644
index 39fb081..0000000
--- a/samples-flatfoot/ApiReviewDemo/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/ApiReviewDemo/app/.gitignore b/samples-flatfoot/ApiReviewDemo/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/samples-flatfoot/ApiReviewDemo/app/build.gradle b/samples-flatfoot/ApiReviewDemo/app/build.gradle
deleted file mode 100644
index 1134737..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId "com.android.flatfoot.apireviewdemo"
- minSdkVersion 16
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_7
- targetCompatibility JavaVersion.VERSION_1_7
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
-
- compile 'com.android.support:support-fragment:25.2.0'
- //noinspection GradleCompatible
- compile 'com.android.support:appcompat-v7:25.2.0'
- //noinspection GradleCompatible
- compile 'com.android.support:recyclerview-v7:25.2.0'
- //noinspection GradleCompatible
- compile 'com.android.support:cardview-v7:25.2.0'
-
- compile "android.arch.lifecycle:extensions:1.0-SNAPSHOT"
- compile "android.arch.persistence.room:runtime:1.0-SNAPSHOT"
-
- compile 'com.jakewharton.timber:timber:4.5.1'
- compile 'com.squareup.retrofit2:retrofit:2.1.0'
- compile 'com.squareup.retrofit2:converter-gson:2.1.0'
-
- annotationProcessor "android.arch.lifecycle:compiler:1.0-SNAPSHOT"
- annotationProcessor "android.arch.persistence.room:compiler:1.0-SNAPSHOT"
- testCompile 'junit:junit:4.12'
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/proguard-rules.pro b/samples-flatfoot/ApiReviewDemo/app/proguard-rules.pro
deleted file mode 100644
index 9926c34..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Volumes/ssd/src/ub-supportlib-master/prebuilts/fullsdk-darwin/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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/samples-flatfoot/ApiReviewDemo/app/src/androidTest/java/com/android/flatfoot/apireviewdemo/ExampleInstrumentedTest.java b/samples-flatfoot/ApiReviewDemo/app/src/androidTest/java/com/android/flatfoot/apireviewdemo/ExampleInstrumentedTest.java
deleted file mode 100644
index ce71b1e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/androidTest/java/com/android/flatfoot/apireviewdemo/ExampleInstrumentedTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo;
-
-import static org.junit.Assert.assertEquals;
-
-import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Instrumentation test, which will execute on an Android device.
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-@RunWith(AndroidJUnit4.class)
-public class ExampleInstrumentedTest {
- @Test
- public void useAppContext() throws Exception {
- // Context of the app under test.
- Context appContext = InstrumentationRegistry.getTargetContext();
-
- assertEquals("com.android.flatfoot.apireviewdemo", appContext.getPackageName());
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/AndroidManifest.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 0addf7d..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,95 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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.android.flatfoot.apireviewdemo">
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
- <uses-permission android:name="android.permission.INTERNET"/>
-
- <uses-feature android:name="android.hardware.location.gps"/>
-
- <application
- android:name=".DemoApplication"
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
-
- <activity
- android:name=".lifecycle_01_basic.LocationActivity"
- android:label="@string/location_sample"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity
- android:name=".lifecycle_02_livedata.LiveLocationActivity"
- android:label="@string/live_location_sample"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity
- android:name=".lifecycle_03_viewmodel.OneAccountActivity"
- android:label="@string/one_account_github"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity
- android:name=".full_sample_xxx.SwitchAccountsActivity"
- android:label="@string/one_account_github"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity
- android:name=".lifecycle_04_shared_viewmodel.ShapesActivity"
- android:label="@string/shapes_label"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <activity
- android:name=".exercise.NoteActivity"
- android:theme="@android:style/Theme.DeviceDefault">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- </application>
-
-</manifest>
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/DemoApplication.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/DemoApplication.java
deleted file mode 100644
index a5b7f96..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/DemoApplication.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo;
-
-import android.app.Application;
-import android.content.Context;
-
-public class DemoApplication extends Application {
-
- private static DemoApplication sApplication;
-
- public static Context context() {
- return sApplication;
- }
-
- @Override
- public void onCreate() {
- super.onCreate();
- sApplication = this;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/entity/Person.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/entity/Person.java
deleted file mode 100644
index b3196bc..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/entity/Person.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.common.entity;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-@Entity
-public class Person {
- @PrimaryKey
- private int id;
- private String login;
- private String name;
- private String lastName;
- private String company;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
- public String getCompany() {
- return company;
- }
-
- public void setCompany(String company) {
- this.company = company;
- }
-
- public String getLogin() {
- return login;
- }
-
- public void setLogin(String login) {
- this.login = login;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDao.java
deleted file mode 100644
index 19283bf..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDao.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.common.github;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.OnConflictStrategy;
-import android.arch.persistence.room.Query;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-
-/**
- * Data access object for github data table.
- */
-@Dao
-public interface GithubDao {
- /**
- * Load full data for a person based on the login.
- */
- @Query("select * from person where login = :login")
- LiveData<Person> getLivePerson(String login);
-
- /**
- * Load full data for a person based on the login.
- */
- @Query("select * from person where login = :login")
- Person getPerson(String login);
-
- /**
- * Insert or update full data for a person.
- */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertOrReplacePerson(Person personData);
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabase.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabase.java
deleted file mode 100644
index 3a0dfe1..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabase.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.common.github;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-
-/**
- * Database for Github entities.
- */
-@Database(entities = {Person.class}, version = 1)
-public abstract class GithubDatabase extends RoomDatabase {
- /**
- * Gets the data access object.
- */
- public abstract GithubDao getGithubDao();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabaseHelper.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabaseHelper.java
deleted file mode 100644
index 02d5e09..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubDatabaseHelper.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.flatfoot.apireviewdemo.common.github;
-
-import android.arch.persistence.room.Room;
-import android.content.Context;
-
-import com.android.flatfoot.apireviewdemo.DemoApplication;
-
-/**
- * Database helper.
- */
-public class GithubDatabaseHelper {
- private static GithubDatabase sInstance;
-
- /**
- * Gets a database instance.
- */
- public static synchronized GithubDatabase getDatabase() {
- if (sInstance == null) {
- Context context = DemoApplication.context();
- sInstance = Room.databaseBuilder(context, GithubDatabase.class, "github.db").build();
- }
- return sInstance;
- }
-
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubService.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubService.java
deleted file mode 100644
index 2c44097..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/common/github/GithubService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.common.github;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-
-import retrofit2.Call;
-import retrofit2.http.GET;
-import retrofit2.http.Path;
-
-/**
- * Retrofit-powered service to connect to Github backend.
- */
-public interface GithubService {
- /**
- * Gets the information about the specified user.
- */
- @GET("/users/{user}")
- Call<Person> getUser(@Path("user") String user);
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/BasicDatabase.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/BasicDatabase.java
deleted file mode 100644
index 2bfb0d9..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/BasicDatabase.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_01_basic;
-
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-@Database(entities = User.class, version = 1)
-public abstract class BasicDatabase extends RoomDatabase {
-
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/Usage.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/Usage.java
deleted file mode 100644
index c2c52d5..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/Usage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_01_basic;
-
-
-import android.arch.persistence.db.SupportSQLiteDatabase;
-import android.arch.persistence.room.Room;
-import android.content.Context;
-import android.database.Cursor;
-
-import timber.log.Timber;
-
-public class Usage {
- BasicDatabase mBasicDatabase;
-
- public Usage(Context context) {
- mBasicDatabase = Room.inMemoryDatabaseBuilder(context.getApplicationContext(),
- BasicDatabase.class).build();
- }
-
- public void directSQL() {
- SupportSQLiteDatabase db = mBasicDatabase.getOpenHelper().getWritableDatabase();
- Cursor cursor = db.rawQuery("select * from User", new String[0]);
- try {
- while (cursor.moveToNext()) {
- Timber.d("user name: %s", cursor.getString(cursor.getColumnIndex("name")));
- }
- } finally {
- cursor.close();
- }
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/User.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/User.java
deleted file mode 100644
index 949569a..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_01_basic/User.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_01_basic;
-
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-@Entity
-public class User {
- @PrimaryKey
- public int id;
- public String name;
- public String lastName;
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/AppDatabase_02.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/AppDatabase_02.java
deleted file mode 100644
index 4b603af..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/AppDatabase_02.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_02_dao;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-
-@Database(entities = User.class, version = 2)
-public abstract class AppDatabase_02 extends RoomDatabase {
- public abstract UserCrudDao userDao();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/Usage.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/Usage.java
deleted file mode 100644
index 5075e2a..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/Usage.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_02_dao;
-
-import android.arch.persistence.room.Room;
-import android.content.Context;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-
-import java.util.List;
-
-import timber.log.Timber;
-
-public class Usage {
- AppDatabase_02 mBasicDatabase;
-
- public Usage(Context context) {
- mBasicDatabase = Room.inMemoryDatabaseBuilder(context.getApplicationContext(),
- AppDatabase_02.class).build();
- }
-
- public void loadAllUsers() {
- List<User> allUsers = mBasicDatabase.userDao().loadAllUsers();
- for (User user : allUsers) {
- Timber.d("user name %s", user.name);
- }
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/UserCrudDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/UserCrudDao.java
deleted file mode 100644
index fe367b9..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_02_dao/UserCrudDao.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_02_dao;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Delete;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.OnConflictStrategy;
-import android.arch.persistence.room.Query;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-
-import java.util.List;
-
-@Dao
-public interface UserCrudDao {
- @Query("select * from user")
- List<User> loadAllUsers();
-
- @Query("select * from user where id = :id")
- User loadUserById(int id);
-
- @Query("select * from user where name = :firstName and lastName = :lastName")
- List<User> findByNameAndLastName(String firstName, String lastName);
-
- @Insert
- void insertUser(User user);
-
- @Delete
- void deleteUser(User user);
-
- @Query("delete from user where name like :badName OR lastName like :badName")
- int deleteUsersByName(String badName);
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertOrReplaceUsers(User... users);
-
- @Delete
- void deleteBothUsers(User user1, User user2);
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/AppDatabase_03.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/AppDatabase_03.java
deleted file mode 100644
index 934c3c5..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/AppDatabase_03.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_03_entity;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-import com.android.flatfoot.apireviewdemo.db_02_dao.UserCrudDao;
-
-@Database(entities = {User.class, Pet.class}, version = 3)
-public abstract class AppDatabase_03 extends RoomDatabase {
- public abstract UserCrudDao userDao();
-
- public abstract PetDao petDao();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/Pet.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/Pet.java
deleted file mode 100644
index a4cc40e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/Pet.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_03_entity;
-
-import android.arch.persistence.room.ColumnInfo;
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.Index;
-import android.arch.persistence.room.PrimaryKey;
-
-@Entity(indices = @Index("name"))
-public class Pet {
- @PrimaryKey
- private int id;
- @ColumnInfo(name = "owner_id", index = true)
- private int ownerId;
- private String name;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public int getOwnerId() {
- return ownerId;
- }
-
- public void setOwnerId(int ownerId) {
- this.ownerId = ownerId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/PetDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/PetDao.java
deleted file mode 100644
index 02ac65d..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_03_entity/PetDao.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_03_entity;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Query;
-
-import java.util.List;
-
-@Dao
-public interface PetDao {
- @Query("select * from Pet where owner_id = :userId")
- List<Pet> findPetsOfUser(int userId);
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/AppDatabase_04.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/AppDatabase_04.java
deleted file mode 100644
index c216901..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/AppDatabase_04.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_04_pojo;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-import com.android.flatfoot.apireviewdemo.db_03_entity.Pet;
-
-@Database(entities = {User.class, Pet.class}, version = 4)
-public abstract class AppDatabase_04 extends RoomDatabase {
- public abstract UserPetDao userPetDao();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserNameAndPetName.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserNameAndPetName.java
deleted file mode 100644
index daae8f0..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserNameAndPetName.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_04_pojo;
-
-import android.arch.persistence.room.ColumnInfo;
-
-public class UserNameAndPetName {
- @ColumnInfo(name = "user_name")
- private String userName;
- @ColumnInfo(name = "pet_name")
- private String petName;
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- public String getPetName() {
- return petName;
- }
-
- public void setPetName(String petName) {
- this.petName = petName;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserPetDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserPetDao.java
deleted file mode 100644
index 9ae8e7b..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserPetDao.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_04_pojo;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Query;
-
-import java.util.List;
-
-@Dao
-public interface UserPetDao {
- @Query("select user.*, COUNT(*) from user, pet where user.id = pet.owner_id GROUP BY user.id")
- List<UserWithPetCount> getUsersAndNumberOfPets();
-
- @Query("select user.name as user_name, pet.name as pet_name FROM user, pet WHERE"
- + " user.id = pet.owner_id")
- List<UserNameAndPetName> getNameTuples();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserWithPetCount.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserWithPetCount.java
deleted file mode 100644
index 62ce989..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_04_pojo/UserWithPetCount.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_04_pojo;
-
-import android.arch.persistence.room.ColumnInfo;
-
-import com.android.flatfoot.apireviewdemo.db_01_basic.User;
-
-public class UserWithPetCount extends User {
- @ColumnInfo(name = "COUNT(*)")
- public int petCount;
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/AppDatabase_05.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/AppDatabase_05.java
deleted file mode 100644
index 927ac8f..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/AppDatabase_05.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_05_converters;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-@Database(entities = Game.class, version = 5)
-public abstract class AppDatabase_05 extends RoomDatabase {
- public abstract GameDao gameDao();
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/DateConverter.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/DateConverter.java
deleted file mode 100644
index 933c13e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/DateConverter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_05_converters;
-
-import android.arch.persistence.room.TypeConverter;
-
-import java.util.Date;
-
-public class DateConverter {
- @TypeConverter
- public static Date toDate(Long timestamp) {
- return timestamp == null ? null : new Date(timestamp);
- }
-
- @TypeConverter
- public static Long toTimestamp(Date date) {
- return date == null ? null : date.getTime();
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/Game.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/Game.java
deleted file mode 100644
index 470861a..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/Game.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_05_converters;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.TypeConverters;
-
-import java.util.Date;
-
-@Entity(primaryKeys = {"home", "away", "time"})
-// could be here as well @TypeConverters(DateConverter.class)
-public class Game {
- private String home;
- private String away;
- @TypeConverters(DateConverter.class)
- private Date time;
- private int homeScore;
- private int awayScore;
-
- public String getHome() {
- return home;
- }
-
- public void setHome(String home) {
- this.home = home;
- }
-
- public String getAway() {
- return away;
- }
-
- public void setAway(String away) {
- this.away = away;
- }
-
- public Date getTime() {
- return time;
- }
-
- public void setTime(Date time) {
- this.time = time;
- }
-
- public int getHomeScore() {
- return homeScore;
- }
-
- public void setHomeScore(int homeScore) {
- this.homeScore = homeScore;
- }
-
- public int getAwayScore() {
- return awayScore;
- }
-
- public void setAwayScore(int awayScore) {
- this.awayScore = awayScore;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/GameDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/GameDao.java
deleted file mode 100644
index a1ccafa..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_05_converters/GameDao.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_05_converters;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Query;
-import android.arch.persistence.room.TypeConverters;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-@Dao
-@TypeConverters(DateConverter.class)
-public abstract class GameDao {
- @Query("select * from Game where `time` BETWEEN :from AND :to")
- abstract public List<Game> findGamesInRange(Date from, Date to);
-
- public List<Game> listGamesIn1Week() {
- Calendar calendar = Calendar.getInstance();
- Date today = calendar.getTime();
- calendar.set(Calendar.DATE, 7);
- Date nextWeek = calendar.getTime();
- return findGamesInRange(today, nextWeek);
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Address.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Address.java
deleted file mode 100644
index ba3d334..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Address.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_06_decompose;
-
-import android.arch.persistence.room.Embedded;
-
-/**
- * Decomposed into {@link School}.
- */
-public class Address {
- public String street;
- public String state;
- @Embedded
- public Location location;
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/AppDatabase_06.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/AppDatabase_06.java
deleted file mode 100644
index 8e0f495..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/AppDatabase_06.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_06_decompose;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-
-@Database(entities = {School.class}, version = 6)
-public abstract class AppDatabase_06 extends RoomDatabase {
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Location.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Location.java
deleted file mode 100644
index e39f110..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/Location.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_06_decompose;
-
-/**
- * Decomposed into {@link Address}.
- */
-public class Location {
- private long latitude;
- private long longitude;
-
- public long getLatitude() {
- return latitude;
- }
-
- public void setLatitude(long latitude) {
- this.latitude = latitude;
- }
-
- public long getLongitude() {
- return longitude;
- }
-
- public void setLongitude(long longitude) {
- this.longitude = longitude;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/School.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/School.java
deleted file mode 100644
index 3137344..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/School.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_06_decompose;
-
-import android.arch.persistence.room.Embedded;
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-/**
- * Has decomposed address which has decomposed location so will have all the fields from 3 classes.
- */
-@Entity
-public class School {
- @PrimaryKey(autoGenerate = true)
- private int id;
- @Embedded
- private Address address;
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public Address getAddress() {
- return address;
- }
-
- public void setAddress(Address address) {
- this.address = address;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/SchoolDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/SchoolDao.java
deleted file mode 100644
index 6060573..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/db_06_decompose/SchoolDao.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.db_06_decompose;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.OnConflictStrategy;
-import android.arch.persistence.room.Query;
-
-import java.util.List;
-
-@Dao
-public interface SchoolDao {
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void save(School school);
-
- @Query("SELECT * FROM school WHERE street LIKE :street")
- List<School> findByStreetName(String street);
-
- @Query("SELECT street, state, latitude, longitude FROM school WHERE id = ?")
- Address findAddressOfSchool(int id);
-
- @Query("SELECT * FROM school WHERE id = ?")
- Location findLocaltionOfSchool(int id);
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/Note.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/Note.java
deleted file mode 100644
index 843bf60..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/Note.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.exercise;
-
-public class Note {
- private int id;
- private String label;
- private String body;
-
- public Note(int id, String label, String body) {
- this.id = id;
- this.label = label;
- this.body = body;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getLabel() {
- return label;
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- public String getBody() {
- return body;
- }
-
- public void setBody(String body) {
- this.body = body;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteActivity.java
deleted file mode 100644
index 847a6ec..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteActivity.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.exercise;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.os.Bundle;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-
-import com.android.flatfoot.apireviewdemo.R;
-
-public class NoteActivity extends LifecycleActivity {
-
- private TextView mNoteLabelView;
- private TextView mNoteBodyView;
- private ProgressBar mProgressBar;
-
- private void showNote(Note note) {
- mNoteLabelView.setText(note.getLabel());
- mNoteBodyView.setText(note.getBody());
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.note_activity_layout);
- mNoteLabelView = (TextView) findViewById(R.id.note_label);
- mNoteBodyView = (TextView) findViewById(R.id.note_body);
- mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
-
- //TODO complete the exercise into steps:
- // 1. create a ViewModel and load a Note via NoteWebService
- // 2. persist a loaded note to NoteDatabase.
- showNote(new Note(0, "a", "b"));
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteWebService.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteWebService.java
deleted file mode 100644
index 6c0936f..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/NoteWebService.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.exercise;
-
-import android.support.annotation.NonNull;
-
-import java.util.Random;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-public class NoteWebService {
-
- interface Callback {
- void success(@NonNull Note note);
-
- void failure(String errorMsg);
- }
-
- public static void loadNoteWithId(int id, Callback callback) {
- InternalNoteWebService.load(id, callback);
- }
-
-}
-
-// IMPLEMENTATION DETAILS
-
-class InternalNoteWebService {
-
- static ExecutorService sService = Executors.newSingleThreadExecutor();
- static Random sRandom = new Random(261);
-
- private static final String[] WILDE = new String[]{
- "I am so clever that sometimes I don't understand a single word of what I am saying",
- "I don't want to go to heaven. None of my friends are there",
- "I am not young enough to know everything.",
- "Quotation is a serviceable substitute for wit."
- };
-
- static void load(final int id, final NoteWebService.Callback callback) {
- sService.submit(new Runnable() {
- @Override
- public void run() {
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- if (sRandom.nextInt(10) == 0) {
- callback.failure("Ooops! Something went wrong.");
- } else {
- Note note = new Note(id, "Label " + id, WILDE[id % WILDE.length]);
- callback.success(note);
- }
- }
- });
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDao.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDao.java
deleted file mode 100644
index 5fff92e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDao.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.exercise.db;
-
-import android.arch.persistence.room.Dao;
-
-@Dao
-public class NoteDao {
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDatabase.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDatabase.java
deleted file mode 100644
index a149498..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/exercise/db/NoteDatabase.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.exercise.db;
-
-import android.arch.persistence.room.Room;
-import android.arch.persistence.room.RoomDatabase;
-import android.content.Context;
-
-import com.android.flatfoot.apireviewdemo.DemoApplication;
-
-//@Database(entities = Note.class)
-abstract public class NoteDatabase extends RoomDatabase {
-
- private static NoteDatabase sInstance;
-
- public abstract NoteDao getNoteDao();
-
- /**
- * Gets a database instance.
- */
- public static synchronized NoteDatabase getInstance() {
- if (sInstance == null) {
- Context context = DemoApplication.context();
- sInstance = Room.databaseBuilder(context, NoteDatabase.class, "notes.db").build();
- }
- return sInstance;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/AccountViewModel.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/AccountViewModel.java
deleted file mode 100644
index 887a1ca..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/AccountViewModel.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.full_sample_xxx;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModel;
-import android.support.annotation.Nullable;
-import android.text.TextUtils;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-import com.android.flatfoot.apireviewdemo.common.github.GithubDatabaseHelper;
-import com.android.flatfoot.apireviewdemo.full_sample_xxx.DataManagement.Cancelable;
-
-public class AccountViewModel extends ViewModel {
-
- public final MutableLiveData<Status> statusData = new MutableLiveData<>();
- public final MutableLiveData<Person> personData = new MutableLiveData<>();
-
- private final DataManagement mDataManagement = DataManagement.getInstance();
-
- private final DataManagement.Callback mCallback = new DataManagement.Callback() {
- @Override
- public void onSuccess() {
- finishRequest(200);
- }
-
- @Override
- public void onFail(int code) {
- finishRequest(code);
- }
- };
-
- private boolean inForceRefresh = false;
- private Cancelable mCurrentRequest;
- private String mLogin;
- private LiveData<Person> mPrivatePersonData;
- private Observer<Person> mObserver = new Observer<Person>() {
- @Override
- public void onChanged(@Nullable Person person) {
- personData.setValue(person);
- }
- };
-
- private void cancelRequest() {
- if (mCurrentRequest != null) {
- mCurrentRequest.cancel();
- statusData.setValue(new Status(0, false));
- mCurrentRequest = null;
- }
- }
-
- private void finishRequest(int code) {
- statusData.setValue(new Status(code, false));
- inForceRefresh = false;
- mCurrentRequest = null;
- }
-
- public void setUser(String login) {
- if (TextUtils.equals(mLogin, login)) {
- return;
- }
- if (mPrivatePersonData != null) {
- mPrivatePersonData.removeObserver(mObserver);
- }
-
- cancelRequest();
- mLogin = login;
- mPrivatePersonData = GithubDatabaseHelper.getDatabase().getGithubDao().getLivePerson(
- mLogin);
- mPrivatePersonData.observeForever(mObserver);
- statusData.setValue(new Status(0, true));
- mCurrentRequest = mDataManagement.refreshIfNeeded(mLogin, mCallback);
- }
-
- public void forceRefresh() {
- if (inForceRefresh || mLogin == null) {
- return;
- }
- cancelRequest();
- inForceRefresh = true;
-
- statusData.setValue(new Status(0, true));
- mCurrentRequest = mDataManagement.forceRefresh(mLogin, mCallback);
- }
-
-
- static class Status {
- final int status;
- final boolean updating;
-
- Status(int status, boolean loading) {
- this.status = status;
- this.updating = loading;
- }
- }
-
- @Override
- protected void onCleared() {
- if (mPrivatePersonData != null) {
- mPrivatePersonData.removeObserver(mObserver);
- }
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/DataManagement.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/DataManagement.java
deleted file mode 100644
index de97554..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/DataManagement.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.full_sample_xxx;
-
-import android.os.Handler;
-import android.os.Looper;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-import com.android.flatfoot.apireviewdemo.common.github.GithubDao;
-import com.android.flatfoot.apireviewdemo.common.github.GithubDatabaseHelper;
-import com.android.flatfoot.apireviewdemo.common.github.GithubService;
-
-import java.io.IOException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import retrofit2.Response;
-import retrofit2.Retrofit;
-import retrofit2.converter.gson.GsonConverterFactory;
-
-public class DataManagement {
- private static DataManagement sInstance;
- private static ExecutorService sExecutor = Executors.newFixedThreadPool(2);
-
- public static DataManagement getInstance() {
- if (sInstance == null) {
- sInstance = new DataManagement();
- }
- return sInstance;
- }
-
- class CallbackWrapper {
- private final Callback mCallback;
- private final CancelRequest mCancelRequest = new CancelRequest();
-
- CallbackWrapper(Callback callback) {
- mCallback = callback;
- }
- }
-
- interface Cancelable {
- void cancel();
- }
-
- class CancelRequest implements Cancelable {
- boolean mCanceled = false;
- Future<?> mFuture;
-
- @Override
- public void cancel() {
- mFuture.cancel(true);
- mCanceled = true;
- }
- }
-
-
- interface Callback {
- void onSuccess();
-
- void onFail(int code);
- }
-
- private Handler mHandler = new Handler(Looper.getMainLooper());
- private final GithubService mGithubService;
-
- public DataManagement() {
- Retrofit retrofit = new Retrofit.Builder()
- .baseUrl("https://api.github.com")
- .addConverterFactory(GsonConverterFactory.create())
- .build();
-
- mGithubService = retrofit.create(GithubService.class);
- }
-
- Cancelable refreshIfNeeded(String user, Callback callback) {
- CallbackWrapper wrapper = new CallbackWrapper(callback);
- wrapper.mCancelRequest.mFuture = sExecutor.submit(
- new UpdateIfNeededRunnable(user, wrapper));
-
- return wrapper.mCancelRequest;
- }
-
- Cancelable forceRefresh(String user, Callback callback) {
- CallbackWrapper wrapper = new CallbackWrapper(callback);
- wrapper.mCancelRequest.mFuture = sExecutor.submit(new UpdateRunnable(user, wrapper));
- return wrapper.mCancelRequest;
- }
-
- private class UpdateIfNeededRunnable implements Runnable {
-
- private final String user;
- private CallbackWrapper mCallback;
-
- private UpdateIfNeededRunnable(String user, CallbackWrapper callback) {
- this.user = user;
- mCallback = callback;
- }
-
- @Override
- public void run() {
- Person personData = getGithubDao().getPerson(user);
- if (personData == null) {
- UpdateRunnable runnable = new UpdateRunnable(user, mCallback);
- runnable.run();
- } else {
- postSuccess(mCallback);
- }
- }
- }
-
- private class UpdateRunnable implements Runnable {
-
- private final String user;
- private final CallbackWrapper mCallback;
-
- private UpdateRunnable(String user, CallbackWrapper callback) {
- this.user = user;
- mCallback = callback;
- }
-
- @Override
- public void run() {
- try {
- try {
- Thread.sleep(15000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- Response<Person> response = mGithubService.getUser(this.user).execute();
- if (response.isSuccessful()) {
- getGithubDao().insertOrReplacePerson(response.body());
- postSuccess(mCallback);
- } else {
- postFail(mCallback, response.code());
- }
- } catch (IOException e) {
- postFail(mCallback, -2);
- }
- }
- }
-
- private void postSuccess(final CallbackWrapper callback) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- if (!callback.mCancelRequest.mCanceled) {
- callback.mCallback.onSuccess();
- }
- }
- });
- }
-
- private void postFail(final CallbackWrapper callback, final int code) {
- mHandler.post(new Runnable() {
- @Override
- public void run() {
- if (!callback.mCancelRequest.mCanceled) {
- callback.mCallback.onFail(code);
- }
- }
- });
- }
-
- private static GithubDao getGithubDao() {
- return GithubDatabaseHelper.getDatabase().getGithubDao();
- }
-
-
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/SwitchAccountsActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/SwitchAccountsActivity.java
deleted file mode 100644
index 41f6b63..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/full_sample_xxx/SwitchAccountsActivity.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.full_sample_xxx;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.View;
-import android.widget.TextView;
-
-import com.android.flatfoot.apireviewdemo.R;
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-
-import java.util.Random;
-
-public class SwitchAccountsActivity extends LifecycleActivity {
-
- public final String[] USERS = new String[]{"yigit", "JakeWharton"};
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- final AccountViewModel viewModel = ViewModelProviders.of(this).get(AccountViewModel.class);
- viewModel.setUser(USERS[0]);
- setContentView(R.layout.switch_accounts);
-
- findViewById(R.id.switch_user).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- viewModel.setUser(USERS[new Random().nextInt(USERS.length)]);
- }
- });
-
- viewModel.personData.observe(this, new Observer<Person>() {
- @Override
- public void onChanged(@Nullable Person data) {
- if (data != null) {
- TextView emailView = (TextView) findViewById(R.id.name);
- emailView.setText(data.getName());
- TextView nameView = (TextView) findViewById(R.id.company);
- nameView.setText(data.getCompany());
- }
- }
- });
-
- viewModel.statusData.observe(this, new Observer<AccountViewModel.Status>() {
- @Override
- public void onChanged(AccountViewModel.Status status) {
- findViewById(R.id.loading_spinner).setVisibility(
- status.updating ? View.VISIBLE : View.GONE);
- }
- });
-
- findViewById(R.id.force_refresh).setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- viewModel.forceRefresh();
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/PermissionUtils.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/PermissionUtils.java
deleted file mode 100644
index b15b646..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/PermissionUtils.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.internal;
-
-import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
-import static android.Manifest.permission.ACCESS_FINE_LOCATION;
-import static android.support.v4.content.ContextCompat.checkSelfPermission;
-
-import android.Manifest;
-import android.app.Activity;
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.support.v4.app.ActivityCompat;
-
-// ignore it as implementation detail
-public class PermissionUtils {
-
- public static boolean hasLocationPermission(Context context) {
- boolean fineLocationPermission = checkSelfPermission(context, ACCESS_FINE_LOCATION)
- == PackageManager.PERMISSION_GRANTED;
- boolean coarseLocationPermission = checkSelfPermission(context,
- ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED;
- return fineLocationPermission && coarseLocationPermission;
- }
-
- public static void requestLocationPermission(Activity activity) {
- ActivityCompat.requestPermissions(activity,
- new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
- Manifest.permission.ACCESS_COARSE_LOCATION}, 0);
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/SimpleLocationListener.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/SimpleLocationListener.java
deleted file mode 100644
index 6c364c9..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/internal/SimpleLocationListener.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.internal;
-
-import android.location.LocationListener;
-import android.os.Bundle;
-
-public abstract class SimpleLocationListener implements LocationListener {
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationActivity.java
deleted file mode 100644
index 1d59048..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationActivity.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_01_basic;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.location.Location;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.android.flatfoot.apireviewdemo.R;
-import com.android.flatfoot.apireviewdemo.internal.PermissionUtils;
-import com.android.flatfoot.apireviewdemo.internal.SimpleLocationListener;
-
-public class LocationActivity extends LifecycleActivity {
-
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
- // ignore permission handling code as an implementation detail
- if (PermissionUtils.hasLocationPermission(this)) {
- startListening();
- } else {
- Toast.makeText(this, "This sample requires Location access", Toast.LENGTH_LONG).show();
- }
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.location_activity);
- // ignore permission handling code as an implementation detail
- if (PermissionUtils.hasLocationPermission(this)) {
- startListening();
- } else {
- PermissionUtils.requestLocationPermission(this);
- }
- }
-
- private void startListening() {
- LocationListener.listenLocation(this, new SimpleLocationListener() {
- @Override
- public void onLocationChanged(Location location) {
- TextView textView = (TextView) findViewById(R.id.location);
- textView.setText(location.getLatitude() + ", " + location.getLongitude());
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationListener.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationListener.java
deleted file mode 100644
index 33ececc..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_01_basic/LocationListener.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_01_basic;
-
-import android.arch.lifecycle.Lifecycle;
-import android.arch.lifecycle.LifecycleObserver;
-import android.arch.lifecycle.LifecycleOwner;
-import android.arch.lifecycle.OnLifecycleEvent;
-import android.content.Context;
-import android.location.LocationManager;
-
-import com.android.flatfoot.apireviewdemo.DemoApplication;
-import com.android.flatfoot.apireviewdemo.internal.SimpleLocationListener;
-
-@SuppressWarnings("MissingPermission")
-class LocationListener implements LifecycleObserver {
-
- static void listenLocation(LifecycleOwner provider,
- SimpleLocationListener listener) {
- new LocationListener(provider, listener);
- }
-
- private android.location.LocationManager mLocationManager;
- private final SimpleLocationListener mListener;
-
- private LocationListener(LifecycleOwner provider, SimpleLocationListener listener) {
- provider.getLifecycle().addObserver(this);
- mListener = listener;
- }
-
- @OnLifecycleEvent(Lifecycle.Event.ON_START)
- void start() {
- mLocationManager = (LocationManager) DemoApplication.context().getSystemService(
- Context.LOCATION_SERVICE);
- mLocationManager.requestLocationUpdates(android.location.LocationManager.GPS_PROVIDER, 0, 0,
- mListener);
- }
-
-
- @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
- void stop() {
- mLocationManager.removeUpdates(mListener);
- mLocationManager = null;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LiveLocationActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LiveLocationActivity.java
deleted file mode 100644
index 9af9c6e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LiveLocationActivity.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_02_livedata;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.location.Location;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.android.flatfoot.apireviewdemo.R;
-import com.android.flatfoot.apireviewdemo.internal.PermissionUtils;
-
-public class LiveLocationActivity extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.location_activity);
- // ignore permission handling code as an implementation detail
- if (PermissionUtils.hasLocationPermission(this)) {
- startListening();
- } else {
- PermissionUtils.requestLocationPermission(this);
- }
- }
-
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
- // ignore permission handling code as an implementation detail
- if (PermissionUtils.hasLocationPermission(this)) {
- startListening();
- } else {
- Toast.makeText(this, "This sample requires a location permission",
- Toast.LENGTH_LONG).show();
- }
- }
-
- private void startListening() {
- LocationLiveData liveData = LocationLiveData.getInstance();
- liveData.observe(this, new Observer<Location>() {
- @Override
- public void onChanged(@Nullable Location location) {
- TextView textView = (TextView) findViewById(R.id.location);
- textView.setText(location.getLatitude() + ", " + location.getLongitude());
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LocationLiveData.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LocationLiveData.java
deleted file mode 100644
index 84512c2..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_02_livedata/LocationLiveData.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_02_livedata;
-
-import android.arch.lifecycle.LiveData;
-import android.content.Context;
-import android.location.Location;
-import android.location.LocationManager;
-
-import com.android.flatfoot.apireviewdemo.DemoApplication;
-import com.android.flatfoot.apireviewdemo.internal.SimpleLocationListener;
-
-@SuppressWarnings("MissingPermission")
-public class LocationLiveData extends LiveData<Location> {
-
- private static LocationLiveData sInstance;
-
- public static LocationLiveData getInstance() {
- if (sInstance == null) {
- sInstance = new LocationLiveData();
- }
- return sInstance;
- }
-
- private LocationManager mLocationManager;
-
- private SimpleLocationListener mListener = new SimpleLocationListener() {
- @Override
- public void onLocationChanged(Location location) {
- setValue(location);
- }
- };
-
- private LocationLiveData() {
- mLocationManager = (LocationManager) DemoApplication.context().getSystemService(
- Context.LOCATION_SERVICE);
- }
-
- @Override
- protected void onActive() {
- mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListener);
- }
-
- @Override
- protected void onInactive() {
- mLocationManager.removeUpdates(mListener);
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/AccountViewModel.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/AccountViewModel.java
deleted file mode 100644
index 9cc1716..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/AccountViewModel.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_03_viewmodel;
-
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.ViewModel;
-import android.support.annotation.NonNull;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-
-public class AccountViewModel extends ViewModel {
-
- static class PersonDataWithStatus {
- final Person person;
- final String errorMsg;
- final boolean loading;
-
- PersonDataWithStatus(Person person, String errorMsg, boolean loading) {
- this.person = person;
- this.errorMsg = errorMsg;
- this.loading = loading;
- }
- }
-
- public final MutableLiveData<PersonDataWithStatus> personData = new MutableLiveData<>();
-
- public AccountViewModel() {
- personData.setValue(new PersonDataWithStatus(null, null, true));
- DataManagement.getInstance().requestPersonData("jakewharton",
- new DataManagement.Callback() {
- @Override
- public void success(@NonNull Person person) {
- personData.setValue(new PersonDataWithStatus(person, null, false));
- }
-
- @Override
- public void failure(String errorMsg) {
- personData.setValue(new PersonDataWithStatus(null, errorMsg, false));
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/DataManagement.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/DataManagement.java
deleted file mode 100644
index 1a1c1ba..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/DataManagement.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_03_viewmodel;
-
-import android.support.annotation.NonNull;
-
-import com.android.flatfoot.apireviewdemo.common.entity.Person;
-import com.android.flatfoot.apireviewdemo.common.github.GithubService;
-
-import retrofit2.Call;
-import retrofit2.Response;
-import retrofit2.Retrofit;
-import retrofit2.converter.gson.GsonConverterFactory;
-
-class DataManagement {
-
- private static DataManagement sInstance = new DataManagement();
-
- interface Callback {
- void success(@NonNull Person person);
-
- void failure(String errorMsg);
- }
-
- public static DataManagement getInstance() {
- return sInstance;
- }
-
- private final GithubService mGithubService;
-
- public DataManagement() {
- Retrofit retrofit = new Retrofit.Builder()
- .baseUrl("https://api.github.com")
- .addConverterFactory(GsonConverterFactory.create())
- .build();
-
- mGithubService = retrofit.create(GithubService.class);
- }
-
- void requestPersonData(String user, final Callback callback) {
- mGithubService.getUser(user).enqueue(new retrofit2.Callback<Person>() {
- @Override
- public void onResponse(Call<Person> call, Response<Person> response) {
- if (response.isSuccessful()) {
- callback.success(response.body());
- } else {
- callback.failure("Failed with " + response.code());
- }
- }
-
- @Override
- public void onFailure(Call<Person> call, Throwable t) {
- callback.failure("Failed with " + t.getMessage());
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/OneAccountActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/OneAccountActivity.java
deleted file mode 100644
index c6743c7..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_03_viewmodel/OneAccountActivity.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_03_viewmodel;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.TextView;
-
-import com.android.flatfoot.apireviewdemo.R;
-
-public class OneAccountActivity extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.view_model1);
-
- AccountViewModel viewModel = ViewModelProviders.of(this).get(AccountViewModel.class);
- viewModel.personData.observe(this, new Observer<AccountViewModel.PersonDataWithStatus>() {
- @Override
- public void onChanged(AccountViewModel.PersonDataWithStatus data) {
- if (data.person != null) {
- TextView emailView = (TextView) findViewById(R.id.name);
- emailView.setText(data.person.getName());
- TextView nameView = (TextView) findViewById(R.id.company);
- nameView.setText(data.person.getCompany());
- }
-
- findViewById(R.id.loading_spinner).setVisibility(data.loading ?
- View.VISIBLE : View.GONE);
- }
- });
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ChosenShapeFragment.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ChosenShapeFragment.java
deleted file mode 100644
index cd07514..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ChosenShapeFragment.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel;
-
-import android.arch.lifecycle.LifecycleFragment;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.graphics.drawable.ShapeDrawable;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.flatfoot.apireviewdemo.R;
-
-public class ChosenShapeFragment extends LifecycleFragment {
-
- private View mNoneShapeView;
- private View mShapeView;
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- View layout = inflater.inflate(R.layout.chosen_shape_layout, container);
- mNoneShapeView = layout.findViewById(R.id.none);
- mShapeView = layout.findViewById(R.id.color);
- SharedViewModel viewModel = ViewModelProviders.of(getActivity()).get(SharedViewModel.class);
- viewModel.shapeDrawableData.observe(this, new Observer<ShapeDrawable>() {
- @Override
- public void onChanged(@Nullable ShapeDrawable shapeDrawable) {
- updateShape(shapeDrawable);
- }
- });
- return layout;
- }
-
- private void updateShape(ShapeDrawable shape) {
- mNoneShapeView.setVisibility(shape == null ? View.VISIBLE : View.GONE);
- mShapeView.setVisibility(shape != null ? View.VISIBLE : View.GONE);
- if (shape != null) {
- mShapeView.setBackground(shape);
- }
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapeChooserFragment.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapeChooserFragment.java
deleted file mode 100644
index 8a79143..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapeChooserFragment.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.LifecycleFragment;
-import android.arch.lifecycle.ViewModelProviders;
-import android.graphics.drawable.ShapeDrawable;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel.internal.ShapesAdapter;
-
-public class ShapeChooserFragment extends LifecycleFragment {
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- LifecycleActivity activity = (LifecycleActivity) getActivity();
- final SharedViewModel sharedViewModel = ViewModelProviders.of(getActivity())
- .get(SharedViewModel.class);
-
- RecyclerView rv = new RecyclerView(activity);
- rv.setLayoutManager(new GridLayoutManager(activity, 3));
-
- // adapter itself is implementation detail, ignore it
- ShapesAdapter adapter = new ShapesAdapter();
- adapter.setShapeListener(new ShapesAdapter.ShapeListener() {
- @Override
- public void onShapeChosen(ShapeDrawable shapeDrawable) {
- sharedViewModel.shapeDrawableData.setValue(shapeDrawable);
- }
- });
- rv.setAdapter(adapter);
- return rv;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapesActivity.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapesActivity.java
deleted file mode 100644
index 3ecfef6..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/ShapesActivity.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.os.Bundle;
-
-import com.android.flatfoot.apireviewdemo.R;
-
-public class ShapesActivity extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.shape_activity);
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/SharedViewModel.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/SharedViewModel.java
deleted file mode 100644
index c8768ac..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/SharedViewModel.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel;
-
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.ViewModel;
-import android.graphics.drawable.ShapeDrawable;
-
-public class SharedViewModel extends ViewModel {
- public final MutableLiveData<ShapeDrawable> shapeDrawableData = createEmpty();
-
- private static MutableLiveData<ShapeDrawable> createEmpty() {
- MutableLiveData<ShapeDrawable> empty = new MutableLiveData<>();
- empty.setValue(null);
- return empty;
- }
-}
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/internal/ShapesAdapter.java b/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/internal/ShapesAdapter.java
deleted file mode 100644
index 9713649..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/java/com/android/flatfoot/apireviewdemo/lifecycle_04_shared_viewmodel/internal/ShapesAdapter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel.internal;
-
-
-import android.graphics.Color;
-import android.graphics.drawable.ShapeDrawable;
-import android.graphics.drawable.shapes.OvalShape;
-import android.graphics.drawable.shapes.RectShape;
-import android.graphics.drawable.shapes.RoundRectShape;
-import android.graphics.drawable.shapes.Shape;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.flatfoot.apireviewdemo.R;
-
-import java.util.ArrayList;
-import java.util.List;
-
-// ignore it as an implementation detail
-public class ShapesAdapter extends RecyclerView.Adapter<VHolder> {
-
- public interface ShapeListener {
- void onShapeChosen(ShapeDrawable shapeDrawable);
- }
-
- private static final float[] RADII =
- {16.0f, 16.0f, 16.0f, 16.0f, 16.0f, 16.0f, 16.0f, 16.0f};
-
- private static final Shape[] SHAPES = new Shape[]{
- new RectShape(),
- new RoundRectShape(RADII, null, null),
- new OvalShape(),
- };
-
- private static final int[] COLORS = new int[]{
- Color.BLUE,
- Color.CYAN,
- Color.YELLOW,
- Color.RED,
- Color.GREEN,
- Color.LTGRAY,
- Color.MAGENTA,
- };
-
- private final List<ShapeDrawable> mDrawables = new ArrayList<>();
- private ShapeListener mShapeListener;
-
- public ShapesAdapter() {
- for (int color : COLORS) {
- for (Shape shape : SHAPES) {
- ShapeDrawable drawable = new ShapeDrawable(shape);
- drawable.getPaint().setColor(color);
- mDrawables.add(drawable);
- }
- }
- }
-
- @Override
- public VHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.shape_item,
- parent, false);
- final VHolder holder = new VHolder(view);
- holder.mShapeView.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mShapeListener != null) {
- mShapeListener.onShapeChosen(holder.mShapeDrawable);
- }
- }
- });
- return holder;
- }
-
- @Override
- public void onBindViewHolder(final VHolder holder, int position) {
- holder.mShapeView.setBackground(mDrawables.get(position));
- holder.mShapeDrawable = mDrawables.get(position);
- }
-
- @Override
- public int getItemCount() {
- return mDrawables.size();
- }
-
- public void setShapeListener(ShapeListener shapeListener) {
- mShapeListener = shapeListener;
- }
-}
-
-class VHolder extends RecyclerView.ViewHolder {
- View mShapeView;
- ShapeDrawable mShapeDrawable;
-
- public VHolder(View itemView) {
- super(itemView);
- mShapeView = itemView.findViewById(R.id.shape);
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/chosen_shape_layout.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/chosen_shape_layout.xml
deleted file mode 100644
index 2a88d65..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/chosen_shape_layout.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:layout_marginBottom="20dp">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:text="@string/current_chosen_color"
- android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
- android:paddingRight="10dp"/>
-
- <ImageView
- android:id="@+id/color"
- android:layout_width="40dp"
- android:layout_height="40dp"
- android:layout_gravity="center_vertical"/>
-
- <TextView
- android:id="@+id/none"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:textAppearance="@android:style/TextAppearance.DeviceDefault.Medium"
- android:text="@string/none"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/location_activity.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/location_activity.xml
deleted file mode 100644
index 6401cc2..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/location_activity.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <TextView
- android:id="@+id/location"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/note_activity_layout.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/note_activity_layout.xml
deleted file mode 100644
index 5eb0fd8..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/note_activity_layout.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
- <ProgressBar
- android:id="@+id/progress_bar"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:visibility="gone"/>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/note_label"
- android:layout_marginRight="3dp"/>
-
- <TextView
- android:id="@+id/note_label"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
- </LinearLayout>
- <TextView
- android:id="@+id/note_body"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_activity.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_activity.xml
deleted file mode 100644
index 54548cf..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_activity.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <fragment
- android:id="@+id/chosen_color_fragment"
- android:name="com.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel.ChosenShapeFragment"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
-
- <fragment
- android:id="@+id/shape_chooser"
- android:name="com.android.flatfoot.apireviewdemo.lifecycle_04_shared_viewmodel.ShapeChooserFragment"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_item.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_item.xml
deleted file mode 100644
index 3f6221e..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/shape_item.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="10dp"
- android:layout_gravity="center"
- android:background="@color/cardview_light_background">
- <View android:id="@+id/shape"
- android:layout_width="50dp"
- android:layout_height="50dp"
- android:layout_gravity="center"
- android:layout_margin="10dp"
- />
-</android.support.v7.widget.CardView>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/switch_accounts.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/switch_accounts.xml
deleted file mode 100644
index 78bb969..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/switch_accounts.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent" android:layout_height="match_parent"
- android:orientation="vertical">
- <Button android:id="@+id/switch_user" android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:text="@string/switch_account"/>
- <ProgressBar android:id="@+id/loading_spinner" android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
- <TextView android:id="@+id/name" android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- <TextView android:id="@+id/company" android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
- <Button android:id="@+id/force_refresh" android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:text="@string/force_refresh"/>>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/view_model1.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/view_model1.xml
deleted file mode 100644
index 3d7f306..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/layout/view_model1.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <ProgressBar
- android:id="@+id/loading_spinner"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
-
- <TextView
- android:id="@+id/name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-
- <TextView
- android:id="@+id/company"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"/>
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index cde69bc..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c133a0c..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfa42f0..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 324e72c..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index aee44e1..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/colors.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/colors.xml
deleted file mode 100644
index 86b4304..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <color name="colorPrimary">#3F51B5</color>
- <color name="colorPrimaryDark">#303F9F</color>
- <color name="colorAccent">#FF4081</color>
-</resources>
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/strings.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/strings.xml
deleted file mode 100644
index 4482754..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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">ApiReviewDemo</string>
- <string name="location_sample">Location Sample</string>
- <string name="live_location_sample">LiveLocation Sample</string>
- <string name="one_account_github">One Account</string>
- <string name="force_refresh">Force refresh</string>
- <string name="switch_account">Switch Account</string>
- <string name="current_chosen_color">Current chosen color:</string>
- <string name="none">None</string>
- <string name="shapes_label">Shapes Activity</string>
- <string name="note_label">Note label:</string>
-</resources>
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/styles.xml b/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/styles.xml
deleted file mode 100644
index 36ef789..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
-
-</resources>
diff --git a/samples-flatfoot/ApiReviewDemo/app/src/test/java/com/android/flatfoot/apireviewdemo/ExampleUnitTest.java b/samples-flatfoot/ApiReviewDemo/app/src/test/java/com/android/flatfoot/apireviewdemo/ExampleUnitTest.java
deleted file mode 100644
index f3d51be..0000000
--- a/samples-flatfoot/ApiReviewDemo/app/src/test/java/com/android/flatfoot/apireviewdemo/ExampleUnitTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.flatfoot.apireviewdemo;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
- */
-public class ExampleUnitTest {
- @Test
- public void addition_isCorrect() throws Exception {
- assertEquals(4, 2 + 2);
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/ApiReviewDemo/build.gradle b/samples-flatfoot/ApiReviewDemo/build.gradle
deleted file mode 100644
index a458edd..0000000
--- a/samples-flatfoot/ApiReviewDemo/build.gradle
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects { p ->
- repositories {
- jcenter()
- def outFolder = new File(project.rootProject.rootDir, "../../../../out/host/gradle/frameworks/")
- maven {
- url "file://${new File(outFolder, "support/build/support_repo").absolutePath}"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/samples-flatfoot/ApiReviewDemo/gradle.properties b/samples-flatfoot/ApiReviewDemo/gradle.properties
deleted file mode 100644
index be27115..0000000
--- a/samples-flatfoot/ApiReviewDemo/gradle.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2017 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.
-#
-
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index be2d403..0000000
--- a/samples-flatfoot/ApiReviewDemo/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2017 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.
-#
-
-#Mon Dec 28 10:00:20 PST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
diff --git a/samples-flatfoot/ApiReviewDemo/gradlew b/samples-flatfoot/ApiReviewDemo/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/ApiReviewDemo/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/ApiReviewDemo/gradlew.bat b/samples-flatfoot/ApiReviewDemo/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/ApiReviewDemo/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/ApiReviewDemo/settings.gradle b/samples-flatfoot/ApiReviewDemo/settings.gradle
deleted file mode 100644
index 1df87d4..0000000
--- a/samples-flatfoot/ApiReviewDemo/settings.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-include ':app'
diff --git a/samples-flatfoot/ContentProviderSample/.gitignore b/samples-flatfoot/ContentProviderSample/.gitignore
deleted file mode 100644
index 39fb081..0000000
--- a/samples-flatfoot/ContentProviderSample/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/ContentProviderSample/app/.gitignore b/samples-flatfoot/ContentProviderSample/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/samples-flatfoot/ContentProviderSample/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/samples-flatfoot/ContentProviderSample/app/build.gradle b/samples-flatfoot/ContentProviderSample/app/build.gradle
deleted file mode 100644
index 72f77c8..0000000
--- a/samples-flatfoot/ContentProviderSample/app/build.gradle
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId "com.example.android.contentprovidersample"
- minSdkVersion 14
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
- // Write out the current schema of Room
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
- }
- }
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
-
- // Test
- testCompile 'junit:junit:4.12'
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
-
- // Support Libraries
- compile 'com.android.support:appcompat-v7:25.3.1'
- compile 'com.android.support:recyclerview-v7:25.3.1'
-
- // App Toolkit
- // TODO: Replace with the actual dependencies
- compile "android.arch.lifecycle:extensions:1.0-SNAPSHOT"
- compile "android.arch.persistence.room:runtime:1.0-SNAPSHOT"
- annotationProcessor "android.arch.lifecycle:compiler:1.0-SNAPSHOT"
- annotationProcessor "android.arch.persistence.room:compiler:1.0-SNAPSHOT"
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/proguard-rules.pro b/samples-flatfoot/ContentProviderSample/app/proguard-rules.pro
deleted file mode 100644
index 06b266f..0000000
--- a/samples-flatfoot/ContentProviderSample/app/proguard-rules.pro
+++ /dev/null
@@ -1,25 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /usr/local/google/home/yaraki/Android/Sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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 *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile
diff --git a/samples-flatfoot/ContentProviderSample/app/schemas/com.example.android.contentprovidersample.data.SampleDatabase/1.json b/samples-flatfoot/ContentProviderSample/app/schemas/com.example.android.contentprovidersample.data.SampleDatabase/1.json
deleted file mode 100644
index d154d07..0000000
--- a/samples-flatfoot/ContentProviderSample/app/schemas/com.example.android.contentprovidersample.data.SampleDatabase/1.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "formatVersion": 1,
- "database": {
- "version": 1,
- "identityHash": "d612c3c0739239af787986e19d97626b",
- "entities": [
- {
- "tableName": "cheeses",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT)",
- "fields": [
- {
- "fieldPath": "id",
- "columnName": "_id",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "name",
- "columnName": "name",
- "affinity": "TEXT"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "_id"
- ],
- "autoGenerate": true
- },
- "indices": [
- {
- "name": "index_cheeses__id",
- "unique": false,
- "columnNames": [
- "_id"
- ],
- "createSql": "CREATE INDEX `index_cheeses__id` ON `${TABLE_NAME}` (`_id`)"
- }
- ],
- "foreignKeys": []
- }
- ],
- "setupQueries": [
- "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
- "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"d612c3c0739239af787986e19d97626b\")"
- ]
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/CheeseTest.java b/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/CheeseTest.java
deleted file mode 100644
index 7ae4ee6..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/CheeseTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample;
-
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-
-import android.arch.persistence.room.Room;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.example.android.contentprovidersample.data.Cheese;
-import com.example.android.contentprovidersample.data.SampleDatabase;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.IOException;
-
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class CheeseTest {
-
- private SampleDatabase mDatabase;
-
- @Before
- public void createDatabase() {
- mDatabase = Room.inMemoryDatabaseBuilder(InstrumentationRegistry.getTargetContext(),
- SampleDatabase.class).build();
- }
-
- @After
- public void closeDatabase() throws IOException {
- mDatabase.close();
- }
-
- @Test
- public void insertAndCount() {
- assertThat(mDatabase.cheese().count(), is(0));
- Cheese cheese = new Cheese();
- cheese.name = "abc";
- mDatabase.cheese().insert(cheese);
- assertThat(mDatabase.cheese().count(), is(1));
- }
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/SampleContentProviderTest.java b/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/SampleContentProviderTest.java
deleted file mode 100644
index 860a551..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/androidTest/java/com/example/android/contentprovidersample/SampleContentProviderTest.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample;
-
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.notNullValue;
-import static org.junit.Assert.assertThat;
-
-import android.content.ContentProviderOperation;
-import android.content.ContentProviderResult;
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.OperationApplicationException;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.RemoteException;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import com.example.android.contentprovidersample.data.Cheese;
-import com.example.android.contentprovidersample.data.SampleDatabase;
-import com.example.android.contentprovidersample.provider.SampleContentProvider;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.util.ArrayList;
-
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class SampleContentProviderTest {
-
- private ContentResolver mContentResolver;
-
- @Before
- public void setUp() {
- final Context context = InstrumentationRegistry.getTargetContext();
- SampleDatabase.switchToInMemory(context);
- mContentResolver = context.getContentResolver();
- }
-
- @Test
- public void cheese_initiallyEmpty() {
- final Cursor cursor = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor, notNullValue());
- assertThat(cursor.getCount(), is(0));
- cursor.close();
- }
-
- @Test
- public void cheese_insert() {
- final Uri itemUri = mContentResolver.insert(SampleContentProvider.URI_CHEESE,
- cheeseWithName("Daigo"));
- assertThat(itemUri, notNullValue());
- final Cursor cursor = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor, notNullValue());
- assertThat(cursor.getCount(), is(1));
- assertThat(cursor.moveToFirst(), is(true));
- assertThat(cursor.getString(cursor.getColumnIndexOrThrow(Cheese.COLUMN_NAME)), is("Daigo"));
- cursor.close();
- }
-
- @Test
- public void cheese_update() {
- final Uri itemUri = mContentResolver.insert(SampleContentProvider.URI_CHEESE,
- cheeseWithName("Daigo"));
- assertThat(itemUri, notNullValue());
- final int count = mContentResolver.update(itemUri, cheeseWithName("Queso"), null, null);
- assertThat(count, is(1));
- final Cursor cursor = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor, notNullValue());
- assertThat(cursor.getCount(), is(1));
- assertThat(cursor.moveToFirst(), is(true));
- assertThat(cursor.getString(cursor.getColumnIndexOrThrow(Cheese.COLUMN_NAME)), is("Queso"));
- cursor.close();
- }
-
- @Test
- public void cheese_delete() {
- final Uri itemUri = mContentResolver.insert(SampleContentProvider.URI_CHEESE,
- cheeseWithName("Daigo"));
- assertThat(itemUri, notNullValue());
- final Cursor cursor1 = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor1, notNullValue());
- assertThat(cursor1.getCount(), is(1));
- cursor1.close();
- final int count = mContentResolver.delete(itemUri, null, null);
- assertThat(count, is(1));
- final Cursor cursor2 = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor2, notNullValue());
- assertThat(cursor2.getCount(), is(0));
- cursor2.close();
- }
-
- @Test
- public void cheese_bulkInsert() {
- final int count = mContentResolver.bulkInsert(SampleContentProvider.URI_CHEESE,
- new ContentValues[]{
- cheeseWithName("Peynir"),
- cheeseWithName("Queso"),
- cheeseWithName("Daigo"),
- });
- assertThat(count, is(3));
- final Cursor cursor = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor, notNullValue());
- assertThat(cursor.getCount(), is(3));
- cursor.close();
- }
-
- @Test
- public void cheese_applyBatch() throws RemoteException, OperationApplicationException {
- final ArrayList<ContentProviderOperation> operations = new ArrayList<>();
- operations.add(ContentProviderOperation
- .newInsert(SampleContentProvider.URI_CHEESE)
- .withValue(Cheese.COLUMN_NAME, "Peynir")
- .build());
- operations.add(ContentProviderOperation
- .newInsert(SampleContentProvider.URI_CHEESE)
- .withValue(Cheese.COLUMN_NAME, "Queso")
- .build());
- final ContentProviderResult[] results = mContentResolver.applyBatch(
- SampleContentProvider.AUTHORITY, operations);
- assertThat(results.length, is(2));
- final Cursor cursor = mContentResolver.query(SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME}, null, null, null);
- assertThat(cursor, notNullValue());
- assertThat(cursor.getCount(), is(2));
- assertThat(cursor.moveToFirst(), is(true));
- cursor.close();
- }
-
- private ContentValues cheeseWithName(String name) {
- final ContentValues values = new ContentValues();
- values.put(Cheese.COLUMN_NAME, name);
- return values;
- }
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/AndroidManifest.xml b/samples-flatfoot/ContentProviderSample/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 82d25e4..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 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"
- xmlns:tools="http://schemas.android.com/tools"
- package="com.example.android.contentprovidersample">
-
- <permission android:name="com.example.android.contentprovidersample.provider.READ_WRITE"/>
-
- <application
- android:allowBackup="false"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/Theme.ContentProviderSample"
- tools:ignore="GoogleAppIndexingWarning">
-
- <activity android:name=".MainActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <provider
- android:name=".provider.SampleContentProvider"
- android:authorities="com.example.android.contentprovidersample.provider"
- android:exported="true"
- android:permission="com.example.android.contentprovidersample.provider.READ_WRITE"/>
-
- </application>
-
-</manifest>
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/MainActivity.java b/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/MainActivity.java
deleted file mode 100644
index 89db65f..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/MainActivity.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample;
-
-import android.database.Cursor;
-import android.os.Bundle;
-import android.support.v4.app.LoaderManager;
-import android.support.v4.content.CursorLoader;
-import android.support.v4.content.Loader;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-import android.widget.TextView;
-
-import com.example.android.contentprovidersample.data.Cheese;
-import com.example.android.contentprovidersample.provider.SampleContentProvider;
-
-
-/**
- * Not very relevant to Room. This just shows data from {@link SampleContentProvider}.
- *
- * <p>Since the data is exposed through the ContentProvider, other apps can read and write the
- * content in a similar manner to this.</p>
- */
-public class MainActivity extends AppCompatActivity {
-
- private static final int LOADER_CHEESES = 1;
-
- private CheeseAdapter mCheeseAdapter;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main_activity);
-
- final RecyclerView list = (RecyclerView) findViewById(R.id.list);
- list.setLayoutManager(new LinearLayoutManager(list.getContext()));
- mCheeseAdapter = new CheeseAdapter();
- list.setAdapter(mCheeseAdapter);
-
- getSupportLoaderManager().initLoader(LOADER_CHEESES, null, mLoaderCallbacks);
- }
-
- private LoaderManager.LoaderCallbacks<Cursor> mLoaderCallbacks =
- new LoaderManager.LoaderCallbacks<Cursor>() {
-
- @Override
- public Loader<Cursor> onCreateLoader(int id, Bundle args) {
- switch (id) {
- case LOADER_CHEESES:
- return new CursorLoader(getApplicationContext(),
- SampleContentProvider.URI_CHEESE,
- new String[]{Cheese.COLUMN_NAME},
- null, null, null);
- default:
- throw new IllegalArgumentException();
- }
- }
-
- @Override
- public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
- switch (loader.getId()) {
- case LOADER_CHEESES:
- mCheeseAdapter.setCheeses(data);
- break;
- }
- }
-
- @Override
- public void onLoaderReset(Loader<Cursor> loader) {
- switch (loader.getId()) {
- case LOADER_CHEESES:
- mCheeseAdapter.setCheeses(null);
- break;
- }
- }
-
- };
-
- private static class CheeseAdapter extends RecyclerView.Adapter<CheeseAdapter.ViewHolder> {
-
- private Cursor mCursor;
-
- @Override
- public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- return new ViewHolder(parent);
- }
-
- @Override
- public void onBindViewHolder(ViewHolder holder, int position) {
- if (mCursor.moveToPosition(position)) {
- holder.mText.setText(mCursor.getString(
- mCursor.getColumnIndexOrThrow(Cheese.COLUMN_NAME)));
- }
- }
-
- @Override
- public int getItemCount() {
- return mCursor == null ? 0 : mCursor.getCount();
- }
-
- void setCheeses(Cursor cursor) {
- mCursor = cursor;
- notifyDataSetChanged();
- }
-
- static class ViewHolder extends RecyclerView.ViewHolder {
-
- TextView mText;
-
- ViewHolder(ViewGroup parent) {
- super(LayoutInflater.from(parent.getContext()).inflate(
- android.R.layout.simple_list_item_1, parent, false));
- mText = (TextView) itemView.findViewById(android.R.id.text1);
- }
-
- }
-
- }
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/Cheese.java b/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/Cheese.java
deleted file mode 100644
index 4534e13..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/Cheese.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample.data;
-
-import android.arch.persistence.room.ColumnInfo;
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-import android.content.ContentValues;
-import android.provider.BaseColumns;
-
-
-/**
- * Represents one record of the Cheese table.
- */
-@Entity(tableName = Cheese.TABLE_NAME)
-public class Cheese {
-
- /** The name of the Cheese table. */
- public static final String TABLE_NAME = "cheeses";
-
- /** The name of the ID column. */
- public static final String COLUMN_ID = BaseColumns._ID;
-
- /** The name of the name column. */
- public static final String COLUMN_NAME = "name";
-
- /** The unique ID of the cheese. */
- @PrimaryKey(autoGenerate = true)
- @ColumnInfo(index = true, name = COLUMN_ID)
- public long id;
-
- /** The name of the cheese. */
- @ColumnInfo(name = COLUMN_NAME)
- public String name;
-
- /**
- * Create a new {@link Cheese} from the specified {@link ContentValues}.
- *
- * @param values A {@link ContentValues} that at least contain {@link #COLUMN_NAME}.
- * @return A newly created {@link Cheese} instance.
- */
- public static Cheese fromContentValues(ContentValues values) {
- final Cheese cheese = new Cheese();
- if (values.containsKey(COLUMN_ID)) {
- cheese.id = values.getAsLong(COLUMN_ID);
- }
- if (values.containsKey(COLUMN_NAME)) {
- cheese.name = values.getAsString(COLUMN_NAME);
- }
- return cheese;
- }
-
- /** Dummy data. */
- static final String[] CHEESES = {
- "Abbaye de Belloc", "Abbaye du Mont des Cats", "Abertam", "Abondance", "Ackawi",
- "Acorn", "Adelost", "Affidelice au Chablis", "Afuega'l Pitu", "Airag", "Airedale",
- "Aisy Cendre", "Allgauer Emmentaler", "Alverca", "Ambert", "American Cheese",
- "Ami du Chambertin", "Anejo Enchilado", "Anneau du Vic-Bilh", "Anthoriro", "Appenzell",
- "Aragon", "Ardi Gasna", "Ardrahan", "Armenian String", "Aromes au Gene de Marc",
- "Asadero", "Asiago", "Aubisque Pyrenees", "Autun", "Avaxtskyr", "Baby Swiss",
- "Babybel", "Baguette Laonnaise", "Bakers", "Baladi", "Balaton", "Bandal", "Banon",
- "Barry's Bay Cheddar", "Basing", "Basket Cheese", "Bath Cheese", "Bavarian Bergkase",
- "Baylough", "Beaufort", "Beauvoorde", "Beenleigh Blue", "Beer Cheese", "Bel Paese",
- "Bergader", "Bergere Bleue", "Berkswell", "Beyaz Peynir", "Bierkase", "Bishop Kennedy",
- "Blarney", "Bleu d'Auvergne", "Bleu de Gex", "Bleu de Laqueuille",
- "Bleu de Septmoncel", "Bleu Des Causses", "Blue", "Blue Castello", "Blue Rathgore",
- "Blue Vein (Australian)", "Blue Vein Cheeses", "Bocconcini", "Bocconcini (Australian)",
- "Boeren Leidenkaas", "Bonchester", "Bosworth", "Bougon", "Boule Du Roves",
- "Boulette d'Avesnes", "Boursault", "Boursin", "Bouyssou", "Bra", "Braudostur",
- "Breakfast Cheese", "Brebis du Lavort", "Brebis du Lochois", "Brebis du Puyfaucon",
- "Bresse Bleu", "Brick", "Brie", "Brie de Meaux", "Brie de Melun", "Brillat-Savarin",
- "Brin", "Brin d' Amour", "Brin d'Amour", "Brinza (Burduf Brinza)",
- "Briquette de Brebis", "Briquette du Forez", "Broccio", "Broccio Demi-Affine",
- "Brousse du Rove", "Bruder Basil", "Brusselae Kaas (Fromage de Bruxelles)", "Bryndza",
- "Buchette d'Anjou", "Buffalo", "Burgos", "Butte", "Butterkase", "Button (Innes)",
- "Buxton Blue", "Cabecou", "Caboc", "Cabrales", "Cachaille", "Caciocavallo", "Caciotta",
- "Caerphilly", "Cairnsmore", "Calenzana", "Cambazola", "Camembert de Normandie",
- "Canadian Cheddar", "Canestrato", "Cantal", "Caprice des Dieux", "Capricorn Goat",
- "Capriole Banon", "Carre de l'Est", "Casciotta di Urbino", "Cashel Blue", "Castellano",
- "Castelleno", "Castelmagno", "Castelo Branco", "Castigliano", "Cathelain",
- "Celtic Promise", "Cendre d'Olivet", "Cerney", "Chabichou", "Chabichou du Poitou",
- "Chabis de Gatine", "Chaource", "Charolais", "Chaumes", "Cheddar",
- "Cheddar Clothbound", "Cheshire", "Chevres", "Chevrotin des Aravis", "Chontaleno",
- "Civray", "Coeur de Camembert au Calvados", "Coeur de Chevre", "Colby", "Cold Pack",
- "Comte", "Coolea", "Cooleney", "Coquetdale", "Corleggy", "Cornish Pepper",
- "Cotherstone", "Cotija", "Cottage Cheese", "Cottage Cheese (Australian)",
- "Cougar Gold", "Coulommiers", "Coverdale", "Crayeux de Roncq", "Cream Cheese",
- "Cream Havarti", "Crema Agria", "Crema Mexicana", "Creme Fraiche", "Crescenza",
- "Croghan", "Crottin de Chavignol", "Crottin du Chavignol", "Crowdie", "Crowley",
- "Cuajada", "Curd", "Cure Nantais", "Curworthy", "Cwmtawe Pecorino",
- "Cypress Grove Chevre", "Danablu (Danish Blue)", "Danbo", "Danish Fontina",
- "Daralagjazsky", "Dauphin", "Delice des Fiouves", "Denhany Dorset Drum", "Derby",
- "Dessertnyj Belyj", "Devon Blue", "Devon Garland", "Dolcelatte", "Doolin",
- "Doppelrhamstufel", "Dorset Blue Vinney", "Double Gloucester", "Double Worcester",
- "Dreux a la Feuille", "Dry Jack", "Duddleswell", "Dunbarra", "Dunlop", "Dunsyre Blue",
- "Duroblando", "Durrus", "Dutch Mimolette (Commissiekaas)", "Edam", "Edelpilz",
- "Emental Grand Cru", "Emlett", "Emmental", "Epoisses de Bourgogne", "Esbareich",
- "Esrom", "Etorki", "Evansdale Farmhouse Brie", "Evora De L'Alentejo", "Exmoor Blue",
- "Explorateur", "Feta", "Feta (Australian)", "Figue", "Filetta", "Fin-de-Siecle",
- "Finlandia Swiss", "Finn", "Fiore Sardo", "Fleur du Maquis", "Flor de Guia",
- "Flower Marie", "Folded", "Folded cheese with mint", "Fondant de Brebis",
- "Fontainebleau", "Fontal", "Fontina Val d'Aosta", "Formaggio di capra", "Fougerus",
- "Four Herb Gouda", "Fourme d' Ambert", "Fourme de Haute Loire", "Fourme de Montbrison",
- "Fresh Jack", "Fresh Mozzarella", "Fresh Ricotta", "Fresh Truffles", "Fribourgeois",
- "Friesekaas", "Friesian", "Friesla", "Frinault", "Fromage a Raclette", "Fromage Corse",
- "Fromage de Montagne de Savoie", "Fromage Frais", "Fruit Cream Cheese",
- "Frying Cheese", "Fynbo", "Gabriel", "Galette du Paludier", "Galette Lyonnaise",
- "Galloway Goat's Milk Gems", "Gammelost", "Gaperon a l'Ail", "Garrotxa", "Gastanberra",
- "Geitost", "Gippsland Blue", "Gjetost", "Gloucester", "Golden Cross", "Gorgonzola",
- "Gornyaltajski", "Gospel Green", "Gouda", "Goutu", "Gowrie", "Grabetto", "Graddost",
- "Grafton Village Cheddar", "Grana", "Grana Padano", "Grand Vatel",
- "Grataron d' Areches", "Gratte-Paille", "Graviera", "Greuilh", "Greve",
- "Gris de Lille", "Gruyere", "Gubbeen", "Guerbigny", "Halloumi",
- "Halloumy (Australian)", "Haloumi-Style Cheese", "Harbourne Blue", "Havarti",
- "Heidi Gruyere", "Hereford Hop", "Herrgardsost", "Herriot Farmhouse", "Herve",
- "Hipi Iti", "Hubbardston Blue Cow", "Hushallsost", "Iberico", "Idaho Goatster",
- "Idiazabal", "Il Boschetto al Tartufo", "Ile d'Yeu", "Isle of Mull", "Jarlsberg",
- "Jermi Tortes", "Jibneh Arabieh", "Jindi Brie", "Jubilee Blue", "Juustoleipa",
- "Kadchgall", "Kaseri", "Kashta", "Kefalotyri", "Kenafa", "Kernhem", "Kervella Affine",
- "Kikorangi", "King Island Cape Wickham Brie", "King River Gold", "Klosterkaese",
- "Knockalara", "Kugelkase", "L'Aveyronnais", "L'Ecir de l'Aubrac", "La Taupiniere",
- "La Vache Qui Rit", "Laguiole", "Lairobell", "Lajta", "Lanark Blue", "Lancashire",
- "Langres", "Lappi", "Laruns", "Lavistown", "Le Brin", "Le Fium Orbo", "Le Lacandou",
- "Le Roule", "Leafield", "Lebbene", "Leerdammer", "Leicester", "Leyden", "Limburger",
- "Lincolnshire Poacher", "Lingot Saint Bousquet d'Orb", "Liptauer", "Little Rydings",
- "Livarot", "Llanboidy", "Llanglofan Farmhouse", "Loch Arthur Farmhouse",
- "Loddiswell Avondale", "Longhorn", "Lou Palou", "Lou Pevre", "Lyonnais", "Maasdam",
- "Macconais", "Mahoe Aged Gouda", "Mahon", "Malvern", "Mamirolle", "Manchego",
- "Manouri", "Manur", "Marble Cheddar", "Marbled Cheeses", "Maredsous", "Margotin",
- "Maribo", "Maroilles", "Mascares", "Mascarpone", "Mascarpone (Australian)",
- "Mascarpone Torta", "Matocq", "Maytag Blue", "Meira", "Menallack Farmhouse",
- "Menonita", "Meredith Blue", "Mesost", "Metton (Cancoillotte)", "Meyer Vintage Gouda",
- "Mihalic Peynir", "Milleens", "Mimolette", "Mine-Gabhar", "Mini Baby Bells", "Mixte",
- "Molbo", "Monastery Cheeses", "Mondseer", "Mont D'or Lyonnais", "Montasio",
- "Monterey Jack", "Monterey Jack Dry", "Morbier", "Morbier Cru de Montagne",
- "Mothais a la Feuille", "Mozzarella", "Mozzarella (Australian)",
- "Mozzarella di Bufala", "Mozzarella Fresh, in water", "Mozzarella Rolls", "Munster",
- "Murol", "Mycella", "Myzithra", "Naboulsi", "Nantais", "Neufchatel",
- "Neufchatel (Australian)", "Niolo", "Nokkelost", "Northumberland", "Oaxaca",
- "Olde York", "Olivet au Foin", "Olivet Bleu", "Olivet Cendre",
- "Orkney Extra Mature Cheddar", "Orla", "Oschtjepka", "Ossau Fermier", "Ossau-Iraty",
- "Oszczypek", "Oxford Blue", "P'tit Berrichon", "Palet de Babligny", "Paneer", "Panela",
- "Pannerone", "Pant ys Gawn", "Parmesan (Parmigiano)", "Parmigiano Reggiano",
- "Pas de l'Escalette", "Passendale", "Pasteurized Processed", "Pate de Fromage",
- "Patefine Fort", "Pave d'Affinois", "Pave d'Auge", "Pave de Chirac", "Pave du Berry",
- "Pecorino", "Pecorino in Walnut Leaves", "Pecorino Romano", "Peekskill Pyramid",
- "Pelardon des Cevennes", "Pelardon des Corbieres", "Penamellera", "Penbryn",
- "Pencarreg", "Perail de Brebis", "Petit Morin", "Petit Pardou", "Petit-Suisse",
- "Picodon de Chevre", "Picos de Europa", "Piora", "Pithtviers au Foin",
- "Plateau de Herve", "Plymouth Cheese", "Podhalanski", "Poivre d'Ane", "Polkolbin",
- "Pont l'Eveque", "Port Nicholson", "Port-Salut", "Postel", "Pouligny-Saint-Pierre",
- "Pourly", "Prastost", "Pressato", "Prince-Jean", "Processed Cheddar", "Provolone",
- "Provolone (Australian)", "Pyengana Cheddar", "Pyramide", "Quark",
- "Quark (Australian)", "Quartirolo Lombardo", "Quatre-Vents", "Quercy Petit",
- "Queso Blanco", "Queso Blanco con Frutas --Pina y Mango", "Queso de Murcia",
- "Queso del Montsec", "Queso del Tietar", "Queso Fresco", "Queso Fresco (Adobera)",
- "Queso Iberico", "Queso Jalapeno", "Queso Majorero", "Queso Media Luna",
- "Queso Para Frier", "Queso Quesadilla", "Rabacal", "Raclette", "Ragusano", "Raschera",
- "Reblochon", "Red Leicester", "Regal de la Dombes", "Reggianito", "Remedou",
- "Requeson", "Richelieu", "Ricotta", "Ricotta (Australian)", "Ricotta Salata", "Ridder",
- "Rigotte", "Rocamadour", "Rollot", "Romano", "Romans Part Dieu", "Roncal", "Roquefort",
- "Roule", "Rouleau De Beaulieu", "Royalp Tilsit", "Rubens", "Rustinu", "Saaland Pfarr",
- "Saanenkaese", "Saga", "Sage Derby", "Sainte Maure", "Saint-Marcellin",
- "Saint-Nectaire", "Saint-Paulin", "Salers", "Samso", "San Simon", "Sancerre",
- "Sap Sago", "Sardo", "Sardo Egyptian", "Sbrinz", "Scamorza", "Schabzieger", "Schloss",
- "Selles sur Cher", "Selva", "Serat", "Seriously Strong Cheddar", "Serra da Estrela",
- "Sharpam", "Shelburne Cheddar", "Shropshire Blue", "Siraz", "Sirene", "Smoked Gouda",
- "Somerset Brie", "Sonoma Jack", "Sottocenare al Tartufo", "Soumaintrain",
- "Sourire Lozerien", "Spenwood", "Sraffordshire Organic", "St. Agur Blue Cheese",
- "Stilton", "Stinking Bishop", "String", "Sussex Slipcote", "Sveciaost", "Swaledale",
- "Sweet Style Swiss", "Swiss", "Syrian (Armenian String)", "Tala", "Taleggio", "Tamie",
- "Tasmania Highland Chevre Log", "Taupiniere", "Teifi", "Telemea", "Testouri",
- "Tete de Moine", "Tetilla", "Texas Goat Cheese", "Tibet", "Tillamook Cheddar",
- "Tilsit", "Timboon Brie", "Toma", "Tomme Brulee", "Tomme d'Abondance",
- "Tomme de Chevre", "Tomme de Romans", "Tomme de Savoie", "Tomme des Chouans", "Tommes",
- "Torta del Casar", "Toscanello", "Touree de L'Aubier", "Tourmalet",
- "Trappe (Veritable)", "Trois Cornes De Vendee", "Tronchon", "Trou du Cru", "Truffe",
- "Tupi", "Turunmaa", "Tymsboro", "Tyn Grug", "Tyning", "Ubriaco", "Ulloa",
- "Vacherin-Fribourgeois", "Valencay", "Vasterbottenost", "Venaco", "Vendomois",
- "Vieux Corse", "Vignotte", "Vulscombe", "Waimata Farmhouse Blue",
- "Washed Rind Cheese (Australian)", "Waterloo", "Weichkaese", "Wellington",
- "Wensleydale", "White Stilton", "Whitestone Farmhouse", "Wigmore", "Woodside Cabecou",
- "Xanadu", "Xynotyro", "Yarg Cornish", "Yarra Valley Pyramid", "Yorkshire Blue",
- "Zamorano", "Zanetti Grana Padano", "Zanetti Parmigiano Reggiano"
- };
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/CheeseDao.java b/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/CheeseDao.java
deleted file mode 100644
index ea007c5..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/CheeseDao.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample.data;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.Query;
-import android.arch.persistence.room.Update;
-import android.database.Cursor;
-
-
-/**
- * Data access object for Cheese.
- */
-@Dao
-public interface CheeseDao {
-
- /**
- * Counts the number of cheeses in the table.
- *
- * @return The number of cheeses.
- */
- @Query("SELECT COUNT(*) FROM " + Cheese.TABLE_NAME)
- int count();
-
- /**
- * Inserts a cheese into the table.
- *
- * @param cheese A new cheese.
- * @return The row ID of the newly inserted cheese.
- */
- @Insert
- long insert(Cheese cheese);
-
- /**
- * Inserts multiple cheeses into the database
- *
- * @param cheeses An array of new cheeses.
- * @return The row IDs of the newly inserted cheeses.
- */
- @Insert
- long[] insertAll(Cheese[] cheeses);
-
- /**
- * Select all cheeses.
- *
- * @return A {@link Cursor} of all the cheeses in the table.
- */
- @Query("SELECT * FROM " + Cheese.TABLE_NAME)
- Cursor selectAll();
-
- /**
- * Select a cheese by the ID.
- *
- * @param id The row ID.
- * @return A {@link Cursor} of the selected cheese.
- */
- @Query("SELECT * FROM " + Cheese.TABLE_NAME + " WHERE " + Cheese.COLUMN_ID + " = :id")
- Cursor selectById(long id);
-
- /**
- * Delete a cheese by the ID.
- *
- * @param id The row ID.
- * @return A number of cheeses deleted. This should always be {@code 1}.
- */
- @Query("DELETE FROM " + Cheese.TABLE_NAME + " WHERE " + Cheese.COLUMN_ID + " = :id")
- int deleteById(long id);
-
- /**
- * Update the cheese. The cheese is identified by the row ID.
- *
- * @param cheese The cheese to update.
- * @return A number of cheeses updated. This should always be {@code 1}.
- */
- @Update
- int update(Cheese cheese);
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/SampleDatabase.java b/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/SampleDatabase.java
deleted file mode 100644
index 9f27bf0..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/data/SampleDatabase.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample.data;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.Room;
-import android.arch.persistence.room.RoomDatabase;
-import android.content.Context;
-import android.support.annotation.VisibleForTesting;
-
-
-/**
- * The Room database.
- */
-@Database(entities = {Cheese.class}, version = 1)
-public abstract class SampleDatabase extends RoomDatabase {
-
- /**
- * @return The DAO for the Cheese table.
- */
- @SuppressWarnings("WeakerAccess")
- public abstract CheeseDao cheese();
-
- /** The only instance */
- private static SampleDatabase sInstance;
-
- /**
- * Gets the singleton instance of SampleDatabase.
- *
- * @param context The context.
- * @return The singleton instance of SampleDatabase.
- */
- public static synchronized SampleDatabase getInstance(Context context) {
- if (sInstance == null) {
- sInstance = Room
- .databaseBuilder(context.getApplicationContext(), SampleDatabase.class, "ex")
- .build();
- sInstance.populateInitialData();
- }
- return sInstance;
- }
-
- /**
- * Switches the internal implementation with an empty in-memory database.
- *
- * @param context The context.
- */
- @VisibleForTesting
- public static void switchToInMemory(Context context) {
- sInstance = Room.inMemoryDatabaseBuilder(context.getApplicationContext(),
- SampleDatabase.class).build();
- }
-
- /**
- * Inserts the dummy data into the database if it is currently empty.
- */
- private void populateInitialData() {
- if (cheese().count() == 0) {
- Cheese cheese = new Cheese();
- beginTransaction();
- try {
- for (int i = 0; i < Cheese.CHEESES.length; i++) {
- cheese.name = Cheese.CHEESES[i];
- cheese().insert(cheese);
- }
- setTransactionSuccessful();
- } finally {
- endTransaction();
- }
- }
- }
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/provider/SampleContentProvider.java b/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/provider/SampleContentProvider.java
deleted file mode 100644
index 00ae751..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/java/com/example/android/contentprovidersample/provider/SampleContentProvider.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2017 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.contentprovidersample.provider;
-
-import android.content.ContentProvider;
-import android.content.ContentProviderOperation;
-import android.content.ContentProviderResult;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.OperationApplicationException;
-import android.content.UriMatcher;
-import android.database.Cursor;
-import android.net.Uri;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-
-import com.example.android.contentprovidersample.data.Cheese;
-import com.example.android.contentprovidersample.data.CheeseDao;
-import com.example.android.contentprovidersample.data.SampleDatabase;
-
-import java.util.ArrayList;
-
-
-/**
- * A {@link ContentProvider} based on a Room database.
- *
- * <p>Note that you don't need to implement a ContentProvider unless you want to expose the data
- * outside your process or your application already uses a ContentProvider.</p>
- */
-public class SampleContentProvider extends ContentProvider {
-
- /** The authority of this content provider. */
- public static final String AUTHORITY = "com.example.android.contentprovidersample.provider";
-
- /** The URI for the Cheese table. */
- public static final Uri URI_CHEESE = Uri.parse(
- "content://" + AUTHORITY + "/" + Cheese.TABLE_NAME);
-
- /** The match code for some items in the Cheese table. */
- private static final int CODE_CHEESE_DIR = 1;
-
- /** The match code for an item in the Cheese table. */
- private static final int CODE_CHEESE_ITEM = 2;
-
- /** The URI matcher. */
- private static final UriMatcher MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
-
- static {
- MATCHER.addURI(AUTHORITY, Cheese.TABLE_NAME, CODE_CHEESE_DIR);
- MATCHER.addURI(AUTHORITY, Cheese.TABLE_NAME + "/*", CODE_CHEESE_ITEM);
- }
-
- @Override
- public boolean onCreate() {
- return true;
- }
-
- @Nullable
- @Override
- public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection,
- @Nullable String[] selectionArgs, @Nullable String sortOrder) {
- final int code = MATCHER.match(uri);
- if (code == CODE_CHEESE_DIR || code == CODE_CHEESE_ITEM) {
- final Context context = getContext();
- if (context == null) {
- return null;
- }
- CheeseDao cheese = SampleDatabase.getInstance(context).cheese();
- final Cursor cursor;
- if (code == CODE_CHEESE_DIR) {
- cursor = cheese.selectAll();
- } else {
- cursor = cheese.selectById(ContentUris.parseId(uri));
- }
- cursor.setNotificationUri(context.getContentResolver(), uri);
- return cursor;
- } else {
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
- @Nullable
- @Override
- public String getType(@NonNull Uri uri) {
- switch (MATCHER.match(uri)) {
- case CODE_CHEESE_DIR:
- return "vnd.android.cursor.dir/" + AUTHORITY + "." + Cheese.TABLE_NAME;
- case CODE_CHEESE_ITEM:
- return "vnd.android.cursor.item/" + AUTHORITY + "." + Cheese.TABLE_NAME;
- default:
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
- @Nullable
- @Override
- public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) {
- switch (MATCHER.match(uri)) {
- case CODE_CHEESE_DIR:
- final Context context = getContext();
- if (context == null) {
- return null;
- }
- final long id = SampleDatabase.getInstance(context).cheese()
- .insert(Cheese.fromContentValues(values));
- context.getContentResolver().notifyChange(uri, null);
- return ContentUris.withAppendedId(uri, id);
- case CODE_CHEESE_ITEM:
- throw new IllegalArgumentException("Invalid URI, cannot insert with ID: " + uri);
- default:
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
- @Override
- public int delete(@NonNull Uri uri, @Nullable String selection,
- @Nullable String[] selectionArgs) {
- switch (MATCHER.match(uri)) {
- case CODE_CHEESE_DIR:
- throw new IllegalArgumentException("Invalid URI, cannot update without ID" + uri);
- case CODE_CHEESE_ITEM:
- final Context context = getContext();
- if (context == null) {
- return 0;
- }
- final int count = SampleDatabase.getInstance(context).cheese()
- .deleteById(ContentUris.parseId(uri));
- context.getContentResolver().notifyChange(uri, null);
- return count;
- default:
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
- @Override
- public int update(@NonNull Uri uri, @Nullable ContentValues values, @Nullable String selection,
- @Nullable String[] selectionArgs) {
- switch (MATCHER.match(uri)) {
- case CODE_CHEESE_DIR:
- throw new IllegalArgumentException("Invalid URI, cannot update without ID" + uri);
- case CODE_CHEESE_ITEM:
- final Context context = getContext();
- if (context == null) {
- return 0;
- }
- final Cheese cheese = Cheese.fromContentValues(values);
- cheese.id = ContentUris.parseId(uri);
- final int count = SampleDatabase.getInstance(context).cheese()
- .update(cheese);
- context.getContentResolver().notifyChange(uri, null);
- return count;
- default:
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
- @NonNull
- @Override
- public ContentProviderResult[] applyBatch(
- @NonNull ArrayList<ContentProviderOperation> operations)
- throws OperationApplicationException {
- final Context context = getContext();
- if (context == null) {
- return new ContentProviderResult[0];
- }
- final SampleDatabase database = SampleDatabase.getInstance(context);
- database.beginTransaction();
- try {
- final ContentProviderResult[] result = super.applyBatch(operations);
- database.setTransactionSuccessful();
- return result;
- } finally {
- database.endTransaction();
- }
- }
-
- @Override
- public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] valuesArray) {
- switch (MATCHER.match(uri)) {
- case CODE_CHEESE_DIR:
- final Context context = getContext();
- if (context == null) {
- return 0;
- }
- final SampleDatabase database = SampleDatabase.getInstance(context);
- final Cheese[] cheeses = new Cheese[valuesArray.length];
- for (int i = 0; i < valuesArray.length; i++) {
- cheeses[i] = Cheese.fromContentValues(valuesArray[i]);
- }
- return database.cheese().insertAll(cheeses).length;
- case CODE_CHEESE_ITEM:
- throw new IllegalArgumentException("Invalid URI, cannot insert with ID: " + uri);
- default:
- throw new IllegalArgumentException("Unknown URI: " + uri);
- }
- }
-
-}
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/layout/main_activity.xml b/samples-flatfoot/ContentProviderSample/app/src/main/res/layout/main_activity.xml
deleted file mode 100644
index 24592dd..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/layout/main_activity.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 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.
--->
-<android.support.v7.widget.RecyclerView
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:clipToPadding="false"
- android:paddingBottom="8dp"
- android:paddingTop="8dp"
- android:scrollbars="vertical"
- tools:context="com.example.android.contentprovidersample.MainActivity"/>
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index 821d510..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index cbe549e..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index ca02616..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 1a7720c..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index e12fb7a..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/colors.xml b/samples-flatfoot/ContentProviderSample/app/src/main/res/values/colors.xml
deleted file mode 100644
index e1723942..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 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>
- <color name="primary">#009688</color>
- <color name="primary_dark">#00796B</color>
- <color name="accent">#536DFE</color>
-</resources>
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/strings.xml b/samples-flatfoot/ContentProviderSample/app/src/main/res/values/strings.xml
deleted file mode 100644
index b2e4230..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 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">ContentProvider Sample</string>
-</resources>
diff --git a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/styles.xml b/samples-flatfoot/ContentProviderSample/app/src/main/res/values/styles.xml
deleted file mode 100644
index 4a858f5..0000000
--- a/samples-flatfoot/ContentProviderSample/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 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.ContentProviderSample" parent="Theme.AppCompat.Light.DarkActionBar">
- <item name="colorPrimary">@color/primary</item>
- <item name="colorPrimaryDark">@color/primary_dark</item>
- <item name="colorAccent">@color/accent</item>
- </style>
-
-</resources>
diff --git a/samples-flatfoot/ContentProviderSample/build.gradle b/samples-flatfoot/ContentProviderSample/build.gradle
deleted file mode 100644
index 79c0183..0000000
--- a/samples-flatfoot/ContentProviderSample/build.gradle
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.4.0-alpha6'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- // TODO: Replace this
- maven {
- url "file:///usr/local/google_ssd/android/m2repository"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/samples-flatfoot/ContentProviderSample/gradle.properties b/samples-flatfoot/ContentProviderSample/gradle.properties
deleted file mode 100644
index aac7c9b..0000000
--- a/samples-flatfoot/ContentProviderSample/gradle.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index c6e5060..0000000
--- a/samples-flatfoot/ContentProviderSample/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Fri Apr 21 15:24:08 JST 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
diff --git a/samples-flatfoot/ContentProviderSample/gradlew b/samples-flatfoot/ContentProviderSample/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/ContentProviderSample/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/ContentProviderSample/gradlew.bat b/samples-flatfoot/ContentProviderSample/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/ContentProviderSample/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/ContentProviderSample/settings.gradle b/samples-flatfoot/ContentProviderSample/settings.gradle
deleted file mode 100644
index e7b4def..0000000
--- a/samples-flatfoot/ContentProviderSample/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app'
diff --git a/samples-flatfoot/GithubBrowser/.gitignore b/samples-flatfoot/GithubBrowser/.gitignore
deleted file mode 100644
index 39fb081..0000000
--- a/samples-flatfoot/GithubBrowser/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/GithubBrowser/app/.gitignore b/samples-flatfoot/GithubBrowser/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/samples-flatfoot/GithubBrowser/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/samples-flatfoot/GithubBrowser/app/build.gradle b/samples-flatfoot/GithubBrowser/app/build.gradle
deleted file mode 100644
index b1f12ac..0000000
--- a/samples-flatfoot/GithubBrowser/app/build.gradle
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId "com.android.sample.githubbrowser"
- minSdkVersion 14
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
-
- javaCompileOptions {
- annotationProcessorOptions {
- arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
- }
- }
- }
- dataBinding {
- enabled = true
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile "com.android.support:percent:$supportLibVersion"
- compile "com.android.support:cardview-v7:$supportLibVersion"
- compile "com.android.support:appcompat-v7:$supportLibVersion"
- compile "com.android.support:design:$supportLibVersion"
- compile 'com.squareup.retrofit2:retrofit:2.1.0'
- compile 'com.squareup.retrofit2:converter-gson:2.1.0'
- compile 'com.github.bumptech.glide:glide:3.7.0'
- compile "com.android.support.room:runtime:$flatfootVersion"
- compile "com.android.support.lifecycle:runtime:$flatfootVersion"
- compile "com.android.support.lifecycle:extensions:$flatfootVersion"
-
- compile "com.google.dagger:dagger:$daggerVersion"
-
- annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"
- annotationProcessor "com.android.support.room:compiler:$flatfootVersion"
- annotationProcessor "com.android.support.lifecycle:compiler:$flatfootVersion"
-
- testCompile 'junit:junit:4.12'
-}
diff --git a/samples-flatfoot/GithubBrowser/app/proguard-rules.pro b/samples-flatfoot/GithubBrowser/app/proguard-rules.pro
deleted file mode 100644
index 99e1cd4..0000000
--- a/samples-flatfoot/GithubBrowser/app/proguard-rules.pro
+++ /dev/null
@@ -1,35 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/kirillg/Android/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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 *;
-#}
-
-# Platform calls Class.forName on types which do not exist on Android to determine platform.
--dontnote retrofit2.Platform
-# Platform used when running on RoboVM on iOS. Will not be used at runtime.
--dontnote retrofit2.Platform$IOS$MainThreadExecutor
-# Platform used when running on Java 8 VMs. Will not be used at runtime.
--dontwarn retrofit2.Platform$Java8
-# Retain generic type information for use by reflection by converters and adapters.
--keepattributes Signature
-# Retain declared checked exceptions for use by a Proxy instance.
--keepattributes Exceptions
-
--keep public class * implements com.bumptech.glide.module.GlideModule
--keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
- **[] $VALUES;
- public *;
-}
--keepresourcexmlelements manifest/application/meta-data@value=GlideModule
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/schemas/com.android.sample.githubbrowser.db.GithubDatabase/1.json b/samples-flatfoot/GithubBrowser/app/schemas/com.android.sample.githubbrowser.db.GithubDatabase/1.json
deleted file mode 100644
index 1409973..0000000
--- a/samples-flatfoot/GithubBrowser/app/schemas/com.android.sample.githubbrowser.db.GithubDatabase/1.json
+++ /dev/null
@@ -1,393 +0,0 @@
-{
- "formatVersion": 1,
- "database": {
- "version": 1,
- "identityHash": "b1b39c866af4b7b44d7ea3c6202c4352",
- "entities": [
- {
- "tableName": "PersonData",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`login` TEXT, `id` TEXT, `avatar_url` TEXT, `repos_url` TEXT, `name` TEXT, `company` TEXT, `blog` TEXT, `location` TEXT, `email` TEXT, `public_repos` INTEGER, `followers` INTEGER, `following` INTEGER, `created_at` TEXT, PRIMARY KEY(`login`))",
- "fields": [
- {
- "fieldPath": "login",
- "columnName": "login",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "id",
- "columnName": "id",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "avatar_url",
- "columnName": "avatar_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "repos_url",
- "columnName": "repos_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "name",
- "columnName": "name",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "company",
- "columnName": "company",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "blog",
- "columnName": "blog",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "location",
- "columnName": "location",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "email",
- "columnName": "email",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "public_repos",
- "columnName": "public_repos",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "followers",
- "columnName": "followers",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "following",
- "columnName": "following",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "created_at",
- "columnName": "created_at",
- "affinity": "TEXT"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "login"
- ],
- "autoGenerate": false
- },
- "indices": []
- },
- {
- "tableName": "SearchQueryData",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`searchQuery` TEXT, `searchKind` INTEGER, `timestamp` INTEGER, `indexOfLastFetchedPage` INTEGER, `numberOfFetchedItems` INTEGER, `hasNoMoreData` INTEGER, PRIMARY KEY(`searchQuery`, `searchKind`))",
- "fields": [
- {
- "fieldPath": "searchQuery",
- "columnName": "searchQuery",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "searchKind",
- "columnName": "searchKind",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "timestamp",
- "columnName": "timestamp",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "indexOfLastFetchedPage",
- "columnName": "indexOfLastFetchedPage",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "numberOfFetchedItems",
- "columnName": "numberOfFetchedItems",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "hasNoMoreData",
- "columnName": "hasNoMoreData",
- "affinity": "INTEGER"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "searchQuery",
- "searchKind"
- ],
- "autoGenerate": false
- },
- "indices": []
- },
- {
- "tableName": "GeneralRepoSearchData",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`searchQuery` TEXT, `resultIndex` INTEGER, `repoId` TEXT, PRIMARY KEY(`searchQuery`, `resultIndex`, `repoId`))",
- "fields": [
- {
- "fieldPath": "searchQuery",
- "columnName": "searchQuery",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "resultIndex",
- "columnName": "resultIndex",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "repoId",
- "columnName": "repoId",
- "affinity": "TEXT"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "searchQuery",
- "resultIndex",
- "repoId"
- ],
- "autoGenerate": false
- },
- "indices": []
- },
- {
- "tableName": "RepositoryData",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT, `name` TEXT, `full_name` TEXT, `description` TEXT, `created_at` TEXT, `stargazers_count` INTEGER, `language` TEXT, `forks_count` INTEGER, `open_issues_count` INTEGER, `subscribers_count` INTEGER, `owner_login` TEXT, `owner_id` TEXT, `owner_avatar_url` TEXT, `owner_repos_url` TEXT, `owner_name` TEXT, `owner_company` TEXT, `owner_blog` TEXT, `owner_location` TEXT, `owner_email` TEXT, `owner_public_repos` INTEGER, `owner_followers` INTEGER, `owner_following` INTEGER, `owner_created_at` TEXT, `organization_login` TEXT, `organization_id` TEXT, `organization_avatar_url` TEXT, `organization_repos_url` TEXT, `organization_name` TEXT, `organization_company` TEXT, `organization_blog` TEXT, `organization_location` TEXT, `organization_email` TEXT, `organization_public_repos` INTEGER, `organization_followers` INTEGER, `organization_following` INTEGER, `organization_created_at` TEXT, PRIMARY KEY(`id`))",
- "fields": [
- {
- "fieldPath": "id",
- "columnName": "id",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "name",
- "columnName": "name",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "full_name",
- "columnName": "full_name",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "description",
- "columnName": "description",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "created_at",
- "columnName": "created_at",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "stargazers_count",
- "columnName": "stargazers_count",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "language",
- "columnName": "language",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "forks_count",
- "columnName": "forks_count",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "open_issues_count",
- "columnName": "open_issues_count",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "subscribers_count",
- "columnName": "subscribers_count",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "owner.login",
- "columnName": "owner_login",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.id",
- "columnName": "owner_id",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.avatar_url",
- "columnName": "owner_avatar_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.repos_url",
- "columnName": "owner_repos_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.name",
- "columnName": "owner_name",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.company",
- "columnName": "owner_company",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.blog",
- "columnName": "owner_blog",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.location",
- "columnName": "owner_location",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.email",
- "columnName": "owner_email",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "owner.public_repos",
- "columnName": "owner_public_repos",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "owner.followers",
- "columnName": "owner_followers",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "owner.following",
- "columnName": "owner_following",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "owner.created_at",
- "columnName": "owner_created_at",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.login",
- "columnName": "organization_login",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.id",
- "columnName": "organization_id",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.avatar_url",
- "columnName": "organization_avatar_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.repos_url",
- "columnName": "organization_repos_url",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.name",
- "columnName": "organization_name",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.company",
- "columnName": "organization_company",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.blog",
- "columnName": "organization_blog",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.location",
- "columnName": "organization_location",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.email",
- "columnName": "organization_email",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "organization.public_repos",
- "columnName": "organization_public_repos",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "organization.followers",
- "columnName": "organization_followers",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "organization.following",
- "columnName": "organization_following",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "organization.created_at",
- "columnName": "organization_created_at",
- "affinity": "TEXT"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "id"
- ],
- "autoGenerate": false
- },
- "indices": []
- },
- {
- "tableName": "ContributorSearchData",
- "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`searchQuery` TEXT, `resultIndex` INTEGER, `contributorId` TEXT, `contributions` INTEGER, PRIMARY KEY(`searchQuery`, `resultIndex`, `contributorId`))",
- "fields": [
- {
- "fieldPath": "searchQuery",
- "columnName": "searchQuery",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "resultIndex",
- "columnName": "resultIndex",
- "affinity": "INTEGER"
- },
- {
- "fieldPath": "contributorId",
- "columnName": "contributorId",
- "affinity": "TEXT"
- },
- {
- "fieldPath": "contributions",
- "columnName": "contributions",
- "affinity": "INTEGER"
- }
- ],
- "primaryKey": {
- "columnNames": [
- "searchQuery",
- "resultIndex",
- "contributorId"
- ],
- "autoGenerate": false
- },
- "indices": []
- }
- ],
- "setupQueries": [
- "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
- "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"b1b39c866af4b7b44d7ea3c6202c4352\")"
- ]
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/AndroidManifest.xml b/samples-flatfoot/GithubBrowser/app/src/main/AndroidManifest.xml
deleted file mode 100644
index b2af65a..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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 package="com.android.sample.githubbrowser"
- xmlns:android="http://schemas.android.com/apk/res/android">
- <uses-permission android:name="android.permission.INTERNET" />
- <application
- android:name=".GithubBrowserApp"
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity
- android:name="com.android.sample.githubbrowser.MainActivity"
- android:label="@string/app_name"
- android:theme="@style/AppTheme.NoActionBar"
- android:windowSoftInputMode="stateHidden">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
-
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseActivity.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseActivity.java
deleted file mode 100644
index d66258d..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseActivity.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.support.v7.app.AppCompatActivity;
-
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.support.lifecycle.LifecycleRegistry;
-import com.android.support.lifecycle.LifecycleRegistryProvider;
-
-/**
- * Temporary base activity that acts as lifecycle provider.
- */
-public abstract class BaseActivity extends AppCompatActivity implements LifecycleRegistryProvider,
- InjectableLifecycleProvider {
-
- private final LifecycleRegistry mRegistry = new LifecycleRegistry(this);
-
- @Override
- public LifecycleRegistry getLifecycle() {
- return mRegistry;
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseFragment.java
deleted file mode 100644
index 75c85d8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/BaseFragment.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser;
-
-import android.os.Bundle;
-
-import com.android.sample.githubbrowser.navigation.NavigationController;
-import com.android.support.lifecycle.LifecycleFragment;
-
-/**
- * Base fragment w/ navigation controller access.
- */
-public class BaseFragment extends LifecycleFragment {
- private NavigationController mNavigationController;
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- mNavigationController = ((MainActivity) getActivity()).getNavigationController();
- }
-
- public NavigationController getNavigationController() {
- return mNavigationController;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/EditUserDetailsFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/EditUserDetailsFragment.java
deleted file mode 100644
index 21235e1..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/EditUserDetailsFragment.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.app.Activity;
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v7.app.AlertDialog;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-import android.widget.EditText;
-
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.databinding.EditUserDetailsBinding;
-import com.android.sample.githubbrowser.viewmodel.PersonDataModel;
-import com.android.support.lifecycle.LifecycleRegistry;
-import com.android.support.lifecycle.LifecycleRegistryProvider;
-import com.android.support.lifecycle.Observer;
-import com.android.support.lifecycle.ViewModelStore;
-
-/**
- * Edit user details fragment.
- */
-public class EditUserDetailsFragment extends DialogFragment implements LifecycleRegistryProvider {
- private static final String LOGIN = "editUser.login";
- private static final int CODE_EDIT = 1;
-
- private LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
- private PersonDataModel mPersonDataModel;
-
- public EditUserDetailsFragment() {
- }
-
- public static EditUserDetailsFragment createFor(Fragment target, PersonData personData) {
- EditUserDetailsFragment editUserDetailsFragment = new EditUserDetailsFragment();
- Bundle editUserDetailsFragmentArgs = new Bundle();
- editUserDetailsFragmentArgs.putString(EditUserDetailsFragment.LOGIN, personData.login);
- editUserDetailsFragment.setArguments(editUserDetailsFragmentArgs);
- editUserDetailsFragment.setTargetFragment(target, CODE_EDIT);
- return editUserDetailsFragment;
- }
-
- @Override
- public LifecycleRegistry getLifecycle() {
- return mLifecycleRegistry;
- }
-
- @NonNull
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- final String login = getArguments().getString(LOGIN);
-
- // Configure the dialog to pass the data back when "OK" button is clicked
- AlertDialog.Builder editBuilder = new AlertDialog.Builder(getContext())
- .setTitle("Edit details")
- .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- // Ask the model to update the two fields on the user
- mPersonDataModel.update(login, getCurrentEmail(),
- getCurrentLocation());
- getTargetFragment().onActivityResult(getTargetRequestCode(),
- Activity.RESULT_OK, null);
- }
- })
- .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- getTargetFragment().onActivityResult(getTargetRequestCode(),
- Activity.RESULT_CANCELED, null);
- }
- });
-
- // Inflate the main editor area and set it as custom view on the dialog
- final LayoutInflater inflater = LayoutInflater.from(getContext());
- final EditUserDetailsBinding binding = DataBindingUtil.inflate(
- inflater, R.layout.edit_user_details, null, false);
- final ViewGroup editor = (ViewGroup) binding.getRoot();
- editBuilder.setView(editor);
- final AlertDialog result = editBuilder.create();
-
- // Get our view model instance and register ourselves to observe change to the
- // user data. When a change is reported, update all UI elements based on the new
- // data.
- mPersonDataModel = ViewModelStore.get(this, login, PersonDataModel.class);
- // Ask the model to load the data for this user. When the data becomes available (either
- // immediately from the previous load or later on when it's fetched from remote API call),
- // we will be notified since this fragment registered itself as an observer on the matching
- // live data object.
- mPersonDataModel.loadData(login, false);
- mPersonDataModel.getPersonData().observe(this, new Observer<PersonData>() {
- @Override
- public void onChanged(@Nullable PersonData personData) {
- if (!isDetached() && (personData != null)) {
- android.util.Log.e("GithubBrowser", "Got data for editing from model");
- getDialog().setTitle(personData.name);
- binding.setUser(personData);
- binding.executePendingBindings();
- }
- }
- });
-
- return result;
- }
-
- private String getCurrentEmail() {
- EditText runtime = (EditText) getDialog().findViewById(R.id.email);
- return runtime.getText().toString();
- }
-
- private String getCurrentLocation() {
- EditText rated = (EditText) getDialog().findViewById(R.id.location);
- return rated.getText().toString();
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GetAuthTokenFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GetAuthTokenFragment.java
deleted file mode 100644
index 6cfbc95..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GetAuthTokenFragment.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.app.Dialog;
-import android.content.DialogInterface;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.v4.app.DialogFragment;
-import android.support.v7.app.AlertDialog;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-import android.widget.EditText;
-
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-import com.android.support.lifecycle.LifecycleRegistry;
-import com.android.support.lifecycle.LifecycleRegistryProvider;
-
-import javax.inject.Inject;
-
-/**
- * UI for getting an auth token for Github API calls.
- */
-public class GetAuthTokenFragment extends DialogFragment implements LifecycleRegistryProvider,
- InjectableLifecycleProvider {
- LifecycleRegistry mLifecycleRegistry = new LifecycleRegistry(this);
- @Inject
- AuthTokenModel mAuthTokenModel;
-
- @Override
- public LifecycleRegistry getLifecycle() {
- return mLifecycleRegistry;
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- }
-
- @NonNull
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState) {
- AlertDialog.Builder editBuilder = new AlertDialog.Builder(getContext())
- .setTitle(R.string.auth_token_title)
- .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialogInterface, int i) {
- mAuthTokenModel.saveToken(getCurrentAuthToken());
- }
- })
- .setNegativeButton(R.string.cancel, null);
-
- LayoutInflater inflater = LayoutInflater.from(getContext());
- ViewGroup editor = (ViewGroup) inflater.inflate(R.layout.get_auth_token, null, false);
- editBuilder.setView(editor);
-
- return editBuilder.create();
- }
-
- private String getCurrentAuthToken() {
- EditText runtime = (EditText) getDialog().findViewById(R.id.token);
- return runtime.getText().toString();
- }
-
- @Override
- public void inject(LifecycleProviderComponent component) {
- component.inject(this);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GithubBrowserApp.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GithubBrowserApp.java
deleted file mode 100644
index 02918fd..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/GithubBrowserApp.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser;
-
-import android.app.Activity;
-import android.app.Application;
-import android.content.Context;
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.app.FragmentManager;
-
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.sample.githubbrowser.di.AppModule;
-import com.android.sample.githubbrowser.di.DaggerAppComponent;
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.di.LifecycleProviderModule;
-import com.android.support.lifecycle.LifecycleProvider;
-
-public class GithubBrowserApp extends Application {
- AppComponent mAppComponent;
-
- @Override
- public void onCreate() {
- super.onCreate();
- mAppComponent = DaggerAppComponent.builder()
- .appModule(new AppModule(this)).build();
- registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacksAdapter() {
- @Override
- public void onActivityCreated(Activity activity, Bundle bundle) {
- tryInject(mAppComponent, activity);
-
- if (activity instanceof FragmentActivity) {
- ((FragmentActivity) activity).getSupportFragmentManager()
- .registerFragmentLifecycleCallbacks(
- new FragmentManager.FragmentLifecycleCallbacks() {
- @Override
- public void onFragmentPreAttached(FragmentManager fm,
- Fragment f, Context context) {
- tryInject(mAppComponent, f);
- }
- }, true);
- }
- }
- });
- }
-
- public AppComponent getAppComponent() {
- return mAppComponent;
- }
-
- private void tryInject(AppComponent appComponent, Object object) {
- if (object instanceof LifecycleProvider
- && object instanceof InjectableLifecycleProvider) {
- final LifecycleProviderComponent component = appComponent
- .plus(new LifecycleProviderModule((LifecycleProvider) object));
- ((InjectableLifecycleProvider) object).inject(component);
- }
- }
-
- /**
- * Empty activity callback impl.
- */
- private static class ActivityLifecycleCallbacksAdapter implements ActivityLifecycleCallbacks {
- @Override
- public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
- }
-
- @Override
- public void onActivityStarted(Activity activity) {
- }
-
- @Override
- public void onActivityResumed(Activity activity) {
- }
-
- @Override
- public void onActivityPaused(Activity activity) {
- }
-
- @Override
- public void onActivityStopped(Activity activity) {
- }
-
- @Override
- public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
- }
-
- @Override
- public void onActivityDestroyed(Activity activity) {
- }
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/MainActivity.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/MainActivity.java
deleted file mode 100644
index de5b9fe..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/MainActivity.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.annotation.SuppressLint;
-import android.content.Context;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.design.widget.Snackbar;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v7.widget.Toolbar;
-import android.text.TextUtils;
-import android.view.KeyEvent;
-import android.view.View;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.EditText;
-
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-import com.android.sample.githubbrowser.navigation.NavigationController;
-import com.android.sample.githubbrowser.viewmodel.RepositorySearchModel;
-import com.android.support.lifecycle.Observer;
-import com.android.support.lifecycle.ViewModelStore;
-
-import javax.inject.Inject;
-
-/**
- * Our main activity.
- */
-public class MainActivity extends BaseActivity {
- private static final String AUTH_TOKEN_FRAGMENT_TAG = "get_auth_token";
- @Inject
- AuthTokenModel mAuthTokenModel;
- private NavigationController mNavigationController;
-
- @Override
- public void inject(LifecycleProviderComponent component) {
- component.inject(this);
- }
-
- @SuppressLint("SetTextI18n")
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- mNavigationController = new NavigationController(this, getSupportFragmentManager(),
- R.id.fragment_container);
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
- final EditText search = (EditText) toolbar.findViewById(R.id.search);
- final RepositorySearchModel mainSearchModel = ViewModelStore.get(this,
- RepositorySearchModel.class);
-
- String currentSearch = search.getText().toString();
- if (TextUtils.isEmpty(currentSearch)) {
- search.setText("google");
- currentSearch = "google";
- }
- mainSearchModel.setQuery(currentSearch, true);
-
- // Check that the activity is using the layout version with
- // the fragment_container FrameLayout
- if (savedInstanceState == null) {
- // Create a new Fragment to be placed in the activity layout
- RepositoryListFragment mainFragment = new RepositoryListFragment();
-
- // Add the fragment to the 'fragment_container' FrameLayout
- getSupportFragmentManager().beginTransaction()
- .add(R.id.fragment_container, mainFragment, "main").commit();
- }
-
- search.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- if ((event.getAction() == KeyEvent.ACTION_DOWN)
- && (keyCode == KeyEvent.KEYCODE_ENTER)) {
- String query = search.getText().toString();
- Snackbar.make(findViewById(R.id.col), "Searching for " + query,
- Snackbar.LENGTH_SHORT).show();
-
- // Dismiss keyboard
- InputMethodManager imm = (InputMethodManager) getSystemService(
- Context.INPUT_METHOD_SERVICE);
- imm.hideSoftInputFromWindow(search.getWindowToken(), 0);
-
- // Pop everything off of the stack except the first entry
- FragmentManager fragmentManager = getSupportFragmentManager();
- while (fragmentManager.getBackStackEntryCount() > 0) {
- fragmentManager.popBackStackImmediate();
- }
-
- // Perform search action on key press
- mainSearchModel.setQuery(query, false);
- return true;
- }
- return false;
- }
- });
-
- mAuthTokenModel.getAuthTokenData().observe(this, new Observer<String>() {
- @Override
- public void onChanged(@Nullable String token) {
- search.setEnabled(token != null);
- // show get auth token fragment
- // Pop everything off of the stack except the first entry
- FragmentManager fragmentManager = getSupportFragmentManager();
- GetAuthTokenFragment getAuthTokenFragment = getGetAuthTokenFragment(
- fragmentManager);
- if (token == null) {
- if (!getAuthTokenFragment.isAdded()) {
- getAuthTokenFragment.show(fragmentManager, AUTH_TOKEN_FRAGMENT_TAG);
- }
- } else {
- if (getAuthTokenFragment.isAdded()) {
- getAuthTokenFragment.dismiss();
- }
- }
- }
- });
- }
-
- @NonNull
- private GetAuthTokenFragment getGetAuthTokenFragment(FragmentManager fragmentManager) {
- Fragment authTokenFragment = fragmentManager
- .findFragmentByTag(AUTH_TOKEN_FRAGMENT_TAG);
- GetAuthTokenFragment getAuthTokenFragment;
- if (authTokenFragment instanceof GetAuthTokenFragment) {
- getAuthTokenFragment = (GetAuthTokenFragment) authTokenFragment;
- } else {
- getAuthTokenFragment = new GetAuthTokenFragment();
- }
- return getAuthTokenFragment;
- }
-
- public NavigationController getNavigationController() {
- return mNavigationController;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryDetailsFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryDetailsFragment.java
deleted file mode 100644
index aad6eed..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryDetailsFragment.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.sample.githubbrowser.adapter.ContributorListAdapter;
-import com.android.sample.githubbrowser.adapter.LoadMoreCallback;
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.databinding.FragmentRepoDetailsBinding;
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.view.PersonClickCallback;
-import com.android.sample.githubbrowser.viewmodel.ContributorListModel;
-import com.android.sample.githubbrowser.viewmodel.RepositoryDataModel;
-import com.android.support.lifecycle.Observer;
-import com.android.support.lifecycle.ViewModelStore;
-
-import java.util.List;
-
-/**
- * Fragment that shows details of a single repository, including the list of its contributors.
- */
-public class RepositoryDetailsFragment extends BaseFragment implements
- InjectableLifecycleProvider {
- private static final String REPO_ID = "repoDetails.id";
- private static final String REPO_FULL_NAME = "repoDetails.fullName";
- private LifecycleProviderComponent mComponent;
- private FragmentRepoDetailsBinding mBinding;
-
- public RepositoryDetailsFragment() {
- }
-
- public static RepositoryDetailsFragment createFor(RepositoryData repo) {
- RepositoryDetailsFragment fragment = new RepositoryDetailsFragment();
- Bundle detailsFragmentArgs = new Bundle();
- detailsFragmentArgs.putString(RepositoryDetailsFragment.REPO_ID, repo.id);
- detailsFragmentArgs.putString(RepositoryDetailsFragment.REPO_FULL_NAME, repo.full_name);
- fragment.setArguments(detailsFragmentArgs);
- return fragment;
- }
-
- @Override
- public View onCreateView(final LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- mBinding = DataBindingUtil.inflate(
- inflater, R.layout.fragment_repo_details, container, false, mComponent);
- return mBinding.getRoot();
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- RepositoryDataModel repositoryDataModel = ViewModelStore.get(this,
- RepositoryDataModel.class);
- final ContributorListModel contributorListModel = ViewModelStore.get(this,
- ContributorListModel.class);
-
- final String repoId = getArguments().getString(REPO_ID);
- final String repoFullName = getArguments().getString(REPO_FULL_NAME);
- setupRecyclerView(contributorListModel);
- // Ask the model to load the data for this repository. When the data becomes available
- // (either immediately from the previous load or later on when it's fetched from
- // remote API call), we will be notified since this fragment registered itself as an
- // observer on the matching live data object.
- repositoryDataModel.loadData(repoId, repoFullName);
-
- repositoryDataModel.getRepositoryData().observe(this, new Observer<RepositoryData>() {
- @Override
- public void onChanged(@Nullable final RepositoryData repositoryData) {
- if (repositoryData != null) {
- // Bind the data on this fragment
- mBinding.setRepo(repositoryData);
- // TODO decompose this data
- String[] split = repositoryData.full_name.split("/");
- contributorListModel.setSearchTerms(split[0], repositoryData.name);
- } else {
- contributorListModel.setSearchTerms(null, null);
- }
- }
- });
- }
-
- private PersonClickCallback mPersonClickCallback = new PersonClickCallback() {
- @Override
- public void onClick(PersonData person) {
- getNavigationController().openUserDetailsFragment(person);
- }
- };
-
- private void setupRecyclerView(final ContributorListModel contributorListModel) {
- final ContributorListAdapter adapter = new ContributorListAdapter(mComponent,
- mPersonClickCallback,
- new LoadMoreCallback() {
- @Override
- public void loadMore(int currentSize) {
- contributorListModel.fetchAtIndexIfNecessary(currentSize);
- }
- });
- contributorListModel.getContributorListLiveData().observe(this,
- new Observer<List<ContributorData>>() {
- @Override
- public void onChanged(@Nullable List<ContributorData> contributorList) {
- adapter.setData(contributorList);
- }
- });
- mBinding.contributors.setAdapter(adapter);
- }
-
- @Override
- public void inject(LifecycleProviderComponent component) {
- mComponent = component;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryListFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryListFragment.java
deleted file mode 100644
index 049a6d2..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/RepositoryListFragment.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.GridLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.text.TextUtils;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.sample.githubbrowser.adapter.LoadMoreCallback;
-import com.android.sample.githubbrowser.adapter.RepositoryListAdapter;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.databinding.FragmentRepoListBinding;
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-import com.android.sample.githubbrowser.view.RepoClickCallback;
-import com.android.sample.githubbrowser.viewmodel.RepositoryListModel;
-import com.android.sample.githubbrowser.viewmodel.RepositorySearchModel;
-import com.android.support.lifecycle.LifecycleProvider;
-import com.android.support.lifecycle.Observer;
-import com.android.support.lifecycle.ViewModelStore;
-
-import java.util.List;
-
-import javax.inject.Inject;
-
-/**
- * Fragment that shows the list of all repositories that match the current search term.
- */
-public class RepositoryListFragment extends BaseFragment implements
- InjectableLifecycleProvider {
- @Inject
- AuthTokenModel mAuthTokenModel;
- FragmentRepoListBinding mBinding;
- LifecycleProviderComponent mComponent;
-
- @Override
- public void inject(LifecycleProviderComponent component) {
- mComponent = component;
- component.inject(this);
- }
- @Override
- public View onCreateView(final LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- mBinding = DataBindingUtil.inflate(
- inflater, R.layout.fragment_repo_list, container, false);
- return mBinding.getRoot();
- }
-
- @Override
- public void onActivityCreated(@Nullable Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- final RecyclerView recyclerView = mBinding.repoList;
-
- // Get all the models that are needed for this fragment
-
- // The model for our search query. Note that we are using the activity scope since
- // that is where the search box "lives"
- final RepositorySearchModel mainSearchModel = ViewModelStore.get(
- (LifecycleProvider) getActivity(), RepositorySearchModel.class);
- // The model for the list of repositories that are shown in this fragment.
- final RepositoryListModel repositoryListModel = ViewModelStore.get(
- this, RepositoryListModel.class);
- // The model for auth token.
- final RepositoryListAdapter adapter = new RepositoryListAdapter(mComponent,
- new RepoClickCallback() {
- @Override
- public void onClick(RepositoryData repositoryData) {
- getNavigationController().openRepositoryDetailsFragment(repositoryData);
- }
- },
- new LoadMoreCallback() {
- @Override
- public void loadMore(int currentSize) {
- repositoryListModel.fetchAtIndexIfNecessary(currentSize);
- }
- });
- recyclerView.setAdapter(adapter);
-
- // Wire changes in search query to update the list of repositories
- mainSearchModel.getSearchQueryData().observe(this, new Observer<String>() {
- @Override
- public void onChanged(@Nullable String s) {
- // When the main search query changes, update the list model with that query
- // so that it starts loading new data.
- repositoryListModel.setSearchTerm(s);
- mBinding.setQuery(s);
- }
- });
-
- repositoryListModel.getRepositoryListLiveData().observe(this,
- new Observer<List<RepositoryData>>() {
- @Override
- public void onChanged(@Nullable List<RepositoryData> repoList) {
- adapter.setData(repoList);
- }
- });
-
- repositoryListModel.getStateLiveData().observe(this, new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer state) {
- mBinding.setState(state);
- }
- });
-
- final int columnCount = getContext().getResources().getInteger(R.integer.column_count);
- recyclerView.setLayoutManager(new GridLayoutManager(getContext(), columnCount));
-
- // Wire changes in auth token to continue loading the list of repositories
- mAuthTokenModel.getAuthTokenData().observe(this, new Observer<String>() {
- @Override
- public void onChanged(@Nullable String s) {
- if (!TextUtils.isEmpty(s)) {
- repositoryListModel.resumeLoading();
- }
- }
- });
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/UserDetailsFragment.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/UserDetailsFragment.java
deleted file mode 100644
index fe0acf8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/UserDetailsFragment.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser;
-
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.GridLayoutManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.sample.githubbrowser.adapter.LoadMoreCallback;
-import com.android.sample.githubbrowser.adapter.RepositoryListAdapter;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.databinding.FragmentUserDetailsBinding;
-import com.android.sample.githubbrowser.di.InjectableLifecycleProvider;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.view.PersonClickCallback;
-import com.android.sample.githubbrowser.view.RepoClickCallback;
-import com.android.sample.githubbrowser.viewmodel.PersonDataModel;
-import com.android.sample.githubbrowser.viewmodel.RepositoryListModel;
-import com.android.support.lifecycle.Observer;
-import com.android.support.lifecycle.ViewModelStore;
-
-import java.util.List;
-
-/**
- * Fragment that shows details of a single user, including the list of their repositories.
- */
-public class UserDetailsFragment extends BaseFragment implements InjectableLifecycleProvider {
- private static final String USER_LOGIN = "userDetails.login";
-
- private String mLogin;
- private PersonDataModel mPersonDataModel;
- private LifecycleProviderComponent mComponent;
-
- public UserDetailsFragment() {
- }
-
- @Override
- public void inject(LifecycleProviderComponent component) {
- mComponent = component;
- }
-
- public static UserDetailsFragment createFor(PersonData person) {
- UserDetailsFragment fragment = new UserDetailsFragment();
- Bundle detailsFragmentArgs = new Bundle();
- detailsFragmentArgs.putString(UserDetailsFragment.USER_LOGIN, person.login);
- fragment.setArguments(detailsFragmentArgs);
- return fragment;
- }
-
- @Override
- public View onCreateView(final LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- final FragmentUserDetailsBinding binding = DataBindingUtil.inflate(
- inflater, R.layout.fragment_user_details, container, false, mComponent);
-
- mLogin = getArguments().getString(USER_LOGIN);
-
- // Get our view model instance and register ourselves to observe change to the
- // full user data. When a change is reported, update all UI elements based on the new
- // data.
- mPersonDataModel = ViewModelStore.get(this, mLogin, PersonDataModel.class);
- // Ask the model to load the data for this user. When the data becomes available (either
- // immediately from the previous load or later on when it's fetched from remote API call),
- // we will be notified since this fragment registered itself as an observer on the matching
- // live data object.
- // Note that the last parameter specifies that we're fine with getting partial data as
- // quickly as possible.
- mPersonDataModel.loadData(mLogin, false);
- binding.setEditCallback(new PersonClickCallback() {
- @Override
- public void onClick(PersonData user) {
- if (user == null) {
- return;
- }
- getNavigationController().openEditUserDetailsFragment(UserDetailsFragment.this,
- user);
- }
- });
- mPersonDataModel.getPersonData().observe(this, new Observer<PersonData>() {
- @Override
- public void onChanged(@Nullable final PersonData personData) {
- if (personData == null) {
- return;
- }
-
- // Populate as much info on this user as we can
- binding.setUser(personData);
- binding.executePendingBindings();
-
- if (!personData.isFullData()) {
- // If we only have partial data, initiate a full load.
- mPersonDataModel.loadData(mLogin, true);
- }
- }
- });
-
- // Load the list of repositories for this user based on the passed login.
- final RepositoryListModel repositoriesListModel = ViewModelStore.get(this,
- RepositoryListModel.class);
- repositoriesListModel.setSearchTerm(mLogin);
-
- final RepositoryListAdapter adapter = new RepositoryListAdapter(mComponent,
- new RepoClickCallback() {
- @Override
- public void onClick(RepositoryData repositoryData) {
- getNavigationController().openRepositoryDetailsFragment(repositoryData);
- }
- },
- new LoadMoreCallback() {
- @Override
- public void loadMore(int currentSize) {
- repositoriesListModel.fetchAtIndexIfNecessary(currentSize);
- }
- });
- binding.repositories.setAdapter(adapter);
- repositoriesListModel.getRepositoryListLiveData().observe(this,
- new Observer<List<RepositoryData>>() {
- @Override
- public void onChanged(@Nullable List<RepositoryData> data) {
- adapter.setData(data);
- }
- });
- final int columnCount = getContext().getResources().getInteger(
- R.integer.column_count);
- binding.repositories.setLayoutManager(new GridLayoutManager(getContext(), columnCount));
-
- return binding.getRoot();
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/ContributorListAdapter.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/ContributorListAdapter.java
deleted file mode 100644
index f8de8c6..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/ContributorListAdapter.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.adapter;
-
-import android.databinding.DataBindingUtil;
-import android.support.annotation.MainThread;
-import android.support.v7.util.DiffUtil;
-import android.support.v7.util.DiffUtil.DiffResult;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import com.android.sample.githubbrowser.R;
-import com.android.sample.githubbrowser.adapter.ContributorListAdapter.ContributorBindingHolder;
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.databinding.UserRowBinding;
-import com.android.sample.githubbrowser.di.LifecycleProviderComponent;
-import com.android.sample.githubbrowser.view.PersonClickCallback;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Adapter for the list of contributors.
- */
-public class ContributorListAdapter extends RecyclerView.Adapter<ContributorBindingHolder> {
- /**
- * Holder for the data cell.
- */
- static class ContributorBindingHolder extends RecyclerView.ViewHolder {
- private UserRowBinding mViewDataBinding;
-
- ContributorBindingHolder(UserRowBinding viewDataBinding) {
- super(viewDataBinding.getRoot());
- mViewDataBinding = viewDataBinding;
- }
-
- public UserRowBinding getBinding() {
- return mViewDataBinding;
- }
- }
-
- private List<ContributorData> mCurrList;
- private PersonClickCallback mPersonClickCallback;
- private LoadMoreCallback mLoadMoreCallback;
- private LifecycleProviderComponent mComponent;
-
- public ContributorListAdapter(LifecycleProviderComponent component,
- PersonClickCallback personClickCallback, LoadMoreCallback loadMoreCallback) {
- mComponent = component;
- mPersonClickCallback = personClickCallback;
- mLoadMoreCallback = loadMoreCallback;
- }
-
- @MainThread
- public void setData(final List<ContributorData> newList) {
- if (newList == null) {
- setData(Collections.<ContributorData>emptyList());
- return;
- }
- if (mCurrList == null) {
- mCurrList = newList;
- notifyItemRangeInserted(0, newList.size());
- } else {
- DiffResult result = DiffUtil.calculateDiff(
- new DiffUtilListCallback<ContributorData, String>(mCurrList, newList) {
- @Override
- String getId(ContributorData item) {
- return item.id;
- }
- });
- result.dispatchUpdatesTo(ContributorListAdapter.this);
- mCurrList = newList;
- }
- }
-
- @Override
- public ContributorBindingHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- UserRowBinding binding = DataBindingUtil.inflate(
- LayoutInflater.from(parent.getContext()),
- R.layout.user_row, parent, false, mComponent);
- binding.setCallback(mPersonClickCallback);
- return new ContributorBindingHolder(binding);
- }
-
- @Override
- public void onBindViewHolder(ContributorBindingHolder holder, final int position) {
- final ContributorData data = mCurrList.get(position);
-
- // Use data binding for wiring the data and the click handler
- UserRowBinding binding = holder.getBinding();
- binding.setContributor(data);
- binding.executePendingBindings();
-
- // Do we need to request another page?
- if (position > (mCurrList.size() - 2)) {
- mLoadMoreCallback.loadMore(mCurrList.size());
- }
- }
-
- @Override
- public int getItemCount() {
- return mCurrList == null ? 0 : mCurrList.size();
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/DiffUtilListCallback.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/DiffUtilListCallback.java
deleted file mode 100644
index 4378267..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/DiffUtilListCallback.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.adapter;
-
-import android.support.v7.util.DiffUtil;
-
-import java.util.List;
-
-/**
- * A DiffUtil callback implementation for lists which use equals for comparison.
- * @param <T>
- * @param <K>
- */
-abstract class DiffUtilListCallback<T, K> extends DiffUtil.Callback {
- private final List<T> mOldList;
- private final List<T> mNewList;
-
- DiffUtilListCallback(List<T> oldList, List<T> newList) {
- mOldList = oldList;
- mNewList = newList;
- }
-
- @Override
- public int getOldListSize() {
- return mOldList.size();
- }
-
- @Override
- public int getNewListSize() {
- return mNewList.size();
- }
-
- @Override
- public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
- K oldId = getId(mOldList.get(oldItemPosition));
- K newId = getId(mNewList.get(newItemPosition));
- return oldId.equals(newId);
- }
-
- @Override
- public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
- return mOldList.get(oldItemPosition).equals(
- mNewList.get(newItemPosition));
- }
-
- abstract K getId(T item);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/LoadMoreCallback.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/LoadMoreCallback.java
deleted file mode 100644
index c1ebb52..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/LoadMoreCallback.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.adapter;
-
-public interface LoadMoreCallback {
- void loadMore(int currentSize);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/RepositoryListAdapter.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/RepositoryListAdapter.java
deleted file mode 100644
index 9bc23ef..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/adapter/RepositoryListAdapter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.adapter;
-
-import android.databinding.DataBindingComponent;
-import android.databinding.DataBindingUtil;
-import android.support.annotation.MainThread;
-import android.support.v7.util.DiffUtil;
-import android.support.v7.util.DiffUtil.DiffResult;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import com.android.sample.githubbrowser.R;
-import com.android.sample.githubbrowser.adapter.RepositoryListAdapter.RepositoryBindingHolder;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.databinding.RepositoryCardBinding;
-import com.android.sample.githubbrowser.view.RepoClickCallback;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Adapter for a list of repositories.
- */
-public class RepositoryListAdapter extends RecyclerView.Adapter<RepositoryBindingHolder> {
- /**
- * Holder for the data cell.
- */
- static class RepositoryBindingHolder extends RecyclerView.ViewHolder {
- private RepositoryCardBinding mViewDataBinding;
-
- RepositoryBindingHolder(RepositoryCardBinding viewDataBinding) {
- super(viewDataBinding.getRoot());
- mViewDataBinding = viewDataBinding;
- }
-
- public RepositoryCardBinding getBinding() {
- return mViewDataBinding;
- }
- }
-
- private List<RepositoryData> mCurrList;
- private DataBindingComponent mComponent;
- private RepoClickCallback mRepoClickCallback;
- private LoadMoreCallback mLoadMoreCallback;
-
- /**
- * Creates an adapter.
- */
- public RepositoryListAdapter(android.databinding.DataBindingComponent component,
- RepoClickCallback callback, LoadMoreCallback loadMoreCallback) {
- mComponent = component;
- mRepoClickCallback = callback;
- mLoadMoreCallback = loadMoreCallback;
- }
-
- @MainThread
- public void setData(final List<RepositoryData> newList) {
- if (newList == null) {
- setData(Collections.<RepositoryData>emptyList());
- return;
- }
- if (mCurrList == null) {
- mCurrList = newList;
- notifyItemRangeInserted(0, newList.size());
- } else {
- DiffResult result = DiffUtil.calculateDiff(
- new DiffUtilListCallback<RepositoryData, String>(mCurrList, newList) {
- @Override
- String getId(RepositoryData item) {
- return item.id;
- }
- });
- result.dispatchUpdatesTo(RepositoryListAdapter.this);
- mCurrList = newList;
- }
- }
-
- @Override
- public RepositoryBindingHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- RepositoryCardBinding binding = DataBindingUtil.inflate(
- LayoutInflater.from(parent.getContext()),
- R.layout.repository_card, parent, false, mComponent);
- binding.setRepoClickCallback(mRepoClickCallback);
- return new RepositoryBindingHolder(binding);
- }
-
- @Override
- public void onBindViewHolder(RepositoryBindingHolder holder, final int position) {
- final RepositoryData data = mCurrList.get(position);
-
- // Use data binding for wiring the data and the click handler
- RepositoryCardBinding binding = holder.getBinding();
- binding.setRepo(data);
- binding.executePendingBindings();
-
- // Do we need to request another page?
- if (position > (mCurrList.size() - 2)) {
- mLoadMoreCallback.loadMore(mCurrList.size());
- }
- }
-
- @Override
- public int getItemCount() {
- return mCurrList == null ? 0 : mCurrList.size();
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorData.java
deleted file mode 100644
index c170902..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorData.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import com.android.support.room.Entity;
-
-/**
- * Contributor data object.
- */
-@Entity
-public class ContributorData extends PersonData {
- public int contributions;
-
- public ContributorData() {
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
-
- ContributorData that = (ContributorData) o;
-
- return contributions == that.contributions;
-
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + contributions;
- return result;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorSearchData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorSearchData.java
deleted file mode 100644
index 20bdd3f..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/ContributorSearchData.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import com.android.support.room.Entity;
-
-/**
- * Contains information on a single locally persisted entry from contributor list.
- */
-@Entity(primaryKeys = {"searchQuery", "resultIndex", "contributorId"})
-public class ContributorSearchData {
- public String searchQuery;
- public int resultIndex;
- public String contributorId;
- public int contributions;
-
- public ContributorSearchData() {
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/GeneralRepoSearchData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/GeneralRepoSearchData.java
deleted file mode 100644
index 1c89cca..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/GeneralRepoSearchData.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import com.android.support.room.Entity;
-
-/**
- * Contains information on a single locally persisted entry from repo search.
- */
-@Entity(primaryKeys = {"searchQuery", "resultIndex", "repoId"})
-public class GeneralRepoSearchData {
- public String searchQuery;
- public int resultIndex;
- public String repoId;
-
- public GeneralRepoSearchData() {
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/PersonData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/PersonData.java
deleted file mode 100644
index ef37c69..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/PersonData.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import android.text.TextUtils;
-
-import com.android.support.room.Entity;
-import com.android.support.room.PrimaryKey;
-
-/**
- * Person data object.
- */
-@Entity
-public class PersonData {
- @PrimaryKey public String login;
- public String id;
- public String avatar_url;
- public String repos_url;
- public String name;
- public String company;
- public String blog;
- public String location;
- public String email;
- public int public_repos;
- public int followers;
- public int following;
- public String created_at;
-
- public PersonData() {
- }
-
- public boolean isFullData() {
- return !TextUtils.isEmpty(created_at);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- PersonData that = (PersonData) o;
-
- if (public_repos != that.public_repos) return false;
- if (followers != that.followers) return false;
- if (following != that.following) return false;
- if (login != null ? !login.equals(that.login) : that.login != null) return false;
- if (id != null ? !id.equals(that.id) : that.id != null) return false;
- if (avatar_url != null ? !avatar_url.equals(that.avatar_url) : that.avatar_url != null) {
- return false;
- }
- if (repos_url != null ? !repos_url.equals(that.repos_url) : that.repos_url != null) {
- return false;
- }
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (company != null ? !company.equals(that.company) : that.company != null) return false;
- if (blog != null ? !blog.equals(that.blog) : that.blog != null) return false;
- if (location != null ? !location.equals(that.location) : that.location != null) {
- return false;
- }
- if (email != null ? !email.equals(that.email) : that.email != null) return false;
- return created_at != null ? created_at.equals(that.created_at) : that.created_at == null;
-
- }
-
- @Override
- public int hashCode() {
- int result = login != null ? login.hashCode() : 0;
- result = 31 * result + (id != null ? id.hashCode() : 0);
- result = 31 * result + (avatar_url != null ? avatar_url.hashCode() : 0);
- result = 31 * result + (repos_url != null ? repos_url.hashCode() : 0);
- result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (company != null ? company.hashCode() : 0);
- result = 31 * result + (blog != null ? blog.hashCode() : 0);
- result = 31 * result + (location != null ? location.hashCode() : 0);
- result = 31 * result + (email != null ? email.hashCode() : 0);
- result = 31 * result + public_repos;
- result = 31 * result + followers;
- result = 31 * result + following;
- result = 31 * result + (created_at != null ? created_at.hashCode() : 0);
- return result;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/RepositoryData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/RepositoryData.java
deleted file mode 100644
index 0bb64cc..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/RepositoryData.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import com.android.support.room.Decompose;
-import com.android.support.room.Entity;
-import com.android.support.room.PrimaryKey;
-import com.android.support.room.RoomWarnings;
-
-/**
- * Repository data object.
- */
-@Entity
-public class RepositoryData {
- @PrimaryKey public String id;
- public String name;
- public String full_name;
- @SuppressWarnings(RoomWarnings.PRIMARY_KEY_FROM_DECOMPOSED_IS_DROPPED)
- @Decompose(prefix = "owner_") public PersonData owner;
- public String description;
- public String created_at;
- public int stargazers_count;
- public String language;
- public int forks_count;
- public int open_issues_count;
- @SuppressWarnings(RoomWarnings.PRIMARY_KEY_FROM_DECOMPOSED_IS_DROPPED)
- @Decompose(prefix = "organization_") public PersonData organization;
- public int subscribers_count;
-
- public RepositoryData() {
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- RepositoryData that = (RepositoryData) o;
-
- if (stargazers_count != that.stargazers_count) return false;
- if (forks_count != that.forks_count) return false;
- if (open_issues_count != that.open_issues_count) return false;
- if (subscribers_count != that.subscribers_count) return false;
- if (id != null ? !id.equals(that.id) : that.id != null) return false;
- if (name != null ? !name.equals(that.name) : that.name != null) return false;
- if (full_name != null ? !full_name.equals(that.full_name) : that.full_name != null) {
- return false;
- }
- if (owner != null ? !owner.equals(that.owner) : that.owner != null) return false;
- if (description != null ? !description.equals(that.description)
- : that.description != null) {
- return false;
- }
- if (created_at != null ? !created_at.equals(that.created_at) : that.created_at != null) {
- return false;
- }
- if (language != null ? !language.equals(that.language) : that.language != null) {
- return false;
- }
- return organization != null ? organization.equals(that.organization)
- : that.organization == null;
-
- }
-
- @Override
- public int hashCode() {
- int result = id != null ? id.hashCode() : 0;
- result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (full_name != null ? full_name.hashCode() : 0);
- result = 31 * result + (owner != null ? owner.hashCode() : 0);
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (created_at != null ? created_at.hashCode() : 0);
- result = 31 * result + stargazers_count;
- result = 31 * result + (language != null ? language.hashCode() : 0);
- result = 31 * result + forks_count;
- result = 31 * result + open_issues_count;
- result = 31 * result + (organization != null ? organization.hashCode() : 0);
- result = 31 * result + subscribers_count;
- return result;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/SearchQueryData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/SearchQueryData.java
deleted file mode 100644
index c9d230f..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/data/SearchQueryData.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.data;
-
-import com.android.support.room.Entity;
-
-/**
- * Contains information about locally persisted data on a single paginable query.
- */
-@Entity(primaryKeys = {"searchQuery", "searchKind"})
-public class SearchQueryData {
- public static final int GENERAL_REPOSITORIES = 0;
- public static final int REPOSITORY_CONTRIBUTORS = 1;
-
- public String searchQuery;
- public int searchKind;
- public long timestamp;
- public int indexOfLastFetchedPage;
- public int numberOfFetchedItems;
- public boolean hasNoMoreData;
-
- public SearchQueryData() {
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/databinding/DataBindingAdapters.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/databinding/DataBindingAdapters.java
deleted file mode 100644
index d70ae64..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/databinding/DataBindingAdapters.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.databinding;
-
-import android.databinding.BindingAdapter;
-import android.support.annotation.StringRes;
-import android.support.v4.app.Fragment;
-import android.text.TextUtils;
-import android.view.View;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.RequestManager;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-public class DataBindingAdapters {
- private static SimpleDateFormat sJsonDateParser = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss",
- Locale.ENGLISH);
-
- RequestManager mRequestManager;
- public DataBindingAdapters(RequestManager requestManager) {
- mRequestManager = requestManager;
- }
-
- @SuppressWarnings("WeakerAccess")
- @BindingAdapter({"imageUrl"})
- public void loadImage(ImageView imageView, String url) {
- if (!TextUtils.isEmpty(url)) {
- mRequestManager.load(url).fitCenter().crossFade().into(imageView);
- } else {
- imageView.setImageBitmap(null);
- }
- }
-
- /**
- * Displays formatted date given a JSON-originating date.
- */
- @BindingAdapter("jsonDate")
- public static void formatDate(TextView textView, String jsonDate) {
- if (TextUtils.isEmpty(jsonDate)) {
- return;
- }
- try {
- textView.setText(SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT).format(
- sJsonDateParser.parse(jsonDate)));
- } catch (ParseException pe) {
- // WTF
- }
- }
-
- /**
- * Displays formatted date given a JSON-originating date.
- */
- @BindingAdapter({"stringRes", "jsonDate"})
- public static void formatDateWithString(TextView textView, @StringRes int stringRes,
- String jsonDate) {
- if (TextUtils.isEmpty(jsonDate)) {
- return;
- }
- try {
- Date date = sJsonDateParser.parse(jsonDate);
- String formattedDate = SimpleDateFormat.getDateInstance(
- SimpleDateFormat.SHORT).format(date);
- textView.setText(textView.getResources().getString(stringRes,
- formattedDate));
- } catch (ParseException pe) {
- // WTF
- }
- }
-
- @BindingAdapter("visibleInvisible")
- public static void changeVisiblity(View view, boolean value) {
- view.setVisibility(value ? View.VISIBLE : View.INVISIBLE);
- }
-
- @BindingAdapter("visibleGone")
- public static void showHide(View view, boolean value) {
- view.setVisibility(value ? View.VISIBLE : View.GONE);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDao.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDao.java
deleted file mode 100644
index f4868e6..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDao.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.db;
-
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.data.ContributorSearchData;
-import com.android.sample.githubbrowser.data.GeneralRepoSearchData;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.data.SearchQueryData;
-import com.android.support.lifecycle.LiveData;
-import com.android.support.room.Dao;
-import com.android.support.room.Insert;
-import com.android.support.room.OnConflictStrategy;
-import com.android.support.room.Query;
-
-import java.util.List;
-
-/**
- * Data access object for github data table.
- */
-@Dao
-public interface GithubDao {
- /**
- * Load full data for a person based on the login.
- */
- @Query("select * from persondata where login = ?")
- LiveData<PersonData> loadPerson(String login);
-
- /**
- * Insert or update full data for a person.
- */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertOrReplacePerson(PersonData personData);
-
- @Query("UPDATE PersonData SET email = :email, location = :location WHERE login = :login")
- void updateUser(String login, String email, String location);
-
- /** Load search data for the specified query. */
- @Query("select * from searchquerydata where searchQuery = :searchQuery"
- + " AND searchKind = :searchKind")
- SearchQueryData getSearchQueryData(String searchQuery, int searchKind);
-
- /** Updates search data. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void update(SearchQueryData searchQueryData);
-
- /** Inserts or updates metadata for results of repository search. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insert(GeneralRepoSearchData[] generalRepoSearchDataArray);
-
- /** Inserts or updates the repository data objects. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insert(RepositoryData[] repoDataArray);
-
- /** Insert or update full data for a repository. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertOrReplaceRepository(RepositoryData repositoryData);
-
- /** Loads full data for a repository. */
- @Query("select * from repositorydata where id = ?")
- LiveData<RepositoryData> loadRepository(String id);
-
- /** Inserts or updates metadata for results of contributor search. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insert(ContributorSearchData[] contributorSearchDataArray);
-
- /** Inserts or updates the person data objects. */
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insert(PersonData[] personDataArray);
-
- /**
- * Loads repository results for the specified query.
- */
- @Query("SELECT r.*, MIN(qr.resultIndex) as resultIndex from repositorydata r, "
- + "generalreposearchdata qr, searchquerydata q"
- + " WHERE q.searchQuery = qr.searchQuery"
- + " AND q.searchKind = " + SearchQueryData.GENERAL_REPOSITORIES
- + " AND r.id = qr.repoId"
- + " AND q.searchQuery = ?"
- + " GROUP BY r.id"
- + " ORDER BY resultIndex")
- LiveData<List<RepositoryData>> getRepositories(String searchQuery);
-
- /**
- * Loads contributor results for the specified repository.
- */
- @Query("SELECT p.*, qr.contributions, MIN(qr.resultIndex) as resultIndex from persondata p, "
- + "contributorsearchdata qr, searchquerydata q"
- + " WHERE q.searchQuery = qr.searchQuery"
- + " AND q.searchKind = " + SearchQueryData.REPOSITORY_CONTRIBUTORS
- + " AND p.id = qr.contributorId"
- + " AND q.searchQuery = ?"
- + " GROUP BY p.id"
- + " ORDER BY resultIndex")
- LiveData<List<ContributorData>> getContributors(String repoName);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDatabase.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDatabase.java
deleted file mode 100644
index 91f7fbe..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/db/GithubDatabase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.db;
-
-import com.android.sample.githubbrowser.data.ContributorSearchData;
-import com.android.sample.githubbrowser.data.GeneralRepoSearchData;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.data.SearchQueryData;
-import com.android.support.room.Database;
-import com.android.support.room.RoomDatabase;
-
-/**
- * Database for Github entities.
- */
-@Database(version = 1, entities = {PersonData.class, SearchQueryData.class,
- GeneralRepoSearchData.class, RepositoryData.class, ContributorSearchData.class})
-public abstract class GithubDatabase extends RoomDatabase {
- /**
- * Gets the data access object.
- */
- public abstract GithubDao getGithubDao();
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppComponent.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppComponent.java
deleted file mode 100644
index ef7d173..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppComponent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-import com.android.sample.githubbrowser.viewmodel.ContributorListModel;
-import com.android.sample.githubbrowser.viewmodel.PersonDataModel;
-import com.android.sample.githubbrowser.viewmodel.RepositoryDataModel;
-import com.android.sample.githubbrowser.viewmodel.RepositoryListModel;
-
-import javax.inject.Singleton;
-
-import dagger.Component;
-
-@Singleton
-@Component(modules = AppModule.class)
-public interface AppComponent {
- LifecycleProviderComponent plus(LifecycleProviderModule lifecycleProviderModule);
- void inject(PersonDataModel personDataModel);
-
- void inject(RepositoryListModel repositoryListModel);
-
- void inject(ContributorListModel contributorListModel);
-
- void inject(RepositoryDataModel repositoryDataModel);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppModule.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppModule.java
deleted file mode 100644
index e3d6a11..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/AppModule.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-import android.app.Application;
-
-import com.android.sample.githubbrowser.db.GithubDatabase;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-import com.android.sample.githubbrowser.network.GithubNetworkManager;
-import com.android.support.room.Room;
-
-import javax.inject.Singleton;
-
-import dagger.Module;
-import dagger.Provides;
-
-@Module
-public class AppModule {
- private final Application mApplication;
-
- public AppModule(Application application) {
- mApplication = application;
- }
-
- @Singleton
- @Provides
- public GithubNetworkManager provideGithubNetworkManager(AuthTokenModel authTokenModel) {
- return new GithubNetworkManager(authTokenModel);
- }
-
- @Singleton
- @Provides
- public AuthTokenModel provideAuthTokenModel(Application application) {
- return new AuthTokenModel(application);
- }
-
- @Provides
- public Application provideApplication() {
- return mApplication;
- }
-
- @Singleton
- @Provides
- public GithubDatabase provideGithubDatabase(Application application) {
- return Room.databaseBuilder(application, GithubDatabase.class, "github.db")
- .build();
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/InjectableLifecycleProvider.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/InjectableLifecycleProvider.java
deleted file mode 100644
index 5cfd517..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/InjectableLifecycleProvider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-public interface InjectableLifecycleProvider {
- void inject(LifecycleProviderComponent component);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderComponent.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderComponent.java
deleted file mode 100644
index de379c8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderComponent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-import android.databinding.DataBindingComponent;
-
-import com.android.sample.githubbrowser.GetAuthTokenFragment;
-import com.android.sample.githubbrowser.MainActivity;
-import com.android.sample.githubbrowser.RepositoryListFragment;
-import com.android.sample.githubbrowser.databinding.DataBindingAdapters;
-
-import dagger.Subcomponent;
-
-@LifecycleProviderScope
-@Subcomponent(modules = {LifecycleProviderModule.class})
-public interface LifecycleProviderComponent extends android.databinding.DataBindingComponent {
- void inject(MainActivity mainActivity);
- void inject(GetAuthTokenFragment getAuthTokenFragment);
- void inject(RepositoryListFragment repositoryListFragment);
- @Override
- DataBindingAdapters getDataBindingAdapters();
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderModule.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderModule.java
deleted file mode 100644
index 75b18eb..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderModule.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-import android.app.Application;
-import android.content.Context;
-
-import com.android.sample.githubbrowser.databinding.DataBindingAdapters;
-import com.android.support.lifecycle.LifecycleObserver;
-import com.android.support.lifecycle.LifecycleProvider;
-import com.android.support.lifecycle.OnLifecycleEvent;
-
-import com.bumptech.glide.Glide;
-import com.bumptech.glide.RequestManager;
-import com.bumptech.glide.manager.Lifecycle;
-import com.bumptech.glide.manager.LifecycleListener;
-import com.bumptech.glide.manager.RequestManagerRetriever;
-import com.bumptech.glide.manager.RequestManagerTreeNode;
-
-import java.util.Collections;
-import java.util.Set;
-
-import javax.inject.Singleton;
-
-import dagger.Module;
-import dagger.Provides;
-
-@Module
-public class LifecycleProviderModule {
- private final LifecycleProvider mLifecycleProvider;
-
- public LifecycleProviderModule(LifecycleProvider lifecycleProvider) {
- mLifecycleProvider = lifecycleProvider;
- }
-
- @Provides
- @Singleton
- public LifecycleProvider provideLifecycleProvider() {
- return mLifecycleProvider;
- }
-
- @Provides
- @LifecycleProviderScope
- public DataBindingAdapters provideAdapters(RequestManager requestManager) {
- return new DataBindingAdapters(requestManager);
- }
-
- @Provides
- @LifecycleProviderScope
- public RequestManager provideGlideRequestManager(Application application) {
- return new RequestManager(application, new Lifecycle() {
- @Override
- public void addListener(final LifecycleListener listener) {
- mLifecycleProvider.getLifecycle().addObserver(new LifecycleObserver() {
- @OnLifecycleEvent(com.android.support.lifecycle.Lifecycle.ON_START)
- public void onStart() {
- listener.onStart();
- }
-
- @OnLifecycleEvent(com.android.support.lifecycle.Lifecycle.ON_STOP)
- public void onStop() {
- listener.onStop();
- }
-
- @OnLifecycleEvent(com.android.support.lifecycle.Lifecycle.ON_DESTROY)
- public void onDestroy() {
- listener.onDestroy();
- }
- });
- }
- }, new RequestManagerTreeNode() {
- @Override
- public Set<RequestManager> getDescendants() {
- return Collections.emptySet();
- }
- });
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderScope.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderScope.java
deleted file mode 100644
index 87dbb46..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/di/LifecycleProviderScope.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.di;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import javax.inject.Scope;
-
-@Scope
-@Retention(RetentionPolicy.RUNTIME)
-public @interface LifecycleProviderScope {
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/model/AuthTokenModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/model/AuthTokenModel.java
deleted file mode 100644
index 8b06c33..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/model/AuthTokenModel.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.model;
-
-import android.app.Application;
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.AsyncTask;
-
-import com.android.sample.githubbrowser.BuildConfig;
-import com.android.support.lifecycle.LiveData;
-
-import javax.inject.Singleton;
-
-/**
- * Model for the auth token.
- */
-@Singleton
-public class AuthTokenModel {
- private static final String AUTH_TOKEN_KEY = "auth_token";
-
- private LiveData<String> mAuthToken = new LiveData<>();
- private final SharedPreferences mSharedPreferences;
-
- public AuthTokenModel(Application application) {
- mSharedPreferences = application
- .getSharedPreferences(BuildConfig.APPLICATION_ID, Context.MODE_PRIVATE);
- loadAsync();
- }
-
- public void saveToken(String token) {
- saveAsync(token);
- mAuthToken.postValue(token);
- }
-
- private void loadAsync() {
- new AsyncTask<Void, Void, Void>() {
- @Override
- protected Void doInBackground(Void... voids) {
- String token = mSharedPreferences.getString(AUTH_TOKEN_KEY, null);
- mAuthToken.postValue(token);
- return null;
- }
- }.execute();
- }
-
- private void saveAsync(String token) {
- new AsyncTask<String, Void, Void>() {
- @Override
- protected Void doInBackground(String... tokens) {
- mSharedPreferences.edit().putString(AUTH_TOKEN_KEY, tokens[0]).apply();
- return null;
- }
- }.execute(token);
- }
-
- /**
- * Returns the {@link LiveData} object that wraps the auth token.
- */
- public LiveData<String> getAuthTokenData() {
- return mAuthToken;
- }
-
- public void clearToken() {
- saveToken(null);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/navigation/NavigationController.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/navigation/NavigationController.java
deleted file mode 100644
index a4a66ba..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/navigation/NavigationController.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.navigation;
-
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentTransaction;
-
-import com.android.sample.githubbrowser.EditUserDetailsFragment;
-import com.android.sample.githubbrowser.RepositoryDetailsFragment;
-import com.android.sample.githubbrowser.UserDetailsFragment;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.support.lifecycle.Lifecycle;
-import com.android.support.lifecycle.LifecycleProvider;
-
-public class NavigationController {
- private final FragmentManager mFragmentManager;
- private final int mHostViewId;
- private final Lifecycle mLifecycle;
-
- public NavigationController(LifecycleProvider lifecycleProvider,
- FragmentManager fragmentManager, int hostViewId) {
- mLifecycle = lifecycleProvider.getLifecycle();
- mFragmentManager = fragmentManager;
- mHostViewId = hostViewId;
- }
-
- private boolean isActive() {
- return mLifecycle.getCurrentState() >= Lifecycle.STARTED;
- }
-
- public void openRepositoryDetailsFragment(RepositoryData repo) {
- RepositoryDetailsFragment fragment = RepositoryDetailsFragment.createFor(repo);
- FragmentTransaction transaction = mFragmentManager.beginTransaction();
- transaction.add(mHostViewId, fragment, "repoDetails:" + repo.id);
- transaction.addToBackStack("repoDetails:" + repo.id);
- transaction.commitAllowingStateLoss();
- }
-
- public void openUserDetailsFragment(PersonData person) {
- UserDetailsFragment fragment = UserDetailsFragment.createFor(person);
- FragmentTransaction transaction = mFragmentManager.beginTransaction();
- transaction.add(mHostViewId, fragment, "userDetails:" + person.login);
- transaction.addToBackStack("userDetails:" + person.login);
- transaction.commitAllowingStateLoss();
- }
-
- public void openEditUserDetailsFragment(Fragment target, PersonData user) {
- if (!isActive()) {
- return;
- }
- EditUserDetailsFragment editUserDetailsFragment =
- EditUserDetailsFragment.createFor(target, user);
- editUserDetailsFragment.show(mFragmentManager, "editUser:" + user.login);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubNetworkManager.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubNetworkManager.java
deleted file mode 100644
index e95a5e8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubNetworkManager.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.network;
-
-import android.support.annotation.MainThread;
-import android.support.annotation.NonNull;
-
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.inject.Singleton;
-
-import okhttp3.HttpUrl;
-import okhttp3.Interceptor;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import retrofit2.Call;
-import retrofit2.Callback;
-import retrofit2.Response;
-import retrofit2.Retrofit;
-import retrofit2.converter.gson.GsonConverterFactory;
-
-/**
- * This class is responsible for loading data from network.
- */
-@Singleton
-public class GithubNetworkManager {
- private GithubService mGithubService;
- private final AuthTokenModel mAuthTokenModel;
-
- /**
- * Interface that exposes successful / failed calls to the rest of the application.
- *
- * @param <T> Payload data class.
- */
- public interface NetworkCallListener<T> {
- /** Called when network response returned empty data, passing back the HTTP code. */
- void onLoadEmpty(int httpCode);
-
- /** Called when data has been succesfully loaded from the network. */
- void onLoadSuccess(T data);
-
- /** Called when data has failed loading from the network. */
- void onLoadFailure();
- }
-
- /**
- * Interface that exposes the option to cancel an existing network call.
- */
- public interface Cancelable {
- /** Cancel the ongoing network call. */
- void cancel();
- }
-
- private class CancelableCall implements Cancelable {
- @NonNull private Call mCall;
-
- private CancelableCall(@NonNull Call call) {
- mCall = call;
- }
-
- @Override
- public void cancel() {
- mCall.cancel();
- }
- }
-
- public GithubNetworkManager(AuthTokenModel authTokenModel) {
- mAuthTokenModel = authTokenModel;
- OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
- httpClient.addInterceptor(new Interceptor() {
- @Override
- public okhttp3.Response intercept(Chain chain) throws IOException {
- Request original = chain.request();
- HttpUrl originalHttpUrl = original.url();
-
- HttpUrl url = originalHttpUrl.newBuilder()
- .addQueryParameter("access_token",
- mAuthTokenModel.getAuthTokenData().getValue())
- .build();
- Request.Builder requestBuilder = original.newBuilder().url(url);
-
- Request request = requestBuilder.build();
- return chain.proceed(request);
- }
- });
-
- httpClient.addInterceptor(new Interceptor() {
- @Override
- public okhttp3.Response intercept(Chain chain) throws IOException {
- Request request = chain.request();
- okhttp3.Response response = chain.proceed(request);
- if (response.code() == 401 || response.code() == 403) {
- mAuthTokenModel.clearToken();
- }
- return response;
- }
- });
-
-
- Retrofit retrofit = new Retrofit.Builder()
- .baseUrl("https://api.github.com")
- .addConverterFactory(GsonConverterFactory.create())
- .client(httpClient.build())
- .build();
-
- mGithubService = retrofit.create(GithubService.class);
- }
-
- /**
- * Fetches the specified page of repositories.
- */
- @MainThread
- public CancelableCall listRepositories(String user, int pageIndex,
- final NetworkCallListener<List<RepositoryData>> networkCallListener) {
- Call<List<RepositoryData>> listRepositoriesCall = mGithubService.listRepositories(
- user, pageIndex);
- listRepositoriesCall.enqueue(new Callback<List<RepositoryData>>() {
- @Override
- public void onResponse(Call<List<RepositoryData>> call,
- Response<List<RepositoryData>> response) {
- List<RepositoryData> body = response.body();
- if (body == null) {
- networkCallListener.onLoadEmpty(response.code());
- } else {
- networkCallListener.onLoadSuccess(body);
- }
- }
-
- @Override
- public void onFailure(Call<List<RepositoryData>> call, Throwable t) {
- android.util.Log.e("GithubBrowser", "Call = " + call.toString(), t);
- networkCallListener.onLoadFailure();
- }
- });
- return new CancelableCall(listRepositoriesCall);
- }
-
- /**
- * Fetches the details of the specified repository.
- */
- @MainThread
- public CancelableCall getRepository(String user, String name,
- final NetworkCallListener<RepositoryData> networkCallListener) {
- Call<RepositoryData> getRepositoryCall = mGithubService.getRepository(user, name);
- getRepositoryCall.enqueue(new Callback<RepositoryData>() {
- @Override
- public void onResponse(Call<RepositoryData> call,
- Response<RepositoryData> response) {
- RepositoryData body = response.body();
- if (body == null) {
- networkCallListener.onLoadEmpty(response.code());
- } else {
- networkCallListener.onLoadSuccess(body);
- }
- }
-
- @Override
- public void onFailure(Call<RepositoryData> call, Throwable t) {
- android.util.Log.e("GithubBrowser", "Call = " + call.toString(), t);
- networkCallListener.onLoadFailure();
- }
- });
- return new CancelableCall(getRepositoryCall);
- }
-
- /**
- * Fetches the specified page of contributors.
- */
- @MainThread
- public CancelableCall getContributors(String owner, String project, int page,
- final NetworkCallListener<List<ContributorData>> networkCallListener) {
- Call<List<ContributorData>> getContributorsCall = mGithubService.getContributors(
- owner, project, page);
- getContributorsCall.enqueue(new Callback<List<ContributorData>>() {
- @Override
- public void onResponse(Call<List<ContributorData>> call,
- Response<List<ContributorData>> response) {
- List<ContributorData> body = response.body();
- if (body == null) {
- networkCallListener.onLoadEmpty(response.code());
- } else {
- networkCallListener.onLoadSuccess(body);
- }
- }
-
- @Override
- public void onFailure(Call<List<ContributorData>> call, Throwable t) {
- android.util.Log.e("GithubBrowser", "Call = " + call.toString(), t);
- networkCallListener.onLoadFailure();
- }
- });
- return new CancelableCall(getContributorsCall);
- }
-
- /**
- * Fetches the details of the specified user.
- */
- @MainThread
- public CancelableCall getUser(String user,
- final NetworkCallListener<PersonData> networkCallListener) {
- Call<PersonData> getUserCall = mGithubService.getUser(user);
- getUserCall.enqueue(new Callback<PersonData>() {
- @Override
- public void onResponse(Call<PersonData> call,
- Response<PersonData> response) {
- PersonData body = response.body();
- if (body == null) {
- networkCallListener.onLoadEmpty(response.code());
- } else {
- networkCallListener.onLoadSuccess(body);
- }
- }
-
- @Override
- public void onFailure(Call<PersonData> call, Throwable t) {
- android.util.Log.e("GithubBrowser", "Call = " + call.toString(), t);
- networkCallListener.onLoadFailure();
- }
- });
- return new CancelableCall(getUserCall);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubService.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubService.java
deleted file mode 100644
index c26c11e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/network/GithubService.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.network;
-
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-
-import java.util.List;
-
-import retrofit2.Call;
-import retrofit2.http.GET;
-import retrofit2.http.Path;
-import retrofit2.http.Query;
-
-/**
- * Retrofit-powered service to connect to Github backend.
- */
-public interface GithubService {
- /**
- * Lists the repositories for the specified user.
- */
- @GET("/users/{user}/repos")
- Call<List<RepositoryData>> listRepositories(@Path("user") String user, @Query("page") int page);
-
- /**
- * Gets the information about the specified repository.
- */
- @GET("/repos/{user}/{name}")
- Call<RepositoryData> getRepository(@Path("user") String user, @Path("name") String name);
-
- /**
- * Lists the contributors for the specified project owned by the specified user.
- */
- @GET("/repos/{user}/{project}/contributors")
- Call<List<ContributorData>> getContributors(@Path("user") String owner,
- @Path("project") String project, @Query("page") int page);
-
- /**
- * Gets the information about the specified user.
- */
- @GET("/users/{user}")
- Call<PersonData> getUser(@Path("user") String user);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/util/ChainedLiveData.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/util/ChainedLiveData.java
deleted file mode 100644
index edba758..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/util/ChainedLiveData.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.util;
-
-import android.support.annotation.Nullable;
-
-import com.android.support.lifecycle.LiveData;
-import com.android.support.lifecycle.Observer;
-
-/**
- * A live data that can be backed by another live data and this backing live data can be swapped.
- * It automatically starts / stops observing on the backing live data as this LiveData's observers
- * and active state changes.
- * <p>
- * This is useful when we want to use a LiveData in a model that arrives from another provider. We
- * don't want the UI to care about this nor we want to leak previous LiveData instances.
- * @param <T>
- */
-public class ChainedLiveData<T> extends LiveData<T> {
- private final Observer<T> mObserver = new Observer<T>() {
- @Override
- public void onChanged(@Nullable T t) {
- setValue(t);
- }
- };
-
- @Nullable
- private LiveData<T> mBackingLiveData;
-
- public void setBackingLiveData(@Nullable LiveData<T> backingLiveData) {
- if (mBackingLiveData != null) {
- mBackingLiveData.removeObserver(mObserver);
- }
- mBackingLiveData = backingLiveData;
- if (backingLiveData == null) {
- setValue(null);
- } else {
- if (getActiveObserverCount() > 0) {
- backingLiveData.observeForever(mObserver);
- } else {
- setValue(backingLiveData.getValue());
- }
- }
- }
-
- @Override
- protected void onActive() {
- if (mBackingLiveData != null) {
- mBackingLiveData.observeForever(mObserver);
- }
- }
-
- @Override
- protected void onInactive() {
- if (mBackingLiveData != null) {
- mBackingLiveData.removeObserver(mObserver);
- }
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/PersonClickCallback.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/PersonClickCallback.java
deleted file mode 100644
index 189c6cc..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/PersonClickCallback.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.view;
-
-import com.android.sample.githubbrowser.data.PersonData;
-
-public interface PersonClickCallback {
- void onClick(PersonData user);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/RepoClickCallback.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/RepoClickCallback.java
deleted file mode 100644
index 4f6658b..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/view/RepoClickCallback.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.view;
-
-import com.android.sample.githubbrowser.data.RepositoryData;
-
-public interface RepoClickCallback {
- void onClick(RepositoryData repositoryData);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/ContributorListModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/ContributorListModel.java
deleted file mode 100644
index 7facc31..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/ContributorListModel.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import android.os.AsyncTask;
-import android.support.annotation.MainThread;
-import android.support.annotation.WorkerThread;
-
-import com.android.sample.githubbrowser.data.ContributorData;
-import com.android.sample.githubbrowser.data.ContributorSearchData;
-import com.android.sample.githubbrowser.data.SearchQueryData;
-import com.android.sample.githubbrowser.db.GithubDao;
-import com.android.sample.githubbrowser.db.GithubDatabase;
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.sample.githubbrowser.network.GithubNetworkManager;
-import com.android.sample.githubbrowser.util.ChainedLiveData;
-import com.android.support.lifecycle.LiveData;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.inject.Inject;
-
-/**
- * View model for contributor list data.
- */
-public class ContributorListModel extends InjectableViewModel {
- private String mOwner;
- private String mProject;
-
- private final ChainedLiveData<List<ContributorData>> mContributorListLiveData
- = new ChainedLiveData<>();
- private AtomicBoolean mHasNetworkRequestPending = new AtomicBoolean(false);
- private GithubNetworkManager.Cancelable mCurrentNetworkCall;
-
- private SearchQueryData mSearchQueryData;
- private AtomicInteger mLastRequestedIndex = new AtomicInteger(0);
-
- @Inject
- GithubNetworkManager mGithubNetworkManager;
- @Inject
- GithubDatabase mDatabase;
-
- @Override
- void inject(AppComponent appComponent) {
- appComponent.inject(this);
- }
-
- /**
- * Sets new search terms.
- */
- @MainThread
- public void setSearchTerms(String owner, String project) {
- mOwner = owner;
- mProject = project;
-
- if (mCurrentNetworkCall != null) {
- mCurrentNetworkCall.cancel();
- }
- if (mOwner == null || mProject == null) {
- mContributorListLiveData.setBackingLiveData(null);
- return;
- }
-
- final GithubDao githubDao = mDatabase.getGithubDao();
-
- // Get the LiveData wrapper around the list of contributors that match our current
- // search query. The wrapped list will be updated on every successful network request
- // that is performed for data that is not available in our database.
- mContributorListLiveData
- .setBackingLiveData(githubDao.getContributors(mOwner + "/" + mProject));
-
- mHasNetworkRequestPending.set(false);
-
- new AsyncTask<String, Void, Void>() {
- @Override
- protected Void doInBackground(String... params) {
- // Get data about locally persisted results of our current search query. Note that
- // since this is working with a disk-based database, we're running off the main
- // thread.
- mSearchQueryData = githubDao.getSearchQueryData(
- params[0], SearchQueryData.REPOSITORY_CONTRIBUTORS);
- if (mSearchQueryData == null) {
- // This query has not been performed before - initialize an entry in the
- // database. TODO - consult the timestamp of network requests for staleness.
- mSearchQueryData = new SearchQueryData();
- mSearchQueryData.searchQuery = params[0];
- mSearchQueryData.searchKind = SearchQueryData.REPOSITORY_CONTRIBUTORS;
- mSearchQueryData.numberOfFetchedItems = -1;
- githubDao.update(mSearchQueryData);
- }
- return null;
- }
-
- @Override
- protected void onPostExecute(Void aVoid) {
- fetchNextPage();
- }
- }.execute(mOwner + "/" + mProject);
- }
-
- private void fetchNextPage() {
- if (mSearchQueryData == null) {
- // Not ready to fetch yet.
- return;
- }
-
- // Do we have data in the database?
- if (mSearchQueryData.numberOfFetchedItems >= mLastRequestedIndex.get()) {
- // We already have the data stored (and retrieved) from database.
- return;
- }
-
- if (mHasNetworkRequestPending.get() || mSearchQueryData.hasNoMoreData) {
- // Previous request still processing or no more results
- return;
- }
-
- mHasNetworkRequestPending.set(true);
- mCurrentNetworkCall = mGithubNetworkManager.getContributors(
- mOwner, mProject, mSearchQueryData.indexOfLastFetchedPage + 1,
- new GithubNetworkManager.NetworkCallListener<List<ContributorData>>() {
- @Override
- public void onLoadEmpty(int httpCode) {
- }
-
- @Override
- public void onLoadSuccess(List<ContributorData> data) {
- new AsyncTask<ContributorData, Void, Void>() {
- @Override
- protected Void doInBackground(ContributorData... params) {
- // Note that since we're going to be inserting data into disk-based
- // database, we need to be running off the main thread.
- processNewPageOfData(params);
- return null;
- }
- }.execute(data.toArray(new ContributorData[data.size()]));
- }
-
- @Override
- public void onLoadFailure() {
- }
- });
- }
-
- @WorkerThread
- private void processNewPageOfData(ContributorData... data) {
- try {
- mDatabase.beginTransaction();
- int newDataCount = data.length;
-
- final GithubDao githubDao = mDatabase.getGithubDao();
- final int indexOfFirstData = mSearchQueryData.numberOfFetchedItems;
- // Update the metadata about our current search query (in the database)
- if (newDataCount == 0) {
- mSearchQueryData.hasNoMoreData = true;
- } else {
- if (mSearchQueryData.indexOfLastFetchedPage == 0) {
- mSearchQueryData.timestamp = System.currentTimeMillis();
- }
- mSearchQueryData.indexOfLastFetchedPage++;
- mSearchQueryData.numberOfFetchedItems += newDataCount;
- }
- githubDao.update(mSearchQueryData);
-
- if (newDataCount > 0) {
- // Insert entries for the newly loaded contributors in two places:
- // 1. The table that stores contributor IDs that match a specific query.
- // 2. The table that stores full data on each individual contributor.
- // This way we don't store multiple full entries for the same contributor
- // that happens to match two or more search queries.
- ContributorSearchData[] contributorSearchDataArray =
- new ContributorSearchData[newDataCount];
- for (int i = 0; i < newDataCount; i++) {
- contributorSearchDataArray[i] = new ContributorSearchData();
- contributorSearchDataArray[i].searchQuery = mOwner + "/" + mProject;
- contributorSearchDataArray[i].resultIndex = indexOfFirstData + i;
- contributorSearchDataArray[i].contributorId = data[i].id;
- contributorSearchDataArray[i].contributions = data[i].contributions;
- }
- githubDao.insert(contributorSearchDataArray);
- githubDao.insert(data);
- }
- mDatabase.setTransactionSuccessful();
- } finally {
- mDatabase.endTransaction();
- }
-
- mHasNetworkRequestPending.set(false);
- }
-
- /**
- * Fetches data at specified index if data does not exist yet.
- */
- public void fetchAtIndexIfNecessary(int index) {
- if (mSearchQueryData == null) {
- // If we're here, we've been asked to start fetching items before we've retrieved
- // the top-level metadata for our search. Save the requested index and return. Once
- // that metadata is fetched off the main thread in the AsyncTask executed in
- // setSearchTerms, we'll call fetchNextPage().
- mLastRequestedIndex.set(index);
- return;
- }
-
- if (mHasNetworkRequestPending.get() || mSearchQueryData.hasNoMoreData) {
- // Previous request still processing or no more results
- return;
- }
-
- mLastRequestedIndex.set(index);
-
- fetchNextPage();
- }
-
- /**
- * Returns the {@link LiveData} object that wraps the current list of contributors that matches
- * the last set search terms.
- */
- public LiveData<List<ContributorData>> getContributorListLiveData() {
- return mContributorListLiveData;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/InjectableViewModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/InjectableViewModel.java
deleted file mode 100644
index 1598448..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/InjectableViewModel.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import com.android.sample.githubbrowser.GithubBrowserApp;
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.support.lifecycle.ViewModel;
-
-public abstract class InjectableViewModel extends ViewModel {
- public InjectableViewModel() {
- inject(((GithubBrowserApp) getApplication()).getAppComponent());
- }
-
- abstract void inject(AppComponent appComponent);
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/PersonDataModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/PersonDataModel.java
deleted file mode 100644
index fda04f2..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/PersonDataModel.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import android.os.AsyncTask;
-import android.support.annotation.MainThread;
-
-import com.android.sample.githubbrowser.data.PersonData;
-import com.android.sample.githubbrowser.db.GithubDatabase;
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.sample.githubbrowser.network.GithubNetworkManager;
-import com.android.sample.githubbrowser.network.GithubNetworkManager.NetworkCallListener;
-import com.android.sample.githubbrowser.util.ChainedLiveData;
-import com.android.support.lifecycle.LiveData;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.inject.Inject;
-
-/**
- * View model for the full person data.
- */
-public class PersonDataModel extends InjectableViewModel {
- private AtomicBoolean mHasNetworkRequestPending = new AtomicBoolean(false);
- private final ChainedLiveData<PersonData> mPersonData = new ChainedLiveData<>();
-
- @Inject
- GithubNetworkManager mGithubNetworkManager;
- @Inject
- GithubDatabase mDatabase;
-
- @Override
- public void inject(AppComponent appComponent) {
- appComponent.inject(this);
- }
-
- /**
- * Returns the {@LiveData} object that wraps the full person data.
- */
- public LiveData<PersonData> getPersonData() {
- return mPersonData;
- }
-
- /**
- * Sets the login for fetching the full person data.
- */
- @MainThread
- public synchronized void loadData(final String login, final boolean forceFullLoad) {
- // Note that the usage of this view model class guarantees that we're always calling
- // with the same login. So checking the value of fetching field is enough to prevent
- // multiple concurrent remote / local DB fetches.
- boolean isFetching = mHasNetworkRequestPending.get();
- boolean havePersonDataAlready = mPersonData.getValue() != null
- && (!forceFullLoad || mPersonData.getValue().isFullData());
- if (isFetching || havePersonDataAlready) {
- // We are either fetching the data or have the data already
- return;
- }
- mPersonData.setBackingLiveData(mDatabase.getGithubDao().loadPerson(login));
- if (mPersonData.getValue() == null || forceFullLoad) {
- // Issue the network request to bring in the data
- mHasNetworkRequestPending.set(true);
-
- mGithubNetworkManager.getUser(login,
- new NetworkCallListener<PersonData>() {
- @Override
- public void onLoadEmpty(int httpCode) {
- mHasNetworkRequestPending.set(false);
- }
-
- @Override
- public void onLoadSuccess(PersonData data) {
- onDataLoadedFromNetwork(data);
- }
-
- @Override
- public void onLoadFailure() {
- mHasNetworkRequestPending.set(false);
- }
- });
- }
- }
-
- @MainThread
- private void onDataLoadedFromNetwork(PersonData data) {
- mHasNetworkRequestPending.set(false);
-
- // Wrap a DB insert call with another AsyncTask. Otherwise we'd
- // be doing a disk IO operation on the UI thread.
- new AsyncTask<PersonData, Void, Void>() {
- @Override
- protected Void doInBackground(PersonData... params) {
- mDatabase.getGithubDao().insertOrReplacePerson(params[0]);
- return null;
- }
- }.execute(data);
- }
-
- /**
- * Updates the data wrapped by this model.
- */
- @MainThread
- public void update(final String login, final String email, final String location) {
- // Create a copy of the currently wrapped data
- // Update the relevant fields
- // And update the entry for this person in our database so that it's reflected
- // in the UI the next time it's fetched and displayed
- // Wrap a DB update call with an AsyncTask. Otherwise we'd be doing a disk IO operation on
- // the UI thread.
- new AsyncTask<Void, Void, Void>() {
- @Override
- protected Void doInBackground(Void... params) {
- mDatabase.getGithubDao().updateUser(login, email, location);
- return null;
- }
- }.execute();
-
- // Note - this is where you would also issue a network request to update user data
- // on the remote backend.
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryDataModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryDataModel.java
deleted file mode 100644
index 8f659ad..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryDataModel.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import android.os.AsyncTask;
-import android.support.annotation.MainThread;
-
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.db.GithubDatabase;
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.sample.githubbrowser.network.GithubNetworkManager;
-import com.android.sample.githubbrowser.util.ChainedLiveData;
-import com.android.support.lifecycle.LiveData;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.inject.Inject;
-
-/**
- * View model for the full repository data.
- */
-public class RepositoryDataModel extends InjectableViewModel {
- private AtomicBoolean mHasNetworkRequestPending = new AtomicBoolean(false);
- private final ChainedLiveData<RepositoryData> mRepositoryData = new ChainedLiveData<>();
- @Inject
- GithubNetworkManager mGithubNetworkManager;
- @Inject
- GithubDatabase mDatabase;
-
- @Override
- void inject(AppComponent appComponent) {
- appComponent.inject(this);
- }
-
- /**
- * Returns the {@link LiveData} object that wraps the full repository data.
- */
- public LiveData<RepositoryData> getRepositoryData() {
- return mRepositoryData;
- }
-
- /**
- * Sets the information for fetching the full repository data.
- */
- @MainThread
- public synchronized void loadData(final String id, final String fullName) {
- // Note that the usage of this view model class guarantees that we're always calling
- // with the same info. So checking the value of fetching field is enough to prevent
- // multiple concurrent remote / local DB fetches.
- boolean isFetching = mHasNetworkRequestPending.get();
- boolean haveRepoDataAlready = (mRepositoryData != null)
- && (mRepositoryData.getValue() != null);
- if (isFetching || haveRepoDataAlready) {
- // We are either fetching the data or have the data already
- return;
- }
-
- mRepositoryData.setBackingLiveData(mDatabase.getGithubDao().loadRepository(id));
- if (mRepositoryData.getValue() == null) {
- // Issue the network request to bring in the data
- mHasNetworkRequestPending.set(true);
-
- // TODO - this is temporary until Room persists non-primitive fields. Until
- // then we split full name into user and name manually
- String[] split = fullName.split("/");
- mGithubNetworkManager.getRepository(split[0], split[1],
- new GithubNetworkManager.NetworkCallListener<RepositoryData>() {
- @Override
- public void onLoadEmpty(int httpCode) {
- mHasNetworkRequestPending.set(false);
- }
-
- @Override
- public void onLoadSuccess(RepositoryData data) {
- onDataLoadedFromNetwork(data, mDatabase);
- }
-
- @Override
- public void onLoadFailure() {
- mHasNetworkRequestPending.set(false);
- }
- });
- }
- }
-
- @MainThread
- private void onDataLoadedFromNetwork(RepositoryData data, final GithubDatabase db) {
- mRepositoryData.setValue(data);
- mHasNetworkRequestPending.set(false);
-
- // Wrap a DB insert call with another AsyncTask. Otherwise we'd
- // be doing a disk IO operation on the UI thread.
- new AsyncTask<RepositoryData, Void, Void>() {
- @Override
- protected Void doInBackground(RepositoryData... params) {
- db.getGithubDao().insertOrReplaceRepository(params[0]);
- return null;
- }
- }.execute(data);
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryListModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryListModel.java
deleted file mode 100644
index 6a158df..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositoryListModel.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import android.os.AsyncTask;
-import android.support.annotation.MainThread;
-import android.support.annotation.WorkerThread;
-import android.text.TextUtils;
-
-import com.android.sample.githubbrowser.data.GeneralRepoSearchData;
-import com.android.sample.githubbrowser.data.RepositoryData;
-import com.android.sample.githubbrowser.data.SearchQueryData;
-import com.android.sample.githubbrowser.db.GithubDao;
-import com.android.sample.githubbrowser.db.GithubDatabase;
-import com.android.sample.githubbrowser.di.AppComponent;
-import com.android.sample.githubbrowser.model.AuthTokenModel;
-import com.android.sample.githubbrowser.network.GithubNetworkManager;
-import com.android.sample.githubbrowser.util.ChainedLiveData;
-import com.android.sample.githubbrowser.viewmodel.InjectableViewModel;
-import com.android.support.lifecycle.LiveData;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.inject.Inject;
-
-/**
- * View model for repository list data.
- */
-public class RepositoryListModel extends InjectableViewModel {
- /** Constant for the initial loading state. */
- public static final int STATE_INITIAL_LOADING = 0;
- /** Constant for the empty / no data state. */
- public static final int STATE_EMPTY = 1;
- /** Constant for the data state. */
- public static final int STATE_DATA = 2;
- /** Constant for the error state. */
- public static final int STATE_ERROR = 3;
-
- private String mSearchTerm;
-
- private final ChainedLiveData<List<RepositoryData>> mRepositoryListLiveData
- = new ChainedLiveData<>();
- private final LiveData<Integer> mStateLiveData = new LiveData<>();
- private AtomicBoolean mHasNetworkRequestPending = new AtomicBoolean(false);
- private GithubNetworkManager.Cancelable mCurrentNetworkCall;
-
- private SearchQueryData mSearchQueryData;
- private AtomicInteger mLastRequestedIndex = new AtomicInteger(0);
-
- @Inject
- GithubNetworkManager mGithubNetworkManager;
- @Inject
- GithubDatabase mDatabase;
- @Inject
- AuthTokenModel mAuthTokenModel;
-
- @Override
- void inject(AppComponent appComponent) {
- appComponent.inject(this);
- }
-
- /**
- * Returns true if the current search term is not empty.
- */
- public boolean hasSearchTerm() {
- return !TextUtils.isEmpty(mSearchTerm);
- }
-
- /**
- * Sets new search term.
- */
- @MainThread
- public void setSearchTerm(String searchTerm) {
- mSearchTerm = searchTerm;
-
- if (mCurrentNetworkCall != null) {
- mCurrentNetworkCall.cancel();
- }
-
- final GithubDao githubDao = mDatabase.getGithubDao();
-
- // Get the LiveData wrapper around the list of repositories that match our current
- // search query. The wrapped list will be updated on every successful network request
- // that is performed for data that is not available in our database.
- mRepositoryListLiveData.setBackingLiveData(githubDao.getRepositories(mSearchTerm));
-
- mStateLiveData.setValue(STATE_INITIAL_LOADING);
- mHasNetworkRequestPending.set(false);
-
- new AsyncTask<String, Void, Void>() {
- @Override
- protected Void doInBackground(String... params) {
- // Get data about locally persisted results of our current search query. Note that
- // since this is working with a disk-based database, we're running off the main
- // thread.
- mSearchQueryData = githubDao.getSearchQueryData(
- params[0], SearchQueryData.GENERAL_REPOSITORIES);
- if (mSearchQueryData == null) {
- // This query has not been performed before - initialize an entry in the
- // database. TODO - consult the timestamp of network requests for staleness.
- mSearchQueryData = new SearchQueryData();
- mSearchQueryData.searchQuery = params[0];
- mSearchQueryData.searchKind = SearchQueryData.GENERAL_REPOSITORIES;
- mSearchQueryData.numberOfFetchedItems = -1;
- githubDao.update(mSearchQueryData);
- }
- return null;
- }
-
- @Override
- protected void onPostExecute(Void aVoid) {
- fetchNextPage();
- }
- }.execute(mSearchTerm);
- }
-
- private void fetchNextPage() {
- if (mSearchQueryData == null) {
- // Not ready to fetch yet.
- return;
- }
-
- // Do we have data in the database?
- if (mSearchQueryData.numberOfFetchedItems >= mLastRequestedIndex.get()) {
- // We already have the data stored (and retrieved) from database.
- mStateLiveData.setValue(STATE_DATA);
- return;
- }
-
- if (mHasNetworkRequestPending.get()) {
- // Previous request still processing
- return;
- }
-
- if (mSearchQueryData.hasNoMoreData) {
- // We don't have any more results
- if (mSearchQueryData.numberOfFetchedItems <= 0) {
- mStateLiveData.setValue(STATE_EMPTY);
- }
- return;
- }
-
- mHasNetworkRequestPending.set(true);
- mCurrentNetworkCall = mGithubNetworkManager.listRepositories(
- mSearchTerm, mSearchQueryData.indexOfLastFetchedPage + 1,
- new GithubNetworkManager.NetworkCallListener<List<RepositoryData>>() {
- @Override
- public void onLoadEmpty(int httpCode) {
- switch (httpCode) {
- case 404:
- // No such user
- mStateLiveData.setValue(STATE_EMPTY);
- break;
- default:
- mStateLiveData.setValue(STATE_ERROR);
- }
- }
-
- @Override
- public void onLoadSuccess(List<RepositoryData> data) {
- new AsyncTask<RepositoryData, Void, Void>() {
- @Override
- protected Void doInBackground(RepositoryData... params) {
- // Note that since we're going to be inserting data into disk-based
- // database, we need to be running off the main thread.
- processNewPageOfData(params);
- return null;
- }
- }.execute(data.toArray(new RepositoryData[data.size()]));
- }
-
- @Override
- public void onLoadFailure() {
- mStateLiveData.setValue(STATE_ERROR);
- }
- });
- }
-
- @WorkerThread
- private void processNewPageOfData(RepositoryData... data) {
- try {
- mDatabase.beginTransaction();
- int newDataCount = data.length;
-
- final GithubDao githubDao = mDatabase.getGithubDao();
- final int indexOfFirstData = mSearchQueryData.numberOfFetchedItems;
- // Update the metadata about our current search query (in the database)
- if (newDataCount == 0) {
- mSearchQueryData.hasNoMoreData = true;
- } else {
- if (mSearchQueryData.indexOfLastFetchedPage == 0) {
- mSearchQueryData.timestamp = System.currentTimeMillis();
- }
- mSearchQueryData.indexOfLastFetchedPage++;
- mSearchQueryData.numberOfFetchedItems += newDataCount;
- }
- githubDao.update(mSearchQueryData);
-
- if (newDataCount > 0) {
- // Insert entries for the newly loaded repositories in two places:
- // 1. The table that stores repository IDs that match a specific query.
- // 2. The table that stores full data on each individual repository.
- // This way we don't store multiple full entries for the same repository
- // that happens to match two or more search queries.
- GeneralRepoSearchData[] generalRepoSearchDataArray =
- new GeneralRepoSearchData[newDataCount];
- for (int i = 0; i < newDataCount; i++) {
- generalRepoSearchDataArray[i] = new GeneralRepoSearchData();
- generalRepoSearchDataArray[i].searchQuery = mSearchTerm;
- generalRepoSearchDataArray[i].resultIndex = indexOfFirstData + i;
- generalRepoSearchDataArray[i].repoId = data[i].id;
- }
- githubDao.insert(generalRepoSearchDataArray);
- githubDao.insert(data);
- }
- mDatabase.setTransactionSuccessful();
- } finally {
- mDatabase.endTransaction();
- }
-
- mHasNetworkRequestPending.set(false);
- mStateLiveData.postValue(
- (mSearchQueryData.numberOfFetchedItems <= 0) && mSearchQueryData.hasNoMoreData
- ? STATE_EMPTY : STATE_DATA);
- }
-
- /**
- * Fetches data at specified index if data does not exist yet.
- */
- public void fetchAtIndexIfNecessary(int index) {
- if (mSearchQueryData == null) {
- // If we're here, we've been asked to start fetching items before we've retrieved
- // the top-level metadata for our search. Save the requested index and return. Once
- // that metadata is fetched off the main thread in the AsyncTask executed in
- // setSearchTerms, we'll call fetchNextPage().
- mLastRequestedIndex.set(index);
- return;
- }
-
- if (mHasNetworkRequestPending.get() || mSearchQueryData.hasNoMoreData) {
- // Previous request still processing or no more results
- return;
- }
-
- mLastRequestedIndex.set(index);
-
- fetchNextPage();
- }
-
- /**
- * Resumes loading of data in this model.
- */
- public void resumeLoading() {
- fetchNextPage();
- }
-
- /**
- * Returns the {@LiveData} object that wraps the current list of repos that matches the last
- * set search term.
- */
- public LiveData<List<RepositoryData>> getRepositoryListLiveData() {
- return mRepositoryListLiveData;
- }
-
- /**
- * Returns the {@LiveData} object that wraps the current data state.
- */
- public LiveData<Integer> getStateLiveData() {
- return mStateLiveData;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositorySearchModel.java b/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositorySearchModel.java
deleted file mode 100644
index 7dd9ad9..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/java/com/android/sample/githubbrowser/viewmodel/RepositorySearchModel.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2017 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) 2017 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.android.sample.githubbrowser.viewmodel;
-
-import android.text.TextUtils;
-
-import com.android.support.lifecycle.LiveData;
-import com.android.support.lifecycle.ViewModel;
-
-/**
- * Model for the top-level search.
- */
-public class RepositorySearchModel extends ViewModel {
- private LiveData<String> mSearchQuery = new LiveData<>();
-
- /**
- * Sets new search query. The second parameter should be used to specify whether
- * the currently set query should be overwritten.
- */
- public void setQuery(String query, boolean ignoreIfAlreadySet) {
- if (ignoreIfAlreadySet && !TextUtils.isEmpty(mSearchQuery.getValue())) {
- return;
- }
-
- mSearchQuery.setValue(query);
- }
-
- /**
- * Returns the {@LiveData} object that wraps the top-level search query.
- */
- public LiveData<String> getSearchQueryData() {
- return mSearchQuery;
- }
-}
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_bug_report_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_bug_report_black_18dp.png
deleted file mode 100644
index 9eff049..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_bug_report_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_content_copy_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_content_copy_black_18dp.png
deleted file mode 100644
index 91b3acf..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_content_copy_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_email_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_email_black_18dp.png
deleted file mode 100644
index ef03f95..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_email_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_link_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_link_black_18dp.png
deleted file mode 100644
index 788c578..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_link_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_location_on_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_location_on_black_18dp.png
deleted file mode 100644
index 5e45f7e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_location_on_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_mode_edit_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_mode_edit_black_24dp.png
deleted file mode 100644
index e531d72..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_mode_edit_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_people_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_people_black_18dp.png
deleted file mode 100644
index f6ac436..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_people_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_remove_red_eye_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_remove_red_eye_black_18dp.png
deleted file mode 100644
index debb2b3..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_remove_red_eye_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_search_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_search_black_24dp.png
deleted file mode 100644
index c593e7a..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_search_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_black_18dp.png
deleted file mode 100644
index 4ea8d0c..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_rate_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_rate_black_18dp.png
deleted file mode 100644
index cd18bed..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_star_rate_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_watch_later_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_watch_later_black_18dp.png
deleted file mode 100644
index c910f75..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-hdpi/ic_watch_later_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_bug_report_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_bug_report_black_18dp.png
deleted file mode 100644
index b3d2e3e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_bug_report_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_content_copy_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_content_copy_black_18dp.png
deleted file mode 100644
index 6363bc4..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_content_copy_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_email_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_email_black_18dp.png
deleted file mode 100644
index 977c4cb..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_email_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_link_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_link_black_18dp.png
deleted file mode 100644
index 6e5c394..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_link_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_location_on_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_location_on_black_18dp.png
deleted file mode 100644
index b35923a..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_location_on_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_mode_edit_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_mode_edit_black_24dp.png
deleted file mode 100644
index 9efbaae..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_mode_edit_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_people_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_people_black_18dp.png
deleted file mode 100644
index cc204fd..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_people_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_remove_red_eye_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_remove_red_eye_black_18dp.png
deleted file mode 100644
index 0f72bfa..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_remove_red_eye_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_search_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_search_black_24dp.png
deleted file mode 100644
index 6b16343..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_search_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_black_18dp.png
deleted file mode 100644
index b125aa0..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_rate_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_rate_black_18dp.png
deleted file mode 100644
index d6496ab..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_star_rate_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_watch_later_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_watch_later_black_18dp.png
deleted file mode 100644
index 19e22c0..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-mdpi/ic_watch_later_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_bug_report_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_bug_report_black_18dp.png
deleted file mode 100644
index 1bccb1d..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_bug_report_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_content_copy_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_content_copy_black_18dp.png
deleted file mode 100644
index 9a9e570..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_content_copy_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_email_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_email_black_18dp.png
deleted file mode 100644
index 36c6311..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_email_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_link_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_link_black_18dp.png
deleted file mode 100644
index 76003e2..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_link_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_location_on_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_location_on_black_18dp.png
deleted file mode 100644
index df1f340..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_location_on_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_mode_edit_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_mode_edit_black_24dp.png
deleted file mode 100644
index 87f8de1..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_mode_edit_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_people_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_people_black_18dp.png
deleted file mode 100644
index 0782166..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_people_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_remove_red_eye_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_remove_red_eye_black_18dp.png
deleted file mode 100644
index 329e617..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_remove_red_eye_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_search_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_search_black_24dp.png
deleted file mode 100644
index 6381902..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_search_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_black_18dp.png
deleted file mode 100644
index 92a0f58..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_rate_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_rate_black_18dp.png
deleted file mode 100644
index 33a02af..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_star_rate_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_watch_later_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_watch_later_black_18dp.png
deleted file mode 100644
index c643539..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xhdpi/ic_watch_later_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_bug_report_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_bug_report_black_18dp.png
deleted file mode 100644
index 145f2e6..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_bug_report_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_content_copy_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_content_copy_black_18dp.png
deleted file mode 100644
index 7ef1968..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_content_copy_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_email_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_email_black_18dp.png
deleted file mode 100644
index 0648fbd..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_email_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_link_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_link_black_18dp.png
deleted file mode 100644
index 69ea7ef..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_link_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_location_on_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_location_on_black_18dp.png
deleted file mode 100644
index ebe833b..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_location_on_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_mode_edit_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_mode_edit_black_24dp.png
deleted file mode 100644
index 4af4ae6..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_mode_edit_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_people_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_people_black_18dp.png
deleted file mode 100644
index a595b2e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_people_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_remove_red_eye_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_remove_red_eye_black_18dp.png
deleted file mode 100644
index 2e54e32..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_remove_red_eye_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_search_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_search_black_24dp.png
deleted file mode 100644
index 3ae490e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_search_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_black_18dp.png
deleted file mode 100644
index 4f67f97..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_rate_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_rate_black_18dp.png
deleted file mode 100644
index 658b08d..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_star_rate_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_watch_later_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_watch_later_black_18dp.png
deleted file mode 100644
index 3b41d99..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxhdpi/ic_watch_later_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_bug_report_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_bug_report_black_18dp.png
deleted file mode 100644
index af8c82e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_bug_report_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_content_copy_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_content_copy_black_18dp.png
deleted file mode 100644
index 074ea88..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_content_copy_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_email_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_email_black_18dp.png
deleted file mode 100644
index 3d13627..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_email_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_link_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_link_black_18dp.png
deleted file mode 100644
index af03b85..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_link_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_location_on_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_location_on_black_18dp.png
deleted file mode 100644
index 5a21dfa..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_location_on_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_black_24dp.png
deleted file mode 100644
index d6761ba..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_mode_edit_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_people_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_people_black_18dp.png
deleted file mode 100644
index 5a8b5d0..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_people_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_remove_red_eye_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_remove_red_eye_black_18dp.png
deleted file mode 100644
index c816ab4..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_remove_red_eye_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_search_black_24dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_search_black_24dp.png
deleted file mode 100644
index 21be572..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_search_black_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_black_18dp.png
deleted file mode 100644
index 54d3065..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_rate_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_rate_black_18dp.png
deleted file mode 100644
index 1823bbb..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_star_rate_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_watch_later_black_18dp.png b/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_watch_later_black_18dp.png
deleted file mode 100644
index bfb296d..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/drawable-xxxhdpi/ic_watch_later_black_18dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/activity_main.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 7aacfcb..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<android.support.design.widget.CoordinatorLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/col"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fitsSystemWindows="true"
- tools:context="com.android.sample.githubbrowser.MainActivity">
-
- <android.support.design.widget.AppBarLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:theme="@style/AppTheme.AppBarOverlay">
-
- <android.support.v7.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- android:background="?attr/colorPrimary"
- app:contentInsetStart="0dp"
- app:popupTheme="@style/AppTheme.PopupOverlay">
-
- <android.support.v7.widget.CardView
- android:id="@+id/card_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_margin="8dip"
- app:cardCornerRadius="4dp"
- app:cardElevation="8dp">
-
- <EditText
- android:id="@+id/search"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:background="@null"
- android:drawableRight="@drawable/ic_search_black_24dp"
- android:paddingLeft="12dp"
- android:paddingRight="12dp"
- android:maxLines="1"
- android:inputType="textNoSuggestions"
- android:textColor="@color/colorPrimary"/>
- </android.support.v7.widget.CardView>
- </android.support.v7.widget.Toolbar>
-
- </android.support.design.widget.AppBarLayout>
-
- <include layout="@layout/content_main"/>
-</android.support.design.widget.CoordinatorLayout>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/content_main.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/content_main.xml
deleted file mode 100644
index ad98eda..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/content_main.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<FrameLayout android:id="@+id/fragment_container"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/edit_user_details.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/edit_user_details.xml
deleted file mode 100644
index 3113520..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/edit_user_details.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android">
- <data>
- <variable name="user" type="com.android.sample.githubbrowser.data.PersonData"/>
- </data>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingTop="16dp"
- android:paddingLeft="8dp"
- android:paddingRight="8dp">
-
- <android.support.design.widget.TextInputLayout
- android:id="@+id/wrapper_email"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <EditText
- android:id="@+id/email"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/hint_email"
- android:text="@{user.email}" />
- </android.support.design.widget.TextInputLayout>
-
- <android.support.design.widget.TextInputLayout
- android:id="@+id/wrapper_location"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <EditText
- android:id="@+id/location"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/hint_location"
- android:text="@{user.location}" />
- </android.support.design.widget.TextInputLayout>
-
- </LinearLayout>
-</layout>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_details.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_details.xml
deleted file mode 100644
index 8727bb8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_details.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <variable name="repo" type="com.android.sample.githubbrowser.data.RepositoryData"/>
- </data>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/background"
- android:orientation="vertical">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/avatar"
- android:layout_width="96dp"
- android:layout_height="96dp"
- android:background="#FAFAFA"
- app:imageUrl="@{repo.owner.avatar_url}"/>
-
- <TextView
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{repo.name}"
- android:textColor="#222"
- android:textSize="20sp"/>
-
- <TextView
- android:id="@+id/description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/name"
- android:layout_toRightOf="@id/avatar"
- android:lines="2"
- android:maxLines="2"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{repo.description}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/created"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@id/avatar"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="2dp"
- android:paddingLeft="8dp"
- android:textColor="#444"
- android:textSize="14sp"
- app:jsonDate="@{repo.created_at}"/>
-
- <TextView
- android:id="@+id/bugs"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/avatar"
- android:drawableLeft="@drawable/ic_bug_report_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:paddingTop="8dp"
- android:text="@{Integer.toString(repo.open_issues_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/starred"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/avatar"
- android:layout_toRightOf="@id/bugs"
- android:drawableLeft="@drawable/ic_star_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:paddingTop="8dp"
- android:text="@{Integer.toString(repo.stargazers_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/forked"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/avatar"
- android:layout_toRightOf="@id/starred"
- android:drawableLeft="@drawable/ic_content_copy_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:paddingRight="10dp"
- android:paddingTop="8dp"
- android:text="@{Integer.toString(repo.forks_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- </RelativeLayout>
-
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="4dp"
- android:paddingLeft="12dp"
- android:paddingTop="24dp"
- android:text="@string/contributors"
- android:textAppearance="@style/TextAppearance.AppCompat.Body2"
- app:textAllCaps="true"/>
-
- <android.support.v7.widget.RecyclerView
- android:id="@+id/contributors"
- android:layout_width="match_parent"
- app:layoutManager="LinearLayoutManager"
- android:layout_height="0dip"
- android:layout_weight="1"/>
-
- </LinearLayout>
-</layout>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_list.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_list.xml
deleted file mode 100644
index 8424df0..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_repo_list.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <import type="java.lang.String"/>
- <import type="com.android.sample.githubbrowser.viewmodel.RepositoryListModel"/>
- <variable name="state" type="Integer"/>
- <variable name="query" type="String"/>
- </data>
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/background">
-
- <ProgressBar
- android:id="@+id/loading"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:indeterminate="true"
- app:visibleInvisible="@{state == RepositoryListModel.STATE_INITIAL_LOADING}"/>
-
- <TextView
- android:id="@+id/status"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center"
- android:paddingLeft="24dp"
- android:paddingRight="24dp"
- android:textSize="20sp"
- android:text="@{state == RepositoryListModel.STATE_EMPTY ? @string/no_results(query) : @string/load_error(query)}"
- app:visibleInvisible="@{state == RepositoryListModel.STATE_EMPTY || state == RepositoryListModel.STATE_ERROR}"/>
-
- <android.support.v7.widget.RecyclerView
- android:id="@+id/repo_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:visibleInvisible="@{state == RepositoryListModel.STATE_DATA}"/>
-
- </FrameLayout>
-</layout>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_user_details.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_user_details.xml
deleted file mode 100644
index 3ed4e05..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/fragment_user_details.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <import type="android.text.TextUtils"/>
- <import type="com.android.sample.githubbrowser.R"/>
- <variable name="user" type="com.android.sample.githubbrowser.data.PersonData"/>
- <variable name="editCallback" type="com.android.sample.githubbrowser.view.PersonClickCallback"/>
- </data>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/background"
- android:orientation="vertical">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/avatar"
- android:layout_width="96dp"
- android:layout_height="96dp"
- android:background="#FAFAFA"
- app:imageUrl="@{user.avatar_url}"/>
-
- <TextView
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{user.name}"
- android:textColor="#222"
- android:textSize="20sp"
- app:visibleInvisible="@{!(user == null || TextUtils.isEmpty(user.name))}"/>
-
- <TextView
- android:id="@+id/login"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/name"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{user.login}"
- android:textColor="#444"
- android:textSize="18sp"/>
-
- <TextView
- android:id="@+id/created"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@id/avatar"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="2dp"
- android:paddingLeft="8dp"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleInvisible="@{!(user == null || TextUtils.isEmpty(user.created_at))}"
- app:jsonDate="@{user.created_at}"
- app:stringRes="@{R.string.joined}"/>
-
- </RelativeLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingLeft="16dp"
- android:paddingTop="8dp">
- <TextView
- android:id="@+id/company"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_people_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:text="@{user.company}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{!(user == null || TextUtils.isEmpty(user.company))}"/>
-
- <TextView
- android:id="@+id/location"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_location_on_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:text="@{user.location}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{!(user == null || TextUtils.isEmpty(user.location))}"/>
-
- <View
- android:layout_width="0dp"
- android:layout_height="0dp"
- android:layout_weight="1"/>
-
- <ImageButton
- android:id="@+id/edit"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginRight="8dp"
- android:background="@null"
- android:clickable="true"
- android:onClick="@{() -> editCallback.onClick(user)}"
- android:src="@drawable/ic_mode_edit_black_24dp"
- app:visibleGone="@{user != null}"/>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingLeft="16dp"
- android:paddingTop="8dp">
- <TextView
- android:id="@+id/email"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_email_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:text="@{user.email}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{!(user == null || TextUtils.isEmpty(user.email))}"/>
-
- <TextView
- android:id="@+id/blog"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:drawableLeft="@drawable/ic_link_black_18dp"
- android:drawablePadding="2dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:text="@{user.blog}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{!(user == null || TextUtils.isEmpty(user.blog))}"/>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingLeft="16dp"
- android:paddingTop="8dp">
- <TextView
- android:id="@+id/followers_label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:lines="1"
- android:maxLines="1"
- android:paddingRight="4dp"
- android:text="@string/followers"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{user != null}"/>
-
- <TextView
- android:id="@+id/followers"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="#CCC"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="4dp"
- android:paddingRight="4dp"
- android:text="@{Integer.toString(user.followers)}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{user != null}"/>
-
- <TextView
- android:id="@+id/following_label"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="16dp"
- android:paddingRight="4dp"
- android:text="@string/following"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{user != null}"/>
-
- <TextView
- android:id="@+id/following"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="#CCC"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="4dp"
- android:paddingRight="4dp"
- android:text="@{Integer.toString(user.following)}"
- android:textColor="#444"
- android:textSize="14sp"
- app:visibleGone="@{user != null}"/>
- </LinearLayout>
-
- <TextView
- android:id="@+id/repositories_header"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="4dp"
- android:paddingLeft="12dp"
- android:paddingTop="24dp"
- android:text="@string/repositories"
- android:textAppearance="@style/TextAppearance.AppCompat.Body2"
- app:visibleGone="@{user != null}"/>
- app:textAllCaps="true"/>
-
- <android.support.v7.widget.RecyclerView
- android:id="@+id/repositories"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"/>
-
- </LinearLayout>
-</layout>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/get_auth_token.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/get_auth_token.xml
deleted file mode 100644
index 9547f40..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/get_auth_token.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingTop="16dp"
- android:paddingLeft="8dp"
- android:paddingRight="8dp">
-
- <android.support.design.widget.TextInputLayout
- android:id="@+id/wrapper_token"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <EditText
- android:id="@+id/token"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/hint_token"/>
- </android.support.design.widget.TextInputLayout>
-
-</FrameLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/repository_card.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/repository_card.xml
deleted file mode 100644
index dc2f6b8..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/repository_card.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <variable name="repo" type="com.android.sample.githubbrowser.data.RepositoryData"/>
- <variable name="repoClickCallback"
- type="com.android.sample.githubbrowser.view.RepoClickCallback"/>
- </data>
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:onClick="@{() -> repoClickCallback.onClick(repo)}">
-
- <android.support.v7.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
- android:layout_marginLeft="10dp"
- android:layout_marginRight="10dp"
- android:layout_marginTop="6dp"
- app:cardCornerRadius="4dp"
- app:cardElevation="2dp">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="96dp">
-
- <TextView
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{repo.name}"
- android:textColor="#222"
- android:textSize="18sp"/>
-
- <TextView
- android:id="@+id/description"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/name"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{repo.description}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/created"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="8dp"
- android:paddingLeft="8dp"
- android:textColor="#444"
- android:textSize="14sp"
- app:jsonDate="@{repo.created_at}"/>
-
- <TextView
- android:id="@+id/forked"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:drawableLeft="@drawable/ic_content_copy_black_18dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="8dp"
- android:paddingLeft="6dp"
- android:paddingRight="10dp"
- android:text="@{Integer.toString(repo.forks_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/starred"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/forked"
- android:drawableLeft="@drawable/ic_star_black_18dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="8dp"
- android:paddingLeft="6dp"
- android:paddingRight="6dp"
- android:text="@{Integer.toString(repo.stargazers_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- <TextView
- android:id="@+id/bugs"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_toLeftOf="@id/starred"
- android:drawableLeft="@drawable/ic_bug_report_black_18dp"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="8dp"
- android:paddingLeft="6dp"
- android:paddingRight="6dp"
- android:text="@{Integer.toString(repo.open_issues_count)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- </RelativeLayout>
-
- </android.support.v7.widget.CardView>
-
- </FrameLayout>
-</layout>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/user_row.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/layout/user_row.xml
deleted file mode 100644
index 495720c..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/layout/user_row.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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.
- -->
-
-<layout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <variable name="contributor" type="com.android.sample.githubbrowser.data.ContributorData"/>
- <variable name="callback" type="com.android.sample.githubbrowser.view.PersonClickCallback"/>
- </data>
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="64dp"
- android:onClick="@{() -> callback.onClick(contributor)}">
-
- <ImageView
- android:id="@+id/avatar"
- android:layout_width="64dp"
- android:layout_height="64dp"
- app:imageUrl="@{contributor.avatar_url}"/>
-
- <View
- android:id="@+id/separator"
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:layout_toRightOf="@id/avatar"
- android:background="#80222222"/>
-
- <TextView
- android:id="@+id/login"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:paddingTop="4dp"
- android:text="@{contributor.login}"
- android:textColor="#222"
- android:textSize="16sp"/>
-
- <TextView
- android:id="@+id/contributions"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_toRightOf="@id/avatar"
- android:lines="1"
- android:maxLines="1"
- android:paddingBottom="6dp"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
- android:text="@{@plurals/contributions(contributor.contributions, contributor.contributions)}"
- android:textColor="#444"
- android:textSize="14sp"/>
-
- </RelativeLayout>
-</layout>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index cde69bc..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c133a0c..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfa42f0..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 324e72c..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index aee44e1..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values-land/ints.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values-land/ints.xml
deleted file mode 100644
index 5b3006e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values-land/ints.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <integer name="column_count">2</integer>
-</resources>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values-v21/styles.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values-v21/styles.xml
deleted file mode 100644
index 064fa76..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values-v21/styles.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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="AppTheme.NoActionBar">
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
- <item name="android:windowDrawsSystemBarBackgrounds">true</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- </style>
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w600dp/ints.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values-w600dp/ints.xml
deleted file mode 100644
index 5b3006e..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w600dp/ints.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <integer name="column_count">2</integer>
-</resources>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/dimens.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/dimens.xml
deleted file mode 100644
index 73f6d98..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/dimens.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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>
- <!-- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/ints.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/ints.xml
deleted file mode 100644
index 574f711..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values-w820dp/ints.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <integer name="column_count">3</integer>
-</resources>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values/colors.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values/colors.xml
deleted file mode 100644
index c375001..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <color name="colorPrimary">#e91e63</color>
- <color name="colorPrimaryDark">#d81b60</color>
- <color name="colorAccent">#4caf50</color>
- <color name="background">#eeeeee</color>
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values/dimens.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 87c9565..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
- <dimen name="fab_margin">16dp</dimen>
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values/ints.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values/ints.xml
deleted file mode 100644
index e489869..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values/ints.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2017 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>
- <integer name="column_count">1</integer>
-</resources>
\ No newline at end of file
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values/strings.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values/strings.xml
deleted file mode 100644
index a77f5ef..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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">GithubBrowser</string>
- <string name="ok">OK</string>
- <string name="cancel">Cancel</string>
-
- <string name="auth_token_title">Type or paste your GitHub token</string>
- <string name="hint_token">GitHub token</string>
- <string name="contributors">Contributors</string>
- <plurals name="bugs">
- <item quantity="one">%1$d issue</item>
- <item quantity="other">%1$d issues</item>
- </plurals>
- <string name="starred">%1$d starred</string>
- <string name="forked">%1$d forked</string>
- <plurals name="contributions">
- <item quantity="one">%1$d contribution</item>
- <item quantity="other">%1$d contributions</item>
- </plurals>
- <string name="created">Created on %1$s</string>
- <string name="repositories">Repositories</string>
- <string name="followers">Followers</string>
- <string name="following">Following</string>
- <string name="joined">Joined on %1$s</string>
- <string name="hint_email">Email</string>
- <string name="hint_location">Location</string>
-
- <string name="no_results">No data for \'%1$s\'</string>
- <string name="load_error">Couldn\'t load data for \'%1$s\'</string>
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/app/src/main/res/values/styles.xml b/samples-flatfoot/GithubBrowser/app/src/main/res/values/styles.xml
deleted file mode 100644
index 4b769cc..0000000
--- a/samples-flatfoot/GithubBrowser/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
- ~ Copyright (C) 2017 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. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
- <style name="AppTheme.NoActionBar">
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
- </style>
- <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
- <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
-
-</resources>
diff --git a/samples-flatfoot/GithubBrowser/build.gradle b/samples-flatfoot/GithubBrowser/build.gradle
deleted file mode 100644
index 99ae156..0000000
--- a/samples-flatfoot/GithubBrowser/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-ext.flatfootVersion = "1.0-SNAPSHOT"
-ext.supportLibVersion = "25.2.0"
-ext.daggerVersion = "2.7"
-
-allprojects { p ->
- repositories {
- jcenter()
- maven { url '/Volumes/ssd/src/ff-repo/m2repository' }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/samples-flatfoot/GithubBrowser/gradle.properties b/samples-flatfoot/GithubBrowser/gradle.properties
deleted file mode 100644
index be27115..0000000
--- a/samples-flatfoot/GithubBrowser/gradle.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2017 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.
-#
-
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index de8435f..0000000
--- a/samples-flatfoot/GithubBrowser/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright (C) 2017 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.
-#
-
-#Mon Mar 13 21:50:29 PDT 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/samples-flatfoot/GithubBrowser/gradlew b/samples-flatfoot/GithubBrowser/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/GithubBrowser/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/GithubBrowser/gradlew.bat b/samples-flatfoot/GithubBrowser/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/GithubBrowser/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/GithubBrowser/settings.gradle b/samples-flatfoot/GithubBrowser/settings.gradle
deleted file mode 100644
index 1df87d4..0000000
--- a/samples-flatfoot/GithubBrowser/settings.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-include ':app'
diff --git a/samples-flatfoot/MusicPlayer/.gitignore b/samples-flatfoot/MusicPlayer/.gitignore
deleted file mode 100644
index 39fb081..0000000
--- a/samples-flatfoot/MusicPlayer/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/MusicPlayer/app/.gitignore b/samples-flatfoot/MusicPlayer/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/samples-flatfoot/MusicPlayer/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/samples-flatfoot/MusicPlayer/app/build.gradle b/samples-flatfoot/MusicPlayer/app/build.gradle
deleted file mode 100644
index 58a68a1..0000000
--- a/samples-flatfoot/MusicPlayer/app/build.gradle
+++ /dev/null
@@ -1,38 +0,0 @@
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId "com.android.sample.musicplayer"
- minSdkVersion 14
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- dataBinding {
- enabled = true
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
-}
-
-dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile "com.android.support:appcompat-v7:$supportLibVersion"
- compile "com.android.support:design:$supportLibVersion"
- compile "com.android.support.lifecycle:runtime:$flatfootVersion"
- compile "com.android.support.lifecycle:extensions:$flatfootVersion"
-
- annotationProcessor "com.android.support.lifecycle:compiler:$flatfootVersion"
-
- testCompile 'junit:junit:4.12'
-}
diff --git a/samples-flatfoot/MusicPlayer/app/proguard-rules.pro b/samples-flatfoot/MusicPlayer/app/proguard-rules.pro
deleted file mode 100644
index 3916ad7..0000000
--- a/samples-flatfoot/MusicPlayer/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /Users/kirillg/Android/sdk/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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/samples-flatfoot/MusicPlayer/app/src/main/AndroidManifest.xml b/samples-flatfoot/MusicPlayer/app/src/main/AndroidManifest.xml
deleted file mode 100644
index d96b452..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest package="com.android.sample.musicplayer"
- xmlns:android="http://schemas.android.com/apk/res/android">
- <uses-permission android:name="android.permission.WAKE_LOCK" />
- <permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
-
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity
- android:name=".MainActivity"
- android:label="@string/app_name"
- android:theme="@style/AppTheme.NoActionBar">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
-
- <category android:name="android.intent.category.LAUNCHER"/>
- </intent-filter>
- </activity>
-
- <service android:exported="false" android:name=".MusicService">
- <intent-filter>
- <action android:name="com.android.sample.musicplayer.action.START" />
- <action android:name="com.android.sample.musicplayer.action.PLAY" />
- <action android:name="com.android.sample.musicplayer.action.PAUSE" />
- <action android:name="com.android.sample.musicplayer.action.NEXT" />
- <action android:name="com.android.sample.musicplayer.action.PREV" />
- <action android:name="com.android.sample.musicplayer.action.STOP" />
- </intent-filter>
- </service>
- </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/BaseActivity.java b/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/BaseActivity.java
deleted file mode 100644
index 2ca54a9..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/BaseActivity.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2016 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.android.sample.musicplayer;
-
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-
-import com.android.support.lifecycle.ActivityLifecycleDispatcher;
-import com.android.support.lifecycle.Lifecycle;
-import com.android.support.lifecycle.LifecycleProvider;
-
-/**
- * Temporary base activity that acts as lifecycle provider.
- */
-public abstract class BaseActivity extends AppCompatActivity implements LifecycleProvider {
- private final ActivityLifecycleDispatcher mDispatcher = new ActivityLifecycleDispatcher(this,
- this);
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- mDispatcher.onActivityPostSuperOnCreate();
- }
- @Override
- protected void onResume() {
- mDispatcher.onActivityPreSuperOnResume();
- super.onResume();
- }
- @Override
- protected void onPause() {
- mDispatcher.onActivityPreSuperOnPause();
- super.onPause();
- }
- @Override
- protected void onStop() {
- mDispatcher.onActivityPreSuperOnStop();
- super.onStop();
- }
- @Override
- protected void onDestroy() {
- mDispatcher.onActivityPreSuperOnDestroy();
- super.onDestroy();
- }
-
- @Override
- public Lifecycle getLifecycle() {
- return mDispatcher.getLifecycle();
- }
-}
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MainActivity.java b/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MainActivity.java
deleted file mode 100644
index e07610a..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MainActivity.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2016 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.android.sample.musicplayer;
-
-import android.content.Intent;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.design.widget.FloatingActionButton;
-import android.support.v7.widget.LinearLayoutManager;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.Toolbar;
-import android.view.View;
-
-import com.android.sample.musicplayer.MusicRepository.TrackMetadata;
-import com.android.sample.musicplayer.adapter.MusicTrackListAdapter;
-import com.android.support.lifecycle.LiveData;
-import com.android.support.lifecycle.Observer;
-
-import java.util.List;
-
-/**
- * Our main activity.
- */
-public class MainActivity extends BaseActivity {
- private RecyclerView mRecyclerView;
-
- private MusicTrackListAdapter mMusicTrackListAdapter;
- private int mCurrPlaybackState;
-
- private void updateFab() {
- final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
- switch (mCurrPlaybackState) {
- case MusicRepository.STATE_PLAYING:
- fab.setImageResource(R.drawable.ic_pause_white_36dp);
- break;
- case MusicRepository.STATE_PAUSED:
- case MusicRepository.STATE_STOPPED:
- fab.setImageResource(R.drawable.ic_play_arrow_white_36dp);
- break;
- }
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
- setSupportActionBar(toolbar);
-
- // Start the service. From this point on there is no direct communication between the
- // activity and the service. Everything is done by updating LiveData objects in the
- // repository and observing / reacting to those changes.
- startService(new Intent(MusicService.ACTION_START).setPackage(
- "com.android.sample.musicplayer"));
-
- final MusicRepository musicRepository = MusicRepository.getInstance();
- LiveData<Integer> currentlyActiveTrackData = musicRepository.getCurrentlyActiveTrackData();
- currentlyActiveTrackData.observe(this, new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer integer) {
- if (mMusicTrackListAdapter != null) {
- mMusicTrackListAdapter.setActiveTrackIndex(integer);
- }
- }
- });
- LiveData<Integer> stateData = musicRepository.getStateData();
- stateData.observe(this, new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer integer) {
- mCurrPlaybackState = integer;
- updateFab();
- }
- });
-
- final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
- updateFab();
-
- fab.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- if (mCurrPlaybackState == MusicRepository.STATE_INITIAL) {
- // If the FAB is clicked in the initial state, start the playback from the
- // first track
- musicRepository.setTrack(0);
- } else {
- // Otherwise we're past the initial state. Set the state to playing or
- // paused based on the current state
- musicRepository.setState((mCurrPlaybackState == MusicRepository.STATE_PLAYING)
- ? MusicRepository.STATE_PAUSED : MusicRepository.STATE_PLAYING);
- }
- }
- });
-
- mRecyclerView = (RecyclerView) findViewById(R.id.recycler);
- final List<TrackMetadata> tracks = MusicRepository.getInstance().getTracks();
- mMusicTrackListAdapter = new MusicTrackListAdapter(tracks);
- mRecyclerView.setAdapter(mMusicTrackListAdapter);
- mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
- }
-}
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicRepository.java b/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicRepository.java
deleted file mode 100644
index 5fb04a4..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicRepository.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2016 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.android.sample.musicplayer;
-
-import android.support.annotation.RawRes;
-
-import com.android.support.lifecycle.LiveData;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Music track / state repository.
- */
-public class MusicRepository {
- public static final int STATE_INITIAL = 0;
- public static final int STATE_PLAYING = 1;
- public static final int STATE_PAUSED = 2;
- public static final int STATE_PREPARING = 3;
- public static final int STATE_STOPPED = 4;
-
- private static MusicRepository sInstance;
-
- /**
- * Metadata for a single track.
- */
- public static final class TrackMetadata {
- private final int mIndex;
- private final String mTitle;
- private final String mArtist;
- @RawRes private final int mTrackRes;
-
- public TrackMetadata(int index, String title, String artist, @RawRes int trackRes) {
- mIndex = index;
- mTitle = title;
- mArtist = artist;
- mTrackRes = trackRes;
- }
-
- public int getIndex() {
- return mIndex;
- }
-
- public String getTitle() {
- return mTitle;
- }
-
- public String getArtist() {
- return mArtist;
- }
-
- @RawRes
- public int getTrackRes() {
- return mTrackRes;
- }
- }
-
- private List<TrackMetadata> mTracks;
-
- private LiveData<Integer> mCurrentlyActiveTrackData;
- private LiveData<Integer> mStateData;
-
- /**
- * Gets the repository instance.
- */
- public static synchronized MusicRepository getInstance() {
- if (sInstance == null) {
- sInstance = new MusicRepository();
- }
- return sInstance;
- }
-
- private MusicRepository() {
- mTracks = new ArrayList<>(9);
- mTracks.add(new TrackMetadata(1, "Tilt You Better", "Dawn Lentil", R.raw.track1));
- mTracks.add(new TrackMetadata(2, "Moongirl", "The Weekdy", R.raw.track2));
- mTracks.add(new TrackMetadata(3, "Further", "The Linkdrinkers", R.raw.track3));
- mTracks.add(new TrackMetadata(4, "Back and Forth", "Marina Venti", R.raw.track4));
- mTracks.add(new TrackMetadata(5, "Let Me Hate You", "Juji Beans", R.raw.track5));
- mTracks.add(new TrackMetadata(6, "Thirsty", "Smiley Leftfield", R.raw.track6));
- mTracks.add(new TrackMetadata(7, "Cheap Deals", "Skia", R.raw.track7));
- mTracks.add(new TrackMetadata(8, "Don't Stop the Drilling", "Raw Oilfield", R.raw.track8));
- mTracks.add(new TrackMetadata(9, "Million Regressions", "Lady BreakBuild", R.raw.track9));
-
- mCurrentlyActiveTrackData = new LiveData<>();
- mCurrentlyActiveTrackData.setValue(-1);
-
- mStateData = new LiveData<>();
- mStateData.setValue(STATE_INITIAL);
- }
-
- /**
- * Returns the unmodifiable list of tracks in this repository.
- */
- public List<TrackMetadata> getTracks() {
- return Collections.unmodifiableList(mTracks);
- }
-
- /**
- * Goes to the specific track.
- */
- public void setTrack(int trackIndex) {
- mCurrentlyActiveTrackData.setValue(trackIndex);
- }
-
- /**
- * Goes to the next track.
- */
- public void goToNextTrack() {
- int nextSourceIndex = mCurrentlyActiveTrackData.getValue() + 1;
- if (nextSourceIndex == mTracks.size()) {
- nextSourceIndex = 0;
- }
- setTrack(nextSourceIndex);
- }
-
- /**
- * Goes to the previous track.
- */
- public void goToPreviousTrack() {
- int prevSourceIndex = mCurrentlyActiveTrackData.getValue() - 1;
- if (prevSourceIndex == -1) {
- prevSourceIndex = mTracks.size() - 1;
- }
- setTrack(prevSourceIndex);
- }
-
- /**
- * Sets the new value for the playback state.
- */
- public void setState(int state) {
- mStateData.setValue(state);
- }
-
- /**
- * Returns the {@link LiveData} object that wraps the currently active track index.
- */
- public LiveData<Integer> getCurrentlyActiveTrackData() {
- return this.mCurrentlyActiveTrackData;
- }
-
- /**
- * Returns the {@link LiveData} object that wraps the playback state.
- */
- public LiveData<Integer> getStateData() {
- return mStateData;
- }
-}
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicService.java b/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicService.java
deleted file mode 100644
index a9d623c..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/MusicService.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*
- * Copyright (C) 2016 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.android.sample.musicplayer;
-
-import android.app.PendingIntent;
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.media.MediaPlayer;
-import android.media.MediaPlayer.OnCompletionListener;
-import android.media.MediaPlayer.OnPreparedListener;
-import android.net.Uri;
-import android.os.IBinder;
-import android.os.PowerManager;
-import android.support.annotation.Nullable;
-import android.support.annotation.RawRes;
-import android.support.v4.app.NotificationManagerCompat;
-import android.support.v4.media.MediaMetadataCompat;
-import android.support.v4.media.session.MediaSessionCompat;
-import android.support.v7.app.NotificationCompat;
-
-import com.android.sample.musicplayer.MusicRepository.TrackMetadata;
-import com.android.support.lifecycle.LifecycleService;
-import com.android.support.lifecycle.LiveData;
-import com.android.support.lifecycle.Observer;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * Music playback service.
- */
-public class MusicService extends LifecycleService implements OnCompletionListener,
- OnPreparedListener {
- // Note that only START action is an entry point "exposed" to the rest of the
- // application. The rest are actions set on the notification intents fired off
- // by this service itself.
- public static final String ACTION_START = "com.android.sample.musicplayer.action.START";
- private static final String ACTION_PLAY = "com.android.sample.musicplayer.action.PLAY";
- private static final String ACTION_PAUSE = "com.android.sample.musicplayer.action.PAUSE";
- private static final String ACTION_STOP = "com.android.sample.musicplayer.action.STOP";
- private static final String ACTION_NEXT = "com.android.sample.musicplayer.action.NEXT";
- private static final String ACTION_PREV = "com.android.sample.musicplayer.action.PREV";
-
- private static final String RESOURCE_PREFIX =
- "android.resource://com.android.sample.musicplayer/";
-
- // The ID we use for the notification (the onscreen alert that appears at the notification
- // area at the top of the screen as an icon -- and as text as well if the user expands the
- // notification area).
- private static final int NOTIFICATION_ID = 1;
-
- private MediaSessionCompat mMediaSession;
-
- private MediaPlayer mMediaPlayer = null;
- private NotificationManagerCompat mNotificationManager;
- private NotificationCompat.Builder mNotificationBuilder;
-
- private MusicRepository mMusicRepository;
- private int mCurrPlaybackState;
- private int mCurrActiveTrackIndex;
- private List<TrackMetadata> mTracks;
-
- @Override
- public void onCreate() {
- super.onCreate();
-
- mMediaSession = new MediaSessionCompat(this, MusicService.class.getSimpleName());
- mMediaSession.setFlags(MediaSessionCompat.FLAG_HANDLES_TRANSPORT_CONTROLS);
- mMediaSession.setActive(true);
-
- mMusicRepository = MusicRepository.getInstance();
-
- mTracks = mMusicRepository.getTracks();
-
- // Attach Callback to receive MediaSession updates
- mMediaSession.setCallback(new MediaSessionCompat.Callback() {
- // Implement callbacks
- @Override
- public void onPlay() {
- super.onPlay();
- processPlayRequest();
- }
-
- @Override
- public void onPause() {
- super.onPause();
- processPauseRequest();
- }
-
- @Override
- public void onSkipToNext() {
- super.onSkipToNext();
- processNextRequest();
- }
-
- @Override
- public void onSkipToPrevious() {
- super.onSkipToPrevious();
- processPreviousRequest();
- }
-
- @Override
- public void onStop() {
- super.onStop();
- processStopRequest();
- }
- });
-
- mNotificationManager = NotificationManagerCompat.from(this);
-
- // Register self as the observer on the LiveData object that wraps the currently
- // active track index.
- LiveData<Integer> currentlyActiveTrackData = mMusicRepository.getCurrentlyActiveTrackData();
- mCurrActiveTrackIndex = currentlyActiveTrackData.getValue();
- currentlyActiveTrackData.observe(this, new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer integer) {
- mCurrActiveTrackIndex = integer;
- if (mCurrActiveTrackIndex < 0) {
- return;
- }
-
- // Create the media player if necessary, set its data to the currently active track
- // and call prepare(). This will eventually result in an asynchronous call to
- // our onPrepared() method which will transition from PREPARING into PLAYING state.
- createMediaPlayerIfNeeded();
- try {
- mMusicRepository.setState(MusicRepository.STATE_PREPARING);
- @RawRes int trackRawRes = mTracks.get(mCurrActiveTrackIndex).getTrackRes();
- mMediaPlayer.setDataSource(getBaseContext(),
- Uri.parse(RESOURCE_PREFIX + trackRawRes));
- mMediaPlayer.prepare();
- } catch (IOException ioe) {
- }
- // As the media player is preparing the track, update the media session and the
- // notification with the metadata of that track.
- updateAudioMetadata();
- updateNotification();
- }
- });
-
- // Register self as the observer on the LiveData object that wraps the playback state.
- LiveData<Integer> stateData = mMusicRepository.getStateData();
- mCurrPlaybackState = stateData.getValue();
- stateData.observe(this, new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer integer) {
- mCurrPlaybackState = integer;
- switch (mCurrPlaybackState) {
- case MusicRepository.STATE_INITIAL:
- createMediaPlayerIfNeeded();
- break;
- case MusicRepository.STATE_PLAYING:
- // Start the media player and update the ongoing notification
- configAndStartMediaPlayer();
- updateNotification();
- break;
- case MusicRepository.STATE_PAUSED:
- // Pause the media player and update the ongoing notification
- mMediaPlayer.pause();
- updateNotification();
- }
- }
- });
- }
-
- private void createMediaPlayerIfNeeded() {
- if (mMediaPlayer == null) {
- mMediaPlayer = new MediaPlayer();
- // Make sure the media player will acquire a wake-lock while playing. If we don't do
- // that, the CPU might go to sleep while the song is playing, causing playback to stop.
- //
- // Remember that to use this, we have to declare the android.permission.WAKE_LOCK
- // permission in AndroidManifest.xml.
- mMediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
- // we want the media player to notify us when it's ready preparing, and when it's done
- // playing:
- mMediaPlayer.setOnPreparedListener(this);
- mMediaPlayer.setOnCompletionListener(this);
- } else {
- mMediaPlayer.reset();
- }
- }
-
- @Override
- public int onStartCommand(Intent intent, int flags, int startId) {
- super.onStartCommand(intent, flags, startId);
-
- // Note that we don't do anything for the START action. The purpose of that action
- // is to start the service. As the service registers itself to observe changes to
- // playback state and current track, it will start the matching flows as a response
- // to those changes.
- // Here we handle service-internal actions that are registered on notification intents.
- if (intent.getAction().equals(ACTION_PLAY)) {
- processPlayRequest();
- } else if (intent.getAction().equals(ACTION_PAUSE)) {
- processPauseRequest();
- } else if (intent.getAction().equals(ACTION_STOP)) {
- processStopRequest();
- } else if (intent.getAction().equals(ACTION_NEXT)) {
- processNextRequest();
- } else if (intent.getAction().equals(ACTION_PREV)) {
- processPreviousRequest();
- }
-
- return START_NOT_STICKY;
- }
-
- private void processPlayRequest() {
- // The logic here is different depending on our current state
- if (mCurrPlaybackState == MusicRepository.STATE_STOPPED) {
- // If we're stopped, just go ahead to the next song and start playing.
- playNextSong();
- } else if (mCurrPlaybackState == MusicRepository.STATE_PAUSED) {
- // If we're paused, just continue playback. We are registered to listen to the changes
- // in LiveData that tracks the playback state, and that observer will update our ongoing
- // notification and resume the playback.
- mMusicRepository.setState(MusicRepository.STATE_PLAYING);
- }
- }
-
- private void processPauseRequest() {
- if (mCurrPlaybackState == MusicRepository.STATE_PLAYING) {
- // Move to the paused state. We are registered
- // to listen to the changes in LiveData that tracks the playback state,
- // and that observer will update our ongoing notification and pause the media
- // player.
- mMusicRepository.setState(MusicRepository.STATE_PAUSED);
- }
- }
-
- private void processStopRequest() {
- processStopRequest(false);
- }
-
- private void processStopRequest(boolean force) {
- if (mCurrPlaybackState != MusicRepository.STATE_STOPPED || force) {
- mMusicRepository.setState(MusicRepository.STATE_STOPPED);
- // let go of all resources...
- relaxResources(true);
- // cancel the notification
- mNotificationManager.cancel(NOTIFICATION_ID);
- // service is no longer necessary. Will be started again if needed.
- stopSelf();
- }
- }
-
- private void processNextRequest() {
- if (mCurrPlaybackState != MusicRepository.STATE_STOPPED) {
- playNextSong();
- }
- }
-
- private void processPreviousRequest() {
- if (mCurrPlaybackState != MusicRepository.STATE_STOPPED) {
- playPrevSong();
- }
- }
-
- /**
- * Releases resources used by the service for playback. This includes the "foreground service"
- * status and notification, the wake locks and possibly the MediaPlayer.
- *
- * @param releaseMediaPlayer Indicates whether the Media Player should also be released or not
- */
- private void relaxResources(boolean releaseMediaPlayer) {
- // stop being a foreground service
- //stopForeground(true);
- // stop and release the Media Player, if it's available
- if (releaseMediaPlayer && mMediaPlayer != null) {
- mMediaPlayer.reset();
- mMediaPlayer.release();
- mMediaPlayer = null;
- }
- }
-
- /**
- * Reconfigures MediaPlayer according to audio focus settings and starts/restarts it. This
- * method starts/restarts the MediaPlayer respecting the current audio focus state. So if
- * we have focus, it will play normally; if we don't have focus, it will either leave the
- * MediaPlayer paused or set it to a low volume, depending on what is allowed by the
- * current focus settings. This method assumes mPlayer != null, so if you are calling it,
- * you have to do so from a context where you are sure this is the case.
- */
- private void configAndStartMediaPlayer() {
- mMediaPlayer.setVolume(1.0f, 1.0f); // we can be loud
- if (!mMediaPlayer.isPlaying()) {
- mMediaPlayer.start();
- }
- }
-
- /**
- * Starts playing the next song in our repository.
- */
- private void playNextSong() {
- relaxResources(false); // release everything except MediaPlayer
-
- // Ask the repository to go to the next track. We are registered to listen to the
- // changes in LiveData that tracks the current track, and that observer will point the
- // media player to the right URI
- mMusicRepository.goToNextTrack();
- }
-
- /**
- * Starts playing the previous song in our repository.
- */
- private void playPrevSong() {
- relaxResources(false); // release everything except MediaPlayer
-
- // Ask the repository to go to the next track. We are registered to listen to the
- // changes in LiveData that tracks the current track, and that observer will point the
- // media player to the right URI
- mMusicRepository.goToPreviousTrack();
- }
-
- /**
- * Called when media player is done playing current song.
- */
- public void onCompletion(MediaPlayer player) {
- // The media player finished playing the current song, so we go ahead and start the next.
- playNextSong();
- }
-
- /** Called when media player is done preparing. */
- public void onPrepared(MediaPlayer player) {
- // The media player is done preparing. That means we can start playing!
- // We are registered to listen to the changes in LiveData that tracks the playback state,
- // and that observer will update our ongoing notification
- mMusicRepository.setState(MusicRepository.STATE_PLAYING);
- }
-
- /**
- * Configures service as a foreground service. A foreground service is a service that's doing
- * something the user is actively aware of (such as playing music), and must appear to the
- * user as a notification. That's why we create the notification here.
- */
- private void populateNotificationBuilderContent(String text) {
- PendingIntent pi = PendingIntent.getActivity(getApplicationContext(),
- (int) (System.currentTimeMillis() & 0xfffffff),
- new Intent().setClass(getApplicationContext(), MainActivity.class)
- .setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),
- PendingIntent.FLAG_UPDATE_CURRENT);
-
- boolean isPlaying = (mCurrPlaybackState == MusicRepository.STATE_PLAYING);
-
- // Build the notification object.
- mNotificationBuilder = new NotificationCompat.Builder(getApplicationContext());
- mNotificationBuilder.setSmallIcon(R.drawable.ic_play_arrow_white_24dp);
- mNotificationBuilder.setTicker(text);
- mNotificationBuilder.setWhen(System.currentTimeMillis());
- mNotificationBuilder.setContentTitle("RandomMusicPlayer");
- mNotificationBuilder.setContentText(text);
- mNotificationBuilder.setContentIntent(pi);
- mNotificationBuilder.setOngoing(isPlaying);
-
- int primaryActionDrawable = isPlaying ? android.R.drawable.ic_media_pause
- : android.R.drawable.ic_media_play;
- PendingIntent primaryActionIntent = isPlaying
- ? PendingIntent.getService(this, 12,
- new Intent(this, MusicService.class).setAction(ACTION_PAUSE), 0)
- : PendingIntent.getService(this, 13,
- new Intent(this, MusicService.class).setAction(ACTION_PLAY), 0);
- String primaryActionName = isPlaying ? "pause" : "play";
-
- mNotificationBuilder.addAction(android.R.drawable.ic_media_previous, "previous",
- PendingIntent.getService(this, 10,
- new Intent(this, MusicService.class).setAction(ACTION_PREV), 0));
- mNotificationBuilder.addAction(primaryActionDrawable, primaryActionName,
- primaryActionIntent);
- mNotificationBuilder.addAction(android.R.drawable.ic_media_next, "next",
- PendingIntent.getService(this, 11,
- new Intent(this, MusicService.class).setAction(ACTION_NEXT), 0));
-
- mNotificationBuilder.setStyle(new NotificationCompat.MediaStyle()
- .setShowActionsInCompactView(0, 1, 2)
- .setMediaSession(mMediaSession.getSessionToken()));
- }
-
- private void updateNotification() {
- if (mCurrPlaybackState == MusicRepository.STATE_INITIAL) {
- return;
- }
-
- if (mNotificationBuilder == null) {
- // This is the very first time we're creating our ongoing notification, and marking
- // the service to be in the foreground.
- populateNotificationBuilderContent("Initializing...");
- startForeground(NOTIFICATION_ID, mNotificationBuilder.build());
- return;
- }
-
- TrackMetadata currTrack = mTracks.get(mCurrActiveTrackIndex);
- populateNotificationBuilderContent(currTrack.getTitle()
- + " by " + currTrack.getArtist());
- mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build());
- }
-
- private void updateAudioMetadata() {
- if (mCurrPlaybackState == MusicRepository.STATE_INITIAL) {
- return;
- }
- Bitmap albumArt = BitmapFactory.decodeResource(getResources(), R.drawable.nougat_bg_2x);
- // Update the current metadata
- TrackMetadata current = mTracks.get(mCurrActiveTrackIndex);
- mMediaSession.setMetadata(new MediaMetadataCompat.Builder()
- .putBitmap(MediaMetadataCompat.METADATA_KEY_ALBUM_ART, albumArt)
- .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, current.getArtist())
- .putString(MediaMetadataCompat.METADATA_KEY_TITLE, "Track #" + current.getTitle())
- .build());
- }
-
- @Nullable
- @Override
- public IBinder onBind(Intent intent) {
- super.onBind(intent);
- return null;
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- if (mMediaPlayer != null) {
- mMediaPlayer.release();
- mNotificationManager.cancel(NOTIFICATION_ID);
- stopForeground(true);
- }
- }
-}
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/adapter/MusicTrackListAdapter.java b/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/adapter/MusicTrackListAdapter.java
deleted file mode 100644
index dd03302..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/java/com/android/sample/musicplayer/adapter/MusicTrackListAdapter.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2016 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.android.sample.musicplayer.adapter;
-
-import android.databinding.DataBindingUtil;
-import android.support.v7.widget.RecyclerView;
-import android.support.v7.widget.RecyclerView.Adapter;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.android.sample.musicplayer.MusicRepository;
-import com.android.sample.musicplayer.MusicRepository.TrackMetadata;
-import com.android.sample.musicplayer.R;
-import com.android.sample.musicplayer.databinding.MainRowBinding;
-
-import java.util.List;
-
-/**
- * Adapter for the list of music tracks.
- */
-public class MusicTrackListAdapter extends Adapter<MusicTrackListAdapter.TrackBindingHolder> {
- private List<TrackMetadata> mTracks;
- private int mActiveTrackIndex;
-
- /**
- * Holder for the track row.
- */
- public static class TrackBindingHolder extends RecyclerView.ViewHolder {
- private MainRowBinding mViewDataBinding;
-
- public TrackBindingHolder(MainRowBinding viewDataBinding) {
- super(viewDataBinding.getRoot());
- mViewDataBinding = viewDataBinding;
- }
-
- public MainRowBinding getBinding() {
- return mViewDataBinding;
- }
- }
-
- public MusicTrackListAdapter(List<TrackMetadata> tracks) {
- mTracks = tracks;
- }
-
- @Override
- public TrackBindingHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- MainRowBinding binding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()),
- R.layout.main_row, parent, false);
- return new TrackBindingHolder(binding);
- }
-
- @Override
- public void onBindViewHolder(TrackBindingHolder holder, final int position) {
- MainRowBinding binding = holder.getBinding();
- binding.setTrack(mTracks.get(position));
- binding.setHandler(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- // Update the LiveData-wrapped current track index directly on the repository.
- // Our service observes those changes and will start the flow of preparing and
- // playing back this track.
- MusicRepository.getInstance().setTrack(position);
- }
- });
- binding.getRoot().setSelected(position == mActiveTrackIndex);
- binding.executePendingBindings();
- }
-
- @Override
- public int getItemCount() {
- return mTracks.size();
- }
-
- public void setActiveTrackIndex(int activeTrackIndex) {
- if (mActiveTrackIndex != activeTrackIndex) {
- int previousActiveTrackIndex = mActiveTrackIndex;
- mActiveTrackIndex = activeTrackIndex;
- notifyItemChanged(previousActiveTrackIndex);
- notifyItemChanged(mActiveTrackIndex);
- }
- }
-}
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_24dp.png
deleted file mode 100644
index 4d2ea05..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_36dp.png
deleted file mode 100644
index 1d02439..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_pause_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png
deleted file mode 100644
index 57c9fa5..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png
deleted file mode 100644
index 29adeed..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-hdpi/ic_play_arrow_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_24dp.png
deleted file mode 100644
index 2272d47..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_36dp.png
deleted file mode 100644
index 4d2ea05..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_pause_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png
deleted file mode 100644
index c61e948..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png
deleted file mode 100644
index 57c9fa5..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-mdpi/ic_play_arrow_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_24dp.png
deleted file mode 100644
index f49aed7..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_36dp.png
deleted file mode 100644
index 7192ad4..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_pause_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png
deleted file mode 100644
index a3c80e7..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png
deleted file mode 100644
index 547ef30..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xhdpi/ic_play_arrow_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_24dp.png
deleted file mode 100644
index 7192ad4..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_36dp.png
deleted file mode 100644
index a03bad2..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_pause_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png
deleted file mode 100644
index 547ef30..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png
deleted file mode 100644
index 23bb1ba..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxhdpi/ic_play_arrow_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_24dp.png
deleted file mode 100644
index 660ac65..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_36dp.png
deleted file mode 100644
index 3ea7e03..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_pause_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png
deleted file mode 100644
index be5c062..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png
deleted file mode 100644
index 2745c3a..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_36dp.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/nougat_bg_2x.jpg b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/nougat_bg_2x.jpg
deleted file mode 100644
index 5c7295e..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/nougat_bg_2x.jpg
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/row_selector.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/row_selector.xml
deleted file mode 100644
index f2736f4a..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/drawable/row_selector.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:drawable="@color/currentTrack" android:state_selected="true"/>
- <item android:drawable="@android:color/transparent" android:state_selected="false"/>
-</selector>
\ No newline at end of file
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/activity_main.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 961b1da..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<android.support.design.widget.CoordinatorLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:fitsSystemWindows="true"
- tools:context="com.android.sample.musicplayer.MainActivity">
-
- <android.support.design.widget.AppBarLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:theme="@style/AppTheme.AppBarOverlay">
-
- <android.support.v7.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- android:background="?attr/colorPrimary"
- app:popupTheme="@style/AppTheme.PopupOverlay"/>
-
- </android.support.design.widget.AppBarLayout>
-
- <include layout="@layout/content_main"/>
-
- <android.support.design.widget.FloatingActionButton
- android:id="@+id/fab"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom|end"
- android:layout_margin="@dimen/fab_margin"
- app:srcCompat="@drawable/ic_play_arrow_white_36dp"/>
-
-</android.support.design.widget.CoordinatorLayout>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/content_main.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/layout/content_main.xml
deleted file mode 100644
index 7da0c97..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/content_main.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<android.support.v7.widget.RecyclerView
- android:id="@+id/recycler"
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layout_behavior="@string/appbar_scrolling_view_behavior"
- tools:context="com.android.sample.musicplayer.MainActivity"
- tools:showIn="@layout/activity_main" />
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/main_row.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/layout/main_row.xml
deleted file mode 100644
index 7d38dd6..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/layout/main_row.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<layout xmlns:android="http://schemas.android.com/apk/res/android">
- <data>
- <import type="java.lang.Integer"/>
- <variable name="track" type="com.android.sample.musicplayer.MusicRepository.TrackMetadata"/>
- <variable name="handler" type="android.view.View.OnClickListener"/>
- </data>
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@drawable/row_selector"
- android:clickable="true"
- android:focusable="true"
- android:onClick="@{handler}"
- android:padding="8dp">
- <TextView
- android:id="@+id/index"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:paddingLeft="8dp"
- android:paddingRight="16dp"
- android:text="@{Integer.toString(track.index)}"
- android:textAppearance="@style/TextAppearance.AppCompat.Large"/>
- <TextView
- android:id="@+id/title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@id/index"
- android:text="@{track.title}"
- android:textAppearance="@style/TextAppearance.AppCompat.Small"
- android:textColor="#222"/>
- <TextView
- android:id="@+id/artist"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/title"
- android:layout_toRightOf="@id/index"
- android:text="@{track.artist}"
- android:textAppearance="@style/TextAppearance.AppCompat.Small"
- android:textColor="#666"/>
- </RelativeLayout>
-</layout>
-
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index cde69bc..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index c133a0c..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index bfa42f0..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 324e72c..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index aee44e1..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track1.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track1.mp3
deleted file mode 100644
index ec6668b..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track1.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track2.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track2.mp3
deleted file mode 100644
index b91854b..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track2.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track3.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track3.mp3
deleted file mode 100644
index 4d765e1..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track3.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track4.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track4.mp3
deleted file mode 100644
index e4e0320..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track4.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track5.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track5.mp3
deleted file mode 100644
index 412e21a..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track5.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track6.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track6.mp3
deleted file mode 100644
index b82bb02..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track6.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track7.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track7.mp3
deleted file mode 100644
index cb42ec0..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track7.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track8.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track8.mp3
deleted file mode 100644
index 37dd232..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track8.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track9.mp3 b/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track9.mp3
deleted file mode 100644
index 3c99c3a..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/raw/track9.mp3
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values-v21/styles.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values-v21/styles.xml
deleted file mode 100644
index 6b23c86..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values-v21/styles.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<resources>
- <style name="AppTheme.NoActionBar">
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
- <item name="android:windowDrawsSystemBarBackgrounds">true</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- </style>
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values-w820dp/dimens.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values-w820dp/dimens.xml
deleted file mode 100644
index 63fc816..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values-w820dp/dimens.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<resources>
- <!-- Example customization of dimensions originally defined in res/values/dimens.xml
- (such as screen margins) for screens with more than 820dp of available width. This
- would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
- <dimen name="activity_horizontal_margin">64dp</dimen>
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values/colors.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values/colors.xml
deleted file mode 100644
index de13610..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
- <color name="colorPrimary">#3F51B5</color>
- <color name="colorPrimaryDark">#303F9F</color>
- <color name="colorAccent">#FFAB00</color>
-
- <color name="currentTrack">#64FFDA</color>
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values/dimens.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 812cb7b..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<resources>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
- <dimen name="fab_margin">16dp</dimen>
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values/strings.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values/strings.xml
deleted file mode 100644
index 4ca3fbf..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<resources>
- <string name="app_name">MusicPlayer</string>
- <string name="action_settings">Settings</string>
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/app/src/main/res/values/styles.xml b/samples-flatfoot/MusicPlayer/app/src/main/res/values/styles.xml
deleted file mode 100644
index 16dbab3..0000000
--- a/samples-flatfoot/MusicPlayer/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<resources>
-
- <!-- Base application theme. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
- <style name="AppTheme.NoActionBar">
- <item name="windowActionBar">false</item>
- <item name="windowNoTitle">true</item>
- </style>
- <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
- <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
-
-</resources>
diff --git a/samples-flatfoot/MusicPlayer/build.gradle b/samples-flatfoot/MusicPlayer/build.gradle
deleted file mode 100644
index 5d6aefc..0000000
--- a/samples-flatfoot/MusicPlayer/build.gradle
+++ /dev/null
@@ -1,32 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.2.3'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-ext.flatfootVersion = "1.0-SNAPSHOT"
-ext.supportLibVersion = "26.0.0-SNAPSHOT"
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url "file://Volumes/android/appToolkitRepository/"
- }
- maven {
- url "file://Volumes/android/m2repository/"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/samples-flatfoot/MusicPlayer/gradle.properties b/samples-flatfoot/MusicPlayer/gradle.properties
deleted file mode 100644
index aac7c9b..0000000
--- a/samples-flatfoot/MusicPlayer/gradle.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 04e285f..0000000
--- a/samples-flatfoot/MusicPlayer/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Mon Dec 28 10:00:20 PST 2015
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
diff --git a/samples-flatfoot/MusicPlayer/gradlew b/samples-flatfoot/MusicPlayer/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/MusicPlayer/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/MusicPlayer/gradlew.bat b/samples-flatfoot/MusicPlayer/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/MusicPlayer/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/MusicPlayer/settings.gradle b/samples-flatfoot/MusicPlayer/settings.gradle
deleted file mode 100644
index e7b4def..0000000
--- a/samples-flatfoot/MusicPlayer/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app'
diff --git a/samples-flatfoot/PersistenceSample/.gitignore b/samples-flatfoot/PersistenceSample/.gitignore
deleted file mode 100644
index c33eb5b..0000000
--- a/samples-flatfoot/PersistenceSample/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-build/
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/PersistenceSample/CONTRIBUTING.md b/samples-flatfoot/PersistenceSample/CONTRIBUTING.md
deleted file mode 100644
index 7b86f95..0000000
--- a/samples-flatfoot/PersistenceSample/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# How to become a contributor and submit your own code
-
-## Contributor License Agreements
-
-We'd love to accept your sample apps and patches! Before we can take them, we
-have to jump a couple of legal hurdles.
-
-Please fill out either the individual or corporate Contributor License Agreement (CLA).
-
- * If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an [individual CLA]
- (https://cla.developers.google.com).
- * If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a [corporate CLA]
- (https://cla.developers.google.com).
- * Please make sure you sign both, Android and Google CLA
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it. Once we receive it, we'll be able to
-accept your pull requests.
-
-## Contributing A Patch
-
-1. Submit an issue describing your proposed change to the repo in question.
-1. The repo owner will respond to your issue promptly.
-1. If your proposed change is accepted, and you haven't already done so, sign a
- Contributor License Agreement (see details above).
-1. Fork the desired repo, develop and test your code changes.
-1. Ensure that your code adheres to the existing style in the sample to which
- you are contributing. Refer to the
- [Android Code Style Guide]
- (https://source.android.com/source/code-style.html) for the
- recommended coding standards for this organization.
-1. Ensure that your code has an appropriate set of unit tests which all pass.
-1. Submit a pull request.
diff --git a/samples-flatfoot/PersistenceSample/LICENSE b/samples-flatfoot/PersistenceSample/LICENSE
deleted file mode 100644
index 1af981f..0000000
--- a/samples-flatfoot/PersistenceSample/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2014 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.
diff --git a/samples-flatfoot/PersistenceSample/app/build.gradle b/samples-flatfoot/PersistenceSample/app/build.gradle
deleted file mode 100644
index 41b73e6..0000000
--- a/samples-flatfoot/PersistenceSample/app/build.gradle
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion rootProject.buildToolsVersion
- defaultConfig {
- applicationId 'com.example.android.persistence'
- minSdkVersion 21
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- dataBinding {
- enabled = true
- }
- productFlavors {
- }
-
- lintOptions {
- abortOnError false
- }
-
-}
-
-dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- compile 'com.android.support:appcompat-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:cardview-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion;
- compile 'android.arch.lifecycle:extensions:1.0-SNAPSHOT'
- compile 'android.arch.persistence.room:runtime:1.0-SNAPSHOT'
- annotationProcessor "android.arch.lifecycle:compiler:1.0-SNAPSHOT"
- annotationProcessor "android.arch.persistence.room:compiler:1.0-SNAPSHOT"
-
- testCompile 'junit:junit:4.12'
-
- // Testing-only dependencies
- androidTestCompile 'com.android.support.test:runner:' + rootProject.runnerVersion;
- androidTestCompile 'com.android.support.test:rules:' + rootProject.rulesVersion;
- androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion;
-
- androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2'){
- exclude group: 'com.android.support', module: 'appcompat-v7'
- exclude group: 'com.android.support', module: 'support-v4'
- exclude module: 'recyclerview-v7'
- }
-
- // Force usage of dependencies in the test app, since it is internally used by the runner module.
- androidTestCompile 'com.android.support:support-annotations:' + rootProject.supportLibVersion;
- androidTestCompile 'com.android.support:support-v4:' + rootProject.supportLibVersion;
- androidTestCompile 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion;
-}
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/proguard-rules.pro b/samples-flatfoot/PersistenceSample/app/proguard-rules.pro
deleted file mode 100644
index 4cb7103..0000000
--- a/samples-flatfoot/PersistenceSample/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /usr/local/google/home/jalc/sw/android-sdks/android-sdk-linux/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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/samples-flatfoot/PersistenceSample/app/src/androidTest/java/com/example/android/persistence/MainActivityTest.java b/samples-flatfoot/PersistenceSample/app/src/androidTest/java/com/example/android/persistence/MainActivityTest.java
deleted file mode 100644
index b9b899c..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/androidTest/java/com/example/android/persistence/MainActivityTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright 2017, 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.persistence;
-
-
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.support.annotation.Nullable;
-import android.support.test.espresso.Espresso;
-import android.support.test.espresso.IdlingResource;
-import android.support.test.espresso.contrib.RecyclerViewActions;
-import android.support.test.rule.ActivityTestRule;
-import android.support.v4.app.Fragment;
-
-import com.example.android.persistence.db.entity.ProductEntity;
-import com.example.android.persistence.viewmodel.ProductListViewModel;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static android.support.test.espresso.Espresso.onView;
-import static android.support.test.espresso.action.ViewActions.click;
-import static android.support.test.espresso.assertion.ViewAssertions.matches;
-import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
-import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
-import static android.support.test.espresso.matcher.ViewMatchers.withText;
-import static org.hamcrest.core.IsNot.not;
-
-public class MainActivityTest {
-
- @Rule
- public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(
- MainActivity.class);
-
- private SimpleIdlingResource idlingRes = new SimpleIdlingResource();
-
- @Before
- public void idlingResourceSetup() {
-
- Espresso.registerIdlingResources(idlingRes);
- // There's always
- idlingRes.setIdleNow(false);
-
- ProductListViewModel productListViewModel = getProductListViewModel();
-
- // Subscribe to ProductListViewModel's products list observable to figure out when the
- // app is idle.
- productListViewModel.getProducts().observeForever(new Observer<List<ProductEntity>>() {
- @Override
- public void onChanged(@Nullable List<ProductEntity> productEntities) {
- if (productEntities != null) {
- idlingRes.setIdleNow(true);
- }
- }
- });
- }
-
- @Test
- public void clickOnFirstItem_opensComments() {
- // When clicking on the first product
- onView(withContentDescription(R.string.cd_products_list))
- .perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));
-
- // Then the second screen with the comments should appear.
- onView(withContentDescription(R.string.cd_comments_list))
- .check(matches(isDisplayed()));
-
- // Then the second screen with the comments should appear.
- onView(withContentDescription(R.string.cd_product_name))
- .check(matches(not(withText(""))));
-
- }
-
- /** Gets the ViewModel for the current fragment */
- private ProductListViewModel getProductListViewModel() {
- MainActivity activity = mActivityRule.getActivity();
-
- Fragment productListFragment = activity.getSupportFragmentManager()
- .findFragmentByTag(ProductListFragment.TAG);
-
- return ViewModelProviders.of(productListFragment)
- .get(ProductListViewModel.class);
- }
-
- private static class SimpleIdlingResource implements IdlingResource {
-
- // written from main thread, read from any thread.
- private volatile ResourceCallback mResourceCallback;
-
- private AtomicBoolean mIsIdleNow = new AtomicBoolean(true);
-
- public void setIdleNow(boolean idleNow) {
- mIsIdleNow.set(idleNow);
- if (idleNow) {
- mResourceCallback.onTransitionToIdle();
- }
- }
-
- @Override
- public String getName() {
- return "Simple idling resource";
- }
-
- @Override
- public boolean isIdleNow() {
- return mIsIdleNow.get();
- }
-
- @Override
- public void registerIdleTransitionCallback(ResourceCallback callback) {
- mResourceCallback = callback;
- }
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/AndroidManifest.xml b/samples-flatfoot/PersistenceSample/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 322d957..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.persistence">
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
- <uses-feature android:name="android.hardware.location.gps" />
-
- <application
- android:allowBackup="false"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity android:name="com.example.android.persistence.MainActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/MainActivity.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/MainActivity.java
deleted file mode 100644
index aee8255..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/MainActivity.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2017, 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.persistence;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.persistence.model.Product;
-
-public class MainActivity extends LifecycleActivity {
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main_activity);
-
- // Add product list fragment if this is first creation
- if (savedInstanceState == null) {
- ProductListFragment fragment = new ProductListFragment();
-
- getSupportFragmentManager().beginTransaction()
- .add(R.id.fragment_container, fragment, ProductListFragment.TAG).commit();
- }
- }
-
- /** Shows the product detail fragment */
- public void show(Product product) {
-
- ProductFragment productFragment = ProductFragment.forProduct(product.getId());
-
- getSupportFragmentManager()
- .beginTransaction()
- .addToBackStack("product")
- .replace(R.id.fragment_container,
- productFragment, null).commit();
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductFragment.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductFragment.java
deleted file mode 100644
index 53dbcbb..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductFragment.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright 2017, 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.persistence;
-
-import android.arch.lifecycle.LifecycleFragment;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.example.android.persistence.databinding.ProductFragmentBinding;
-import com.example.android.persistence.db.entity.CommentEntity;
-import com.example.android.persistence.db.entity.ProductEntity;
-import com.example.android.persistence.model.Comment;
-import com.example.android.persistence.ui.CommentAdapter;
-import com.example.android.persistence.ui.CommentClickCallback;
-import com.example.android.persistence.viewmodel.ProductViewModel;
-
-import java.util.List;
-
-public class ProductFragment extends LifecycleFragment {
-
- private static final String KEY_PRODUCT_ID = "product_id";
-
- private ProductFragmentBinding mBinding;
-
- private CommentAdapter mCommentAdapter;
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- // Inflate this data binding layout
- mBinding = DataBindingUtil.inflate(inflater, R.layout.product_fragment, container, false);
-
- // Create and set the adapter for the RecyclerView.
- mCommentAdapter = new CommentAdapter(mCommentClickCallback);
- mBinding.commentList.setAdapter(mCommentAdapter);
- return mBinding.getRoot();
- }
-
- private final CommentClickCallback mCommentClickCallback = new CommentClickCallback() {
- @Override
- public void onClick(Comment comment) {
- // no-op
-
- }
- };
-
- @Override
- public void onActivityCreated(@Nullable Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- ProductViewModel.Factory factory = new ProductViewModel.Factory(
- getActivity().getApplication(), getArguments().getInt(KEY_PRODUCT_ID));
-
- final ProductViewModel model = ViewModelProviders.of(this, factory)
- .get(ProductViewModel.class);
-
- mBinding.setProductViewModel(model);
-
- subscribeToModel(model);
- }
-
- private void subscribeToModel(final ProductViewModel model) {
-
- model.getComments().observe(this, new Observer<List<CommentEntity>>() {
- @Override
- public void onChanged(@Nullable List<CommentEntity> commentEntities) {
- if (commentEntities != null) {
- mBinding.setIsLoading(false);
- mCommentAdapter.setCommentList(commentEntities);
- } else {
- mBinding.setIsLoading(true);
- }
- }
- });
-
- model.getObservableProduct().observe(this, new Observer<ProductEntity>() {
- @Override
- public void onChanged(@Nullable ProductEntity productEntity) {
- model.setProduct(productEntity);
- }
- });
- }
-
- /** Creates product fragment for specific product ID */
- public static ProductFragment forProduct(int productId) {
- ProductFragment fragment = new ProductFragment();
- Bundle args = new Bundle();
- args.putInt(KEY_PRODUCT_ID, productId);
- fragment.setArguments(args);
- return fragment;
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductListFragment.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductListFragment.java
deleted file mode 100644
index 772bc9c..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ProductListFragment.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017, 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.persistence;
-
-import android.arch.lifecycle.Lifecycle;
-import android.arch.lifecycle.LifecycleFragment;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.databinding.DataBindingUtil;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import com.example.android.persistence.databinding.ListFragmentBinding;
-import com.example.android.persistence.db.entity.ProductEntity;
-import com.example.android.persistence.model.Product;
-import com.example.android.persistence.ui.ProductAdapter;
-import com.example.android.persistence.ui.ProductClickCallback;
-import com.example.android.persistence.viewmodel.ProductListViewModel;
-
-import java.util.List;
-
-public class ProductListFragment extends LifecycleFragment {
-
- public static final String TAG = "ProductListViewModel";
-
- private ProductAdapter mProductAdapter;
-
- private ListFragmentBinding mBinding;
-
- @Nullable
- @Override
- public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
- @Nullable Bundle savedInstanceState) {
- mBinding = DataBindingUtil.inflate(inflater, R.layout.list_fragment, container, false);
-
- mProductAdapter = new ProductAdapter(mProductClickCallback);
- mBinding.productsList.setAdapter(mProductAdapter);
-
- return mBinding.getRoot();
- }
-
- @Override
- public void onActivityCreated(@Nullable Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- final ProductListViewModel viewModel =
- ViewModelProviders.of(this).get(ProductListViewModel.class);
-
- subscribeUi(viewModel);
- }
-
- private void subscribeUi(ProductListViewModel viewModel) {
- // Update the list when the data changes
- viewModel.getProducts().observe(this, new Observer<List<ProductEntity>>() {
- @Override
- public void onChanged(@Nullable List<ProductEntity> myProducts) {
- if (myProducts != null) {
- mBinding.setIsLoading(false);
- mProductAdapter.setProductList(myProducts);
- } else {
- mBinding.setIsLoading(true);
- }
- }
- });
- }
-
- private final ProductClickCallback mProductClickCallback = new ProductClickCallback() {
- @Override
- public void onClick(Product product) {
-
- if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
- ((MainActivity) getActivity()).show(product);
- }
- }
- };
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/AppDatabase.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/AppDatabase.java
deleted file mode 100644
index ce0afe4..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/AppDatabase.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.RoomDatabase;
-import android.arch.persistence.room.TypeConverters;
-
-import com.example.android.persistence.db.dao.CommentDao;
-import com.example.android.persistence.db.dao.ProductDao;
-import com.example.android.persistence.db.entity.CommentEntity;
-import com.example.android.persistence.db.entity.ProductEntity;
-import com.example.android.persistence.db.converter.DateConverter;
-
-@Database(entities = {ProductEntity.class, CommentEntity.class}, version = 1)
-@TypeConverters(DateConverter.class)
-public abstract class AppDatabase extends RoomDatabase {
-
- static final String DATABASE_NAME = "basic-sample-db";
-
- public abstract ProductDao productDao();
-
- public abstract CommentDao commentDao();
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseCreator.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseCreator.java
deleted file mode 100644
index 5ecb884..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseCreator.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.persistence.room.Room;
-import android.content.Context;
-import android.os.AsyncTask;
-import android.support.annotation.Nullable;
-import android.util.Log;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static com.example.android.persistence.db.AppDatabase.DATABASE_NAME;
-
-/**
- * Creates the {@link AppDatabase} asynchronously, exposing a LiveData object to notify of creation.
- */
-public class DatabaseCreator {
-
- private static DatabaseCreator sInstance;
-
- private final MutableLiveData<Boolean> mIsDatabaseCreated = new MutableLiveData<>();
-
- private AppDatabase mDb;
-
- private final AtomicBoolean mInitializing = new AtomicBoolean(true);
-
- // For Singleton instantiation
- private static final Object LOCK = new Object();
-
- public synchronized static DatabaseCreator getInstance(Context context) {
- if (sInstance == null) {
- synchronized (LOCK) {
- if (sInstance == null) {
- sInstance = new DatabaseCreator();
- }
- }
- }
- return sInstance;
- }
-
- /** Used to observe when the database initialization is done */
- public LiveData<Boolean> isDatabaseCreated() {
- return mIsDatabaseCreated;
- }
-
- @Nullable
- public AppDatabase getDatabase() {
- return mDb;
- }
-
- /**
- * Creates or returns a previously-created database.
- * <p>
- * Although this uses an AsyncTask which currently uses a serial executor, it's thread-safe.
- */
- public void createDb(Context context) {
-
- Log.d("DatabaseCreator", "Creating DB from " + Thread.currentThread().getName());
-
- if (!mInitializing.compareAndSet(true, false)) {
- return; // Already initializing
- }
-
- mIsDatabaseCreated.setValue(false);// Trigger an update to show a loading screen.
- new AsyncTask<Context, Void, Void>() {
-
- @Override
- protected Void doInBackground(Context... params) {
- Log.d("DatabaseCreator",
- "Starting bg job " + Thread.currentThread().getName());
-
- Context context = params[0].getApplicationContext();
-
- // Reset the database to have new data on every run.
- context.deleteDatabase(DATABASE_NAME);
-
- // Build the database!
- AppDatabase db = Room.databaseBuilder(context.getApplicationContext(),
- AppDatabase.class, DATABASE_NAME).build();
-
- // Add a delay to simulate a long-running operation
- addDelay();
-
- // Add some data to the database
- DatabaseInitUtil.initializeDb(db);
- Log.d("DatabaseCreator",
- "DB was populated in thread " + Thread.currentThread().getName());
-
- mDb = db;
- return null;
- }
-
- @Override
- protected void onPostExecute(Void ignored) {
- // Now on the main thread, notify observers that the db is created and ready.
- mIsDatabaseCreated.setValue(true);
- }
- }.execute(context.getApplicationContext());
- }
-
- private void addDelay() {
- try {
- Thread.sleep(4000);
- } catch (InterruptedException ignored) {}
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseInitUtil.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseInitUtil.java
deleted file mode 100644
index c68fe8f..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/DatabaseInitUtil.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db;
-
-import com.example.android.persistence.db.entity.CommentEntity;
-import com.example.android.persistence.db.entity.ProductEntity;
-import com.example.android.persistence.model.Product;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-import java.util.concurrent.TimeUnit;
-
-/** Generates dummy data and inserts them into the database */
-class DatabaseInitUtil {
-
- private static final String[] FIRST = new String[]{
- "Special edition", "New", "Cheap", "Quality", "Used"};
- private static final String[] SECOND = new String[]{
- "Three-headed Monkey", "Rubber Chicken", "Pint of Grog", "Monocle"};
- private static final String[] DESCRIPTION = new String[]{
- "is finally here", "is recommended by Stan S. Stanman",
- "is the best sold product on Mêlée Island", "is \uD83D\uDCAF", "is ❤️", "is fine"};
- private static final String[] COMMENTS = new String[]{
- "Comment 1", "Comment 2", "Comment 3", "Comment 4", "Comment 5", "Comment 6",
- };
-
- static void initializeDb(AppDatabase db) {
- List<ProductEntity> products = new ArrayList<>(FIRST.length * SECOND.length);
- List<CommentEntity> comments = new ArrayList<>();
-
- generateData(products, comments);
-
- insertData(db, products, comments);
- }
-
- private static void generateData(List<ProductEntity> products, List<CommentEntity> comments) {
- Random rnd = new Random();
- for (int i = 0; i < FIRST.length; i++) {
- for (int j = 0; j < SECOND.length; j++) {
- ProductEntity product = new ProductEntity();
- product.setName(FIRST[i] + " " + SECOND[j]);
- product.setDescription(product.getName() + " " + DESCRIPTION[j]);
- product.setPrice(rnd.nextInt(240));
- product.setId(FIRST.length * i + j + 1);
- products.add(product);
- }
- }
-
- for (Product product : products) {
- int commentsNumber = rnd.nextInt(5) + 1;
- for (int i = 0; i < commentsNumber; i++) {
- CommentEntity comment = new CommentEntity();
- comment.setProductId(product.getId());
- comment.setText(COMMENTS[i] + " for " + product.getName());
- comment.setPostedAt(new Date(System.currentTimeMillis()
- - TimeUnit.DAYS.toMillis(commentsNumber - i) + TimeUnit.HOURS.toMillis(i)));
- comments.add(comment);
- }
- }
- }
-
- private static void insertData(AppDatabase db, List<ProductEntity> products, List<CommentEntity> comments) {
- db.beginTransaction();
- try {
- db.productDao().insertAll(products);
- db.commentDao().insertAll(comments);
- db.setTransactionSuccessful();
- } finally {
- db.endTransaction();
- }
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/converter/DateConverter.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/converter/DateConverter.java
deleted file mode 100644
index da5fe22..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/converter/DateConverter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db.converter;
-
-import android.arch.persistence.room.TypeConverter;
-
-import java.util.Date;
-
-public class DateConverter {
- @TypeConverter
- public static Date toDate(Long timestamp) {
- return timestamp == null ? null : new Date(timestamp);
- }
-
- @TypeConverter
- public static Long toTimestamp(Date date) {
- return date == null ? null : date.getTime();
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/CommentDao.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/CommentDao.java
deleted file mode 100644
index b351526..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/CommentDao.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db.dao;
-
-
-import android.arch.lifecycle.LiveData;
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.OnConflictStrategy;
-import android.arch.persistence.room.Query;
-
-import com.example.android.persistence.db.entity.CommentEntity;
-
-import java.util.List;
-
-@Dao
-public interface CommentDao {
- @Query("SELECT * FROM comments where productId = :productId")
- LiveData<List<CommentEntity>> loadComments(int productId);
-
- @Query("SELECT * FROM comments where productId = :productId")
- List<CommentEntity> loadCommentsSync(int productId);
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertAll(List<CommentEntity> products);
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/ProductDao.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/ProductDao.java
deleted file mode 100644
index 39407d06..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/dao/ProductDao.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db.dao;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.OnConflictStrategy;
-import android.arch.persistence.room.Query;
-
-import com.example.android.persistence.db.entity.ProductEntity;
-
-import java.util.List;
-
-@Dao
-public interface ProductDao {
- @Query("SELECT * FROM products")
- LiveData<List<ProductEntity>> loadAllProducts();
-
- @Insert(onConflict = OnConflictStrategy.REPLACE)
- void insertAll(List<ProductEntity> products);
-
- @Query("select * from products where id = :productId")
- LiveData<ProductEntity> loadProduct(int productId);
-
- @Query("select * from products where id = :productId")
- ProductEntity loadProductSync(int productId);
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/CommentEntity.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/CommentEntity.java
deleted file mode 100644
index e3d5702..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/CommentEntity.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db.entity;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.ForeignKey;
-import android.arch.persistence.room.Index;
-import android.arch.persistence.room.PrimaryKey;
-import com.example.android.persistence.model.Comment;
-
-import java.util.Date;
-
-@Entity(tableName = "comments", foreignKeys = {
- @ForeignKey(entity = ProductEntity.class,
- parentColumns = "id",
- childColumns = "productId",
- onDelete = ForeignKey.CASCADE)}, indices = {
- @Index(value = "productId")
-})
-public class CommentEntity implements Comment {
- @PrimaryKey(autoGenerate = true)
- private int id;
- private int productId;
- private String text;
- private Date postedAt;
-
- @Override
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- @Override
- public int getProductId() {
- return productId;
- }
-
- public void setProductId(int productId) {
- this.productId = productId;
- }
-
- @Override
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- @Override
- public Date getPostedAt() {
- return postedAt;
- }
-
- public void setPostedAt(Date postedAt) {
- this.postedAt = postedAt;
- }
-
- public CommentEntity() {
- }
-
- public CommentEntity(Comment comment) {
- id = comment.getId();
- productId = comment.getProductId();
- text = comment.getText();
- postedAt = comment.getPostedAt();
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/ProductEntity.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/ProductEntity.java
deleted file mode 100644
index af1b79a..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/db/entity/ProductEntity.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.db.entity;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-import com.example.android.persistence.model.Product;
-
-@Entity(tableName = "products")
-public class ProductEntity implements Product {
- @PrimaryKey
- private int id;
- private String name;
- private String description;
- private int price;
-
- @Override
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public int getPrice() {
- return price;
- }
-
- public void setPrice(int price) {
- this.price = price;
- }
-
- public ProductEntity() {
- }
-
- public ProductEntity(Product product) {
- this.id = product.getId();
- this.name = product.getName();
- this.description = product.getDescription();
- this.price = product.getPrice();
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Comment.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Comment.java
deleted file mode 100644
index c3483a4..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Comment.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.model;
-
-import java.util.Date;
-
-public interface Comment {
- int getId();
- int getProductId();
- String getText();
- Date getPostedAt();
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Product.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Product.java
deleted file mode 100644
index 72e4276..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/model/Product.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.model;
-
-public interface Product {
- int getId();
- String getName();
- String getDescription();
- int getPrice();
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/BindingAdapters.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/BindingAdapters.java
deleted file mode 100644
index 0b90335..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/BindingAdapters.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.ui;
-
-import android.databinding.BindingAdapter;
-import android.view.View;
-
-
-public class BindingAdapters {
- @BindingAdapter("visibleGone")
- public static void showHide(View view, boolean show) {
- view.setVisibility(show ? View.VISIBLE : View.GONE);
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentAdapter.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentAdapter.java
deleted file mode 100644
index 24e0ecb..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentAdapter.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.ui;
-
-import android.databinding.DataBindingUtil;
-import android.support.annotation.Nullable;
-import android.support.v7.util.DiffUtil;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import com.example.android.persistence.databinding.CommentItemBinding;
-import com.example.android.persistence.model.Comment;
-import com.example.android.persistence.R;
-
-import java.util.List;
-import java.util.Objects;
-
-public class CommentAdapter extends RecyclerView.Adapter<CommentAdapter.CommentViewHolder> {
-
- private List<? extends Comment> mCommentList;
-
- @Nullable
- private final CommentClickCallback mCommentClickCallback;
-
- public CommentAdapter(@Nullable CommentClickCallback commentClickCallback) {
- mCommentClickCallback = commentClickCallback;
- }
-
- public void setCommentList(final List<? extends Comment> comments) {
- if (mCommentList == null) {
- mCommentList = comments;
- notifyItemRangeInserted(0, comments.size());
- } else {
- DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(new DiffUtil.Callback() {
- @Override
- public int getOldListSize() {
- return mCommentList.size();
- }
-
- @Override
- public int getNewListSize() {
- return comments.size();
- }
-
- @Override
- public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
- Comment old = mCommentList.get(oldItemPosition);
- Comment comment = comments.get(newItemPosition);
- return old.getId() == comment.getId();
- }
-
- @Override
- public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
- Comment old = mCommentList.get(oldItemPosition);
- Comment comment = comments.get(newItemPosition);
- return old.getId() == comment.getId()
- && old.getPostedAt() == comment.getPostedAt()
- && old.getProductId() == comment.getProductId()
- && Objects.equals(old.getText(), comment.getText());
- }
- });
- mCommentList = comments;
- diffResult.dispatchUpdatesTo(this);
- }
- }
-
- @Override
- public CommentViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- CommentItemBinding binding = DataBindingUtil
- .inflate(LayoutInflater.from(parent.getContext()), R.layout.comment_item,
- parent, false);
- binding.setCallback(mCommentClickCallback);
- return new CommentViewHolder(binding);
- }
-
- @Override
- public void onBindViewHolder(CommentViewHolder holder, int position) {
- holder.binding.setComment(mCommentList.get(position));
- holder.binding.executePendingBindings();
- }
-
- @Override
- public int getItemCount() {
- return mCommentList == null ? 0 : mCommentList.size();
- }
-
- static class CommentViewHolder extends RecyclerView.ViewHolder {
-
- final CommentItemBinding binding;
-
- CommentViewHolder(CommentItemBinding binding) {
- super(binding.getRoot());
- this.binding = binding;
- }
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentClickCallback.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentClickCallback.java
deleted file mode 100644
index ced8065..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/CommentClickCallback.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.ui;
-
-import com.example.android.persistence.model.Comment;
-
-public interface CommentClickCallback {
- void onClick(Comment comment);
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductAdapter.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductAdapter.java
deleted file mode 100644
index e54c1ca..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductAdapter.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.ui;
-
-import android.databinding.DataBindingUtil;
-import android.support.annotation.Nullable;
-import android.support.v7.util.DiffUtil;
-import android.support.v7.widget.RecyclerView;
-import android.view.LayoutInflater;
-import android.view.ViewGroup;
-
-import com.example.android.persistence.databinding.ProductItemBinding;
-import com.example.android.persistence.model.Product;
-import com.example.android.persistence.R;
-
-import java.util.List;
-import java.util.Objects;
-
-public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.ProductViewHolder> {
-
- List<? extends Product> mProductList;
-
- @Nullable
- private final ProductClickCallback mProductClickCallback;
-
- public ProductAdapter(@Nullable ProductClickCallback clickCallback) {
- mProductClickCallback = clickCallback;
- }
-
- public void setProductList(final List<? extends Product> productList) {
- if (mProductList == null) {
- mProductList = productList;
- notifyItemRangeInserted(0, productList.size());
- } else {
- DiffUtil.DiffResult result = DiffUtil.calculateDiff(new DiffUtil.Callback() {
- @Override
- public int getOldListSize() {
- return mProductList.size();
- }
-
- @Override
- public int getNewListSize() {
- return productList.size();
- }
-
- @Override
- public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
- return mProductList.get(oldItemPosition).getId() ==
- productList.get(newItemPosition).getId();
- }
-
- @Override
- public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
- Product product = productList.get(newItemPosition);
- Product old = productList.get(oldItemPosition);
- return product.getId() == old.getId()
- && Objects.equals(product.getDescription(), old.getDescription())
- && Objects.equals(product.getName(), old.getName())
- && product.getPrice() == old.getPrice();
- }
- });
- mProductList = productList;
- result.dispatchUpdatesTo(this);
- }
- }
-
- @Override
- public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
- ProductItemBinding binding = DataBindingUtil
- .inflate(LayoutInflater.from(parent.getContext()), R.layout.product_item,
- parent, false);
- binding.setCallback(mProductClickCallback);
- return new ProductViewHolder(binding);
- }
-
- @Override
- public void onBindViewHolder(ProductViewHolder holder, int position) {
- holder.binding.setProduct(mProductList.get(position));
- holder.binding.executePendingBindings();
- }
-
- @Override
- public int getItemCount() {
- return mProductList == null ? 0 : mProductList.size();
- }
-
- static class ProductViewHolder extends RecyclerView.ViewHolder {
-
- final ProductItemBinding binding;
-
- public ProductViewHolder(ProductItemBinding binding) {
- super(binding.getRoot());
- this.binding = binding;
- }
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductClickCallback.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductClickCallback.java
deleted file mode 100644
index b8f4c6b..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/ui/ProductClickCallback.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.ui;
-
-import com.example.android.persistence.model.Product;
-
-public interface ProductClickCallback {
- void onClick(Product product);
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductListViewModel.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductListViewModel.java
deleted file mode 100644
index 8905b14..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductListViewModel.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.viewmodel;
-
-import android.app.Application;
-import android.arch.core.util.Function;
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.Transformations;
-
-import com.example.android.persistence.db.DatabaseCreator;
-import com.example.android.persistence.db.entity.ProductEntity;
-
-import java.util.List;
-
-public class ProductListViewModel extends AndroidViewModel {
-
- private static final MutableLiveData ABSENT = new MutableLiveData();
- {
- //noinspection unchecked
- ABSENT.setValue(null);
- }
-
- private final LiveData<List<ProductEntity>> mObservableProducts;
-
- public ProductListViewModel(Application application) {
- super(application);
-
- final DatabaseCreator databaseCreator = DatabaseCreator.getInstance(this.getApplication());
-
- LiveData<Boolean> databaseCreated = databaseCreator.isDatabaseCreated();
- mObservableProducts = Transformations.switchMap(databaseCreated,
- new Function<Boolean, LiveData<List<ProductEntity>>>() {
- @Override
- public LiveData<List<ProductEntity>> apply(Boolean isDbCreated) {
- if (!Boolean.TRUE.equals(isDbCreated)) { // Not needed here, but watch out for null
- //noinspection unchecked
- return ABSENT;
- } else {
- //noinspection ConstantConditions
- return databaseCreator.getDatabase().productDao().loadAllProducts();
- }
- }
- });
-
- databaseCreator.createDb(this.getApplication());
- }
-
- /**
- * Expose the LiveData Products query so the UI can observe it.
- */
- public LiveData<List<ProductEntity>> getProducts() {
- return mObservableProducts;
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductViewModel.java b/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductViewModel.java
deleted file mode 100644
index be524d5..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/java/com/example/android/persistence/viewmodel/ProductViewModel.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.viewmodel;
-
-import android.app.Application;
-import android.arch.core.util.Function;
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.Transformations;
-import android.arch.lifecycle.ViewModel;
-import android.arch.lifecycle.ViewModelProvider;
-import android.databinding.ObservableField;
-import android.support.annotation.NonNull;
-
-import com.example.android.persistence.db.DatabaseCreator;
-import com.example.android.persistence.db.entity.CommentEntity;
-import com.example.android.persistence.db.entity.ProductEntity;
-
-import java.util.List;
-
-public class ProductViewModel extends AndroidViewModel {
-
- private static final MutableLiveData ABSENT = new MutableLiveData();
-
- private final LiveData<ProductEntity> mObservableProduct;
-
- private Observer<ProductEntity> mProductObserver;
-
- public ObservableField<ProductEntity> product = new ObservableField<>();
-
- {
- //noinspection unchecked
- ABSENT.setValue(null);
- }
-
- // Product exposed for data binding
- //public final ObservableField<ProductEntity> product = new ObservableField<>();
-
- private final int mProductId;
-
- private final LiveData<List<CommentEntity>> mObservableComments;
-
- public ProductViewModel(@NonNull Application application,
- final int productId) {
- super(application);
- mProductId = productId;
-
- final DatabaseCreator databaseCreator = DatabaseCreator.getInstance(this.getApplication());
-
- mObservableComments = Transformations.switchMap(databaseCreator.isDatabaseCreated(), new Function<Boolean, LiveData<List<CommentEntity>>>() {
- @Override
- public LiveData<List<CommentEntity>> apply(Boolean isDbCreated) {
- if (!isDbCreated) {
- //noinspection unchecked
- return ABSENT;
- } else {
- //noinspection ConstantConditions
- return databaseCreator.getDatabase().commentDao().loadComments(mProductId);
- }
- }
- });
-
- mObservableProduct = Transformations.switchMap(databaseCreator.isDatabaseCreated(), new Function<Boolean, LiveData<ProductEntity>>() {
- @Override
- public LiveData<ProductEntity> apply(Boolean isDbCreated) {
- if (!isDbCreated) {
- //noinspection unchecked
- return ABSENT;
- } else {
- //noinspection ConstantConditions
- return databaseCreator.getDatabase().productDao().loadProduct(mProductId);
- }
- }
- });
-
- databaseCreator.createDb(this.getApplication());
-
- }
- /**
- * Expose the LiveData Comments query so the UI can observe it.
- */
- public LiveData<List<CommentEntity>> getComments() {
- return mObservableComments;
- }
-
- public LiveData<ProductEntity> getObservableProduct() {
- return mObservableProduct;
- }
-
- public void setProduct(ProductEntity product) {
- this.product.set(product);
- }
-
- /**
- * A creator is used to inject the product ID into the ViewModel
- * <p>
- * This creator is to showcase how to inject dependencies into ViewModels. It's not
- * actually necessary in this case, as the product ID can be passed in a public method.
- */
- public static class Factory extends ViewModelProvider.NewInstanceFactory {
-
- @NonNull
- private final Application mApplication;
-
- private final int mProductId;
-
- public Factory(@NonNull Application application, int productId) {
- mApplication = application;
- mProductId = productId;
- }
-
- @Override
- public <T extends ViewModel> T create(Class<T> modelClass) {
- //noinspection unchecked
- return (T) new ProductViewModel(mApplication, mProductId);
- }
- }
-}
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/comment_item.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/layout/comment_item.xml
deleted file mode 100644
index e1bf7f4..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/comment_item.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <variable name="comment"
- type="com.example.android.persistence.model.Comment"/>
- <variable name="callback"
- type="com.example.android.persistence.ui.CommentClickCallback"/>
- </data>
- <android.support.v7.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:cardBackgroundColor="@color/comment_light_background"
- android:layout_marginStart="@dimen/comment_horizontal_margin"
- android:layout_marginEnd="@dimen/comment_horizontal_margin"
-
- android:minHeight="@dimen/comment_minHeight"
- android:onClick="@{() -> callback.onClick(comment)}"
- android:orientation="horizontal"
- android:padding="8dp"
- app:cardUseCompatPadding="true">
- <RelativeLayout android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <TextView android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="@dimen/comment_padding"
- android:text="@{comment.text}"/>
- </RelativeLayout>
- </android.support.v7.widget.CardView>
-</layout>
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/list_fragment.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/layout/list_fragment.xml
deleted file mode 100644
index 4f1d382..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/list_fragment.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
-
- <data>
- <variable
- name="isLoading"
- type="boolean" />
- </data>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/cardview_light_background"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/loading_tv"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center_vertical|center_horizontal"
- android:text="@string/loading_products"
- android:textAlignment="center"
- app:visibleGone="@{isLoading}"/>
-
- <android.support.v7.widget.RecyclerView
- android:id="@+id/products_list"
- android:contentDescription="@string/cd_products_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layoutManager="LinearLayoutManager"
- app:visibleGone="@{!isLoading}"/>
-
- </LinearLayout>
-</layout>
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/main_activity.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/layout/main_activity.xml
deleted file mode 100644
index 29ee166..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/main_activity.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/fragment_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-</FrameLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_fragment.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_fragment.xml
deleted file mode 100644
index f80d69f..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_fragment.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
-
- <data>
-
- <import type="android.view.View"/>
-
- <variable
- name="isLoading"
- type="boolean" />
-
- <variable
- name="productViewModel"
- type="com.example.android.persistence.viewmodel.ProductViewModel"/>
- </data>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@color/cardview_light_background"
- android:orientation="vertical">
-
- <include
- layout="@layout/product_item"
- app:product="@{productViewModel.product}"/>
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:id="@+id/loading_comments_tv"
- android:text="@string/loading_comments"
- app:visibleGone="@{isLoading}"/>
-
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:id="@+id/comments_list_wrapper">
-
- <android.support.v7.widget.RecyclerView
- android:id="@+id/comment_list"
- android:contentDescription="@string/cd_comments_list"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- app:layoutManager="LinearLayoutManager"
- app:visibleGone="@{!isLoading}"/>
- </FrameLayout>
- </FrameLayout>
-
-
- </LinearLayout>
-</layout>
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_item.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_item.xml
deleted file mode 100644
index aa85489..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/layout/product_item.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<layout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
- <data>
- <variable name="product"
- type="com.example.android.persistence.model.Product"/>
- <variable name="callback"
- type="com.example.android.persistence.ui.ProductClickCallback"/>
- </data>
-
- <android.support.v7.widget.CardView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:minHeight="@dimen/product_item_min_height"
- android:onClick="@{() -> callback.onClick(product)}"
- android:orientation="horizontal"
- android:layout_marginStart="@dimen/item_horizontal_margin"
- android:layout_marginEnd="@dimen/item_horizontal_margin"
- app:cardUseCompatPadding="true">
-
- <RelativeLayout
- android:layout_marginStart="@dimen/item_horizontal_margin"
- android:layout_marginEnd="@dimen/item_horizontal_margin"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <TextView
- android:id="@+id/name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:contentDescription="@string/cd_product_name"
- android:text="@{product.name}"/>
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_marginEnd="5dp"
- android:text="@{@string/product_price(product.price)}"/>
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/name"
- android:text="@{product.description}"/>
- </RelativeLayout>
-
- </android.support.v7.widget.CardView>
-</layout>
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index e19d44f..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 7876250..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 9ae3725..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 6a6c3aa..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 43ca523..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/values/colors.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/values/colors.xml
deleted file mode 100644
index c481ea4..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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>
- <color name="colorPrimary">#3F51B5</color>
- <color name="colorPrimaryDark">#303F9F</color>
- <color name="colorAccent">#FF4081</color>
-
- <color name="comment_light_background">#d6d6d6</color>
-</resources>
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/values/dimens.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 265e367..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ Copyright 2017, 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>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="item_horizontal_margin">8dp</dimen>
- <dimen name="comment_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
- <dimen name="comment_padding">8dp</dimen>
- <dimen name="comment_minHeight">64dp</dimen>
-</resources>
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/values/product_app.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/values/product_app.xml
deleted file mode 100644
index d1fe819..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/values/product_app.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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="product_price">Price: $%d</string>
- <dimen name="product_item_min_height">100dp</dimen>
-</resources>
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/values/strings.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/values/strings.xml
deleted file mode 100644
index 04a5057..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<!--
- ~ Copyright 2017, 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">Persistence sample</string>
- <string name="no_comments">No comments</string>
- <string name="loading_comments">Loading comments...</string>
- <string name="loading_products">Loading products...</string>
- <string name="cd_products_list">Products list</string>
- <string name="cd_comments_list">Comments list</string>
- <string name="cd_product_name">Name of the product</string>
-</resources>
diff --git a/samples-flatfoot/PersistenceSample/app/src/main/res/values/styles.xml b/samples-flatfoot/PersistenceSample/app/src/main/res/values/styles.xml
deleted file mode 100644
index 7aa7228..0000000
--- a/samples-flatfoot/PersistenceSample/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Copyright 2017, 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. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
-
-</resources>
diff --git a/samples-flatfoot/PersistenceSample/build.gradle b/samples-flatfoot/PersistenceSample/build.gradle
deleted file mode 100644
index f8c0790..0000000
--- a/samples-flatfoot/PersistenceSample/build.gradle
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.3.1'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url "../../prebuilts0905"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
-
-ext {
- buildToolsVersion = "25.0.2"
- supportLibVersion = "25.3.1"
- runnerVersion = "0.5"
- rulesVersion = "0.5"
- espressoVersion = "2.2.2"
-}
\ No newline at end of file
diff --git a/samples-flatfoot/PersistenceSample/gradle.properties b/samples-flatfoot/PersistenceSample/gradle.properties
deleted file mode 100644
index 684bee6..0000000
--- a/samples-flatfoot/PersistenceSample/gradle.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 37b4e8c..0000000
--- a/samples-flatfoot/PersistenceSample/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-#Mon Apr 24 18:19:01 CEST 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip
diff --git a/samples-flatfoot/PersistenceSample/gradlew b/samples-flatfoot/PersistenceSample/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/PersistenceSample/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/PersistenceSample/gradlew.bat b/samples-flatfoot/PersistenceSample/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/PersistenceSample/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/PersistenceSample/settings.gradle b/samples-flatfoot/PersistenceSample/settings.gradle
deleted file mode 100644
index a266f7d..0000000
--- a/samples-flatfoot/PersistenceSample/settings.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-include ':app'
diff --git a/samples-flatfoot/codelabs/CONTRIBUTING.md b/samples-flatfoot/codelabs/CONTRIBUTING.md
deleted file mode 100644
index 7b86f95..0000000
--- a/samples-flatfoot/codelabs/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# How to become a contributor and submit your own code
-
-## Contributor License Agreements
-
-We'd love to accept your sample apps and patches! Before we can take them, we
-have to jump a couple of legal hurdles.
-
-Please fill out either the individual or corporate Contributor License Agreement (CLA).
-
- * If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an [individual CLA]
- (https://cla.developers.google.com).
- * If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a [corporate CLA]
- (https://cla.developers.google.com).
- * Please make sure you sign both, Android and Google CLA
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it. Once we receive it, we'll be able to
-accept your pull requests.
-
-## Contributing A Patch
-
-1. Submit an issue describing your proposed change to the repo in question.
-1. The repo owner will respond to your issue promptly.
-1. If your proposed change is accepted, and you haven't already done so, sign a
- Contributor License Agreement (see details above).
-1. Fork the desired repo, develop and test your code changes.
-1. Ensure that your code adheres to the existing style in the sample to which
- you are contributing. Refer to the
- [Android Code Style Guide]
- (https://source.android.com/source/code-style.html) for the
- recommended coding standards for this organization.
-1. Ensure that your code has an appropriate set of unit tests which all pass.
-1. Submit a pull request.
diff --git a/samples-flatfoot/codelabs/LICENSE b/samples-flatfoot/codelabs/LICENSE
deleted file mode 100644
index 1af981f..0000000
--- a/samples-flatfoot/codelabs/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2014 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.
diff --git a/samples-flatfoot/codelabs/lifecycle/.gitignore b/samples-flatfoot/codelabs/lifecycle/.gitignore
deleted file mode 100644
index c33eb5b..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-build/
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_1.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_1.xml
deleted file mode 100644
index 0dfbdcb..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_1.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 1" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step1.ChronoActivity1" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_2___ViewModel.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_2___ViewModel.xml
deleted file mode 100644
index 7d2f95d..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_2___ViewModel.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 2 - ViewModel" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step2.ChronoActivity2" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData.xml
deleted file mode 100644
index c924446..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 3 - LiveData" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step3.ChronoActivity3" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData_solution.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData_solution.xml
deleted file mode 100644
index 546a8ad..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_3___LiveData_solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 3 - LiveData solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step3_solution.ChronoActivity3" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider.xml
deleted file mode 100644
index c23cba6..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 4 - Lifecycle provider" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step4.LocationActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider_solution.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider_solution.xml
deleted file mode 100644
index 01c21e4..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_4___Lifecycle_provider_solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 4 - Lifecycle provider solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step4_solution.LocationActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs.xml
deleted file mode 100644
index 55b1e43..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 5 - Sharing VMs" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step5.Activity_step5" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs_solution.xml b/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs_solution.xml
deleted file mode 100644
index a060505..0000000
--- a/samples-flatfoot/codelabs/lifecycle/.idea/runConfigurations/Step_5___Sharing_VMs_solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 5 - Sharing VMs solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.lifecycles.step5_solution.Activity_step5" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/CONTRIBUTING.md b/samples-flatfoot/codelabs/lifecycle/CONTRIBUTING.md
deleted file mode 100644
index 7b86f95..0000000
--- a/samples-flatfoot/codelabs/lifecycle/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# How to become a contributor and submit your own code
-
-## Contributor License Agreements
-
-We'd love to accept your sample apps and patches! Before we can take them, we
-have to jump a couple of legal hurdles.
-
-Please fill out either the individual or corporate Contributor License Agreement (CLA).
-
- * If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an [individual CLA]
- (https://cla.developers.google.com).
- * If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a [corporate CLA]
- (https://cla.developers.google.com).
- * Please make sure you sign both, Android and Google CLA
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it. Once we receive it, we'll be able to
-accept your pull requests.
-
-## Contributing A Patch
-
-1. Submit an issue describing your proposed change to the repo in question.
-1. The repo owner will respond to your issue promptly.
-1. If your proposed change is accepted, and you haven't already done so, sign a
- Contributor License Agreement (see details above).
-1. Fork the desired repo, develop and test your code changes.
-1. Ensure that your code adheres to the existing style in the sample to which
- you are contributing. Refer to the
- [Android Code Style Guide]
- (https://source.android.com/source/code-style.html) for the
- recommended coding standards for this organization.
-1. Ensure that your code has an appropriate set of unit tests which all pass.
-1. Submit a pull request.
diff --git a/samples-flatfoot/codelabs/lifecycle/LICENSE b/samples-flatfoot/codelabs/lifecycle/LICENSE
deleted file mode 100644
index 1af981f..0000000
--- a/samples-flatfoot/codelabs/lifecycle/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2014 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.
diff --git a/samples-flatfoot/codelabs/lifecycle/app/build.gradle b/samples-flatfoot/codelabs/lifecycle/app/build.gradle
deleted file mode 100644
index 7a9e955..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/build.gradle
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId 'com.example.android.codelabs.lifecycle'
- minSdkVersion 21
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- dataBinding {
- enabled = true
- }
- productFlavors {
- }
-}
-
-dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- androidTestCompile('com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion, {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile 'com.android.support:appcompat-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:cardview-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion;
- testCompile 'junit:junit:4.12'
- compile 'android.arch.lifecycle:extensions:' + rootProject.archLifecycleVersion;
- compile 'android.arch.persistence.room:runtime:' + rootProject.archRoomVersion;
- annotationProcessor 'android.arch.lifecycle:compiler:' + rootProject.archLifecycleVersion;
- annotationProcessor 'android.arch.persistence.room:compiler:' + rootProject.archRoomVersion;
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/proguard-rules.pro b/samples-flatfoot/codelabs/lifecycle/app/proguard-rules.pro
deleted file mode 100644
index 4cb7103..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /usr/local/google/home/jalc/sw/android-sdks/android-sdk-linux/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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/samples-flatfoot/codelabs/lifecycle/app/src/main/AndroidManifest.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 1327ac7..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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.codelabs.lifecycle">
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
- <uses-feature android:name="android.hardware.location.gps" />
-
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity android:name="com.example.android.lifecycles.step1.ChronoActivity1">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step2.ChronoActivity2">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step3.ChronoActivity3">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step3_solution.ChronoActivity3">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step4_solution.LocationActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step4.LocationActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step5.Activity_step5">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.lifecycles.step5_solution.Activity_step5">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step1/ChronoActivity1.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step1/ChronoActivity1.java
deleted file mode 100644
index d7dcf59..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step1/ChronoActivity1.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step1;
-
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.widget.Chronometer;
-
-import com.example.android.codelabs.lifecycle.R;
-
-
-public class ChronoActivity1 extends AppCompatActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- Chronometer chronometer = (Chronometer) findViewById(R.id.chronometer);
-
- chronometer.start();
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronoActivity2.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronoActivity2.java
deleted file mode 100644
index 4ef5e23..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronoActivity2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step2;
-
-import android.os.Bundle;
-import android.os.SystemClock;
-import android.widget.Chronometer;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.lifecycle.R;
-
-public class ChronoActivity2 extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
-
- // The ViewModelStore provides a new ViewModel or one previously created.
- ChronometerViewModel chronometerViewModel
- = ViewModelProviders.of(this).get(ChronometerViewModel.class);
-
- // Get the chronometer reference
- Chronometer chronometer = (Chronometer) findViewById(R.id.chronometer);
-
- if (chronometerViewModel.getStartDate() == null) {
- // If the start date is not defined, it's a new ViewModel so set it.
- long startTime = SystemClock.elapsedRealtime();
- chronometerViewModel.setStartDate(startTime);
- chronometer.setBase(startTime);
- } else {
- // Otherwise the ViewModel has been retained, set the chronometer's base to the original
- // starting time.
- chronometer.setBase(chronometerViewModel.getStartDate());
- }
-
- chronometer.start();
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronometerViewModel.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronometerViewModel.java
deleted file mode 100644
index 136ed50..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step2/ChronometerViewModel.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step2;
-
-import android.support.annotation.Nullable;
-
-import android.arch.lifecycle.ViewModel;
-
-/**
- * A ViewModel used for the {@link ChronoActivity2}.
- */
-public class ChronometerViewModel extends ViewModel {
-
- @Nullable
- private Long startDate;
-
- @Nullable
- public Long getStartDate() {
- return startDate;
- }
-
- public void setStartDate(final long startDate) {
- this.startDate = startDate;
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/ChronoActivity3.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/ChronoActivity3.java
deleted file mode 100644
index 4ff1a87..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/ChronoActivity3.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step3;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.util.Log;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.lifecycle.R;
-
-
-public class ChronoActivity3 extends LifecycleActivity {
-
- private LiveDataTimerViewModel chronometerViewModel;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.chrono_activity_3);
-
- chronometerViewModel = ViewModelProviders.of(this).get(LiveDataTimerViewModel.class);
-
- subscribe();
- }
-
- private void subscribe() {
- final Observer<Long> elapsedTimeObserver = new Observer<Long>() {
- @Override
- public void onChanged(@Nullable final Long aLong) {
- String newText = ChronoActivity3.this.getResources().getString(R.string.seconds, aLong);
- ((TextView) findViewById(R.id.timer_textview)).setText(newText);
- Log.d("ChronoActivity3", "Updating timer");
- }
- };
-
- //TODO: observe the ViewModel's elapsed time
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/LiveDataTimerViewModel.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/LiveDataTimerViewModel.java
deleted file mode 100644
index cc88d7c..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3/LiveDataTimerViewModel.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step3;
-
-import android.arch.lifecycle.MutableLiveData;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.SystemClock;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.ViewModel;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * A ViewModel used for the {@link ChronoActivity3}.
- */
-public class LiveDataTimerViewModel extends ViewModel {
-
- private static final int ONE_SECOND = 1000;
-
- private MutableLiveData<Long> elapsedTime = new MutableLiveData<>();
-
- private long mInitialTime;
-
- public LiveDataTimerViewModel() {
- mInitialTime = SystemClock.elapsedRealtime();
- Timer timer = new Timer();
-
- // Update the elapsed time every second.
- timer.scheduleAtFixedRate(new TimerTask() {
- @Override
- public void run() {
- final long newValue = (SystemClock.elapsedRealtime() - mInitialTime) / 1000;
-
- // setValue() cannot be called from a background thread so post to main thread.
- new Handler(Looper.getMainLooper()).post(new Runnable() {
- @Override
- public void run() {
-
- //TODO set the new value
-
- }
- });
- }
- }, ONE_SECOND, ONE_SECOND);
-
- }
-
- @SuppressWarnings("unused") // Will be used when step is completed
- public LiveData<Long> getElapsedTime() {
- return elapsedTime;
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/ChronoActivity3.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/ChronoActivity3.java
deleted file mode 100644
index 2caf5fb..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/ChronoActivity3.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step3_solution;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.util.Log;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.lifecycle.R;
-
-public class ChronoActivity3 extends LifecycleActivity {
-
- private LiveDataTimerViewModel chronometerViewModel;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.chrono_activity_3);
-
- chronometerViewModel = ViewModelProviders.of(this).get(LiveDataTimerViewModel.class);
-
- subscribe();
- }
-
- private void subscribe() {
- final Observer<Long> elapsedTimeObserver = new Observer<Long>() {
- @Override
- public void onChanged(@Nullable final Long aLong) {
- String newText = ChronoActivity3.this.getResources().getString(R.string.seconds, aLong);
- ((TextView) findViewById(R.id.timer_textview)).setText(newText);
- Log.d("ChronoActivity3", "Updating timer");
- }
- };
-
- chronometerViewModel.getElapsedTime().observe(this, elapsedTimeObserver);
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/LiveDataTimerViewModel.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/LiveDataTimerViewModel.java
deleted file mode 100644
index 2644415..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step3_solution/LiveDataTimerViewModel.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step3_solution;
-
-import android.arch.lifecycle.MutableLiveData;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.SystemClock;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.ViewModel;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * A ViewModel used for the {@link ChronoActivity3}.
- */
-public class LiveDataTimerViewModel extends ViewModel {
-
- private static final int ONE_SECOND = 1000;
-
- private MutableLiveData<Long> elapsedTime = new MutableLiveData<>();
-
- private long mInitialTime;
-
- public LiveDataTimerViewModel() {
- mInitialTime = SystemClock.elapsedRealtime();
- Timer timer = new Timer();
-
- // Update the elapsed time every second.
- timer.scheduleAtFixedRate(new TimerTask() {
- @Override
- public void run() {
- final long newValue = (SystemClock.elapsedRealtime() - mInitialTime) / 1000;
- // setValue() cannot be called from a background thread so post to main thread.
- new Handler(Looper.getMainLooper()).post(new Runnable() {
- @Override
- public void run() {
- elapsedTime.setValue(newValue);
-
- }
- });
- }
- }, ONE_SECOND, ONE_SECOND);
-
- }
-
- public LiveData<Long> getElapsedTime() {
- return elapsedTime;
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/BoundLocationManager.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/BoundLocationManager.java
deleted file mode 100644
index ad38c4a..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/BoundLocationManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step4;
-
-import android.content.Context;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.util.Log;
-
-import android.arch.lifecycle.LifecycleObserver;
-import android.arch.lifecycle.LifecycleRegistryOwner;
-
-
-public class BoundLocationManager {
- public static void bindLocationListenerIn(LifecycleRegistryOwner lifecycleOwner,
- LocationListener listener, Context context) {
- new BoundLocationListener(lifecycleOwner, listener, context);
- }
-
- @SuppressWarnings("MissingPermission")
- static class BoundLocationListener implements LifecycleObserver {
- private final Context mContext;
- private LocationManager mLocationManager;
- private final LocationListener mListener;
-
- public BoundLocationListener(LifecycleRegistryOwner lifecycleOwner,
- LocationListener listener, Context context) {
- mContext = context;
- mListener = listener;
- //TODO: Add lifecycle observer
- }
-
- //TODO: Call this on resume
- void addLocationListener() {
- // Note: Use the Fused Location Provider from Google Play Services instead.
- // https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi
-
- mLocationManager =
- (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
- mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListener);
- Log.d("BoundLocationMgr", "Listener added");
-
- // Force an update with the last location, if available.
- Location lastLocation = mLocationManager.getLastKnownLocation(
- LocationManager.GPS_PROVIDER);
- if (lastLocation != null) {
- mListener.onLocationChanged(lastLocation);
- }
- }
-
- //TODO: Call this on pause
- void removeLocationListener() {
- if (mLocationManager == null) {
- return;
- }
- mLocationManager.removeUpdates(mListener);
- mLocationManager = null;
- Log.d("BoundLocationMgr", "Listener removed");
- }
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/LocationActivity.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/LocationActivity.java
deleted file mode 100644
index 4712267..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4/LocationActivity.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step4;
-
-import android.Manifest;
-import android.content.pm.PackageManager;
-import android.location.Location;
-import android.location.LocationListener;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.v4.app.ActivityCompat;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.lifecycle.R;
-
-public class LocationActivity extends LifecycleActivity {
-
- private static final int REQUEST_LOCATION_PERMISSION_CODE = 1;
-
- private LocationListener mGpsListener = new MyLocationListener();
-
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
- if (grantResults[0] == PackageManager.PERMISSION_GRANTED
- && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
- bindLocationListener();
- } else {
- Toast.makeText(this, "This sample requires Location access", Toast.LENGTH_LONG).show();
- }
- }
-
- private void bindLocationListener() {
- BoundLocationManager.bindLocationListenerIn(this, mGpsListener, getApplicationContext());
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.location_activity);
-
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
- Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(this,
- new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
- Manifest.permission.ACCESS_COARSE_LOCATION},
- REQUEST_LOCATION_PERMISSION_CODE);
- } else {
- bindLocationListener();
- }
- }
-
- private class MyLocationListener implements LocationListener {
- @Override
- public void onLocationChanged(Location location) {
- TextView textView = (TextView) findViewById(R.id.location);
- textView.setText(location.getLatitude() + ", " + location.getLongitude());
- }
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- Toast.makeText(LocationActivity.this,
- "Provider enabled: " + provider, Toast.LENGTH_SHORT).show();
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/BoundLocationManager.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/BoundLocationManager.java
deleted file mode 100644
index 4360c2a..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/BoundLocationManager.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step4_solution;
-
-import android.arch.lifecycle.Lifecycle;
-import android.arch.lifecycle.LifecycleObserver;
-import android.arch.lifecycle.LifecycleOwner;
-import android.arch.lifecycle.OnLifecycleEvent;
-import android.content.Context;
-import android.location.Location;
-import android.location.LocationListener;
-import android.location.LocationManager;
-import android.util.Log;
-
-public class BoundLocationManager {
- public static void bindLocationListenerIn(LifecycleOwner lifecycleOwner,
- LocationListener listener, Context context) {
- new BoundLocationListener(lifecycleOwner, listener, context);
- }
-
- @SuppressWarnings("MissingPermission")
- static class BoundLocationListener implements LifecycleObserver {
- private final Context mContext;
- private LocationManager mLocationManager;
- private final LocationListener mListener;
-
- public BoundLocationListener(LifecycleOwner lifecycleOwner,
- LocationListener listener, Context context) {
- mContext = context;
- mListener = listener;
- lifecycleOwner.getLifecycle().addObserver(this);
- }
-
- @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
- void addLocationListener() {
- // Note: Use the Fused Location Provider from Google Play Services instead.
- // https://developers.google.com/android/reference/com/google/android/gms/location/FusedLocationProviderApi
-
- mLocationManager =
- (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
- mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, mListener);
- Log.d("BoundLocationMgr", "Listener added");
-
- // Force an update with the last location, if available.
- Location lastLocation = mLocationManager.getLastKnownLocation(
- LocationManager.GPS_PROVIDER);
- if (lastLocation != null) {
- mListener.onLocationChanged(lastLocation);
- }
- }
-
-
- @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
- void removeLocationListener() {
- if (mLocationManager == null) {
- return;
- }
- mLocationManager.removeUpdates(mListener);
- mLocationManager = null;
- Log.d("BoundLocationMgr", "Listener removed");
- }
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/LocationActivity.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/LocationActivity.java
deleted file mode 100644
index 79ff562..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step4_solution/LocationActivity.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step4_solution;
-
-import android.Manifest;
-import android.content.pm.PackageManager;
-import android.location.Location;
-import android.location.LocationListener;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.v4.app.ActivityCompat;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.lifecycle.R;
-
-public class LocationActivity extends LifecycleActivity {
-
- private static final int REQUEST_LOCATION_PERMISSION_CODE = 1;
-
- private LocationListener mGpsListener = new MyLocationListener();
-
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- super.onRequestPermissionsResult(requestCode, permissions, grantResults);
- if (grantResults[0] == PackageManager.PERMISSION_GRANTED
- && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
- bindLocationListener();
- } else {
- Toast.makeText(this, "This sample requires Location access", Toast.LENGTH_LONG).show();
- }
- }
-
- private void bindLocationListener() {
- BoundLocationManager.bindLocationListenerIn(this, mGpsListener, getApplicationContext());
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.location_activity);
-
- if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
- != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this,
- Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
- ActivityCompat.requestPermissions(this,
- new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
- Manifest.permission.ACCESS_COARSE_LOCATION},
- REQUEST_LOCATION_PERMISSION_CODE);
- } else {
- bindLocationListener();
- }
- }
-
- private class MyLocationListener implements LocationListener {
- @Override
- public void onLocationChanged(Location location) {
- TextView textView = (TextView) findViewById(R.id.location);
- textView.setText(location.getLatitude() + ", " + location.getLongitude());
- }
-
- @Override
- public void onStatusChanged(String provider, int status, Bundle extras) {
- }
-
- @Override
- public void onProviderEnabled(String provider) {
- Toast.makeText(LocationActivity.this,
- "Provider enabled: " + provider, Toast.LENGTH_SHORT).show();
- }
-
- @Override
- public void onProviderDisabled(String provider) {
- }
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Activity_step5.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Activity_step5.java
deleted file mode 100644
index ec6df9a..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Activity_step5.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step5;
-
-import android.os.Bundle;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.lifecycle.R;
-
-/**
- * Shows two {@link Fragment_step5} fragments.
- */
-public class Activity_step5 extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_step5);
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Fragment_step5.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Fragment_step5.java
deleted file mode 100644
index 1b580ea..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/Fragment_step5.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step5;
-
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.SeekBar;
-
-import com.example.android.codelabs.lifecycle.R;
-
-/**
- * Shows a SeekBar that should be synced with a value in a ViewModel.
- */
-public class Fragment_step5 extends Fragment {
-
- private SeekBar mSeekBar;
-
- private SeekBarViewModel mSeekBarViewModel;
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- // Inflate the layout for this fragment
- View root = inflater.inflate(R.layout.fragment_step5, container, false);
- mSeekBar = (SeekBar) root.findViewById(R.id.seekBar);
-
- // TODO: get ViewModel
- subscribeSeekBar();
-
- return root;
- }
-
- private void subscribeSeekBar() {
-
- // Update the ViewModel when the SeekBar is changed.
-
- mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- // TODO: Set the ViewModel's value when the change comes from the user.
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) { }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) { }
- });
-
- // TODO: Update the SeekBar when the ViewModel is changed.
- // mSeekBarViewModel.seekbarValue.observe(...
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/SeekBarViewModel.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/SeekBarViewModel.java
deleted file mode 100644
index 5811a19..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5/SeekBarViewModel.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step5;
-
-import android.arch.lifecycle.MutableLiveData;
-import android.arch.lifecycle.ViewModel;
-
-/**
- * A ViewModel used in step 5.
- */
-public class SeekBarViewModel extends ViewModel {
-
- public MutableLiveData<Integer> seekbarValue = new MutableLiveData<>();
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Activity_step5.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Activity_step5.java
deleted file mode 100644
index 89fe54b..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Activity_step5.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step5_solution;
-
-import android.os.Bundle;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.lifecycle.R;
-
-/**
- * Shows two {@link Fragment_step5} fragments.
- */
-public class Activity_step5 extends LifecycleActivity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.activity_step5_solution);
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Fragment_step5.java b/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Fragment_step5.java
deleted file mode 100644
index f82eb87..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/java/com/example/android/lifecycles/step5_solution/Fragment_step5.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2017, 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.lifecycles.step5_solution;
-
-
-import android.arch.lifecycle.LifecycleOwner;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v4.app.Fragment;
-import android.util.Log;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.SeekBar;
-
-import com.example.android.codelabs.lifecycle.R;
-import com.example.android.lifecycles.step5.SeekBarViewModel;
-
-/**
- * Shows a SeekBar that is synced with a value in a ViewModel.
- */
-public class Fragment_step5 extends Fragment {
-
- private SeekBar mSeekBar;
-
- private SeekBarViewModel mSeekBarViewModel;
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- // Inflate the layout for this fragment
- View root = inflater.inflate(R.layout.fragment_step5, container, false);
- mSeekBar = (SeekBar) root.findViewById(R.id.seekBar);
-
- mSeekBarViewModel = ViewModelProviders.of(getActivity()).get(SeekBarViewModel.class);
-
- subscribeSeekBar();
-
- return root;
- }
-
- private void subscribeSeekBar() {
-
- // Update the ViewModel when the SeekBar is changed.
- mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- if (fromUser) {
- Log.d("Step5", "Progress changed!");
- mSeekBarViewModel.seekbarValue.setValue(progress);
- }
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) { }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) { }
- });
-
- // Update the SeekBar when the ViewModel is changed.
- mSeekBarViewModel.seekbarValue.observe(
- (LifecycleOwner) getActivity(),
- new Observer<Integer>() {
- @Override
- public void onChanged(@Nullable Integer value) {
- if (value != null) {
- mSeekBar.setProgress(value);
- }
- }
- });
- }
-}
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_main.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index b48e95e..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<RelativeLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.android.lifecycles.step1.ChronoActivity1">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="Hello World!"
- android:layout_centerVertical="true"
- android:layout_centerHorizontal="true"
- android:id="@+id/hello_textview"/>
-
- <Chronometer
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_above="@+id/hello_textview"
- android:layout_centerHorizontal="true"
- android:id="@+id/chronometer"/>
-</RelativeLayout>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5.xml
deleted file mode 100644
index 479cffd..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.android.lifecycles.step5.Activity_step5">
-
- <fragment
- android:id="@+id/fragment1"
- android:name="com.example.android.lifecycles.step5.Fragment_step5"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
- <fragment
- android:id="@+id/fragment2"
- android:name="com.example.android.lifecycles.step5.Fragment_step5"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-</LinearLayout>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5_solution.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5_solution.xml
deleted file mode 100644
index a307499..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/activity_step5_solution.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.android.lifecycles.step5_solution.Activity_step5">
-
- <fragment
- android:id="@+id/fragment1"
- android:name="com.example.android.lifecycles.step5_solution.Fragment_step5"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-
- <fragment
- android:id="@+id/fragment2"
- android:name="com.example.android.lifecycles.step5_solution.Fragment_step5"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- android:layout_weight="1" />
-</LinearLayout>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_3.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_3.xml
deleted file mode 100644
index cdbaa6f..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_3.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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.
- -->
-
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.android.persistence.codelab.step_databinding.ChronoDataBindingActivity">
-
- <TextView
- android:id="@+id/hello_textview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:text="Hello World!" />
-
- <TextView
- android:id="@+id/timer_textview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/hello_textview"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true" />
-
-</RelativeLayout>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_databinding.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_databinding.xml
deleted file mode 100644
index 6d2698e..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/chrono_activity_databinding.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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.
- -->
-
-<layout>
-
- <data>
-
- <import type="android.databinding.ObservableField" />
-
- <variable
- name="elapsedTime"
- type="ObservableField<Long>">
-
- </variable>
- </data>
-
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin"
- tools:context="com.example.android.persistence.codelab.step_databinding.ChronoDataBindingActivity">
-
- <TextView
- android:id="@+id/hello_textview"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:text="Hello World!" />
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/hello_textview"
- android:layout_centerHorizontal="true"
- android:layout_centerVertical="true"
- android:text="@{String.format(@string/seconds, elapsedTime)}" />
-
- </RelativeLayout>
-
-</layout>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/fragment_step5.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/fragment_step5.xml
deleted file mode 100644
index 3821796..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/fragment_step5.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<!--
- ~ Copyright 2017, 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.
- -->
-
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.example.android.lifecycles.step5_solution.Fragment_step5">
-
- <SeekBar
- android:id="@+id/seekBar"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
-</FrameLayout>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/location_activity.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/location_activity.xml
deleted file mode 100644
index f1bc410..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/layout/location_activity.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/location"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_margin="12dp"
- android:text="@string/location" />
-</LinearLayout>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index e19d44f..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 7876250..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 9ae3725..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 6a6c3aa..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 43ca523..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/colors.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/colors.xml
deleted file mode 100644
index 255f15d..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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>
- <color name="colorPrimary">#3F51B5</color>
- <color name="colorPrimaryDark">#303F9F</color>
- <color name="colorAccent">#FF4081</color>
-</resources>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/dimens.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 9a3477e..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Copyright 2017, 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>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-</resources>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/strings.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/strings.xml
deleted file mode 100644
index 198dac9..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Copyright 2017, 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">Lifecycle codelab</string>
- <string name="seconds">%d seconds elapsed</string>
- <string name="location">Location</string>
-</resources>
diff --git a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/styles.xml b/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/styles.xml
deleted file mode 100644
index 7aa7228..0000000
--- a/samples-flatfoot/codelabs/lifecycle/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Copyright 2017, 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. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
-
-</resources>
diff --git a/samples-flatfoot/codelabs/lifecycle/build.gradle b/samples-flatfoot/codelabs/lifecycle/build.gradle
deleted file mode 100644
index c68afa8..0000000
--- a/samples-flatfoot/codelabs/lifecycle/build.gradle
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url "../../../prebuilts0905"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
-
-ext {
- buildToolsVersion = "25.0.2"
- supportLibVersion = "25.3.1"
- runnerVersion = "0.5"
- rulesVersion = "0.5"
- espressoVersion = "2.2.2"
- archLifecycleVersion = "1.0-SNAPSHOT"
- archRoomVersion = "1.0-SNAPSHOT"
-}
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/lifecycle/gradle.properties b/samples-flatfoot/codelabs/lifecycle/gradle.properties
deleted file mode 100644
index 684bee6..0000000
--- a/samples-flatfoot/codelabs/lifecycle/gradle.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 1af3d91..0000000
--- a/samples-flatfoot/codelabs/lifecycle/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-#Mon Feb 20 17:11:12 GMT 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/samples-flatfoot/codelabs/lifecycle/gradlew b/samples-flatfoot/codelabs/lifecycle/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/codelabs/lifecycle/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/codelabs/lifecycle/gradlew.bat b/samples-flatfoot/codelabs/lifecycle/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/codelabs/lifecycle/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/codelabs/lifecycle/settings.gradle b/samples-flatfoot/codelabs/lifecycle/settings.gradle
deleted file mode 100644
index a266f7d..0000000
--- a/samples-flatfoot/codelabs/lifecycle/settings.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-include ':app'
diff --git a/samples-flatfoot/codelabs/persistence/.gitignore b/samples-flatfoot/codelabs/persistence/.gitignore
deleted file mode 100644
index c33eb5b..0000000
--- a/samples-flatfoot/codelabs/persistence/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-build/
-/captures
-.externalNativeBuild
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Dao.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Dao.xml
deleted file mode 100644
index c4fb918..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Dao.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 1 - Dao" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="false" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step1.UsersActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Solution.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Solution.xml
deleted file mode 100644
index b047801..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_1___Solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 1 - Solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step1_solution.UsersActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_2___Relationships.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_2___Relationships.xml
deleted file mode 100644
index 17fe2f9..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_2___Relationships.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 2 - Relationships" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step2.JankShowUserActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Async_calls.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Async_calls.xml
deleted file mode 100644
index 28ddac1..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Async_calls.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 3 - Async calls" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step3.BooksBorrowedByUserActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Solution.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Solution.xml
deleted file mode 100644
index 38fcfb3..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_3___Solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 3 - Solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step3_solution.BooksBorrowedByUserActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Solution.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Solution.xml
deleted file mode 100644
index 094bac9..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 4 - Solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step4_solution.TypeConvertersActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Type_converters.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Type_converters.xml
deleted file mode 100644
index d75817c..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_4___Type_converters.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 4 - Type converters" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step4.TypeConvertersActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Custom_Results.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Custom_Results.xml
deleted file mode 100644
index 3dcf7f5..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Custom_Results.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 5 - Custom Results" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="true" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step5.CustomResultActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Solution.xml b/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Solution.xml
deleted file mode 100644
index 790b28c..0000000
--- a/samples-flatfoot/codelabs/persistence/.idea/runConfigurations/Step_5___Solution.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<component name="ProjectRunConfigurationManager">
- <configuration default="false" name="Step 5 - Solution" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
- <module name="app" />
- <option name="DEPLOY" value="true" />
- <option name="ARTIFACT_NAME" value="" />
- <option name="PM_INSTALL_OPTIONS" value="" />
- <option name="ACTIVITY_EXTRA_FLAGS" value="" />
- <option name="MODE" value="specific_activity" />
- <option name="PREFERRED_AVD" value="" />
- <option name="CLEAR_LOGCAT" value="false" />
- <option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
- <option name="SKIP_NOOP_APK_INSTALLATIONS" value="true" />
- <option name="FORCE_STOP_RUNNING_APP" value="true" />
- <option name="TARGET_SELECTION_MODE" value="SHOW_DIALOG" />
- <option name="USE_LAST_SELECTED_DEVICE" value="true" />
- <option name="PREFERRED_AVD" value="" />
- <option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
- <option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
- <option name="DEBUGGER_TYPE" value="Auto" />
- <Auto>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Auto>
- <Hybrid>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Hybrid>
- <Java />
- <Native>
- <option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
- <option name="SHOW_STATIC_VARS" value="true" />
- <option name="WORKING_DIR" value="" />
- <option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
- <option name="SHOW_OPTIMIZED_WARNING" value="true" />
- </Native>
- <Profilers>
- <option name="ENABLE_ADVANCED_PROFILING" value="false" />
- <option name="SUPPORT_LIB_ENABLED" value="true" />
- <option name="INSTRUMENTATION_ENABLED" value="true" />
- </Profilers>
- <option name="DEEP_LINK" value="" />
- <option name="ACTIVITY_CLASS" value="com.example.android.persistence.codelab.step5_solution.CustomResultUserActivity" />
- <method />
- </configuration>
-</component>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/CONTRIBUTING.md b/samples-flatfoot/codelabs/persistence/CONTRIBUTING.md
deleted file mode 100644
index 7b86f95..0000000
--- a/samples-flatfoot/codelabs/persistence/CONTRIBUTING.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# How to become a contributor and submit your own code
-
-## Contributor License Agreements
-
-We'd love to accept your sample apps and patches! Before we can take them, we
-have to jump a couple of legal hurdles.
-
-Please fill out either the individual or corporate Contributor License Agreement (CLA).
-
- * If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an [individual CLA]
- (https://cla.developers.google.com).
- * If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a [corporate CLA]
- (https://cla.developers.google.com).
- * Please make sure you sign both, Android and Google CLA
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it. Once we receive it, we'll be able to
-accept your pull requests.
-
-## Contributing A Patch
-
-1. Submit an issue describing your proposed change to the repo in question.
-1. The repo owner will respond to your issue promptly.
-1. If your proposed change is accepted, and you haven't already done so, sign a
- Contributor License Agreement (see details above).
-1. Fork the desired repo, develop and test your code changes.
-1. Ensure that your code adheres to the existing style in the sample to which
- you are contributing. Refer to the
- [Android Code Style Guide]
- (https://source.android.com/source/code-style.html) for the
- recommended coding standards for this organization.
-1. Ensure that your code has an appropriate set of unit tests which all pass.
-1. Submit a pull request.
diff --git a/samples-flatfoot/codelabs/persistence/LICENSE b/samples-flatfoot/codelabs/persistence/LICENSE
deleted file mode 100644
index 1af981f..0000000
--- a/samples-flatfoot/codelabs/persistence/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2014 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.
diff --git a/samples-flatfoot/codelabs/persistence/app/build.gradle b/samples-flatfoot/codelabs/persistence/app/build.gradle
deleted file mode 100644
index 0a382b4..0000000
--- a/samples-flatfoot/codelabs/persistence/app/build.gradle
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-apply plugin: 'com.android.application'
-
-android {
- compileSdkVersion 25
- buildToolsVersion "25.0.2"
- defaultConfig {
- applicationId 'com.example.android.codelabs.persistence'
- minSdkVersion 21
- targetSdkVersion 25
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- dataBinding {
- enabled = true
- }
- productFlavors {
- }
- // To avoid lint errors on generated sources, we temporarily disable abortOnError
- // until the fix is released.
- lintOptions {
- abortOnError false
- }
-}
-
-dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- androidTestCompile('com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion, {
- exclude group: 'com.android.support', module: 'support-annotations'
- })
- compile 'com.android.support:appcompat-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:cardview-v7:' + rootProject.supportLibVersion;
- compile 'com.android.support:recyclerview-v7:' + rootProject.supportLibVersion;
- testCompile 'junit:junit:4.12'
- compile 'android.arch.lifecycle:extensions:' + rootProject.archLifecycleVersion;
- compile 'android.arch.persistence.room:runtime:' + rootProject.archRoomVersion;
- annotationProcessor 'android.arch.lifecycle:compiler:' + rootProject.archLifecycleVersion;
- annotationProcessor 'android.arch.persistence.room:compiler:' + rootProject.archRoomVersion;
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/proguard-rules.pro b/samples-flatfoot/codelabs/persistence/app/proguard-rules.pro
deleted file mode 100644
index 4cb7103..0000000
--- a/samples-flatfoot/codelabs/persistence/app/proguard-rules.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-# Add project specific ProGuard rules here.
-# By default, the flags in this file are appended to flags specified
-# in /usr/local/google/home/jalc/sw/android-sdks/android-sdk-linux/tools/proguard/proguard-android.txt
-# You can edit the include path and order by changing the proguardFiles
-# directive in build.gradle.
-#
-# 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/samples-flatfoot/codelabs/persistence/app/src/main/AndroidManifest.xml b/samples-flatfoot/codelabs/persistence/app/src/main/AndroidManifest.xml
deleted file mode 100644
index ade902e..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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.codelabs.persistence">
-
- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-
- <uses-feature android:name="android.hardware.location.gps" />
-
- <application
- android:allowBackup="true"
- android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:supportsRtl="true"
- android:theme="@style/AppTheme">
- <activity android:name="com.example.android.persistence.codelab.step1_solution.UsersActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step1.UsersActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step2.JankShowUserActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step3.BooksBorrowedByUserActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step3_solution.BooksBorrowedByUserActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step4.TypeConvertersActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step4_solution.TypeConvertersActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step5_solution.CustomResultUserActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- <activity android:name="com.example.android.persistence.codelab.step5.CustomResultActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN"/>
- </intent-filter>
- </activity>
- </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/AppDatabase.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/AppDatabase.java
deleted file mode 100644
index 4399a84..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/AppDatabase.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.content.Context;
-
-import android.arch.persistence.room.Database;
-import android.arch.persistence.room.Room;
-import android.arch.persistence.room.RoomDatabase;
-
-@Database(entities = {User.class, Book.class, Loan.class}, version = 1)
-public abstract class AppDatabase extends RoomDatabase {
-
- private static AppDatabase INSTANCE;
-
- public abstract UserDao userModel();
- public abstract BookDao bookModel();
- public abstract LoanDao loanModel();
-
- public static AppDatabase getInMemoryDatabase(Context context) {
- if (INSTANCE == null) {
- INSTANCE = Room.inMemoryDatabaseBuilder(
- context.getApplicationContext(), AppDatabase.class).build();
- }
- return INSTANCE;
- }
-
- public static void destroyInstance() {
- INSTANCE = null;
- }
-}
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Book.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Book.java
deleted file mode 100644
index 5b3cd39..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Book.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-@Entity
-public class Book {
- public @PrimaryKey String id;
- public String title;
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/BookDao.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/BookDao.java
deleted file mode 100644
index 07a419a..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/BookDao.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.lifecycle.LiveData;
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.Query;
-import android.arch.persistence.room.TypeConverters;
-import android.arch.persistence.room.Update;
-
-import java.util.Date;
-import java.util.List;
-
-import static android.arch.persistence.room.OnConflictStrategy.IGNORE;
-import static android.arch.persistence.room.OnConflictStrategy.REPLACE;
-
-
-@Dao
-@TypeConverters(DateConverter.class)
-public interface BookDao {
-
- @Query("select * from Book where id = :id")
- User loadUserById(int id);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id = Book.id " +
- "INNER JOIN User on User.id = Loan.user_id " +
- "WHERE User.name LIKE :userName"
- )
- public LiveData<List<Book>> findBooksBorrowedByName(String userName);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id = Book.id " +
- "INNER JOIN User on User.id = Loan.user_id " +
- "WHERE User.name LIKE :userName " +
- "AND Loan.endTime > :after "
- )
- public LiveData<List<Book>> findBooksBorrowedByNameAfter(String userName, Date after);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id = Book.id " +
- "INNER JOIN User on User.id = Loan.user_id " +
- "WHERE User.name LIKE :userName"
- )
- public List<Book> findBooksBorrowedByNameSync(String userName);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id LIKE Book.id " +
- "WHERE Loan.user_id LIKE :userId "
- )
- public LiveData<List<Book>> findBooksBorrowedByUser(String userId);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id LIKE Book.id " +
- "WHERE Loan.user_id LIKE :userId " +
- "AND Loan.endTime > :after "
- )
- public LiveData<List<Book>> findBooksBorrowedByUserAfter(String userId, Date after);
-
- @Query("SELECT * FROM Book " +
- "INNER JOIN Loan ON Loan.book_id LIKE Book.id " +
- "WHERE Loan.user_id LIKE :userId "
- )
- public List<Book> findBooksBorrowedByUserSync(String userId);
-
- @Query("SELECT * FROM Book")
- public LiveData<List<Book>> findAllBooks();
-
-
- @Query("SELECT * FROM Book")
- public List<Book> findAllBooksSync();
-
- @Insert(onConflict = IGNORE)
- void insertBook(Book book);
-
- @Update(onConflict = REPLACE)
- void updateBook(Book book);
-
- @Query("DELETE FROM Book")
- void deleteAll();
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/DateConverter.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/DateConverter.java
deleted file mode 100644
index f7ad1d6..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/DateConverter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.TypeConverter;
-
-import java.util.Date;
-
-public class DateConverter {
- @TypeConverter
- public static Date toDate(Long timestamp) {
- return timestamp == null ? null : new Date(timestamp);
- }
-
- @TypeConverter
- public static Long toTimestamp(Date date) {
- return date == null ? null : date.getTime();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Loan.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Loan.java
deleted file mode 100644
index 39e8a89..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/Loan.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.ColumnInfo;
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.ForeignKey;
-import android.arch.persistence.room.PrimaryKey;
-import android.arch.persistence.room.TypeConverters;
-
-import java.util.Date;
-
-@Entity(foreignKeys = {
- @ForeignKey(entity = Book.class,
- parentColumns = "id",
- childColumns = "book_id"),
-
- @ForeignKey(entity = User.class,
- parentColumns = "id",
- childColumns = "user_id")})
-@TypeConverters(DateConverter.class)
-public class Loan {
- // Fields can be public or private with getters and setters.
- public @PrimaryKey String id;
- public Date startTime;
- public Date endTime;
- @ColumnInfo(name="book_id")
- public String bookId;
- @ColumnInfo(name="user_id")
- public String userId;
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanDao.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanDao.java
deleted file mode 100644
index 5a8f9ed..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanDao.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-
-import android.arch.lifecycle.LiveData;
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.Query;
-import android.arch.persistence.room.TypeConverters;
-
-import java.util.Date;
-import java.util.List;
-
-import static android.arch.persistence.room.OnConflictStrategy.ABORT;
-
-@Dao
-@TypeConverters(DateConverter.class)
-public interface LoanDao {
-
- @Query("SELECT * From Loan")
- LiveData<List<Loan>> findAll();
-
- @Query("SELECT Loan.id, Book.title, User.name, Loan.startTime, Loan.endTime From Loan " +
- "INNER JOIN Book ON Loan.book_id = Book.id " +
- "INNER JOIN User ON Loan.user_id = User.id ")
- LiveData<List<LoanWithUserAndBook>> findAllWithUserAndBook();
-
- @Query("SELECT Loan.id, Book.title as title, User.name as name, Loan.startTime, Loan.endTime " +
- "FROM Book " +
- "INNER JOIN Loan ON Loan.book_id = Book.id " +
- "INNER JOIN User on User.id = Loan.user_id " +
- "WHERE User.name LIKE :userName " +
- "AND Loan.endTime > :after "
- )
- public LiveData<List<LoanWithUserAndBook>> findLoansByNameAfter(String userName, Date after);
-
- @Insert(onConflict = ABORT)
- void insertLoan(Loan loan);
-
- @Query("DELETE FROM Loan")
- void deleteAll();
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanWithUserAndBook.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanWithUserAndBook.java
deleted file mode 100644
index 9df2dda..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/LoanWithUserAndBook.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.ColumnInfo;
-import android.arch.persistence.room.TypeConverters;
-
-import java.util.Date;
-
-public class LoanWithUserAndBook {
- public String id;
- @ColumnInfo(name="title")
- public String bookTitle;
- @ColumnInfo(name="name")
- public String userName;
- @TypeConverters(DateConverter.class)
- public Date startTime;
- @TypeConverters(DateConverter.class)
- public Date endTime;
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/User.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/User.java
deleted file mode 100644
index 75dc4b3..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/User.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.Entity;
-import android.arch.persistence.room.PrimaryKey;
-
-
-@Entity
-public class User {
- public @PrimaryKey String id;
- public String name;
- public String lastName;
- public int age;
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/UserDao.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/UserDao.java
deleted file mode 100644
index 3dd836d..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/UserDao.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db;
-
-import android.arch.persistence.room.Dao;
-import android.arch.persistence.room.Delete;
-import android.arch.persistence.room.Insert;
-import android.arch.persistence.room.Query;
-
-import java.util.List;
-
-import static android.arch.persistence.room.OnConflictStrategy.IGNORE;
-
-@Dao
-public interface UserDao {
- @Query("select * from user")
- List<User> loadAllUsers();
-
- @Query("select * from user where id = :id")
- User loadUserById(int id);
-
- @Query("select * from user where name = :firstName and lastName = :lastName")
- List<User> findByNameAndLastName(String firstName, String lastName);
-
- @Insert(onConflict = IGNORE)
- void insertUser(User user);
-
- @Delete
- void deleteUser(User user);
-
- @Query("delete from user where name like :badName OR lastName like :badName")
- int deleteUsersByName(String badName);
-
- @Insert(onConflict = IGNORE)
- void insertOrReplaceUsers(User... users);
-
- @Delete
- void deleteUsers(User user1, User user2);
-
- @Query("SELECT * FROM User WHERE :age == :age") // TODO: Fix this!
- List<User> findYoungerThan(int age);
-
- @Query("SELECT * FROM User WHERE age < :age")
- List<User> findYoungerThanSolution(int age);
-
- @Query("DELETE FROM User")
- void deleteAll();
-}
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/utils/DatabaseInitializer.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/utils/DatabaseInitializer.java
deleted file mode 100644
index 7ced200..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/db/utils/DatabaseInitializer.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.db.utils;
-
-import android.os.AsyncTask;
-import android.support.annotation.NonNull;
-import android.util.Log;
-
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.Loan;
-import com.example.android.persistence.codelab.db.User;
-
-import java.util.Calendar;
-import java.util.Date;
-
-public class DatabaseInitializer {
-
- // Simulate a blocking operation delaying each Loan insertion with a delay:
- private static final int DELAY_MILLIS = 500;
-
- public static void populateAsync(final AppDatabase db) {
-
- PopulateDbAsync task = new PopulateDbAsync(db);
- task.execute();
- }
-
- public static void populateSync(@NonNull final AppDatabase db) {
- populateWithTestData(db);
- }
-
- private static void addLoan(final AppDatabase db, final String id,
- final User user, final Book book, Date from, Date to) {
- Loan loan = new Loan();
- loan.id = id;
- loan.bookId = book.id;
- loan.userId = user.id;
- loan.startTime = from;
- loan.endTime = to;
- db.loanModel().insertLoan(loan);
- }
-
- private static Book addBook(final AppDatabase db, final String id, final String title) {
- Book book = new Book();
- book.id = id;
- book.title = title;
- db.bookModel().insertBook(book);
- return book;
- }
-
- private static User addUser(final AppDatabase db, final String id, final String name,
- final String lastName, final int age) {
- User user = new User();
- user.id = id;
- user.age = age;
- user.name = name;
- user.lastName = lastName;
- db.userModel().insertUser(user);
- return user;
- }
-
- private static void populateWithTestData(AppDatabase db) {
- db.loanModel().deleteAll();
- db.userModel().deleteAll();
- db.bookModel().deleteAll();
-
- User user1 = addUser(db, "1", "Jason", "Seaver", 40);
- User user2 = addUser(db, "2", "Mike", "Seaver", 12);
- addUser(db, "3", "Carol", "Seaver", 15);
-
- Book book1 = addBook(db, "1", "Dune");
- Book book2 = addBook(db, "2", "1984");
- Book book3 = addBook(db, "3", "The War of the Worlds");
- Book book4 = addBook(db, "4", "Brave New World");
- addBook(db, "5", "Foundation");
- try {
- // Loans are added with a delay, to have time for the UI to react to changes.
-
- Date today = getTodayPlusDays(0);
- Date yesterday = getTodayPlusDays(-1);
- Date twoDaysAgo = getTodayPlusDays(-2);
- Date lastWeek = getTodayPlusDays(-7);
- Date twoWeeksAgo = getTodayPlusDays(-14);
-
- addLoan(db, "1", user1, book1, twoWeeksAgo, lastWeek);
- Thread.sleep(DELAY_MILLIS);
- addLoan(db, "2", user2, book1, lastWeek, yesterday);
- Thread.sleep(DELAY_MILLIS);
- addLoan(db, "3", user2, book2, lastWeek, today);
- Thread.sleep(DELAY_MILLIS);
- addLoan(db, "4", user2, book3, lastWeek, twoDaysAgo);
- Thread.sleep(DELAY_MILLIS);
- addLoan(db, "5", user2, book4, lastWeek, today);
- Log.d("DB", "Added loans");
-
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
-
- private static Date getTodayPlusDays(int daysAgo) {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.DATE, daysAgo);
- return calendar.getTime();
- }
-
- private static class PopulateDbAsync extends AsyncTask<Void, Void, Void> {
-
- private final AppDatabase mDb;
-
- PopulateDbAsync(AppDatabase db) {
- mDb = db;
- }
-
- @Override
- protected Void doInBackground(final Void... params) {
- populateWithTestData(mDb);
- return null;
- }
-
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1/UsersActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1/UsersActivity.java
deleted file mode 100644
index 3a7f118..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1/UsersActivity.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step1;
-
-import android.os.Bundle;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.User;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-import java.util.Locale;
-
-public class UsersActivity extends LifecycleActivity {
-
- private AppDatabase mDb;
-
- private TextView mYoungUsersTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity1);
-
- mYoungUsersTextView = (TextView) findViewById(R.id.young_users_tv);
-
- // Note: Db references should not be in an activity.
- mDb = AppDatabase.getInMemoryDatabase(getApplicationContext());
-
- populateDb();
-
- fetchData();
- }
-
- @Override
- protected void onDestroy() {
- AppDatabase.destroyInstance();
- super.onDestroy();
- }
-
- private void populateDb() {
- DatabaseInitializer.populateSync(mDb);
- }
-
- private void fetchData() {
- // Note: this kind of logic should not be in an activity.
- StringBuilder sb = new StringBuilder();
- List<User> youngUsers = mDb.userModel().findYoungerThan(35);
- for (User youngUser : youngUsers) {
- sb.append(String.format(Locale.US,
- "%s, %s (%d)\n", youngUser.lastName, youngUser.name, youngUser.age));
- }
- mYoungUsersTextView.setText(sb);
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1_solution/UsersActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1_solution/UsersActivity.java
deleted file mode 100644
index 1399f0e..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step1_solution/UsersActivity.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step1_solution;
-
-import android.os.Bundle;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.User;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-import java.util.Locale;
-
-public class UsersActivity extends LifecycleActivity {
-
- private AppDatabase mDb;
-
- private TextView mYoungUsersTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity1);
-
- mYoungUsersTextView = (TextView) findViewById(R.id.young_users_tv);
-
- // Note: Db references should not be in an activity.
- mDb = AppDatabase.getInMemoryDatabase(getApplicationContext());
-
- populateDb();
-
- fetchData();
- }
-
- @Override
- protected void onDestroy() {
- AppDatabase.destroyInstance();
- super.onDestroy();
- }
-
- private void populateDb() {
- DatabaseInitializer.populateSync(mDb);
- }
-
- private void fetchData() {
- // Note: this kind of logic should not be in an activity.
- StringBuilder sb = new StringBuilder();
- List<User> youngUsers = mDb.userModel().findYoungerThanSolution(35);
- for (User youngUser : youngUsers) {
- sb.append(String.format(Locale.US,
- "%s, %s (%d)\n", youngUser.lastName, youngUser.name, youngUser.age));
- }
- mYoungUsersTextView.setText(sb);
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step2/JankShowUserActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step2/JankShowUserActivity.java
deleted file mode 100644
index 7ff52cc..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step2/JankShowUserActivity.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step2;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-
-public class JankShowUserActivity extends LifecycleActivity {
-
- private AppDatabase mDb;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
-
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- // Note: Db references should not be in an activity.
- mDb = AppDatabase.getInMemoryDatabase(getApplicationContext());
-
- populateDb();
-
- fetchData();
- }
-
- @Override
- protected void onDestroy() {
- AppDatabase.destroyInstance();
- super.onDestroy();
- }
-
- private void populateDb() {
- DatabaseInitializer.populateSync(mDb);
- }
-
- private void fetchData() {
- // This activity is executing a query on the main thread, making the UI perform badly.
- List<Book> books = mDb.bookModel().findBooksBorrowedByNameSync("Mike");
- showListInUI(books, mBooksTextView);
- }
-
- private static void showListInUI(final @NonNull List<Book> books,
- final TextView booksTextView) {
- StringBuilder sb = new StringBuilder();
- for (Book book : books) {
- sb.append(book.title);
- sb.append("\n");
- }
- booksTextView.setText(sb.toString());
- }
-
- public void onRefreshBtClicked(View view) {
- mBooksTextView.setText("");
- fetchData();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserActivity.java
deleted file mode 100644
index 0e11268..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserActivity.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step3;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.Book;
-
-import java.util.List;
-
-public class BooksBorrowedByUserActivity extends LifecycleActivity {
-
- private BooksBorrowedByUserViewModel mViewModel;
-
- @SuppressWarnings("unused")
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- // Get a reference to the ViewModel for this screen.
- mViewModel = ViewModelProviders.of(this).get(BooksBorrowedByUserViewModel.class);
-
- // Update the UI whenever there's a change in the ViewModel's data.
- subscribeUiBooks();
- }
-
- public void onRefreshBtClicked(View view) {
- mViewModel.createDb();
- }
-
- private void subscribeUiBooks() {
- // TODO: refresh the list of books when there's new data
- // mViewModel.books.observe(...
- }
-
- @SuppressWarnings("unused")
- private static void showBooksInUi(final @NonNull List<Book> books,
- final TextView booksTextView) {
- StringBuilder sb = new StringBuilder();
-
- for (Book book : books) {
- sb.append(book.title);
- sb.append("\n");
-
- }
- booksTextView.setText(sb.toString());
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserViewModel.java
deleted file mode 100644
index badead3..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3/BooksBorrowedByUserViewModel.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step3;
-
-import android.app.Application;
-
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-
-
-public class BooksBorrowedByUserViewModel extends AndroidViewModel {
-
- public final LiveData<List<Book>> books;
-
- private AppDatabase mDb;
-
- public BooksBorrowedByUserViewModel(Application application) {
- super(application);
- createDb();
-
- // TODO: Assign books to the 'findBooksBorrowedByName' query.
- books = null;
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(this.getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserActivity.java
deleted file mode 100644
index d488333..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserActivity.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step3_solution;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.Book;
-
-import java.util.List;
-
-public class BooksBorrowedByUserActivity extends LifecycleActivity {
-
- private BooksBorrowedByUserViewModel mViewModel;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- // Get a reference to the ViewModel for this screen.
- mViewModel = ViewModelProviders.of(this).get(BooksBorrowedByUserViewModel.class);
-
- // Update the UI whenever there's a change in the ViewModel's data.
- subscribeUiBooks();
- }
-
- public void onRefreshBtClicked(View view) {
- mViewModel.createDb();
- }
-
- private void subscribeUiBooks() {
- mViewModel.books.observe(this, new Observer<List<Book>>() {
- @Override
- public void onChanged(@NonNull final List<Book> books) {
- showBooksInUi(books, mBooksTextView);
- }
- });
- }
-
- private static void showBooksInUi(final @NonNull List<Book> books,
- final TextView booksTextView) {
- StringBuilder sb = new StringBuilder();
-
- for (Book book : books) {
- sb.append(book.title);
- sb.append("\n");
-
- }
- booksTextView.setText(sb.toString());
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserViewModel.java
deleted file mode 100644
index 4599b68..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step3_solution/BooksBorrowedByUserViewModel.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step3_solution;
-
-import android.app.Application;
-
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-
-
-public class BooksBorrowedByUserViewModel extends AndroidViewModel {
-
- public final LiveData<List<Book>> books;
-
- private AppDatabase mDb;
-
- public BooksBorrowedByUserViewModel(Application application) {
- super(application);
- createDb();
-
- // Books is a LiveData object so updates are observed.
- books = mDb.bookModel().findBooksBorrowedByName("Mike");
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(this.getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersActivity.java
deleted file mode 100644
index 2af252b..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersActivity.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step4;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.Book;
-
-import java.util.List;
-
-public class TypeConvertersActivity extends LifecycleActivity {
-
- private TypeConvertersViewModel mViewModel;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- // Get a reference to the ViewModel for this screen.
- mViewModel = ViewModelProviders.of(this).get(TypeConvertersViewModel.class);
-
- // Update the UI whenever there's a change in the ViewModel's data.
- subscribeUiBooks();
- }
-
- public void onRefreshBtClicked(View view) {
- mViewModel.createDb();
- }
-
- private void subscribeUiBooks() {
- mViewModel.getBooks().observe(this, new Observer<List<Book>>() {
- @Override
- public void onChanged(@NonNull final List<Book> books) {
- showBooksInUi(books, mBooksTextView);
- }
- });
- }
-
- private static void showBooksInUi(final @NonNull List<Book> books,
- final TextView booksTextView) {
- StringBuilder sb = new StringBuilder();
-
- for (Book book : books) {
- sb.append(book.title);
- sb.append("\n");
-
- }
- booksTextView.setText(sb.toString());
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersViewModel.java
deleted file mode 100644
index 08b7edf..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4/TypeConvertersViewModel.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step4;
-
-import android.app.Application;
-
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.List;
-
-
-public class TypeConvertersViewModel extends AndroidViewModel {
-
- private LiveData<List<Book>> mBooks;
-
- private AppDatabase mDb;
-
- public TypeConvertersViewModel(Application application) {
- super(application);
- createDb();
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(this.getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
-
- // Receive changes
- subscribeToDbChanges();
- }
-
- public LiveData<List<Book>> getBooks() {
- return mBooks;
- }
-
- private void subscribeToDbChanges() {
- // Books is a LiveData object so updates are observed.
- // TODO: replace this with a query that finds books borrowed by Mike in the last 24h
- mBooks = mDb.bookModel().findBooksBorrowedByName("Mike");
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersActivity.java
deleted file mode 100644
index 2d309ac..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersActivity.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step4_solution;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-import com.example.android.persistence.codelab.db.Book;
-
-import java.util.List;
-
-public class TypeConvertersActivity extends LifecycleActivity {
-
- private TypeConvertersViewModel mViewModel;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- // Get a reference to the ViewModel for this screen.
- mViewModel = ViewModelProviders.of(this).get(TypeConvertersViewModel.class);
-
- // Update the UI whenever there's a change in the ViewModel's data.
- subscribeUiBooks();
- }
-
- public void onRefreshBtClicked(View view) {
- mViewModel.createDb();
- }
-
- private void subscribeUiBooks() {
- mViewModel.getBooks().observe(this, new Observer<List<Book>>() {
- @Override
- public void onChanged(@NonNull final List<Book> books) {
- showBooksInUi(books, mBooksTextView);
- }
- });
- }
-
- private static void showBooksInUi(final @NonNull List<Book> books,
- final TextView booksTextView) {
- StringBuilder sb = new StringBuilder();
-
- for (Book book : books) {
- sb.append(book.title);
- sb.append("\n");
-
- }
- booksTextView.setText(sb.toString());
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersViewModel.java
deleted file mode 100644
index 5add97c..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step4_solution/TypeConvertersViewModel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step4_solution;
-
-import android.app.Application;
-
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.Book;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-
-public class TypeConvertersViewModel extends AndroidViewModel {
-
- private LiveData<List<Book>> mBooks;
-
- private AppDatabase mDb;
-
- public TypeConvertersViewModel(Application application) {
- super(application);
- createDb();
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(this.getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
-
- // Receive changes
- subscribeToDbChanges();
- }
-
- public LiveData<List<Book>> getBooks() {
- return mBooks;
- }
-
- private void subscribeToDbChanges() {
- // Books is a LiveData object so updates are observed.
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.DATE, -1);
- Date yesterday = calendar.getTime();
- mBooks = mDb.bookModel().findBooksBorrowedByNameAfter("Mike", yesterday);
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultActivity.java
deleted file mode 100644
index 2e07e97..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultActivity.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step5;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-
-
-public class CustomResultActivity extends LifecycleActivity {
-
- private CustomResultViewModel mShowUserViewModel;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- mShowUserViewModel = ViewModelProviders.of(this).get(CustomResultViewModel.class);
-
- populateDb();
-
- subscribeUiLoans();
- }
-
- private void populateDb() {
- mShowUserViewModel.createDb();
- }
-
- private void subscribeUiLoans() {
- mShowUserViewModel.getLoansResult().observe(this, new Observer<String>() {
- @Override
- public void onChanged(@Nullable final String result) {
- mBooksTextView.setText(result);
- }
- });
- }
-
- public void onRefreshBtClicked(View view) {
- populateDb();
- subscribeUiLoans();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultViewModel.java
deleted file mode 100644
index 157c4db..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5/CustomResultViewModel.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step5;
-
-import android.app.Application;
-import android.arch.core.util.Function;
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.Transformations;
-
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.LoanWithUserAndBook;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-
-public class CustomResultViewModel extends AndroidViewModel {
-
- private LiveData<String> mLoansResult;
-
- private AppDatabase mDb;
-
- public CustomResultViewModel(Application application) {
- super(application);
- }
-
- public LiveData<String> getLoansResult() {
- return mLoansResult;
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
-
- // Receive changes
- subscribeToDbChanges();
- }
-
- private void subscribeToDbChanges() {
- // TODO: Modify this query to show only recent loans from specific user
- LiveData<List<LoanWithUserAndBook>> loans
- = mDb.loanModel().findAllWithUserAndBook();
-
- // Instead of exposing the list of Loans, we can apply a transformation and expose Strings.
- mLoansResult = Transformations.map(loans,
- new Function<List<LoanWithUserAndBook>, String>() {
- @Override
- public String apply(List<LoanWithUserAndBook> loansWithUserAndBook) {
- StringBuilder sb = new StringBuilder();
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm",
- Locale.US);
-
- for (LoanWithUserAndBook loan : loansWithUserAndBook) {
- sb.append(String.format("%s\n (Returned: %s)\n",
- loan.bookTitle,
- simpleDateFormat.format(loan.endTime)));
- }
- return sb.toString();
- }
- });
- }
-
- @SuppressWarnings("unused")
- private Date getYesterdayDate() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.DATE, -1);
- return calendar.getTime();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultUserActivity.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultUserActivity.java
deleted file mode 100644
index e17a809..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultUserActivity.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step5_solution;
-
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.View;
-import android.widget.TextView;
-
-import android.arch.lifecycle.LifecycleActivity;
-import android.arch.lifecycle.Observer;
-import android.arch.lifecycle.ViewModelProviders;
-import com.example.android.codelabs.persistence.R;
-
-
-public class CustomResultUserActivity extends LifecycleActivity {
-
- private CustomResultViewModel mShowUserViewModel;
-
- private TextView mBooksTextView;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.db_activity);
- mBooksTextView = (TextView) findViewById(R.id.books_tv);
-
- mShowUserViewModel = ViewModelProviders.of(this).get(CustomResultViewModel.class);
-
- populateDb();
-
- subscribeUiLoans();
- }
-
- private void populateDb() {
- mShowUserViewModel.createDb();
- }
-
- private void subscribeUiLoans() {
- mShowUserViewModel.getLoansResult().observe(this, new Observer<String>() {
- @Override
- public void onChanged(@Nullable final String result) {
- mBooksTextView.setText(result);
- }
- });
- }
-
- public void onRefreshBtClicked(View view) {
- populateDb();
- subscribeUiLoans();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultViewModel.java b/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultViewModel.java
deleted file mode 100644
index f6f4c20..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/java/com/example/android/persistence/codelab/step5_solution/CustomResultViewModel.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2017, 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.persistence.codelab.step5_solution;
-
-import android.app.Application;
-import android.arch.core.util.Function;
-import android.arch.lifecycle.AndroidViewModel;
-import android.arch.lifecycle.LiveData;
-import android.arch.lifecycle.Transformations;
-
-import com.example.android.persistence.codelab.db.AppDatabase;
-import com.example.android.persistence.codelab.db.LoanWithUserAndBook;
-import com.example.android.persistence.codelab.db.utils.DatabaseInitializer;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-
-public class CustomResultViewModel extends AndroidViewModel {
-
- private LiveData<String> mLoansResult;
-
- private AppDatabase mDb;
-
- public CustomResultViewModel(Application application) {
- super(application);
- }
-
- public LiveData<String> getLoansResult() {
- return mLoansResult;
- }
-
- public void createDb() {
- mDb = AppDatabase.getInMemoryDatabase(getApplication());
-
- // Populate it with initial data
- DatabaseInitializer.populateAsync(mDb);
-
- // Receive changes
- subscribeToDbChanges();
- }
-
- private void subscribeToDbChanges() {
- LiveData<List<LoanWithUserAndBook>> loans
- = mDb.loanModel().findLoansByNameAfter("Mike", getYesterdayDate());
-
- // Instead of exposing the list of Loans, we can apply a transformation and expose Strings.
- mLoansResult = Transformations.map(loans,
- new Function<List<LoanWithUserAndBook>, String>() {
- @Override
- public String apply(List<LoanWithUserAndBook> loansWithUserAndBook) {
- StringBuilder sb = new StringBuilder();
- SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm",
- Locale.US);
-
- for (LoanWithUserAndBook loan : loansWithUserAndBook) {
- sb.append(String.format("%s\n (Returned: %s)\n",
- loan.bookTitle,
- simpleDateFormat.format(loan.endTime)));
- }
- return sb.toString();
- }
- });
- }
-
- private Date getYesterdayDate() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.DATE, -1);
- return calendar.getTime();
- }
-}
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity.xml
deleted file mode 100644
index d4b7bfb..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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.
- -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/books_borrowed_by_user"
- android:textSize="24sp" />
-
- <TextView
- android:id="@+id/books_tv"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingStart="8dp" />
-
- <Button
- android:id="@+id/button"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:onClick="onRefreshBtClicked"
- android:text="@string/refresh" />
-
- </LinearLayout>
-
- </ScrollView>
-
-</RelativeLayout>
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity1.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity1.xml
deleted file mode 100644
index d603b9d..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/layout/db_activity1.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- ~ Copyright 2017, 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.
- -->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/activity_main"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
- android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
- android:paddingTop="@dimen/activity_vertical_margin">
-
- <ScrollView
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/young_users"
- android:textSize="24sp" />
-
- <TextView
- android:id="@+id/young_users_tv"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingStart="8dp" />
-
- </LinearLayout>
- </ScrollView>
-</RelativeLayout>
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-hdpi/ic_launcher.png b/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index e19d44f..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-hdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-mdpi/ic_launcher.png b/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 7876250..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-mdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index 9ae3725..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index 6a6c3aa..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 43ca523..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/colors.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/values/colors.xml
deleted file mode 100644
index 255f15d..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright 2017, 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>
- <color name="colorPrimary">#3F51B5</color>
- <color name="colorPrimaryDark">#303F9F</color>
- <color name="colorAccent">#FF4081</color>
-</resources>
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/dimens.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/values/dimens.xml
deleted file mode 100644
index 9a3477e..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/dimens.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--
- ~ Copyright 2017, 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>
- <!-- Default screen margins, per the Android Design guidelines. -->
- <dimen name="activity_horizontal_margin">16dp</dimen>
- <dimen name="activity_vertical_margin">16dp</dimen>
-</resources>
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/strings.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/values/strings.xml
deleted file mode 100644
index 8d4f357..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--
- ~ Copyright 2017, 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">Persistence codelab</string>
- <string name="books_borrowed_by_user">Books borrowed by Mike:</string>
- <string name="refresh">Refresh</string>
- <string name="young_users">Young users:</string>
-</resources>
diff --git a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/styles.xml b/samples-flatfoot/codelabs/persistence/app/src/main/res/values/styles.xml
deleted file mode 100644
index 7aa7228..0000000
--- a/samples-flatfoot/codelabs/persistence/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
- ~ Copyright 2017, 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. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- Customize your theme here. -->
- <item name="colorPrimary">@color/colorPrimary</item>
- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
- <item name="colorAccent">@color/colorAccent</item>
- </style>
-
-</resources>
diff --git a/samples-flatfoot/codelabs/persistence/build.gradle b/samples-flatfoot/codelabs/persistence/build.gradle
deleted file mode 100644
index c68afa8..0000000
--- a/samples-flatfoot/codelabs/persistence/build.gradle
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- jcenter()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- jcenter()
- maven {
- url "../../../prebuilts0905"
- }
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
-
-ext {
- buildToolsVersion = "25.0.2"
- supportLibVersion = "25.3.1"
- runnerVersion = "0.5"
- rulesVersion = "0.5"
- espressoVersion = "2.2.2"
- archLifecycleVersion = "1.0-SNAPSHOT"
- archRoomVersion = "1.0-SNAPSHOT"
-}
\ No newline at end of file
diff --git a/samples-flatfoot/codelabs/persistence/gradle.properties b/samples-flatfoot/codelabs/persistence/gradle.properties
deleted file mode 100644
index 684bee6..0000000
--- a/samples-flatfoot/codelabs/persistence/gradle.properties
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-# Project-wide Gradle settings.
-
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
diff --git a/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.jar b/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 13372ae..0000000
--- a/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.properties b/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 1af3d91..0000000
--- a/samples-flatfoot/codelabs/persistence/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright 2017, 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.
-#
-
-#Mon Feb 20 17:11:12 GMT 2017
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
diff --git a/samples-flatfoot/codelabs/persistence/gradlew b/samples-flatfoot/codelabs/persistence/gradlew
deleted file mode 100755
index 9d82f78..0000000
--- a/samples-flatfoot/codelabs/persistence/gradlew
+++ /dev/null
@@ -1,160 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >/dev/null
-APP_HOME="`pwd -P`"
-cd "$SAVED" >/dev/null
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
- JAVACMD=`cygpath --unix "$JAVACMD"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/samples-flatfoot/codelabs/persistence/gradlew.bat b/samples-flatfoot/codelabs/persistence/gradlew.bat
deleted file mode 100644
index aec9973..0000000
--- a/samples-flatfoot/codelabs/persistence/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/samples-flatfoot/codelabs/persistence/settings.gradle b/samples-flatfoot/codelabs/persistence/settings.gradle
deleted file mode 100644
index a266f7d..0000000
--- a/samples-flatfoot/codelabs/persistence/settings.gradle
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright 2017, 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.
- */
-
-include ':app'
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar
deleted file mode 100644
index 6138a05..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.md5
deleted file mode 100644
index 21687b1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-ca1aba09bd76b2d712a70b09674fa412
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.sha1
deleted file mode 100644
index c355fa9..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-786fff12d11854e99079f3e0e6b83ebd28ff760b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar
deleted file mode 100644
index 841ae62..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.md5
deleted file mode 100644
index 900ce94..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-9e86f87a007df4935a8cf0082e1320a9
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.sha1
deleted file mode 100644
index eb644c7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-3b31c3725f3657796df063e274b23e6383d662db
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom
deleted file mode 100644
index bc302ff..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.core</groupId>
- <artifactId>core-testing</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>compile</scope>
- <exclusions>
- <exclusion>
- <artifactId>hamcrest-core</artifactId>
- <groupId>*</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.md5
deleted file mode 100644
index 99a13b1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-9161bbbd4308131850c1620bb771413b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.sha1
deleted file mode 100644
index 8881d77..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/core-testing-1.0-20170509.055323-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-980c8177656c28f493cb217a9062edc76f3d3200
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 3f48496..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.core</groupId>
- <artifactId>core-testing</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055323</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055323</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 482731c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-16f7cf4f43258b77ea8e33338cd1f4cb
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index a01b80b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d7c7da1de4e1b50b126834001789e48c480cec9b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml
deleted file mode 100644
index bdb88ee..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.core</groupId>
- <artifactId>core-testing</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055323</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.md5
deleted file mode 100644
index 2bbeb72..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-28ca42527f6d8bec31b416b80d6ffc54
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.sha1
deleted file mode 100644
index cd44769..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core-testing/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-94753c43775c32019a4f85863e1338d7ff3638aa
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar
deleted file mode 100644
index f52dc52..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.md5
deleted file mode 100644
index 2de86ff..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-a9cb0e2a06be3862ac3eb5dd0a40bc38
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.sha1
deleted file mode 100644
index fff6c6e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-492b289a5504fa4911396b6aa30f51152f3bd63d
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar
deleted file mode 100644
index f7f1fe2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.md5
deleted file mode 100644
index 5e269c4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-85e796de2d30eb59d8efab529494aef1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.sha1
deleted file mode 100644
index 50b923f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9b8ae95c6cc663e2d878fa0eb8d5929d48e317be
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom
deleted file mode 100644
index e4f8577..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.md5
deleted file mode 100644
index f3b5050..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-50b9fc578d98dbde38da151dd8b255ab
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.sha1
deleted file mode 100644
index 91cc482..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/core-1.0-20170509.055320-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9f6fb7815cbc0182e9ec7f8265a1cdb7b61683d6
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 200b060..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055320</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055320</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index e5613e2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-3c01bf68e8d32b635a83b8253fc25d23
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index b26628c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-58c742a83ad30c448a9a761d47c294c6cc8ac7c1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml
deleted file mode 100644
index 239807f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055320</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.md5
deleted file mode 100644
index fa46ec3..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-60274a3697bb7af7269caf05465128b0
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.sha1
deleted file mode 100644
index d2982c8..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/core/core/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-519a49c6d42f3b1c626f50ac403a9d41eabec4a6
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar
deleted file mode 100644
index e40c05a..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5
deleted file mode 100644
index a0a52da..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-e8baf35acac6b25d983783be3e621cda
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1
deleted file mode 100644
index 58a271e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-89fb66a8f95627748ead98b767a49049ffde0dff
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar
deleted file mode 100644
index 4aa7230..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5
deleted file mode 100644
index 68484a7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-802e82041a07652f61f9165b153dc15d
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1
deleted file mode 100644
index f83bdc4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e3145ca81e2c53e03fd28e2055038c6dcbd685a3
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom
deleted file mode 100644
index 2a2c6a2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5
deleted file mode 100644
index f587d0d..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-a3d47b73dc2c60f4e284edccaa32a2c6
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1
deleted file mode 100644
index 4b27254..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-08b48078fcd3405b228d765b3f5330657177dcf9
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 0639952..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055319</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index de4dbeb..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-adfb440ef27599c81051adf3c6870fdd
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 2cdc1f1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-fe97e167517cf6a5dea2542bdb6dcf0a8b4fd836
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml
deleted file mode 100644
index d57f771..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.md5
deleted file mode 100644
index 0028096..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-9e7b509d54a18ba3dd9d4490c5e0fe4b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.sha1
deleted file mode 100644
index 6a4a338..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/common/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0a2cc2cde711fcfab4a2130f23a2ffc46da1c9e2
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar
deleted file mode 100644
index c4ec5ee..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.md5
deleted file mode 100644
index 5f9022d..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-283d1cef886ab31cdfa36fc4f4723522
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.sha1
deleted file mode 100644
index 057382f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bb04fae46a4f5b3437647c6b220d3f83e743a142
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom
deleted file mode 100644
index f535b27..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>compiler</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.auto</groupId>
- <artifactId>auto-common</artifactId>
- <version>0.6</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.squareup</groupId>
- <artifactId>javapoet</artifactId>
- <version>1.8.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.testing.compile</groupId>
- <artifactId>compile-testing</artifactId>
- <version>0.9</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.md5
deleted file mode 100644
index 6133381..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-11e01c4576a32a85e2217ace258bb3ae
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.sha1
deleted file mode 100644
index 7f95c9e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055334-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0b05cdc5ef9399c719781af8eca2181e26c497eb
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 9f84bdd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>compiler</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055334</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055334</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 42056ce..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-a8acb146e14626b29f5fcadaf0024440
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 63adc5c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4f276e57a746f8db4893e08f0f27ae8ba56d7fce
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml
deleted file mode 100644
index d5436f7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>compiler</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055334</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.md5
deleted file mode 100644
index f76a96f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-c57843ea079fc099a5154241eec684cf
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.sha1
deleted file mode 100644
index f9a9353..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/compiler/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5fc8da2188394ab4e2eb58c531c9220f13db8a24
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar
deleted file mode 100644
index d73e7df..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.md5
deleted file mode 100644
index 767e164..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-e4b150782bee7fb260a2c78853477add
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.sha1
deleted file mode 100644
index bd310fa..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a5925ed0438d698a075e6414436cfdcc4c9e0ba7
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar
deleted file mode 100644
index a09f22c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.md5
deleted file mode 100644
index 89fe675..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-e418844524d5c65029aa348c53a0bf67
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.sha1
deleted file mode 100644
index d39825b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-373647ae3a3bad83e032c612649efd2ea133799e
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom
deleted file mode 100644
index 9296ff2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>extensions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-fragment</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.md5
deleted file mode 100644
index 7978412..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-b3f086ec40beb1fcc4bdbe38c5a20991
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.sha1
deleted file mode 100644
index 0dfcc82..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/extensions-1.0-20170509.055326-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1b0f4dacffaededdf8586e0725ee7b885a35ca78
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index af54226..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>extensions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055326</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index efc9595..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-99b5c18f18ea47c80ece0f2491238a30
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 2898c42..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0dfc0c4ec791e73736f931cc858dedc97b3fd7f3
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml
deleted file mode 100644
index 93ce52b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>extensions</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.md5
deleted file mode 100644
index 522068b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-040c8b66d0d04d6c22a3387168a3ea55
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.sha1
deleted file mode 100644
index 60128e1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/extensions/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bb7352424e9431928663f02b3c0601594851185d
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 74ef725..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>reactivestreams</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055326</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 933c1d0..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-7fc056a05fe5d7c22a1e7272a29b3260
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index dee724e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1a0545cbc716124ace898ea8d8591682fba09858
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar
deleted file mode 100644
index fdf77cb..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.md5
deleted file mode 100644
index 10ec5e4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-52a8b0601fcc93dbe00c6c4383a761f9
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.sha1
deleted file mode 100644
index 63a57f2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4be78d28a595a3780e81688377685fa3a8e6e762
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar
deleted file mode 100644
index d3fbc8d..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.md5
deleted file mode 100644
index ebf9646..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-7c9c2c20f41ca66ab06d29ba702717e1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.sha1
deleted file mode 100644
index 3b283bd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0ea07afc69041e728122223c405754daf3c6245b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom
deleted file mode 100644
index 1acf4de..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>reactivestreams</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>extensions</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.reactivestreams</groupId>
- <artifactId>reactive-streams</artifactId>
- <version>1.0.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.md5
deleted file mode 100644
index 281c0ec..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-d100fe77c4b95264134281078880bf7c
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.sha1
deleted file mode 100644
index 83d8797..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/1.0-SNAPSHOT/reactivestreams-1.0-20170509.055326-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0b1f6442bb8375850efc983bef2352cb17fbfb49
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml
deleted file mode 100644
index 219ace3..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>reactivestreams</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.md5
deleted file mode 100644
index 613ffc5..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-a8578e327c72aef75966f5d8e2dab594
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.sha1
deleted file mode 100644
index a02462f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/reactivestreams/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bc5e3cca5166659a77527b953600fe9d9cc14f99
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 07fcce9..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055323</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055323</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 0a6997e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-119521b96ea5b84141125701eb521df0
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 021dc3e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bb6a47101b4b0b10f21d31869325168d2282510b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar
deleted file mode 100644
index 5c5b019..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.md5
deleted file mode 100644
index 429dca5..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-ddac4b3463d2bce5169b57550caf4897
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.sha1
deleted file mode 100644
index a451feb..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-684636a06ea02c5c7c0edb05cef8b54b6904cd9a
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar
deleted file mode 100644
index 3977677..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.md5
deleted file mode 100644
index e92c468..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-9378a6ef4cfdfa8edb8782ccea95cdf7
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.sha1
deleted file mode 100644
index 6e17fc4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-df3ef640c9deb3ff016704de2730b2f8b45f9fd4
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom
deleted file mode 100644
index 7277c40..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-fragment</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.md5
deleted file mode 100644
index 8a3f144..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-cdb420b579966da6376ed24a5ae83b69
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.sha1
deleted file mode 100644
index 5cc15e7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055323-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-58d1017ee4b7026ce71d4f5d8be32615332f3875
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml
deleted file mode 100644
index f61cff8..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.lifecycle</groupId>
- <artifactId>runtime</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055323</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.md5
deleted file mode 100644
index cf3ad70..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-d8899f99ced40f4ad3bbd8fbe36841f1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.sha1
deleted file mode 100644
index d73bdaf..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/lifecycle/runtime/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a8a7e9043d27353cfe1365687757e8585a004695
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar
deleted file mode 100644
index edd10aa..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5
deleted file mode 100644
index 3924784..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-d96a6026f4f80ce4d6b89c0fc4303796
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1
deleted file mode 100644
index ed8b25e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5d525be81aafd7f9dcdf97256ebc048c9eabcb07
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar
deleted file mode 100644
index 2d13c79..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5
deleted file mode 100644
index 653ce9e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-617e423f1eb5587f924f26c92cf6fe7c
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1
deleted file mode 100644
index 0994ece..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8f2696a4d237db1a136040470d52e7d8509c5e76
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom
deleted file mode 100644
index 9e1e0a7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5
deleted file mode 100644
index 337b77b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-d2d34afe4df97e3cc011ea5767004ab1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1
deleted file mode 100644
index 7aed843..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/common-1.0-20170509.055319-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-cfb361baaef3ea8286b0b20785d6e1fac68abf38
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 4f8bf1d..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055319</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 62b1eb2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-f87d8e9973f56fdafd9815f8642f3358
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 330cc7f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2110a03050a782cb1b95ec525e6039429b40d74f
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml
deleted file mode 100644
index 4cb4c36..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.md5
deleted file mode 100644
index 600e038..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-7fc679dffa8896ced94b1ba240424f1a
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.sha1
deleted file mode 100644
index d0db785..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/common/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9f66a6fcbce5453296232fbab25c009bf6ebc2d3
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar
deleted file mode 100644
index 87008fd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.md5
deleted file mode 100644
index 5dab906..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-878684478cf5fcd81aa5961c0bf8c940
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.sha1
deleted file mode 100644
index cda2f71..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-01fbebc823191731e95eb090598bddb71c770846
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom
deleted file mode 100644
index efe6593..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>compiler</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>migration</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.auto</groupId>
- <artifactId>auto-common</artifactId>
- <version>0.6</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.squareup</groupId>
- <artifactId>javapoet</artifactId>
- <version>1.8.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr4</artifactId>
- <version>4.5.3</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.xerial</groupId>
- <artifactId>sqlite-jdbc</artifactId>
- <version>3.16.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.10</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.testing.compile</groupId>
- <artifactId>compile-testing</artifactId>
- <version>0.9</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.intellij</groupId>
- <artifactId>annotations</artifactId>
- <version>12.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.md5
deleted file mode 100644
index 488d62c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-48fb3ae050b678360a30cb666cf9a1c6
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.sha1
deleted file mode 100644
index 75933e7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/compiler-1.0-20170509.055353-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e4542a5347e599d1d47698c0d22b9896b143aea1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 8ce1efb..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>compiler</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055353</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055353</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 7b11f7b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-968ac62f039514702b626c638098a1c8
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 0f271a2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-077974f948717100560d289e57c7dfdf64ec9ffb
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml
deleted file mode 100644
index 9789469..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>compiler</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055353</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.md5
deleted file mode 100644
index 19b39d5..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-971636fd89a0d54a36cf44c563013f86
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.sha1
deleted file mode 100644
index 6ed6e2c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/compiler/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f4c75f7d9c9d2a8b435d8bf5dc3a76c9f8b208c0
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index d2b3c09..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>migration</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055319</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 48d33d0..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-d506023a946730d4c5a41001626247f1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 6660c9b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-da8833c7dcb320a7f548e52943a3486019bc16ed
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar
deleted file mode 100644
index fd9cd07..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.md5
deleted file mode 100644
index 925253c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-60b4e759c801c0352ede3896ddae748a
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.sha1
deleted file mode 100644
index 44a46ad..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9cd324c2a179d054e2211967c22b806fe8af955e
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom
deleted file mode 100644
index 9d8a6fa..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>migration</artifactId>
- <version>1.0-SNAPSHOT</version>
- <dependencies>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib</artifactId>
- <version>1.1.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.intellij</groupId>
- <artifactId>annotations</artifactId>
- <version>12.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.md5
deleted file mode 100644
index 33a93b0..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-0a669e52701c46ecadc30de6c051a639
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.sha1
deleted file mode 100644
index 0a70f31..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/1.0-SNAPSHOT/migration-1.0-20170509.055319-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a63a70d662d9323509cb6a572a796758fe9db461
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml
deleted file mode 100644
index ebb0a29..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>migration</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055319</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.md5
deleted file mode 100644
index 978b8a7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-99b3b410dc02180c9c0c10c3781fa579
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.sha1
deleted file mode 100644
index 2c8a5a7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/migration/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-cd88e7b77886db1e0b132f0e9e9a53cdb03970a3
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 730bd12..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055326</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index fc02d49..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-a924de46a5dcc1837668bfa561d23711
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index b0aff48..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9104e562526a8f14c66bb9e98254b57ea80600d0
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar
deleted file mode 100644
index f6ee59f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.md5
deleted file mode 100644
index d40df09..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-eda26e1ab785dc53971d889eb9845083
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.sha1
deleted file mode 100644
index 27bb421..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e4e8c9823635c2322145356b70ef47f2cfc28ab1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar
deleted file mode 100644
index 2379814..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.md5
deleted file mode 100644
index 1ec84fd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-f0175ecb0f8d43aaaeb4d692fde7d116
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.sha1
deleted file mode 100644
index d1e8e03..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a66782337fb073ec6f5f7697238c9346bc286532
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom
deleted file mode 100644
index f36ae08..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.md5
deleted file mode 100644
index 2b67aef..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-63a5441f7d834dca6869ca055581a475
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.sha1
deleted file mode 100644
index f9dd7aa..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/1.0-SNAPSHOT/runtime-1.0-20170509.055326-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9b2b7d966e4a38c01ae60edd3f18b7cd54fba817
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml
deleted file mode 100644
index b1872b1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>runtime</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055326</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.md5
deleted file mode 100644
index 9e5d9c2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-19721121b6e77919fb393e427498d077
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.sha1
deleted file mode 100644
index 2b87a99..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/runtime/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-993d09a7892477275a4fe8e66631c4588e08b510
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 2c5971f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>rxjava2</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055327</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055327</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index e4459d4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-c0a13a54362f5390ee372be302cbcbeb
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index b2c0179..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a22e62e654b051d3747bea4b571eab0ce8a7f74c
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar
deleted file mode 100644
index 01fcbf2..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.md5
deleted file mode 100644
index 3054f51..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-35d73b25d37fcee1a93968ec26b3cff5
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.sha1
deleted file mode 100644
index 5182d8c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-4019a6fb4e91c18e57c616f7757b1416cfd3dbe4
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar
deleted file mode 100644
index ff6d027..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.md5
deleted file mode 100644
index 22d1715..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-5a829c47d703301417cc6cdfb5fbd59b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.sha1
deleted file mode 100644
index 5a0f774..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c0ab291d1694054050f731b9dbff531a70e16062
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom
deleted file mode 100644
index a874342..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>rxjava2</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>io.reactivex.rxjava2</groupId>
- <artifactId>rxjava</artifactId>
- <version>2.0.6</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.md5
deleted file mode 100644
index 35a1d84..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-93d2c8e208b502d109ceb9f643cb45f9
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.sha1
deleted file mode 100644
index db0de3c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/1.0-SNAPSHOT/rxjava2-1.0-20170509.055327-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-dd0eb45799347fdb34ecc954aac657c3171aee92
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml
deleted file mode 100644
index 8715932..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>rxjava2</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055327</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.md5
deleted file mode 100644
index 5fc31ef..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-7c48385b26704ac646c7bf9cd8a5bb52
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.sha1
deleted file mode 100644
index 77f2cdd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/rxjava2/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8ba90dedbd7600671eb67ac40259103b2cac38af
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index 40eb680..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055321</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055321</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 9365695..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-3bc629486eaa6d2cae6abfcad5265a22
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index b5f569b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c6bb4877462ab4f0e61ae9d128e88f8b91d016e5
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar
deleted file mode 100644
index 7f1a590..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.md5
deleted file mode 100644
index 20e510b..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-55ed9edfb94fb93ec6472f0b8e0711b8
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.sha1
deleted file mode 100644
index 656af8d..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-8c84ee3e91cce6ccf284bc94d4472714092bc98d
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar
deleted file mode 100644
index d079677..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.md5
deleted file mode 100644
index 31fee99..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-245cae9051e31d798357f66330982b5f
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.sha1
deleted file mode 100644
index 4161415..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-1fdafb1d828ce170ca0f11c3ddb293bcf5efce0f
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom
deleted file mode 100644
index 73afcf1..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.md5
deleted file mode 100644
index d5372bd..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-380065e2dc039d8d34076288bb2ea938
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.sha1
deleted file mode 100644
index 9559b0e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/1.0-SNAPSHOT/support-db-impl-1.0-20170509.055321-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-c532878901a9aea9a5524ae24f14a065c5a3b87e
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml
deleted file mode 100644
index 965ab38..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db-impl</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055321</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.md5
deleted file mode 100644
index ab89ce3..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-fd51ff5d8d3680ec184c53d3b91d0ed1
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.sha1
deleted file mode 100644
index c72819f..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db-impl/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a2d5a89cb59f6fc89cba73e91b985b344afd87f4
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index bf42d23..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055321</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055321</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index 873f0bc..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-2cf9e4ddbd0f858a15e07ac3355aeb24
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 9134405..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5f2a26acd9607febe58a18cce0265f2ca4c880aa
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar
deleted file mode 100644
index 52ad39a..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.md5
deleted file mode 100644
index 16b3b27..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-4266c636eb39b348d7d91e4dcce2ddf0
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.sha1
deleted file mode 100644
index 212c5f6..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a9af60a542e8a4cb28d6983e87cb5e65c84bce33
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar
deleted file mode 100644
index ae6fd22..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.md5
deleted file mode 100644
index 9b46fb8..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-aff2c60fe9ae9879d3aba2b2d74e426b
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.sha1
deleted file mode 100644
index e43f29e..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-3c485b7a86a6cccbf98b6f330bbf7a1409798f16
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom
deleted file mode 100644
index 16e3450..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-annotations</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.md5
deleted file mode 100644
index b3cc2ff..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-efe1c96944a927073adda14ff86c2135
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.sha1
deleted file mode 100644
index a180ef3..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/1.0-SNAPSHOT/support-db-1.0-20170509.055321-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b85080854ab0c7856175b5bc235f07392df97b77
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml
deleted file mode 100644
index f2bc7f7..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055321</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.md5
deleted file mode 100644
index 0901e08..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-fa59bfa211d652dcc19b2e663c68ebc4
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.sha1
deleted file mode 100644
index 7432573..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/support-db/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2c3c2f524d551508d7adc3f99c3c0a26c08ee9d8
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml
deleted file mode 100644
index b73482a..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>testing</artifactId>
- <version>1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <timestamp>20170509.055327</timestamp>
- <buildNumber>1</buildNumber>
- </snapshot>
- <lastUpdated>20170509055327</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.md5
deleted file mode 100644
index bdad56c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-e2d9eb39804daee0510063402d3657e6
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.sha1
deleted file mode 100644
index 56ed4cc..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0c604096877dbc6ef6c947217335895115690568
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar
deleted file mode 100644
index 190f5e4..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.md5
deleted file mode 100644
index 18f461c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.md5
+++ /dev/null
@@ -1 +0,0 @@
-4ce813e7662bb18f1a1160549c1e8aea
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.sha1
deleted file mode 100644
index dc67b23..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1-sources.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-be6096c6c0e24cdaece94a81f311d632eabf5481
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar
deleted file mode 100644
index aea6991..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar
+++ /dev/null
Binary files differ
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.md5
deleted file mode 100644
index 62ff241..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.md5
+++ /dev/null
@@ -1 +0,0 @@
-cdcceb69a05e598ea45569fcd30dec7e
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.sha1
deleted file mode 100644
index b4090a5..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.aar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-9bc04de1a0494539696ad1a97d9b4eb3afe14f86
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom
deleted file mode 100644
index e05307c..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>testing</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>aar</packaging>
- <dependencies>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>common</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>runtime</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>support-db-impl</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>migration</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>android.arch.core</groupId>
- <artifactId>core</artifactId>
- <version>1.0-SNAPSHOT</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>com.android.support</groupId>
- <artifactId>support-core-utils</artifactId>
- <version>25.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
-</project>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.md5
deleted file mode 100644
index 95dd555..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.md5
+++ /dev/null
@@ -1 +0,0 @@
-a8ff5e6331cbfbb65cfe54098c53fef7
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.sha1
deleted file mode 100644
index 972fbc3..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/1.0-SNAPSHOT/testing-1.0-20170509.055327-1.pom.sha1
+++ /dev/null
@@ -1 +0,0 @@
-0d39779bea0506af5ffa78167035cd62ad72e8b7
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml
deleted file mode 100644
index 0784805..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata>
- <groupId>android.arch.persistence.room</groupId>
- <artifactId>testing</artifactId>
- <versioning>
- <versions>
- <version>1.0-SNAPSHOT</version>
- </versions>
- <lastUpdated>20170509055327</lastUpdated>
- </versioning>
-</metadata>
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.md5 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.md5
deleted file mode 100644
index e6a97a9..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.md5
+++ /dev/null
@@ -1 +0,0 @@
-2132c0282da897b43ed3b8e50548dcc2
\ No newline at end of file
diff --git a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.sha1 b/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.sha1
deleted file mode 100644
index c167f8a..0000000
--- a/samples-flatfoot/prebuilts0905/android/arch/persistence/room/testing/maven-metadata.xml.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f8628435c4e8e8d8f8ae3bf0c4a1f16ebd40c80b
\ No newline at end of file
diff --git a/samples/SupportContentDemos/build.gradle b/samples/SupportContentDemos/build.gradle
index 4c7691a..7e204b1 100644
--- a/samples/SupportContentDemos/build.gradle
+++ b/samples/SupportContentDemos/build.gradle
@@ -16,6 +16,12 @@
apply plugin: 'com.android.application'
+dependencies {
+ implementation project(':design')
+ implementation project(':appcompat-v7')
+ implementation project(':support-content')
+}
+
android {
compileSdkVersion project.ext.currentSdk
@@ -27,14 +33,7 @@
lintOptions {
abortOnError true
- check 'NewApi'
+ disable "SetTextI18n", "AppCompatResource", "WrongConstant", "AllowBackup",
+ "GoogleAppIndexingWarning", "AlwaysShowAction"
}
-
}
-
-dependencies {
- compile project(':design')
- compile project(':appcompat-v7')
- compile project(':support-content')
-}
-
diff --git a/samples/SupportContentDemos/src/main/java/com/example/android/support/content/demos/ContentPagerDemoActivity.java b/samples/SupportContentDemos/src/main/java/com/example/android/support/content/demos/ContentPagerDemoActivity.java
index c2b0266..a496dd3 100644
--- a/samples/SupportContentDemos/src/main/java/com/example/android/support/content/demos/ContentPagerDemoActivity.java
+++ b/samples/SupportContentDemos/src/main/java/com/example/android/support/content/demos/ContentPagerDemoActivity.java
@@ -19,6 +19,7 @@
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.content.ContentPager;
import android.support.content.ContentPager.ContentCallback;
import android.support.content.LoaderQueryRunner;
@@ -34,6 +35,8 @@
import android.view.ViewGroup;
import android.widget.TextView;
+import java.util.Locale;
+
/**
* ContentPager demo activity.
*/
@@ -160,8 +163,9 @@
}
void loadPage(int page) {
- assert page >= 0;
- assert page <= (UnpagedDemoDataProvider.TOTAL_SIZE / PAGE_SIZE) - 1;
+ if (page < 0 || page >= (UnpagedDemoDataProvider.TOTAL_SIZE / PAGE_SIZE)) {
+ throw new IndexOutOfBoundsException();
+ }
mCurrentPage = page;
int offset = mCurrentPage * mPageSize;
@@ -180,7 +184,7 @@
return;
}
- holder.view.setText(String.format(
+ holder.view.setText(String.format(Locale.US,
"%d.%d (%d): %s",
mCurrentPage,
mCursor.getInt(0),
@@ -194,7 +198,7 @@
}
@Override
- public void onCursorReady(Query query, Cursor cursor) {
+ public void onCursorReady(@NonNull Query query, Cursor cursor) {
if (cursor == null) {
msg("Content query returned a null cursor: " + query.getUri());
}
diff --git a/samples/SupportTransitionDemos/AndroidManifest.xml b/samples/SupportTransitionDemos/AndroidManifest.xml
index a58c189..f8398d3 100644
--- a/samples/SupportTransitionDemos/AndroidManifest.xml
+++ b/samples/SupportTransitionDemos/AndroidManifest.xml
@@ -114,5 +114,14 @@
<category android:name="com.example.android.support.transition.SAMPLE_CODE" />
</intent-filter>
</activity>
+
+ <activity android:name=".widget.FragmentTransitionUsage"
+ android:label="@string/fragmentTransition"
+ android:theme="@style/Theme.Transition">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="com.example.android.support.transition.SAMPLE_CODE" />
+ </intent-filter>
+ </activity>
</application>
</manifest>
diff --git a/samples/SupportTransitionDemos/res/layout/fragment_transition.xml b/samples/SupportTransitionDemos/res/layout/fragment_transition.xml
new file mode 100644
index 0000000..4eeddbe
--- /dev/null
+++ b/samples/SupportTransitionDemos/res/layout/fragment_transition.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
diff --git a/samples/SupportTransitionDemos/res/layout/fragment_transition_first.xml b/samples/SupportTransitionDemos/res/layout/fragment_transition_first.xml
new file mode 100644
index 0000000..b0d95ca
--- /dev/null
+++ b/samples/SupportTransitionDemos/res/layout/fragment_transition_first.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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.
+ -->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <Button
+ android:id="@+id/move"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp"
+ android:text="@string/move"/>
+
+ <View
+ android:id="@+id/red"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_gravity="start|center_vertical"
+ android:background="#f00"/>
+
+ <View
+ android:id="@+id/green"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_gravity="start|bottom"
+ android:background="#0f0"/>
+
+</FrameLayout>
diff --git a/samples/SupportTransitionDemos/res/layout/fragment_transition_second.xml b/samples/SupportTransitionDemos/res/layout/fragment_transition_second.xml
new file mode 100644
index 0000000..dc4e66a
--- /dev/null
+++ b/samples/SupportTransitionDemos/res/layout/fragment_transition_second.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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.
+ -->
+
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <View
+ android:id="@+id/red"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_gravity="end|center_vertical"
+ android:background="#f00"/>
+
+ <View
+ android:id="@+id/blue"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:layout_gravity="end|bottom"
+ android:background="#00f"/>
+
+</FrameLayout>
diff --git a/samples/SupportTransitionDemos/res/values/strings.xml b/samples/SupportTransitionDemos/res/values/strings.xml
index b87b371..a8c1138 100644
--- a/samples/SupportTransitionDemos/res/values/strings.xml
+++ b/samples/SupportTransitionDemos/res/values/strings.xml
@@ -25,6 +25,7 @@
<string name="changeTransform">Change Transform</string>
<string name="changeImageTransform">Change Image Transform</string>
<string name="reparentImage">Reparent Image</string>
+ <string name="fragmentTransition">Fragment Transition</string>
<string name="toggle">Toggle</string>
<string name="begin">Begin</string>
<string name="hello_world">Hello, world!</string>
diff --git a/samples/SupportTransitionDemos/src/com/example/android/support/transition/widget/FragmentTransitionUsage.java b/samples/SupportTransitionDemos/src/com/example/android/support/transition/widget/FragmentTransitionUsage.java
new file mode 100644
index 0000000..31cb61a
--- /dev/null
+++ b/samples/SupportTransitionDemos/src/com/example/android/support/transition/widget/FragmentTransitionUsage.java
@@ -0,0 +1,152 @@
+/*
+ * Copyright (C) 2017 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.support.transition.widget;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.transition.AutoTransition;
+import android.support.transition.Fade;
+import android.support.transition.Transition;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.view.animation.FastOutSlowInInterpolator;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.android.support.transition.R;
+
+/**
+ * Demonstrates usage of shared element Transition between Fragments.
+ */
+public class FragmentTransitionUsage extends TransitionUsageBase {
+
+ private static final String SHARED = "red";
+
+ private static final Transition SHARED_TRANSITION = new AutoTransition();
+ private static final Transition NON_SHARED_TRANSITION = new Fade();
+
+ static {
+ SHARED_TRANSITION.setDuration(1000);
+ SHARED_TRANSITION.setInterpolator(new FastOutSlowInInterpolator());
+ NON_SHARED_TRANSITION.setDuration(1000);
+ NON_SHARED_TRANSITION.setInterpolator(new FastOutSlowInInterpolator());
+ }
+
+ private static final String FRAGMENT_FIRST = "first";
+ private static final String FRAGMENT_SECOND = "second";
+
+ @Override
+ int getLayoutResId() {
+ return R.layout.fragment_transition;
+ }
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ if (savedInstanceState == null) {
+ getSupportFragmentManager().beginTransaction()
+ .replace(R.id.container, new FirstFragment(), FRAGMENT_FIRST)
+ .setReorderingAllowed(true)
+ .commitNow();
+ }
+ }
+
+ void showSecond(View sharedElement) {
+ FragmentManager fragmentManager = getSupportFragmentManager();
+ final FirstFragment first =
+ (FirstFragment) fragmentManager.findFragmentByTag(FRAGMENT_FIRST);
+ if (first == null) {
+ return;
+ }
+ final SecondFragment second = new SecondFragment();
+
+ fragmentManager.beginTransaction()
+ .replace(R.id.container, second, FRAGMENT_SECOND)
+ .addToBackStack(null)
+ .setReorderingAllowed(true)
+ .addSharedElement(sharedElement, SHARED)
+ .commit();
+ }
+
+ private abstract static class TransitionFragment extends Fragment {
+
+ @Override
+ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ setSharedElementEnterTransition(SHARED_TRANSITION);
+ setSharedElementReturnTransition(SHARED_TRANSITION);
+ setExitTransition(NON_SHARED_TRANSITION);
+ setEnterTransition(NON_SHARED_TRANSITION);
+ setReenterTransition(NON_SHARED_TRANSITION);
+ setReturnTransition(NON_SHARED_TRANSITION);
+ setAllowEnterTransitionOverlap(true);
+ setAllowReturnTransitionOverlap(true);
+ }
+
+ }
+
+ /**
+ * A {@link Fragment} with red and yellow squares.
+ */
+ public static class FirstFragment extends TransitionFragment {
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_transition_first, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ final View red = view.findViewById(R.id.red);
+ ViewCompat.setTransitionName(red, SHARED);
+ view.findViewById(R.id.move).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ FragmentTransitionUsage activity = (FragmentTransitionUsage) getActivity();
+ if (activity != null) {
+ activity.showSecond(red);
+ }
+ }
+ });
+ }
+
+ }
+
+ /**
+ * A {@link Fragment} with red and blue squares.
+ */
+ public static class SecondFragment extends TransitionFragment {
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_transition_second, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ ViewCompat.setTransitionName(view.findViewById(R.id.red), SHARED);
+ }
+
+ }
+
+}
diff --git a/samples/SupportWearDemos/AndroidManifest.xml b/samples/SupportWearDemos/AndroidManifest.xml
index 4e4fb60..04e3e68 100644
--- a/samples/SupportWearDemos/AndroidManifest.xml
+++ b/samples/SupportWearDemos/AndroidManifest.xml
@@ -20,13 +20,11 @@
<application android:icon="@drawable/app_sample_code" android:label="SupportWearDemos"
android:theme="@android:style/Theme.DeviceDefault">
- <activity android:name="com.example.android.support.wear.app.SimpleWearableRecyclerViewDemo">
- </activity>
- <activity android:name="com.example.android.support.wear.app.WearableSwitchDemo">
- </activity>
- <activity android:name="com.example.android.support.wear.app.CircularProgressLayoutDemo">
- </activity>
- <activity android:name="com.example.android.support.wear.app.MainDemoActivity">
+ <activity android:name=".app.SimpleWearableRecyclerViewDemo" />
+ <activity android:name=".app.WearableSwitchDemo" />
+ <activity android:name=".app.CircularProgressLayoutDemo" />
+ <activity android:name=".app.drawers.WearableDrawersDemo" android:exported="true" />
+ <activity android:name=".app.MainDemoActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
diff --git a/samples/SupportWearDemos/res/layout/wearable_drawers_demo.xml b/samples/SupportWearDemos/res/layout/wearable_drawers_demo.xml
new file mode 100644
index 0000000..27843e0
--- /dev/null
+++ b/samples/SupportWearDemos/res/layout/wearable_drawers_demo.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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.
+ -->
+
+<android.support.wear.widget.drawer.WearableDrawerLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <FrameLayout
+ android:id="@+id/fragment_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <android.support.wear.widget.drawer.WearableNavigationDrawerView
+ android:id="@+id/nav_drawer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <android.support.wear.widget.drawer.WearableActionDrawerView
+ android:id="@+id/action_drawer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:actionMenu="@menu/action_drawer_menu" />
+</android.support.wear.widget.drawer.WearableDrawerLayout>
diff --git a/samples/SupportWearDemos/res/layout/wearable_drawers_frame_layout_demo.xml b/samples/SupportWearDemos/res/layout/wearable_drawers_frame_layout_demo.xml
new file mode 100644
index 0000000..90e3d42
--- /dev/null
+++ b/samples/SupportWearDemos/res/layout/wearable_drawers_frame_layout_demo.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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.
+ -->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:text="FrameLayout"/>
+
+</FrameLayout>
diff --git a/samples/SupportWearDemos/res/layout/wearable_drawers_scroll_view_demo.xml b/samples/SupportWearDemos/res/layout/wearable_drawers_scroll_view_demo.xml
new file mode 100644
index 0000000..9b58bbc
--- /dev/null
+++ b/samples/SupportWearDemos/res/layout/wearable_drawers_scroll_view_demo.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2017 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:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:nestedScrollingEnabled="true">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingTop="30dp"
+ android:paddingStart="30dp"
+ android:paddingEnd="30dp"
+ android:paddingBottom="10dp"
+ android:text="ScrollView Fragment"
+ style="@android:style/TextAppearance.Material.Title"/>
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="30dp"
+ android:paddingStart="30dp"
+ android:paddingEnd="30dp"
+ android:text="@string/lorem_ipsum"
+ style="@android:style/TextAppearance.Material.Body1"/>
+ </LinearLayout>
+
+</ScrollView>
diff --git a/samples/SupportWearDemos/res/menu/action_drawer_menu.xml b/samples/SupportWearDemos/res/menu/action_drawer_menu.xml
new file mode 100644
index 0000000..ba81111
--- /dev/null
+++ b/samples/SupportWearDemos/res/menu/action_drawer_menu.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:title="Item 1" android:icon="@android:drawable/ic_menu_add"/>
+ <item android:title="Item 2" android:icon="@android:drawable/ic_menu_agenda"/>
+ <item android:title="Item 3" android:icon="@android:drawable/ic_menu_call"/>
+ <item android:title="Item 4" android:icon="@android:drawable/ic_menu_delete"/>
+</menu>
\ No newline at end of file
diff --git a/samples/SupportWearDemos/res/values/strings.xml b/samples/SupportWearDemos/res/values/strings.xml
index 7f92211..d0156bf 100644
--- a/samples/SupportWearDemos/res/values/strings.xml
+++ b/samples/SupportWearDemos/res/values/strings.xml
@@ -19,4 +19,11 @@
<string name="cpl_click_me">Click me!</string>
<string name="cpl_clicked">Clicked!</string>
<string name="cpl_finished">Finished!</string>
+ <string name="lorem_ipsum">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
+ irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
+ anim id est laborum.
+ </string>
</resources>
\ No newline at end of file
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/MainDemoActivity.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/MainDemoActivity.java
index 313457b..154b14f 100644
--- a/samples/SupportWearDemos/src/com/example/android/support/wear/app/MainDemoActivity.java
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/MainDemoActivity.java
@@ -27,6 +27,8 @@
import android.view.ViewGroup;
import android.widget.Button;
+import com.example.android.support.wear.app.drawers.WearableDrawersDemo;
+
import java.util.HashMap;
import java.util.Map;
@@ -56,6 +58,8 @@
this, WearableSwitchDemo.class));
contentMap.put("Circular Progress Layout", new Intent(
this, CircularProgressLayoutDemo.class));
+ contentMap.put("Wearable Drawers", new Intent(
+ this, WearableDrawersDemo.class));
return contentMap;
}
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/DemoNavDrawerAdapter.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/DemoNavDrawerAdapter.java
new file mode 100644
index 0000000..f8d0955
--- /dev/null
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/DemoNavDrawerAdapter.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 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.support.wear.app.drawers;
+
+import android.graphics.drawable.Drawable;
+import android.support.wear.widget.drawer.WearableNavigationDrawerView.WearableNavigationDrawerAdapter;
+
+/** Simple and declarative {@link WearableNavigationDrawerAdapter}. */
+public class DemoNavDrawerAdapter extends WearableNavigationDrawerAdapter {
+
+ private final NavItem[] mNavItems;
+
+ public DemoNavDrawerAdapter(NavItem[] navItems) {
+ mNavItems = navItems;
+ }
+
+ @Override
+ public CharSequence getItemText(int pos) {
+ return mNavItems[pos].getTitle();
+ }
+
+ @Override
+ public Drawable getItemDrawable(int pos) {
+ return mNavItems[pos].getDrawable();
+ }
+
+ @Override
+ public int getCount() {
+ return mNavItems.length;
+ }
+}
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/FrameLayoutFragment.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/FrameLayoutFragment.java
new file mode 100644
index 0000000..d2be3e8
--- /dev/null
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/FrameLayoutFragment.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 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.support.wear.app.drawers;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.android.support.wear.R;
+
+/** {@link Fragment} which contains a {@link android.widget.FrameLayout} */
+public class FrameLayoutFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.wearable_drawers_frame_layout_demo, container, false);
+ }
+}
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/NavItem.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/NavItem.java
new file mode 100644
index 0000000..8e65d2c
--- /dev/null
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/NavItem.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 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.support.wear.app.drawers;
+
+import android.app.Fragment;
+import android.graphics.drawable.Drawable;
+
+/** Represents one top-level navigational item. */
+public class NavItem {
+ private final Class<? extends Fragment> mFragment;
+ private final String mTitle;
+ private final Drawable mDrawable;
+
+ public NavItem(Class<? extends Fragment> fragment, String title, Drawable drawable) {
+ mFragment = fragment;
+ mTitle = title;
+ mDrawable = drawable;
+ }
+
+ public Class<? extends Fragment> getFragment() {
+ return mFragment;
+ }
+
+ public String getTitle() {
+ return mTitle;
+ }
+
+ public Drawable getDrawable() {
+ return mDrawable;
+ }
+}
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/ScrollViewFragment.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/ScrollViewFragment.java
new file mode 100644
index 0000000..2b9ac40
--- /dev/null
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/ScrollViewFragment.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2017 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.support.wear.app.drawers;
+
+import android.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.example.android.support.wear.R;
+
+/** {@link Fragment} which contains a {@link android.widget.ScrollView} */
+public class ScrollViewFragment extends Fragment {
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.wearable_drawers_scroll_view_demo, container, false);
+ }
+}
diff --git a/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/WearableDrawersDemo.java b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/WearableDrawersDemo.java
new file mode 100644
index 0000000..c7c79a3
--- /dev/null
+++ b/samples/SupportWearDemos/src/com/example/android/support/wear/app/drawers/WearableDrawersDemo.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2017 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.support.wear.app.drawers;
+
+import android.app.Activity;
+import android.app.Fragment;
+import android.os.Bundle;
+import android.support.wear.widget.drawer.WearableActionDrawerView;
+import android.support.wear.widget.drawer.WearableNavigationDrawerView;
+import android.util.Log;
+import android.view.MenuItem;
+import android.widget.Toast;
+
+import com.example.android.support.wear.R;
+
+/** Main {@link Activity} for demoing the Wearable Drawers. */
+public class WearableDrawersDemo extends Activity {
+ private static final String TAG = "WearableDrawersDemo";
+
+ private WearableNavigationDrawerView mNavDrawer;
+ private WearableActionDrawerView mActionDrawer;
+ private NavItem[] mNavItems;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.wearable_drawers_demo);
+ mNavItems = new NavItem[] {
+ new NavItem(
+ ScrollViewFragment.class,
+ "ScrollView",
+ getDrawable(android.R.drawable.star_big_off)),
+ new NavItem(
+ FrameLayoutFragment.class,
+ "FrameLayout",
+ getDrawable(android.R.drawable.star_big_on)),
+ };
+
+ onNavItemSelected(0);
+
+ mNavDrawer = findViewById(R.id.nav_drawer);
+ mNavDrawer.setAdapter(new DemoNavDrawerAdapter(mNavItems));
+ mNavDrawer.addOnItemSelectedListener(this::onNavItemSelected);
+ mNavDrawer.getController().peekDrawer();
+
+ mActionDrawer = findViewById(R.id.action_drawer);
+ mActionDrawer.setOnMenuItemClickListener(this::onActionClicked);
+ mActionDrawer.getController().peekDrawer();
+ }
+
+ private boolean onActionClicked(MenuItem menuItem) {
+ Toast.makeText(this, menuItem.getTitle() + " clicked", Toast.LENGTH_SHORT).show();
+ mActionDrawer.getController().peekDrawer();
+ return true;
+ }
+
+ private void onNavItemSelected(int pos) {
+ Fragment fragment;
+ try {
+ fragment = mNavItems[pos].getFragment().newInstance();
+ } catch (InstantiationException | IllegalAccessException e) {
+ Log.e(TAG, "Failed to instantiate fragment", e);
+ return;
+ }
+
+ getFragmentManager()
+ .beginTransaction()
+ .replace(R.id.fragment_container, fragment)
+ .commit();
+ }
+}
diff --git a/transition/AndroidManifest.xml b/transition/AndroidManifest.xml
index 309b695..1b70510 100644
--- a/transition/AndroidManifest.xml
+++ b/transition/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.transition">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.transition.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/transition/build.gradle b/transition/build.gradle
index 6bdb319..5756785 100644
--- a/transition/build.gradle
+++ b/transition/build.gradle
@@ -2,12 +2,15 @@
dependencies {
api project(':support-annotations')
- api project(':support-v4')
+ api project(':support-compat')
+ compileOnly project(':support-fragment')
androidTestImplementation libs.test_runner, { exclude module: 'support-annotations' }
androidTestImplementation libs.espresso_core, { exclude module: 'support-annotations' }
androidTestImplementation libs.mockito_core, { exclude group: 'net.bytebuddy' } // DexMaker has it"s own MockMaker
androidTestImplementation libs.dexmaker_mockito, { exclude group: 'net.bytebuddy' } // DexMaker has it"s own MockMaker
+ androidTestImplementation project(':support-v4')
+ androidTestImplementation project(':appcompat-v7')
}
android {
@@ -31,6 +34,10 @@
]
}
+ buildTypes.all {
+ consumerProguardFiles 'proguard-rules.pro'
+ }
+
aaptOptions {
additionalParameters "--no-version-transitions"
}
diff --git a/transition/proguard-rules.pro b/transition/proguard-rules.pro
new file mode 100644
index 0000000..6e193b4
--- /dev/null
+++ b/transition/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Copyright (C) 2017 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.
+
+# FragmentTransitionSupport is instantiated in support-fragment via reflection.
+-keep public class android.support.transition.FragmentTransitionSupport {
+}
diff --git a/transition/src/android/support/transition/FragmentTransitionSupport.java b/transition/src/android/support/transition/FragmentTransitionSupport.java
new file mode 100644
index 0000000..b117946
--- /dev/null
+++ b/transition/src/android/support/transition/FragmentTransitionSupport.java
@@ -0,0 +1,320 @@
+/*
+ * Copyright (C) 2017 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 android.support.transition;
+
+import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP;
+
+import android.graphics.Rect;
+import android.support.annotation.NonNull;
+import android.support.annotation.RestrictTo;
+import android.support.v4.app.FragmentTransitionImpl;
+import android.view.View;
+import android.view.ViewGroup;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @hide
+ */
+// This is instantiated in android.support.v4.app.FragmentTransition
+@SuppressWarnings("unused")
+@RestrictTo(LIBRARY_GROUP)
+public class FragmentTransitionSupport extends FragmentTransitionImpl {
+
+ @Override
+ public boolean canHandle(Object transition) {
+ return transition instanceof Transition;
+ }
+
+ @Override
+ public Object cloneTransition(Object transition) {
+ Transition copy = null;
+ if (transition != null) {
+ copy = ((Transition) transition).clone();
+ }
+ return copy;
+ }
+
+ @Override
+ public Object wrapTransitionInSet(Object transition) {
+ if (transition == null) {
+ return null;
+ }
+ TransitionSet transitionSet = new TransitionSet();
+ transitionSet.addTransition((Transition) transition);
+ return transitionSet;
+ }
+
+ @Override
+ public void setSharedElementTargets(Object transitionObj,
+ View nonExistentView, ArrayList<View> sharedViews) {
+ TransitionSet transition = (TransitionSet) transitionObj;
+ final List<View> views = transition.getTargets();
+ views.clear();
+ final int count = sharedViews.size();
+ for (int i = 0; i < count; i++) {
+ final View view = sharedViews.get(i);
+ bfsAddViewChildren(views, view);
+ }
+ views.add(nonExistentView);
+ sharedViews.add(nonExistentView);
+ addTargets(transition, sharedViews);
+ }
+
+ @Override
+ public void setEpicenter(Object transitionObj, View view) {
+ if (view != null) {
+ Transition transition = (Transition) transitionObj;
+ final Rect epicenter = new Rect();
+ getBoundsOnScreen(view, epicenter);
+
+ transition.setEpicenterCallback(new Transition.EpicenterCallback() {
+ @Override
+ public Rect onGetEpicenter(@NonNull Transition transition) {
+ return epicenter;
+ }
+ });
+ }
+ }
+
+ @Override
+ public void addTargets(Object transitionObj, ArrayList<View> views) {
+ Transition transition = (Transition) transitionObj;
+ if (transition == null) {
+ return;
+ }
+ if (transition instanceof TransitionSet) {
+ TransitionSet set = (TransitionSet) transition;
+ int numTransitions = set.getTransitionCount();
+ for (int i = 0; i < numTransitions; i++) {
+ Transition child = set.getTransitionAt(i);
+ addTargets(child, views);
+ }
+ } else if (!hasSimpleTarget(transition)) {
+ List<View> targets = transition.getTargets();
+ if (isNullOrEmpty(targets)) {
+ // We can just add the target views
+ int numViews = views.size();
+ for (int i = 0; i < numViews; i++) {
+ transition.addTarget(views.get(i));
+ }
+ }
+ }
+ }
+
+ private static boolean hasSimpleTarget(Transition transition) {
+ return !isNullOrEmpty(transition.getTargetIds())
+ || !isNullOrEmpty(transition.getTargetNames())
+ || !isNullOrEmpty(transition.getTargetTypes());
+ }
+
+ @Override
+ public Object mergeTransitionsTogether(Object transition1, Object transition2,
+ Object transition3) {
+ TransitionSet transitionSet = new TransitionSet();
+ if (transition1 != null) {
+ transitionSet.addTransition((Transition) transition1);
+ }
+ if (transition2 != null) {
+ transitionSet.addTransition((Transition) transition2);
+ }
+ if (transition3 != null) {
+ transitionSet.addTransition((Transition) transition3);
+ }
+ return transitionSet;
+ }
+
+ @Override
+ public void scheduleHideFragmentView(Object exitTransitionObj, final View fragmentView,
+ final ArrayList<View> exitingViews) {
+ Transition exitTransition = (Transition) exitTransitionObj;
+ exitTransition.addListener(new Transition.TransitionListener() {
+ @Override
+ public void onTransitionStart(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionEnd(@NonNull Transition transition) {
+ transition.removeListener(this);
+ fragmentView.setVisibility(View.GONE);
+ final int numViews = exitingViews.size();
+ for (int i = 0; i < numViews; i++) {
+ exitingViews.get(i).setVisibility(View.VISIBLE);
+ }
+ }
+
+ @Override
+ public void onTransitionCancel(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionPause(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionResume(@NonNull Transition transition) {
+ }
+ });
+ }
+
+ @Override
+ public Object mergeTransitionsInSequence(Object exitTransitionObj,
+ Object enterTransitionObj, Object sharedElementTransitionObj) {
+ // First do exit, then enter, but allow shared element transition to happen
+ // during both.
+ Transition staggered = null;
+ final Transition exitTransition = (Transition) exitTransitionObj;
+ final Transition enterTransition = (Transition) enterTransitionObj;
+ final Transition sharedElementTransition = (Transition) sharedElementTransitionObj;
+ if (exitTransition != null && enterTransition != null) {
+ staggered = new TransitionSet()
+ .addTransition(exitTransition)
+ .addTransition(enterTransition)
+ .setOrdering(TransitionSet.ORDERING_SEQUENTIAL);
+ } else if (exitTransition != null) {
+ staggered = exitTransition;
+ } else if (enterTransition != null) {
+ staggered = enterTransition;
+ }
+ if (sharedElementTransition != null) {
+ TransitionSet together = new TransitionSet();
+ if (staggered != null) {
+ together.addTransition(staggered);
+ }
+ together.addTransition(sharedElementTransition);
+ return together;
+ } else {
+ return staggered;
+ }
+ }
+
+ @Override
+ public void beginDelayedTransition(ViewGroup sceneRoot, Object transition) {
+ TransitionManager.beginDelayedTransition(sceneRoot, (Transition) transition);
+ }
+
+ @Override
+ public void scheduleRemoveTargets(final Object overallTransitionObj,
+ final Object enterTransition, final ArrayList<View> enteringViews,
+ final Object exitTransition, final ArrayList<View> exitingViews,
+ final Object sharedElementTransition, final ArrayList<View> sharedElementsIn) {
+ final Transition overallTransition = (Transition) overallTransitionObj;
+ overallTransition.addListener(new Transition.TransitionListener() {
+ @Override
+ public void onTransitionStart(@NonNull Transition transition) {
+ if (enterTransition != null) {
+ replaceTargets(enterTransition, enteringViews, null);
+ }
+ if (exitTransition != null) {
+ replaceTargets(exitTransition, exitingViews, null);
+ }
+ if (sharedElementTransition != null) {
+ replaceTargets(sharedElementTransition, sharedElementsIn, null);
+ }
+ }
+
+ @Override
+ public void onTransitionEnd(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionCancel(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionPause(@NonNull Transition transition) {
+ }
+
+ @Override
+ public void onTransitionResume(@NonNull Transition transition) {
+ }
+ });
+ }
+
+ @Override
+ public void swapSharedElementTargets(Object sharedElementTransitionObj,
+ ArrayList<View> sharedElementsOut, ArrayList<View> sharedElementsIn) {
+ TransitionSet sharedElementTransition = (TransitionSet) sharedElementTransitionObj;
+ if (sharedElementTransition != null) {
+ sharedElementTransition.getTargets().clear();
+ sharedElementTransition.getTargets().addAll(sharedElementsIn);
+ replaceTargets(sharedElementTransition, sharedElementsOut, sharedElementsIn);
+ }
+ }
+
+ @Override
+ public void replaceTargets(Object transitionObj, ArrayList<View> oldTargets,
+ ArrayList<View> newTargets) {
+ Transition transition = (Transition) transitionObj;
+ if (transition instanceof TransitionSet) {
+ TransitionSet set = (TransitionSet) transition;
+ int numTransitions = set.getTransitionCount();
+ for (int i = 0; i < numTransitions; i++) {
+ Transition child = set.getTransitionAt(i);
+ replaceTargets(child, oldTargets, newTargets);
+ }
+ } else if (!hasSimpleTarget(transition)) {
+ List<View> targets = transition.getTargets();
+ if (targets.size() == oldTargets.size()
+ && targets.containsAll(oldTargets)) {
+ // We have an exact match. We must have added these earlier in addTargets
+ final int targetCount = newTargets == null ? 0 : newTargets.size();
+ for (int i = 0; i < targetCount; i++) {
+ transition.addTarget(newTargets.get(i));
+ }
+ for (int i = oldTargets.size() - 1; i >= 0; i--) {
+ transition.removeTarget(oldTargets.get(i));
+ }
+ }
+ }
+ }
+
+ @Override
+ public void addTarget(Object transitionObj, View view) {
+ if (transitionObj != null) {
+ Transition transition = (Transition) transitionObj;
+ transition.addTarget(view);
+ }
+ }
+
+ @Override
+ public void removeTarget(Object transitionObj, View view) {
+ if (transitionObj != null) {
+ Transition transition = (Transition) transitionObj;
+ transition.removeTarget(view);
+ }
+ }
+
+ @Override
+ public void setEpicenter(Object transitionObj, final Rect epicenter) {
+ if (transitionObj != null) {
+ Transition transition = (Transition) transitionObj;
+ transition.setEpicenterCallback(new Transition.EpicenterCallback() {
+ @Override
+ public Rect onGetEpicenter(@NonNull Transition transition) {
+ if (epicenter == null || epicenter.isEmpty()) {
+ return null;
+ }
+ return epicenter;
+ }
+ });
+ }
+ }
+
+}
diff --git a/transition/tests/res/layout/scene2.xml b/transition/tests/res/layout/scene2.xml
new file mode 100644
index 0000000..c450938
--- /dev/null
+++ b/transition/tests/res/layout/scene2.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2017 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"
+ android:id="@+id/squareContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <View
+ android:id="@+id/blueSquare"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="#008"/>
+
+ <View
+ android:id="@+id/greenSquare"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="#080"/>
+
+</LinearLayout>
diff --git a/transition/tests/res/layout/scene3.xml b/transition/tests/res/layout/scene3.xml
new file mode 100644
index 0000000..7e6cab0
--- /dev/null
+++ b/transition/tests/res/layout/scene3.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2017 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"
+ android:id="@+id/squareContainer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <View
+ android:id="@+id/redSquare"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="#800"/>
+
+ <View
+ android:id="@+id/blueSquare"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="#008"/>
+
+ <View
+ android:id="@+id/greenSquare"
+ android:layout_width="10dp"
+ android:layout_height="10dp"
+ android:background="#080"/>
+
+</LinearLayout>
diff --git a/transition/tests/src/android/support/transition/FragmentTransitionTest.java b/transition/tests/src/android/support/transition/FragmentTransitionTest.java
new file mode 100644
index 0000000..893d4c6
--- /dev/null
+++ b/transition/tests/src/android/support/transition/FragmentTransitionTest.java
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2017 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 android.support.transition;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.verify;
+
+import android.app.Instrumentation;
+import android.os.Bundle;
+import android.support.annotation.LayoutRes;
+import android.support.annotation.Nullable;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.filters.MediumTest;
+import android.support.transition.test.R;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v4.util.Pair;
+import android.support.v4.util.SparseArrayCompat;
+import android.support.v4.view.ViewCompat;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+
+@MediumTest
+@RunWith(Parameterized.class)
+public class FragmentTransitionTest extends BaseTest {
+
+ @Parameterized.Parameters
+ public static Object[] data() {
+ return new Boolean[]{
+ false, true
+ };
+ }
+
+ private final boolean mReorderingAllowed;
+
+ public FragmentTransitionTest(boolean reorderingAllowed) {
+ mReorderingAllowed = reorderingAllowed;
+ }
+
+ @Test
+ public void preconditions() {
+ final TransitionFragment fragment1 = TransitionFragment.newInstance(R.layout.scene2);
+ final TransitionFragment fragment2 = TransitionFragment.newInstance(R.layout.scene3);
+ showFragment(fragment1, false, null);
+ assertNull(fragment1.mRed);
+ assertNotNull(fragment1.mGreen);
+ assertNotNull(fragment1.mBlue);
+ showFragment(fragment2, true, new Pair<>(fragment1.mGreen, "green"));
+ assertNotNull(fragment2.mRed);
+ assertNotNull(fragment2.mGreen);
+ assertNotNull(fragment2.mBlue);
+ }
+
+ @Test
+ public void nonSharedTransition() {
+ final TransitionFragment fragment1 = TransitionFragment.newInstance(R.layout.scene2);
+ final TransitionFragment fragment2 = TransitionFragment.newInstance(R.layout.scene3);
+ showFragment(fragment1, false, null);
+ showFragment(fragment2, true, null);
+ verify(fragment1.mListeners.get(TransitionFragment.TRANSITION_EXIT))
+ .onTransitionStart(any(Transition.class));
+ verify(fragment1.mListeners.get(TransitionFragment.TRANSITION_EXIT), timeout(3000))
+ .onTransitionEnd(any(Transition.class));
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_ENTER))
+ .onTransitionStart(any(Transition.class));
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_ENTER), timeout(3000))
+ .onTransitionEnd(any(Transition.class));
+ popBackStack();
+ verify(fragment1.mListeners.get(TransitionFragment.TRANSITION_REENTER))
+ .onTransitionStart(any(Transition.class));
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_RETURN))
+ .onTransitionStart(any(Transition.class));
+ }
+
+ @Test
+ public void sharedTransition() {
+ final TransitionFragment fragment1 = TransitionFragment.newInstance(R.layout.scene2);
+ final TransitionFragment fragment2 = TransitionFragment.newInstance(R.layout.scene3);
+ showFragment(fragment1, false, null);
+ showFragment(fragment2, true, new Pair<>(fragment1.mGreen, "green"));
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_SHARED_ENTER))
+ .onTransitionStart(any(Transition.class));
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_SHARED_ENTER), timeout(3000))
+ .onTransitionEnd(any(Transition.class));
+ popBackStack();
+ verify(fragment2.mListeners.get(TransitionFragment.TRANSITION_SHARED_RETURN))
+ .onTransitionStart(any(Transition.class));
+ }
+
+ private void showFragment(final Fragment fragment, final boolean addToBackStack,
+ final Pair<View, String> sharedElement) {
+ final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ instrumentation.runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ final FragmentTransaction transaction = getFragmentManager().beginTransaction();
+ transaction.replace(R.id.root, fragment);
+ transaction.setReorderingAllowed(mReorderingAllowed);
+ if (sharedElement != null) {
+ transaction.addSharedElement(sharedElement.first, sharedElement.second);
+ }
+ if (addToBackStack) {
+ transaction.addToBackStack(null);
+ transaction.commit();
+ getFragmentManager().executePendingTransactions();
+ } else {
+ transaction.commitNow();
+ }
+ }
+ });
+ instrumentation.waitForIdleSync();
+ }
+
+ private void popBackStack() {
+ final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ instrumentation.runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ getFragmentManager().popBackStackImmediate();
+ }
+ });
+ instrumentation.waitForIdleSync();
+ }
+
+ private FragmentManager getFragmentManager() {
+ return rule.getActivity().getSupportFragmentManager();
+ }
+
+ /**
+ * A {@link Fragment} with all kinds of {@link Transition} with tracking listeners.
+ */
+ public static class TransitionFragment extends Fragment {
+
+ static final int TRANSITION_ENTER = 1;
+ static final int TRANSITION_EXIT = 2;
+ static final int TRANSITION_REENTER = 3;
+ static final int TRANSITION_RETURN = 4;
+ static final int TRANSITION_SHARED_ENTER = 5;
+ static final int TRANSITION_SHARED_RETURN = 6;
+
+ private static final String ARG_LAYOUT_ID = "layout_id";
+
+ View mRed;
+ View mGreen;
+ View mBlue;
+
+ SparseArrayCompat<Transition.TransitionListener> mListeners = new SparseArrayCompat<>();
+
+ public static TransitionFragment newInstance(@LayoutRes int layout) {
+ final Bundle args = new Bundle();
+ args.putInt(ARG_LAYOUT_ID, layout);
+ final TransitionFragment fragment = new TransitionFragment();
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ public TransitionFragment() {
+ setEnterTransition(createTransition(TRANSITION_ENTER));
+ setExitTransition(createTransition(TRANSITION_EXIT));
+ setReenterTransition(createTransition(TRANSITION_REENTER));
+ setReturnTransition(createTransition(TRANSITION_RETURN));
+ setSharedElementEnterTransition(createTransition(TRANSITION_SHARED_ENTER));
+ setSharedElementReturnTransition(createTransition(TRANSITION_SHARED_RETURN));
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ return inflater.inflate(getArguments().getInt(ARG_LAYOUT_ID), container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ mRed = view.findViewById(R.id.redSquare);
+ mGreen = view.findViewById(R.id.greenSquare);
+ mBlue = view.findViewById(R.id.blueSquare);
+ if (mRed != null) {
+ ViewCompat.setTransitionName(mRed, "red");
+ }
+ if (mGreen != null) {
+ ViewCompat.setTransitionName(mGreen, "green");
+ }
+ if (mBlue != null) {
+ ViewCompat.setTransitionName(mBlue, "blue");
+ }
+ }
+
+ private Transition createTransition(int type) {
+ final Transition.TransitionListener listener = mock(
+ Transition.TransitionListener.class);
+ final AutoTransition transition = new AutoTransition();
+ transition.addListener(listener);
+ transition.setDuration(10);
+ mListeners.put(type, listener);
+ return transition;
+ }
+
+ }
+
+}
diff --git a/transition/tests/src/android/support/transition/TransitionActivity.java b/transition/tests/src/android/support/transition/TransitionActivity.java
index 958435c..ecb9355 100644
--- a/transition/tests/src/android/support/transition/TransitionActivity.java
+++ b/transition/tests/src/android/support/transition/TransitionActivity.java
@@ -16,13 +16,13 @@
package android.support.transition;
-import android.app.Activity;
import android.os.Bundle;
import android.support.transition.test.R;
+import android.support.v4.app.FragmentActivity;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-public class TransitionActivity extends Activity {
+public class TransitionActivity extends FragmentActivity {
private LinearLayout mRoot;
diff --git a/tv-provider/AndroidManifest.xml b/tv-provider/AndroidManifest.xml
index f07d090..f7569a6 100644
--- a/tv-provider/AndroidManifest.xml
+++ b/tv-provider/AndroidManifest.xml
@@ -19,6 +19,7 @@
<uses-permission android:name="com.android.providers.tv.permission.WRITE_EPG_DATA" />
<uses-permission android:name="com.android.providers.tv.permission.READ_EPG_DATA" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.media.tv.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v13/AndroidManifest.xml b/v13/AndroidManifest.xml
index 6eea520..6f5a696 100644
--- a/v13/AndroidManifest.xml
+++ b/v13/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.v13">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.v13"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v13.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v14/preference/AndroidManifest.xml b/v14/preference/AndroidManifest.xml
index 95bab75..18cc666 100644
--- a/v14/preference/AndroidManifest.xml
+++ b/v14/preference/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v14.preference">
<uses-sdk android:minSdkVersion="14" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v14.preference.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v17/leanback/AndroidManifest.xml b/v17/leanback/AndroidManifest.xml
index 9176231..23c5c00 100644
--- a/v17/leanback/AndroidManifest.xml
+++ b/v17/leanback/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v17.leanback">
<uses-sdk android:minSdkVersion="17"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v17.leanback.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v17/leanback/src/android/support/v17/leanback/app/OnboardingFragment.java b/v17/leanback/src/android/support/v17/leanback/app/OnboardingFragment.java
index 5eb2784..22dd211 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/OnboardingFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/OnboardingFragment.java
@@ -593,6 +593,9 @@
boolean startLogoAnimation() {
final Context context = FragmentUtil.getContext(this);
+ if (context == null) {
+ return false;
+ }
Animator animator = null;
if (mLogoResourceId != 0) {
mLogoView.setVisibility(View.VISIBLE);
@@ -713,12 +716,15 @@
* been done in the past, {@code false} otherwise
*/
protected final void startEnterAnimation(boolean force) {
+ final Context context = FragmentUtil.getContext(this);
+ if (context == null) {
+ return;
+ }
hideLogoView();
if (mEnterAnimationFinished && !force) {
return;
}
List<Animator> animators = new ArrayList<>();
- final Context context = FragmentUtil.getContext(this);
Animator animator = AnimatorInflater.loadAnimator(context,
R.animator.lb_onboarding_page_indicator_enter);
animator.setTarget(getPageCount() <= 1 ? mStartButton : mPageIndicator);
diff --git a/v17/leanback/src/android/support/v17/leanback/app/OnboardingSupportFragment.java b/v17/leanback/src/android/support/v17/leanback/app/OnboardingSupportFragment.java
index 46c2a81..a24ea4d 100644
--- a/v17/leanback/src/android/support/v17/leanback/app/OnboardingSupportFragment.java
+++ b/v17/leanback/src/android/support/v17/leanback/app/OnboardingSupportFragment.java
@@ -596,6 +596,9 @@
boolean startLogoAnimation() {
final Context context = getContext();
+ if (context == null) {
+ return false;
+ }
Animator animator = null;
if (mLogoResourceId != 0) {
mLogoView.setVisibility(View.VISIBLE);
@@ -716,12 +719,15 @@
* been done in the past, {@code false} otherwise
*/
protected final void startEnterAnimation(boolean force) {
+ final Context context = getContext();
+ if (context == null) {
+ return;
+ }
hideLogoView();
if (mEnterAnimationFinished && !force) {
return;
}
List<Animator> animators = new ArrayList<>();
- final Context context = getContext();
Animator animator = AnimatorInflater.loadAnimator(context,
R.animator.lb_onboarding_page_indicator_enter);
animator.setTarget(getPageCount() <= 1 ? mStartButton : mPageIndicator);
diff --git a/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java b/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
index 45d69ef..f2dae95 100644
--- a/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
+++ b/v17/leanback/src/android/support/v17/leanback/widget/GridLayoutManager.java
@@ -1269,8 +1269,7 @@
if (TRACE) TraceCompat.beginSection("processRowSizeSecondary");
CircularIntArray[] rows = mGrid == null ? null : mGrid.getItemPositionsInRows();
boolean changed = false;
- int scrapChildWidth = -1;
- int scrapChildHeight = -1;
+ int scrapeChildSize = -1;
for (int rowIndex = 0; rowIndex < mNumRows; rowIndex++) {
CircularIntArray row = rows == null ? null : rows[rowIndex];
@@ -1281,7 +1280,7 @@
final int rowIndexStart = row.get(rowItemPairIndex);
final int rowIndexEnd = row.get(rowItemPairIndex + 1);
for (int i = rowIndexStart; i <= rowIndexEnd; i++) {
- final View view = findViewByPosition(i);
+ final View view = findViewByPosition(i - mPositionDeltaInPreLayout);
if (view == null) {
continue;
}
@@ -1299,27 +1298,49 @@
final int itemCount = mState.getItemCount();
if (!mBaseGridView.hasFixedSize() && measure && rowSize < 0 && itemCount > 0) {
- if (scrapChildWidth < 0 && scrapChildHeight < 0) {
- int position;
- if (mFocusPosition == NO_POSITION) {
+ if (scrapeChildSize < 0) {
+ // measure a child that is close to mFocusPosition but not currently visible
+ int position = mFocusPosition;
+ if (position < 0) {
position = 0;
- } else if (mFocusPosition >= itemCount) {
+ } else if (position >= itemCount) {
position = itemCount - 1;
- } else {
- position = mFocusPosition;
}
- measureScrapChild(position,
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
- mMeasuredDimension);
- scrapChildWidth = mMeasuredDimension[0];
- scrapChildHeight = mMeasuredDimension[1];
- if (DEBUG) {
- Log.v(TAG, "measured scrap child: " + scrapChildWidth + " "
- + scrapChildHeight);
+ if (getChildCount() > 0) {
+ int firstPos = mBaseGridView.getChildViewHolder(
+ getChildAt(0)).getLayoutPosition();
+ int lastPos = mBaseGridView.getChildViewHolder(
+ getChildAt(getChildCount() - 1)).getLayoutPosition();
+ // if mFocusPosition is between first and last, choose either
+ // first - 1 or last + 1
+ if (position >= firstPos && position <= lastPos) {
+ position = (position - firstPos <= lastPos - position)
+ ? (firstPos - 1) : (lastPos + 1);
+ // try the other value if the position is invalid. if both values are
+ // invalid, skip measureScrapChild below.
+ if (position < 0 && lastPos < itemCount - 1) {
+ position = lastPos + 1;
+ } else if (position >= itemCount && firstPos > 0) {
+ position = firstPos - 1;
+ }
+ }
+ }
+ if (position >= 0 && position < itemCount) {
+ measureScrapChild(position,
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
+ mMeasuredDimension);
+ scrapeChildSize = mOrientation == HORIZONTAL ? mMeasuredDimension[0] :
+ mMeasuredDimension[1];
+ if (DEBUG) {
+ Log.v(TAG, "measured scrap child: " + mMeasuredDimension[0] + " "
+ + mMeasuredDimension[1]);
+ }
}
}
- rowSize = mOrientation == HORIZONTAL ? scrapChildHeight : scrapChildWidth;
+ if (scrapeChildSize >= 0) {
+ rowSize = scrapeChildSize;
+ }
}
if (rowSize < 0) {
rowSize = 0;
@@ -1404,7 +1425,10 @@
mRowSizeSecondary = new int[mNumRows];
}
- // Measure all current children and update cached row heights
+ if (mState.isPreLayout()) {
+ updatePositionDeltaInPreLayout();
+ }
+ // Measure all current children and update cached row height or column width
processRowSizeSecondary(true);
switch (modeSecondary) {
@@ -2057,6 +2081,22 @@
mPositionToRowInPostLayout.clear();
}
+ // in prelayout, first child's getViewPosition can be smaller than old adapter position
+ // if there were items removed before first visible index. For example:
+ // visible items are 3, 4, 5, 6, deleting 1, 2, 3 from adapter; the view position in
+ // prelayout are not 3(deleted), 4, 5, 6. Instead it's 1(deleted), 2, 3, 4.
+ // So there is a delta (2 in this case) between last cached position and prelayout position.
+ void updatePositionDeltaInPreLayout() {
+ if (getChildCount() > 0) {
+ View view = getChildAt(0);
+ LayoutParams lp = (LayoutParams) view.getLayoutParams();
+ mPositionDeltaInPreLayout = mGrid.getFirstVisibleIndex()
+ - lp.getViewLayoutPosition();
+ } else {
+ mPositionDeltaInPreLayout = 0;
+ }
+ }
+
// Lays out items based on the current scroll position
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
@@ -2094,6 +2134,7 @@
saveContext(recycler, state);
if (state.isPreLayout()) {
+ updatePositionDeltaInPreLayout();
int childCount = getChildCount();
if (mGrid != null && childCount > 0) {
int minChangedEdge = Integer.MAX_VALUE;
@@ -2105,12 +2146,6 @@
for (int i = 0; i < childCount; i++) {
View view = getChildAt(i);
LayoutParams lp = (LayoutParams) view.getLayoutParams();
- if (i == 0) {
- // first child's layout position can be smaller than index if there were
- // items removed before first visible index.
- mPositionDeltaInPreLayout = mGrid.getFirstVisibleIndex()
- - lp.getViewLayoutPosition();
- }
int newAdapterPosition = mBaseGridView.getChildAdapterPosition(view);
// if either of following happening
// 1. item itself has changed or layout parameter changed
diff --git a/v17/leanback/tests/java/android/support/v17/leanback/widget/GridWidgetTest.java b/v17/leanback/tests/java/android/support/v17/leanback/widget/GridWidgetTest.java
index 1f6bdb2..61974cc 100644
--- a/v17/leanback/tests/java/android/support/v17/leanback/widget/GridWidgetTest.java
+++ b/v17/leanback/tests/java/android/support/v17/leanback/widget/GridWidgetTest.java
@@ -920,8 +920,7 @@
void preparePredictiveLayout() throws Throwable {
Intent intent = new Intent();
- intent.putExtra(GridActivity.EXTRA_LAYOUT_RESOURCE_ID,
- R.layout.horizontal_linear);
+ intent.putExtra(GridActivity.EXTRA_LAYOUT_RESOURCE_ID, R.layout.horizontal_linear);
intent.putExtra(GridActivity.EXTRA_NUM_ITEMS, 100);
initActivity(intent);
mOrientation = BaseGridView.HORIZONTAL;
@@ -1016,6 +1015,50 @@
}
@Test
+ public void testPredictiveOnMeasureWrapContent() throws Throwable {
+ Intent intent = new Intent();
+ intent.putExtra(GridActivity.EXTRA_LAYOUT_RESOURCE_ID,
+ R.layout.horizontal_linear_wrap_content);
+ int count = 50;
+ intent.putExtra(GridActivity.EXTRA_NUM_ITEMS, count);
+ initActivity(intent);
+ mOrientation = BaseGridView.HORIZONTAL;
+ mNumRows = 1;
+
+ waitForScrollIdle(mVerifyLayout);
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mGridView.setHasFixedSize(false);
+ }
+ });
+
+ for (int i = 0; i < 30; i++) {
+ final int oldCount = count;
+ final int newCount = i;
+ mActivityTestRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (oldCount > 0) {
+ mActivity.removeItems(0, oldCount);
+ }
+ if (newCount > 0) {
+ int[] newItems = new int[newCount];
+ for (int i = 0; i < newCount; i++) {
+ newItems[i] = 400;
+ }
+ mActivity.addItems(0, newItems);
+ }
+ }
+ });
+ waitForItemAnimationStart();
+ waitForItemAnimation();
+ count = newCount;
+ }
+
+ }
+
+ @Test
public void testPredictiveLayoutRemove4() throws Throwable {
Intent intent = new Intent();
intent.putExtra(GridActivity.EXTRA_LAYOUT_RESOURCE_ID,
diff --git a/v17/leanback/tests/res/layout/horizontal_linear_wrap_content.xml b/v17/leanback/tests/res/layout/horizontal_linear_wrap_content.xml
new file mode 100644
index 0000000..c0e2715
--- /dev/null
+++ b/v17/leanback/tests/res/layout/horizontal_linear_wrap_content.xml
@@ -0,0 +1,39 @@
+<!--
+ ~ Copyright (C) 2017 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"
+ xmlns:lb="http://schemas.android.com/apk/res-auto"
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ >
+ <android.support.v17.leanback.widget.HorizontalGridViewEx
+ android:id="@+id/gridview"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipToPadding="false"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:background="#00ffff"
+ android:horizontalSpacing="12dip"
+ android:verticalSpacing="24dip"
+ lb:rowHeight="wrap_content"
+ android:paddingBottom="12dip"
+ android:paddingLeft="12dip"
+ android:paddingRight="12dip"
+ android:paddingTop="12dip" />
+</LinearLayout>
diff --git a/v17/preference-leanback/AndroidManifest.xml b/v17/preference-leanback/AndroidManifest.xml
index e2cfe35..c34c254 100644
--- a/v17/preference-leanback/AndroidManifest.xml
+++ b/v17/preference-leanback/AndroidManifest.xml
@@ -16,9 +16,10 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="android.support.v17.preference"
- android:versionCode="1"
- android:versionName="1.0">
+ package="android.support.v17.preference">
<uses-sdk android:minSdkVersion="17" />
- <application />
+ <application>
+ <meta-data android:name="android.support.v17.preference.VERSION"
+ android:value="${support-version}" />
+ </application>
</manifest>
diff --git a/v4/AndroidManifest.xml b/v4/AndroidManifest.xml
index 470f5c2..c179eb2 100644
--- a/v4/AndroidManifest.xml
+++ b/v4/AndroidManifest.xml
@@ -14,10 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.v4">
- <uses-sdk android:minSdkVersion="14" tools:overrideLibrary="android.support.v4"/>
+ <uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v4.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/appcompat/AndroidManifest.xml b/v7/appcompat/AndroidManifest.xml
index 7de91ff..786d361 100644
--- a/v7/appcompat/AndroidManifest.xml
+++ b/v7/appcompat/AndroidManifest.xml
@@ -14,11 +14,10 @@
limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
package="android.support.v7.appcompat">
- <uses-sdk android:minSdkVersion="14"
- tools:overrideLibrary="android.support.graphics.drawable.animated"/>
+ <uses-sdk android:minSdkVersion="14" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.appcompat.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/appcompat/res-public/values/public_styles.xml b/v7/appcompat/res-public/values/public_styles.xml
index 38efc46..a9956ad 100644
--- a/v7/appcompat/res-public/values/public_styles.xml
+++ b/v7/appcompat/res-public/values/public_styles.xml
@@ -36,6 +36,12 @@
<public type="style" name="TextAppearance.AppCompat.Medium"/>
<public type="style" name="TextAppearance.AppCompat.Medium.Inverse"/>
<public type="style" name="TextAppearance.AppCompat.Menu"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification.Info"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification.Line2"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification.Media"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification.Time"/>
+ <public type="style" name="TextAppearance.AppCompat.Notification.Title"/>
<public type="style" name="TextAppearance.AppCompat.SearchResult.Subtitle"/>
<public type="style" name="TextAppearance.AppCompat.SearchResult.Title"/>
<public type="style" name="TextAppearance.AppCompat.Small"/>
diff --git a/v7/appcompat/res/values-bs/strings.xml b/v7/appcompat/res/values-bs/strings.xml
index 9f845a7..3687875 100644
--- a/v7/appcompat/res/values-bs/strings.xml
+++ b/v7/appcompat/res/values-bs/strings.xml
@@ -28,7 +28,7 @@
<string name="abc_searchview_description_submit" msgid="8928215447528550784">"Pošalji upit"</string>
<string name="abc_searchview_description_voice" msgid="893419373245838918">"Glasovno pretraživanje"</string>
<string name="abc_activitychooserview_choose_application" msgid="2031811694353399454">"Odaberite aplikaciju"</string>
- <string name="abc_activity_chooser_view_see_all" msgid="7468859129482906941">"Vidi sve"</string>
+ <string name="abc_activity_chooser_view_see_all" msgid="7468859129482906941">"Prikaži sve"</string>
<string name="abc_shareactionprovider_share_with_application" msgid="3300176832234831527">"Podijeli koristeći aplikaciju <xliff:g id="APPLICATION_NAME">%s</xliff:g>"</string>
<string name="abc_shareactionprovider_share_with" msgid="3421042268587513524">"Podijeli sa"</string>
<string name="abc_capital_on" msgid="3405795526292276155">"UKLJUČI"</string>
diff --git a/v7/appcompat/res/values-v21/styles.xml b/v7/appcompat/res/values-v21/styles.xml
new file mode 100644
index 0000000..48d0366
--- /dev/null
+++ b/v7/appcompat/res/values-v21/styles.xml
@@ -0,0 +1,47 @@
+<!--
+ ~ Copyright (C) 2016 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>
+
+ <!-- Use platform styles -->
+ <style name="TextAppearance.AppCompat.Notification.Info"
+ parent="@android:style/TextAppearance.Material.Notification.Info"/>
+
+ <style name="TextAppearance.AppCompat.Notification.Time"
+ parent="@android:style/TextAppearance.Material.Notification.Time"/>
+
+ <style name="TextAppearance.AppCompat.Notification.Title"
+ parent="@android:style/TextAppearance.Material.Notification.Title"/>
+
+ <style name="TextAppearance.AppCompat.Notification"
+ parent="@android:style/TextAppearance.Material.Notification"/>
+
+ <style name="TextAppearance.AppCompat.Notification.Media" >
+ <item name="android:textColor">@color/secondary_text_default_material_dark</item>
+ </style>
+
+ <style name="TextAppearance.AppCompat.Notification.Title.Media" >
+ <item name="android:textColor">@color/primary_text_default_material_dark</item>
+ </style>
+
+ <style name="TextAppearance.AppCompat.Notification.Info.Media">
+ <item name="android:textColor">@color/secondary_text_default_material_dark</item>
+ </style>
+
+ <style name="TextAppearance.AppCompat.Notification.Time.Media">
+ <item name="android:textColor">@color/secondary_text_default_material_dark</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/v7/appcompat/res/values-v24/styles.xml b/v7/appcompat/res/values-v24/styles.xml
new file mode 100644
index 0000000..4cd8461
--- /dev/null
+++ b/v7/appcompat/res/values-v24/styles.xml
@@ -0,0 +1,26 @@
+<!--
+ ~ Copyright (C) 2016 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>
+ <!-- Use platform styles, Media is dark again -->
+ <style name="TextAppearance.AppCompat.Notification.Media" />
+
+ <style name="TextAppearance.AppCompat.Notification.Info.Media" />
+
+ <style name="TextAppearance.AppCompat.Notification.Time.Media" />
+
+ <style name="TextAppearance.AppCompat.Notification.Title.Media" />
+</resources>
diff --git a/v7/appcompat/res/values/styles.xml b/v7/appcompat/res/values/styles.xml
index 247ca4c..ce74a89 100644
--- a/v7/appcompat/res/values/styles.xml
+++ b/v7/appcompat/res/values/styles.xml
@@ -329,4 +329,25 @@
<style name="TextAppearance.AppCompat.Light.Widget.PopupMenu.Large" parent="TextAppearance.AppCompat.Widget.PopupMenu.Large" />
<style name="TextAppearance.AppCompat.Light.Widget.PopupMenu.Small" parent="TextAppearance.AppCompat.Widget.PopupMenu.Small" />
+ <!-- These styles have moved to support-compat and should be removed when
+ android.support.v7.app.NotificationCompat is removed -->
+ <style name="TextAppearance.AppCompat.Notification" parent="@android:style/TextAppearance.StatusBar.EventContent" />
+ <style name="TextAppearance.AppCompat.Notification.Title" parent="@android:style/TextAppearance.StatusBar.EventContent.Title" />
+ <style name="TextAppearance.AppCompat.Notification.Info">
+ <item name="android:textSize">12sp</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ </style>
+ <style name="TextAppearance.AppCompat.Notification.Time">
+ <item name="android:textSize">12sp</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ </style>
+ <style name="TextAppearance.AppCompat.Notification.Line2" parent="TextAppearance.AppCompat.Notification.Info" />
+
+ <!-- These styles have moved to media-compat and should be removed when
+ android.support.v7.app.NotificationCompat is removed -->
+ <style name="TextAppearance.AppCompat.Notification.Title.Media" />
+ <style name="TextAppearance.AppCompat.Notification.Media" />
+ <style name="TextAppearance.AppCompat.Notification.Info.Media" />
+ <style name="TextAppearance.AppCompat.Notification.Time.Media" />
+ <style name="TextAppearance.AppCompat.Notification.Line2.Media" parent="TextAppearance.AppCompat.Notification.Info.Media" />
</resources>
diff --git a/v7/appcompat/src/android/support/v7/app/NotificationCompat.java b/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
index 6e10d9c..b1c3e95 100644
--- a/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
+++ b/v7/appcompat/src/android/support/v7/app/NotificationCompat.java
@@ -260,8 +260,8 @@
* </pre>
*
* <p>If you are using this style, consider using the corresponding styles like
- * {@link android.support.compat.R.style#TextAppearance_Compat_Notification} or
- * {@link android.support.compat.R.style#TextAppearance_Compat_Notification_Title} in
+ * {@link android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification} or
+ * {@link android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification_Title} in
* your custom views in order to get the correct styling on each platform version.
*
* @deprecated Use {@link android.support.v4.app.NotificationCompat.DecoratedCustomViewStyle}
@@ -308,9 +308,9 @@
* </pre>
*
* <p>If you are using this style, consider using the corresponding styles like
- * {@link android.support.mediacompat.R.style#TextAppearance_Compat_Notification_Media} or
+ * {@link android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification_Media} or
* {@link
- * android.support.mediacompat.R.style#TextAppearance_Compat_Notification_Title_Media} in
+ * android.support.v7.appcompat.R.style#TextAppearance_AppCompat_Notification_Title_Media} in
* your custom views in order to get the correct styling on each platform version.
*
* @see android.support.v4.app.NotificationCompat.DecoratedCustomViewStyle
diff --git a/v7/cardview/AndroidManifest.xml b/v7/cardview/AndroidManifest.xml
index 8fcf55a..af07bbc 100644
--- a/v7/cardview/AndroidManifest.xml
+++ b/v7/cardview/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.cardview">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.cardview.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/gridlayout/AndroidManifest.xml b/v7/gridlayout/AndroidManifest.xml
index b6cb783..c18f5a1 100644
--- a/v7/gridlayout/AndroidManifest.xml
+++ b/v7/gridlayout/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.gridlayout">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.gridlayout.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/mediarouter/AndroidManifest.xml b/v7/mediarouter/AndroidManifest.xml
index c4577f9..c2c4ee3 100644
--- a/v7/mediarouter/AndroidManifest.xml
+++ b/v7/mediarouter/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.mediarouter">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.mediarouter.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/palette/AndroidManifest.xml b/v7/palette/AndroidManifest.xml
index 8e5ffaa..491cc8e 100644
--- a/v7/palette/AndroidManifest.xml
+++ b/v7/palette/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.palette">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.palette.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/preference/AndroidManifest.xml b/v7/preference/AndroidManifest.xml
index 772b410..c8df9a0 100644
--- a/v7/preference/AndroidManifest.xml
+++ b/v7/preference/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.preference">
<uses-sdk android:minSdkVersion="14" />
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.preference.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/recyclerview/AndroidManifest.xml b/v7/recyclerview/AndroidManifest.xml
index 5b03882..04d095c 100644
--- a/v7/recyclerview/AndroidManifest.xml
+++ b/v7/recyclerview/AndroidManifest.xml
@@ -17,6 +17,7 @@
package="android.support.v7.recyclerview">
<uses-sdk android:minSdkVersion="14"/>
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.v7.recyclerview.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
index ba6b0a1..eacae37 100644
--- a/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
+++ b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
@@ -1033,7 +1033,6 @@
// bail out if layout is frozen
setLayoutFrozen(false);
setAdapterInternal(adapter, true, removeAndRecycleExistingViews);
- setDataSetChangedAfterLayout();
requestLayout();
}
/**
@@ -1102,7 +1101,7 @@
}
mRecycler.onAdapterChanged(oldAdapter, mAdapter, compatibleWithPrevious);
mState.mStructureChanged = true;
- markKnownViewsInvalid();
+ setDataSetChangedAfterLayout();
}
/**
@@ -4255,8 +4254,8 @@
/**
* Call this method to signal that *all* adapter content has changed (generally, because of
- * swapAdapter, or notifyDataSetChanged), and that once layout occurs, all attached items should
- * be discarded or animated.
+ * setAdapter, swapAdapter, or notifyDataSetChanged), and that once layout occurs, all
+ * attached items should be discarded or animated.
*
* Attached items are labeled as invalid, and all cached items are discarded.
*
diff --git a/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java b/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java
index 9654997..d74c36c 100644
--- a/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java
@@ -839,7 +839,7 @@
mLayoutParams = layoutParams;
}
- private void addItems(int pos, int count, String prefix) {
+ void addItems(int pos, int count, String prefix) {
for (int i = 0; i < count; i++, pos++) {
mItems.add(pos, new Item(pos, prefix));
}
diff --git a/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java b/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
index 1547049..42fde85 100644
--- a/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
@@ -252,7 +252,53 @@
}
@Test
- public void preditiveMeasuredCrashTest() throws Throwable {
+ public void setAdapterNotifyItemRangeInsertedCrashTest() throws Throwable {
+ final RecyclerView rv = new RecyclerView(getActivity());
+ final TestLayoutManager lm = new LayoutAllLayoutManager(true);
+ lm.setSupportsPredictive(true);
+ rv.setLayoutManager(lm);
+ setRecyclerView(rv);
+ lm.expectLayouts(1);
+ setAdapter(new TestAdapter(1));
+ lm.waitForLayout(2);
+ lm.expectLayouts(1);
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ final TestAdapter adapter2 = new TestAdapter(0);
+ rv.setAdapter(adapter2);
+ adapter2.addItems(0, 1, "1");
+ adapter2.notifyItemRangeInserted(0, 1);
+ }
+ });
+ lm.waitForLayout(2);
+ }
+
+ @Test
+ public void swapAdapterNotifyItemRangeInsertedCrashTest() throws Throwable {
+ final RecyclerView rv = new RecyclerView(getActivity());
+ final TestLayoutManager lm = new LayoutAllLayoutManager(true);
+ lm.setSupportsPredictive(true);
+ rv.setLayoutManager(lm);
+ setRecyclerView(rv);
+ lm.expectLayouts(1);
+ setAdapter(new TestAdapter(1));
+ lm.waitForLayout(2);
+ lm.expectLayouts(1);
+ mActivityRule.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ final TestAdapter adapter2 = new TestAdapter(0);
+ rv.swapAdapter(adapter2, true);
+ adapter2.addItems(0, 1, "1");
+ adapter2.notifyItemRangeInserted(0, 1);
+ }
+ });
+ lm.waitForLayout(2);
+ }
+
+ @Test
+ public void predictiveMeasuredCrashTest() throws Throwable {
final RecyclerView rv = new RecyclerView(getActivity());
final LayoutAllLayoutManager lm = new LayoutAllLayoutManager(true) {
@Override
diff --git a/wear/AndroidManifest.xml b/wear/AndroidManifest.xml
index 5fa5a83..0541f36 100644
--- a/wear/AndroidManifest.xml
+++ b/wear/AndroidManifest.xml
@@ -16,6 +16,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.support.wear">
<application>
- <meta-data android:name="android.support.VERSION" android:value="${support-version}" />
+ <meta-data android:name="android.support.wear.VERSION"
+ android:value="${support-version}" />
</application>
</manifest>
diff --git a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_14w.png b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_14w.png
index 371469c..035e901 100644
--- a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_14w.png
+++ b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_14w.png
Binary files differ
diff --git a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_15w.png b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_15w.png
index e477260..6688631 100644
--- a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_15w.png
+++ b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_15w.png
Binary files differ
diff --git a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_16w.png b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_16w.png
index 19a1bd3..0dd9fce 100644
--- a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_16w.png
+++ b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_16w.png
Binary files differ
diff --git a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_17w.png b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_17w.png
index 79dc733..a15b133 100644
--- a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_17w.png
+++ b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_17w.png
Binary files differ
diff --git a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_18w.png b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_18w.png
index 6d921c0..1cd259e 100644
--- a/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_18w.png
+++ b/wear/res/drawable-hdpi/ws_switch_thumb_mtrl_18w.png
Binary files differ
diff --git a/wear/res/drawable-hdpi/ws_switch_track_mtrl.png b/wear/res/drawable-hdpi/ws_switch_track_mtrl.png
index ecee3e1..8ed1c97 100644
--- a/wear/res/drawable-hdpi/ws_switch_track_mtrl.png
+++ b/wear/res/drawable-hdpi/ws_switch_track_mtrl.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_14w.png b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_14w.png
index 7f7ca14..119207b 100644
--- a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_14w.png
+++ b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_14w.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_15w.png b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_15w.png
index 52120b8..b89c86a 100644
--- a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_15w.png
+++ b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_15w.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_16w.png b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_16w.png
index d6e9be9..7528731 100644
--- a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_16w.png
+++ b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_16w.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_17w.png b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_17w.png
index 8d76393..dba351f 100644
--- a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_17w.png
+++ b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_17w.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_18w.png b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_18w.png
index ca9c66e..ab7b1df 100644
--- a/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_18w.png
+++ b/wear/res/drawable-xhdpi/ws_switch_thumb_mtrl_18w.png
Binary files differ
diff --git a/wear/res/drawable-xhdpi/ws_switch_track_mtrl.png b/wear/res/drawable-xhdpi/ws_switch_track_mtrl.png
index 1aa5442..1769795 100644
--- a/wear/res/drawable-xhdpi/ws_switch_track_mtrl.png
+++ b/wear/res/drawable-xhdpi/ws_switch_track_mtrl.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_14w.png b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_14w.png
index c0d72d7..8a00760 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_14w.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_14w.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_15w.png b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_15w.png
index d7c0ec0..64a0cab 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_15w.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_15w.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_16w.png b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_16w.png
index 5815ba9..ce7369e 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_16w.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_16w.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_17w.png b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_17w.png
index 41da8c0..398e3f2 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_17w.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_17w.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_18w.png b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_18w.png
index 975eb01..1cf40e2 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_18w.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_thumb_mtrl_18w.png
Binary files differ
diff --git a/wear/res/drawable-xxhdpi/ws_switch_track_mtrl.png b/wear/res/drawable-xxhdpi/ws_switch_track_mtrl.png
index af2042b..a329817 100644
--- a/wear/res/drawable-xxhdpi/ws_switch_track_mtrl.png
+++ b/wear/res/drawable-xxhdpi/ws_switch_track_mtrl.png
Binary files differ
diff --git a/wear/src/android/support/wear/widget/RoundedDrawable.java b/wear/src/android/support/wear/widget/RoundedDrawable.java
index 627e2de..e2d7611 100644
--- a/wear/src/android/support/wear/widget/RoundedDrawable.java
+++ b/wear/src/android/support/wear/widget/RoundedDrawable.java
@@ -38,17 +38,18 @@
/**
* Maintains and draws a drawable inside rounded rectangular bounds.
*
- * The drawable set by the {@link #setDrawable(Drawable)} method will be drawn within the rounded
+ * <p>The drawable set by the {@link #setDrawable(Drawable)} method will be drawn within the rounded
* bounds specified by {@link #setBounds(Rect)} and {@link #setRadius(int)} when the
* {@link #draw(Canvas)} method is called.
*
- * By default, RoundedDrawable will apply padding to the drawable inside to fit the drawable into
+ * <p>By default, RoundedDrawable will apply padding to the drawable inside to fit the drawable into
* the rounded rectangle. If clipping is enabled by the {@link #setClipEnabled(boolean)} method, it
* will clip the drawable to a rounded rectangle instead of resizing it.
*
- * The {@link #setRadius(int)} method is used to specify the amount of border radius applied to the
- * corners of inner drawable, regardless of whether or not the clipping is enabled, border radius
- * will be applied to prevent overflowing of the drawable from specified rounded rectangular area.
+ * <p>The {@link #setRadius(int)} method is used to specify the amount of border radius applied to
+ * the corners of inner drawable, regardless of whether or not the clipping is enabled, border
+ * radius will be applied to prevent overflowing of the drawable from specified rounded rectangular
+ * area.
*/
@TargetApi(Build.VERSION_CODES.N)
public class RoundedDrawable extends Drawable {