-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
android: Update examples to display errors with a red background (#166)
This is just a change to allow us to more easily visualize when Envoy fails. We're repurposing the examples here to also display this. This way others can also install the example application and be able to visualize the success/failures of Envoy in the wild. Changes: 1. An error view item background is: #ff3651 1. Added a request count on the top of the item view (Screen below) 1. Moved all the duplicated classes for java and kotlin examples under a shared lib Related to #129: App lifecycle & network condition handling. For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/master/PULL_REQUESTS.md) Description: Update examples to display errors with a red background Risk Level: low Testing: manual Docs Changes: n/a Release Notes: na/ [Optional Fixes #Issue] [Optional Deprecated:] ![Screenshot_20190621-164638](https://user-images.githubusercontent.com/7771562/59956309-74d03580-9444-11e9-8c0e-9c73c9beddc1.png)
- Loading branch information
Alan Chiu
authored
Jun 25, 2019
1 parent
4012c3e
commit a5916eb
Showing
19 changed files
with
145 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
examples/java/hello_world/ResponseRecyclerViewAdapter.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.envoyproxy.envoymobile.shared" | ||
android:versionCode="1" | ||
android:versionName="0.1"> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@envoy//bazel:envoy_build_system.bzl", "envoy_package") | ||
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library") | ||
|
||
envoy_package() | ||
|
||
kt_android_library( | ||
name = "hello_envoy_shared_lib", | ||
srcs = [ | ||
"Response.kt", | ||
"ResponseRecyclerViewAdapter.kt", | ||
"ResponseViewHolder.kt", | ||
], | ||
custom_package = "io.envoyproxy.envoymobile.shared", | ||
manifest = "AndroidManifest.xml", | ||
resource_files = glob([ | ||
"res/layout/item.xml", | ||
"res/values/colors.xml", | ||
"res/values/strings.xml", | ||
]), | ||
deps = [ | ||
"@androidsdk//com.android.support:recyclerview-v7-25.0.0", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.envoyproxy.envoymobile.shared | ||
|
||
// Response is a class to handle HTTP responses. | ||
sealed class Response { | ||
fun fold(success: (Success) -> Unit, failure: (Failure) -> Unit) = when (this) { | ||
is Success -> success(this) | ||
is Failure -> failure(this) | ||
} | ||
} | ||
|
||
data class Success(val title: String, val header: String) : Response() | ||
|
||
data class Failure(val message: String) : Response() | ||
|
||
|
||
|
Oops, something went wrong.