Merge "NOT NULL constraint by @NonNull" into oc-support-26.0-dev
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/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/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/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java b/v7/recyclerview/src/android/support/v7/widget/RecyclerView.java
index 89aa2e8..ff8e0e6 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();
}
/**
@@ -4237,8 +4236,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 90e0536..2139497 100644
--- a/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java
+++ b/v7/recyclerview/tests/src/android/support/v7/widget/BaseRecyclerViewInstrumentationTest.java
@@ -845,7 +845,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