├── mobile ├── .gitignore ├── proguard │ ├── firebase.pro │ ├── otto.pro │ ├── icepick.pro │ ├── butterknife.pro │ ├── aerogear.pro │ └── common.pro ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_notification.png │ │ │ ├── values │ │ │ │ ├── settings.xml │ │ │ │ ├── feedback.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ └── themes.xml │ │ │ ├── menu │ │ │ │ ├── popup_delete.xml │ │ │ │ ├── popup_alerts.xml │ │ │ │ ├── menu_search.xml │ │ │ │ ├── toolbar_time.xml │ │ │ │ ├── drawer.xml │ │ │ │ └── toolbar_alerts.xml │ │ │ ├── drawable │ │ │ │ ├── ic_expand.xml │ │ │ │ ├── ic_plus_white.xml │ │ │ │ ├── ic_toolbar_menu.xml │ │ │ │ ├── ic_delete.xml │ │ │ │ ├── ic_alerts.xml │ │ │ │ ├── ic_metrics.xml │ │ │ │ ├── ic_drawer_logout.xml │ │ │ │ ├── ic_favorite.xml │ │ │ │ ├── ic_more.xml │ │ │ │ ├── ic_time.xml │ │ │ │ ├── ic_explore.xml │ │ │ │ ├── ic_search.xml │ │ │ │ └── ic_feedback.xml │ │ │ ├── anim │ │ │ │ └── bounce.xml │ │ │ ├── xml │ │ │ │ └── settings.xml │ │ │ ├── layout │ │ │ │ ├── layout_toolbar.xml │ │ │ │ ├── layout_list_item.xml │ │ │ │ ├── layout_list_item_persona.xml │ │ │ │ ├── row_edit.xml │ │ │ │ ├── activity_inventory_explorer.xml │ │ │ │ ├── row_toggle.xml │ │ │ │ ├── layout_error.xml │ │ │ │ ├── custom_availability.xml │ │ │ │ ├── layout_message.xml │ │ │ │ ├── activity_container.xml │ │ │ │ ├── fragment_trigger_detail.xml │ │ │ │ ├── fragment_list.xml │ │ │ │ ├── fragment_container.xml │ │ │ │ ├── custom_threshold.xml │ │ │ │ ├── layout_icon_node.xml │ │ │ │ ├── layout_list_item_token.xml │ │ │ │ └── layout_list_item_three.xml │ │ │ └── values-v21 │ │ │ │ └── themes.xml │ │ ├── assets │ │ │ └── fonts │ │ │ │ └── material-icon-font.ttf │ │ └── java │ │ │ └── org │ │ │ └── hawkular │ │ │ └── client │ │ │ └── android │ │ │ ├── event │ │ │ ├── ResourceSelectedEvent.java │ │ │ └── Events.java │ │ │ ├── backend │ │ │ ├── BackendEndpoints.java │ │ │ ├── model │ │ │ │ ├── MetricBucket.java │ │ │ │ ├── Condition.java │ │ │ │ ├── AlertType.java │ │ │ │ ├── AlertStatus.java │ │ │ │ ├── MetricType.java │ │ │ │ ├── Error.java │ │ │ │ ├── Persona.java │ │ │ │ ├── Environment.java │ │ │ │ ├── ResourceProperties.java │ │ │ │ ├── MetricProperties.java │ │ │ │ ├── MetricConfiguration.java │ │ │ │ ├── MetricTemp.java │ │ │ │ ├── Resource.java │ │ │ │ ├── Tags.java │ │ │ │ ├── ResourceType.java │ │ │ │ ├── AvailabilityCondition.java │ │ │ │ ├── MetricData.java │ │ │ │ ├── Feed.java │ │ │ │ └── Data.java │ │ │ └── BackendPersonnel.java │ │ │ ├── util │ │ │ ├── Ports.java │ │ │ ├── ColorSchemer.java │ │ │ ├── Android.java │ │ │ ├── Cookies.java │ │ │ ├── Formatter.java │ │ │ ├── Time.java │ │ │ ├── ErrorUtil.java │ │ │ ├── Urls.java │ │ │ ├── ViewDirector.java │ │ │ └── Views.java │ │ │ ├── activity │ │ │ ├── TriggerDetailActivity.java │ │ │ ├── AlertDetailActivity.java │ │ │ ├── SettingsActivity.java │ │ │ └── DetailActivity.java │ │ │ ├── animation │ │ │ └── MyBounceInterpolator.java │ │ │ ├── push │ │ │ ├── PushHandler.java │ │ │ └── PushConfiguration.java │ │ │ ├── service │ │ │ └── AlertService.java │ │ │ └── adapter │ │ │ ├── BindableAdapter.java │ │ │ └── ViewPagerAdapter.java │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── hawkular │ │ │ └── client │ │ │ └── android │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── org │ │ └── hawkular │ │ └── client │ │ └── android │ │ ├── event │ │ └── EventsTester.java │ │ ├── util │ │ ├── PortsTester.java │ │ ├── Randomizer.java │ │ └── Parceler.java │ │ └── backend │ │ └── model │ │ ├── AlertTypeTester.java │ │ ├── MetricTypeTester.java │ │ ├── AlertStatusTester.java │ │ ├── PersonaTester.java │ │ ├── MetricAvailabilityTester.java │ │ ├── EnvironmentTester.java │ │ ├── ResourceTypeTester.java │ │ ├── MetricConfigurationTester.java │ │ ├── MetricPropertiesTester.java │ │ ├── ResourcePropertiesTester.java │ │ ├── MetricDataTester.java │ │ ├── NoteTester.java │ │ ├── TriggerTester.java │ │ ├── AlertEvaluationConditionTester.java │ │ ├── ResourceTester.java │ │ ├── MetricTester.java │ │ ├── AlertTester.java │ │ └── AlertEvaluationTester.java └── properties │ ├── signing.properties │ └── server.properties ├── wear ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── rect_activity_main.xml │ │ │ ├── activity_main.xml │ │ │ └── round_activity_main.xml │ │ ├── java │ │ └── org │ │ │ └── hawkular │ │ │ └── client │ │ │ └── android │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .travis.yml ├── misc └── HEADER.txt ├── gradle.properties └── README.adoc /mobile/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /wear/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':mobile', ':wear' 2 | -------------------------------------------------------------------------------- /mobile/proguard/firebase.pro: -------------------------------------------------------------------------------- 1 | -keep class com.google.android.gms.** { *; } 2 | -dontwarn com.google.android.gms.** 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /wear/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/wear/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /wear/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/wear/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /wear/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/wear/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /wear/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/wear/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/properties/signing.properties: -------------------------------------------------------------------------------- 1 | keystore.file = KEYSTORE_FILE 2 | keystore.password = KEYSTORE_PASSWORD 3 | key.alias = KEY_ALIAS 4 | key.password = KEY_PASSWORD 5 | -------------------------------------------------------------------------------- /mobile/src/main/assets/fonts/material-icon-font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/assets/fonts/material-icon-font.ttf -------------------------------------------------------------------------------- /mobile/src/main/res/drawable-xhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hawkular/hawkular-android-client/HEAD/mobile/src/main/res/drawable-xhdpi/ic_notification.png -------------------------------------------------------------------------------- /mobile/proguard/otto.pro: -------------------------------------------------------------------------------- 1 | -keepattributes *Annotation* 2 | 3 | -keepclassmembers class ** { 4 | @com.squareup.otto.Subscribe public *; 5 | @com.squareup.otto.Produce public *; 6 | } 7 | -------------------------------------------------------------------------------- /mobile/proguard/icepick.pro: -------------------------------------------------------------------------------- 1 | ## Icepick 2 | 3 | -dontwarn icepick.** 4 | 5 | -keepnames class * { @icepick.State *; } 6 | 7 | -keep class **$$Icepick { *; } 8 | 9 | -keepclasseswithmembernames class * { 10 | @icepick.* ; 11 | } 12 | -------------------------------------------------------------------------------- /mobile/properties/server.properties: -------------------------------------------------------------------------------- 1 | ups.url = UPS_URL 2 | ups.variant = UPS_VARIANT 3 | ups.secret = UPS_SECRET 4 | fcm.sender = FCM_SENDER 5 | fcm.application = FCM_APPLICATION_ID 6 | fcm.api = FCM_API_KEY 7 | fcm.database = FCM_DATABASE_URL 8 | fcm.bucket = FCM_STORAGE_BUCKET 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Mar 08 10:06:06 BRT 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /mobile/proguard/butterknife.pro: -------------------------------------------------------------------------------- 1 | -dontwarn butterknife.internal.** 2 | 3 | -keep class butterknife.** { *; } 4 | -keep class **$$ViewBinder { *; } 5 | 6 | -keepclasseswithmembernames class * { 7 | @butterknife.* ; 8 | } 9 | 10 | -keepclasseswithmembernames class * { 11 | @butterknife.* ; 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | ## Android SDK 4 | 5 | local.properties 6 | 7 | ## Server 8 | 9 | /server.properties 10 | 11 | ## Signing 12 | 13 | /signing.properties 14 | 15 | # IDE 16 | 17 | ## Android Studio 18 | 19 | .idea/ 20 | *.iml 21 | 22 | ## Eclipse 23 | 24 | .project 25 | .classpath 26 | .settings 27 | 28 | # Build System 29 | 30 | ## Gradle 31 | 32 | .gradle/ 33 | build/ 34 | 35 | ## Maven 36 | 37 | target/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | android: 7 | components: 8 | - tools 9 | - android-25 10 | - build-tools-25.0.2 11 | - extra-android-m2repository 12 | - extra-google-m2repository 13 | 14 | script: 15 | - mvn --settings maven.settings.xml license:check checkstyle:check && ./gradlew clean assembleDebug 16 | 17 | cache: 18 | directories: 19 | - $HOME/.gradle 20 | - $HOME/.m2 21 | 22 | sudo: 23 | false 24 | -------------------------------------------------------------------------------- /misc/HEADER.txt: -------------------------------------------------------------------------------- 1 | Copyright 2015-${year} Red Hat, Inc. and/or its affiliates 2 | and other contributors as indicated by the @author tags. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. -------------------------------------------------------------------------------- /mobile/proguard/aerogear.pro: -------------------------------------------------------------------------------- 1 | -dontwarn org.bouncycastle.x509.util.LDAPStoreHelper 2 | -dontwarn org.bouncycastle.jce.provider.X509LDAPCertStoreSpi 3 | -dontwarn org.bouncycastle.util.io.pem.AllTests 4 | -dontwarn org.bouncycastle.util.AllTests 5 | -dontwarn org.bouncycastle.x509.X509V3CertificateGenerator 6 | -dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider 7 | 8 | -dontwarn org.spongycastle.x509.util.LDAPStoreHelper 9 | -dontwarn org.spongycastle.jce.provider.X509LDAPCertStoreSpi 10 | -dontwarn org.spongycastle.util.AllTests 11 | -dontwarn org.spongycastle.util.io.pem.AllTests 12 | -dontwarn org.spongycastle.x509.X509V3CertificateGenerator 13 | -dontwarn org.spongycastle.jce.provider.spongyCastleProvider 14 | -------------------------------------------------------------------------------- /mobile/proguard/common.pro: -------------------------------------------------------------------------------- 1 | -dontobfuscate 2 | -keep class org.hawkular.client.android.backend.model.Alert { 3 | public ; 4 | } 5 | -keep class org.hawkular.client.android.auth.Session { 6 | public ; 7 | } 8 | -keep class org.hawkular.client.android.backend.model.Token { 9 | public ; 10 | } 11 | -keep class org.hawkular.client.android.backend.model.Note { 12 | public ; 13 | } 14 | -keep class org.hawkular.client.android.explorer.holder.IconTreeItemHolder { 15 | public ; 16 | } 17 | -keep class org.hawkular.client.android.backend.model.Metric { 18 | public ; 19 | } 20 | -keep class org.hawkular.client.android.backend.model.Trigger { 21 | public ; 22 | } 23 | -dontwarn okio.** 24 | -------------------------------------------------------------------------------- /wear/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/passos/Development/SDK/android-sdk-macosx/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /mobile/src/main/res/values/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | sign_out 23 | 24 | -------------------------------------------------------------------------------- /wear/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | Hawkular 21 | Hello Round World! 22 | Hello Square World! 23 | 24 | -------------------------------------------------------------------------------- /mobile/src/main/res/menu/popup_delete.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/feedback.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | hawkular-dev@lists.jboss.org 23 | Hawkular Android Client 24 | 25 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_expand.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/menu/popup_alerts.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 25 | 26 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_plus_white.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_toolbar_menu.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/anim/bounce.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /mobile/src/test/java/org/hawkular/client/android/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android; 18 | 19 | import org.junit.Test; 20 | 21 | import static org.junit.Assert.*; 22 | 23 | /** 24 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 25 | */ 26 | public class ExampleUnitTest { 27 | @Test 28 | public void addition_isCorrect() throws Exception { 29 | assertEquals(4, 2 + 2); 30 | } 31 | } -------------------------------------------------------------------------------- /mobile/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 16sp 23 | 14sp 24 | 12sp 25 | 10sp 26 | 27 | 16dp 28 | 29 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_alerts.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/event/EventsTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.event; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | 23 | import android.support.test.runner.AndroidJUnit4; 24 | 25 | @RunWith(AndroidJUnit4.class) 26 | public final class EventsTester { 27 | @Test 28 | public void singleton() { 29 | Assertions.assertThat(Events.getBus()).isSameAs(Events.getBus()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_metrics.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/xml/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 24 | 25 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_drawer_logout.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_favorite.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_more.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/event/ResourceSelectedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.event; 18 | 19 | import org.hawkular.client.android.backend.model.Resource; 20 | 21 | import android.support.annotation.NonNull; 22 | 23 | public class ResourceSelectedEvent { 24 | private final Resource resource; 25 | 26 | public ResourceSelectedEvent(@NonNull Resource resource) { 27 | this.resource = resource; 28 | } 29 | 30 | @NonNull 31 | public Resource getResource() { 32 | return resource; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/backend/BackendEndpoints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend; 18 | 19 | /** 20 | * Backend endpoints. 21 | * 22 | * Default endpoint configurations, such as a demo server. 23 | */ 24 | public final class BackendEndpoints { 25 | private BackendEndpoints() { 26 | } 27 | 28 | public static final class Demo { 29 | private Demo() { 30 | } 31 | 32 | public static final String HOST = "livingontheedge.hawkular.org"; 33 | public static final String PORT = ""; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_time.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/menu/menu_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/layout_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 29 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_explore.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/layout_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 31 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/layout_list_item_persona.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /mobile/src/main/res/values-v21/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 26 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/util/Ports.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.util; 18 | 19 | import android.support.annotation.IntRange; 20 | 21 | /** 22 | * Port utilities. 23 | * 24 | * Provides port-related constants and checks a port for correctness. 25 | */ 26 | public final class Ports { 27 | private Ports() { 28 | } 29 | 30 | public static final int MINIMUM = 0; 31 | public static final int MAXIMUM = 0xFFFF; 32 | 33 | public static boolean isCorrect(@IntRange(from = Ports.MINIMUM, to = Ports.MAXIMUM) int port) { 34 | return (port >= MINIMUM) && (port <= MAXIMUM); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 26 | 27 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /wear/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.github.hierynomus.license" version "0.13.1" 3 | } 4 | 5 | apply plugin: 'com.android.application' 6 | 7 | 8 | android { 9 | compileSdkVersion rootProject.ext.compileSdkVersion 10 | buildToolsVersion rootProject.ext.buildToolsVersion 11 | 12 | defaultConfig { 13 | applicationId "org.hawkular.client.android" 14 | minSdkVersion 20 15 | targetSdkVersion rootProject.ext.targetSdkVersion 16 | versionCode 1 17 | versionName "1.0" 18 | } 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | } 26 | 27 | license { 28 | header rootProject.file('misc/HEADER.txt') 29 | strictCheck true 30 | ext.year = Calendar.getInstance().get(Calendar.YEAR) 31 | exclude "**/build/" 32 | exclude "**/*.gradle/" 33 | exclude "gradle/" 34 | exclude "gradlew" 35 | exclude "gradlew.bat" 36 | exclude "**/*.pro" 37 | exclude "**/*.properties" 38 | exclude "**/misc/*" 39 | exclude "**/*.png" 40 | } 41 | 42 | dependencies { 43 | provided 'com.google.android.wearable:wearable:2.0.0' 44 | 45 | compile 'com.google.android.support:wearable:2.0.0' 46 | compile 'com.google.android.gms:play-services-wearable:10.0.1' 47 | } 48 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/util/PortsTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.util; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | 23 | import android.support.test.runner.AndroidJUnit4; 24 | 25 | @RunWith(AndroidJUnit4.class) 26 | public final class PortsTester { 27 | @Test 28 | public void check() { 29 | Assertions.assertThat(Ports.isCorrect(Integer.MAX_VALUE)).isFalse(); 30 | Assertions.assertThat(Ports.isCorrect(Integer.MIN_VALUE)).isFalse(); 31 | 32 | Assertions.assertThat(Ports.isCorrect(8080)).isTrue(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/activity/TriggerDetailActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.activity; 18 | 19 | import org.hawkular.client.android.backend.model.Trigger; 20 | import org.hawkular.client.android.util.Fragments; 21 | import org.hawkular.client.android.util.Intents; 22 | 23 | import android.support.v4.app.Fragment; 24 | 25 | 26 | public class TriggerDetailActivity extends DetailActivity { 27 | @Override protected Fragment getDetailFragment() { 28 | Trigger trigger= getIntent().getParcelableExtra(Intents.Extras.TRIGGER); 29 | return Fragments.Builder.buildTriggerDetailFragment(trigger); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/row_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 29 | 30 | 36 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | #f44336 23 | #d32f2f 24 | #ffca28 25 | @color/background_primary 26 | #424242 27 | 28 | #1e000000 29 | #fafafa 30 | 31 | #de000000 32 | #8a000000 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/activity_inventory_explorer.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 23 | 24 | 27 | 28 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_feedback.xml: -------------------------------------------------------------------------------- 1 | 19 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /wear/src/main/res/layout/rect_activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 27 | 28 | 33 | 34 | -------------------------------------------------------------------------------- /wear/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 30 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/util/ColorSchemer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.util; 18 | 19 | import org.hawkular.client.android.R; 20 | 21 | import android.support.annotation.NonNull; 22 | 23 | /** 24 | * Color schemer. 25 | * 26 | * Provides a default color scheme, especially useful 27 | * for {@link android.support.v4.widget.SwipeRefreshLayout} configuration. 28 | */ 29 | public final class ColorSchemer { 30 | private ColorSchemer() { 31 | } 32 | 33 | @NonNull 34 | public static int[] getScheme() { 35 | return new int[]{ 36 | R.color.background_primary, 37 | R.color.background_secondary 38 | }; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/animation/MyBounceInterpolator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.animation; 18 | 19 | /** 20 | * Created by pallavi on 09/03/17. 21 | */ 22 | 23 | public class MyBounceInterpolator implements android.view.animation.Interpolator { 24 | double mAmplitude = 1; 25 | double mFrequency = 10; 26 | 27 | public MyBounceInterpolator(double amplitude, double frequency) { 28 | mAmplitude = amplitude; 29 | mFrequency = frequency; 30 | } 31 | 32 | public float getInterpolation(float time) { 33 | return (float) (-1 * Math.pow(Math.E, -time/ mAmplitude) * 34 | Math.cos(mFrequency * time) + 1); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /wear/src/main/res/layout/round_activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 26 | 27 | 34 | 35 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/AlertTypeTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import android.support.test.runner.AndroidJUnit4; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | public final class AlertTypeTester { 28 | @Test 29 | public void parcelable() { 30 | AlertType originalAlertType = AlertType.AVAILABILITY; 31 | AlertType parceledAlertType = Parceler.parcel(AlertType.CREATOR, originalAlertType); 32 | 33 | Assertions.assertThat(parceledAlertType).isEqualTo(originalAlertType); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/MetricTypeTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import android.support.test.runner.AndroidJUnit4; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | public final class MetricTypeTester { 28 | @Test 29 | public void parcelable() { 30 | MetricType originalMetricType = MetricType.AVAILABILITY; 31 | MetricType parceledMetricType = Parceler.parcel(MetricType.CREATOR, originalMetricType); 32 | 33 | Assertions.assertThat(parceledMetricType).isEqualTo(originalMetricType); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/AlertStatusTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import android.support.test.runner.AndroidJUnit4; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | public final class AlertStatusTester { 28 | @Test 29 | public void parcelable() { 30 | AlertStatus originalAlertStatus = AlertStatus.ACKNOWLEDGED; 31 | AlertStatus parceledAlertStatus = Parceler.parcel(AlertStatus.CREATOR, originalAlertStatus); 32 | 33 | Assertions.assertThat(parceledAlertStatus).isEqualTo(originalAlertStatus); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/row_toggle.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 29 | 30 | 38 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/backend/model/MetricBucket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public abstract class MetricBucket { 22 | 23 | @SerializedName("start") 24 | protected long startTimestamp; 25 | 26 | @SerializedName("end") 27 | protected long endTimestamp; 28 | 29 | @SerializedName("empty") 30 | protected boolean empty; 31 | 32 | public abstract String getValue(); 33 | 34 | public long getStartTimestamp() { 35 | return startTimestamp; 36 | } 37 | 38 | public long getEndTimestamp() { 39 | return endTimestamp; 40 | } 41 | 42 | public boolean isEmpty() { 43 | return empty; 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/activity/AlertDetailActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.activity; 18 | 19 | import org.hawkular.client.android.backend.model.Alert; 20 | import org.hawkular.client.android.util.Fragments; 21 | import org.hawkular.client.android.util.Intents; 22 | 23 | import android.support.v4.app.Fragment; 24 | 25 | /** 26 | * Alert Detail activity. 27 | *

28 | * Can be considered as a wrapper for {@link org.hawkular.client.android.fragment.AlertDetailFragment}. 29 | */ 30 | public class AlertDetailActivity extends DetailActivity { 31 | protected Fragment getDetailFragment() { 32 | Alert alert = getIntent().getParcelableExtra(Intents.Extras.ALERT); 33 | return Fragments.Builder.buildAlertDetailFragment(alert); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/PersonaTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.hawkular.client.android.util.Randomizer; 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | 25 | import android.support.test.runner.AndroidJUnit4; 26 | 27 | @RunWith(AndroidJUnit4.class) 28 | public final class PersonaTester { 29 | @Test 30 | public void parcelable() { 31 | Persona originalPersona = new Persona(Randomizer.generateString()); 32 | Persona parceledPerson = Parceler.parcel(Persona.CREATOR, originalPersona); 33 | 34 | Assertions.assertThat(parceledPerson.getId()).isEqualTo(originalPersona.getId()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/util/Android.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.util; 18 | 19 | import org.hawkular.client.android.BuildConfig; 20 | 21 | import android.os.Build; 22 | 23 | /** 24 | * Android utilities. 25 | * 26 | * Provides basic OS-related information in the single place. 27 | */ 28 | public final class Android { 29 | public static class Versions { 30 | private Versions() { 31 | } 32 | 33 | public static final int TARGET = Build.VERSION_CODES.LOLLIPOP_MR1; 34 | } 35 | 36 | private Android() { 37 | } 38 | 39 | public static boolean isDebugging() { 40 | return BuildConfig.DEBUG; 41 | } 42 | 43 | public static boolean isLollipopOrLater() { 44 | return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/MetricAvailabilityTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import android.support.test.runner.AndroidJUnit4; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | public final class MetricAvailabilityTester { 28 | @Test 29 | public void parcelable() { 30 | MetricAvailability originalMetricAvailability = MetricAvailability.UP; 31 | MetricAvailability parceledMetricAvailability = Parceler.parcel( 32 | MetricAvailability.CREATOR, originalMetricAvailability); 33 | 34 | Assertions.assertThat(parceledMetricAvailability).isEqualTo(originalMetricAvailability); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/EnvironmentTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.hawkular.client.android.util.Randomizer; 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | 25 | import android.support.test.runner.AndroidJUnit4; 26 | 27 | @RunWith(AndroidJUnit4.class) 28 | public final class EnvironmentTester { 29 | @Test 30 | public void parcelable() { 31 | Environment originalEnvironment = new Environment(Randomizer.generateString()); 32 | Environment parceledEnvironment = Parceler.parcel(Environment.CREATOR, originalEnvironment); 33 | 34 | Assertions.assertThat(parceledEnvironment.getId()).isEqualTo(originalEnvironment.getId()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/ResourceTypeTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.hawkular.client.android.util.Randomizer; 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | 25 | import android.support.test.runner.AndroidJUnit4; 26 | 27 | @RunWith(AndroidJUnit4.class) 28 | public final class ResourceTypeTester { 29 | @Test 30 | public void parcelable() { 31 | ResourceType originalResourceType = new ResourceType(Randomizer.generateString()); 32 | ResourceType parceledResourceType = Parceler.parcel(ResourceType.CREATOR, originalResourceType); 33 | 34 | Assertions.assertThat(parceledResourceType.getId()).isEqualTo(originalResourceType.getId()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mobile/src/main/java/org/hawkular/client/android/event/Events.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.event; 18 | 19 | import com.squareup.otto.Bus; 20 | 21 | import android.support.annotation.NonNull; 22 | 23 | /** 24 | * Events handler. 25 | * 26 | * Basically handles a {@link com.squareup.otto.Bus} reference. 27 | * 28 | * Use it carefully as a callbacks replacement for application components, 29 | * such as {@link android.app.Activity}, {@link android.app.Fragment}, 30 | * {@link android.app.Service} and {@link android.content.BroadcastReceiver}. 31 | */ 32 | public final class Events { 33 | private Events() { 34 | } 35 | 36 | private static final class EventsBusHolder { 37 | private EventsBusHolder() { 38 | } 39 | 40 | public static final Bus BUS = new Bus(); 41 | } 42 | 43 | @NonNull 44 | public static Bus getBus() { 45 | return EventsBusHolder.BUS; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /mobile/src/androidTest/java/org/hawkular/client/android/backend/model/MetricConfigurationTester.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android.backend.model; 18 | 19 | import org.assertj.core.api.Assertions; 20 | import org.hawkular.client.android.util.Parceler; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | 24 | import android.support.test.runner.AndroidJUnit4; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | public final class MetricConfigurationTester { 28 | @Test 29 | public void parcelable() { 30 | MetricConfiguration originalMetricConfiguration = new MetricConfiguration( 31 | MetricType.AVAILABILITY); 32 | MetricConfiguration parceledMetricConfiguration = Parceler.parcel( 33 | MetricConfiguration.CREATOR, originalMetricConfiguration); 34 | 35 | Assertions.assertThat(parceledMetricConfiguration.getType()).isEqualTo(originalMetricConfiguration.getType()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /wear/src/main/java/org/hawkular/client/android/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 Red Hat, Inc. and/or its affiliates 3 | * and other contributors as indicated by the @author tags. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.hawkular.client.android; 18 | 19 | import android.app.Activity; 20 | import android.os.Bundle; 21 | import android.support.wearable.view.WatchViewStub; 22 | import android.widget.TextView; 23 | 24 | public class MainActivity extends Activity { 25 | 26 | private TextView mTextView; 27 | 28 | @Override 29 | protected void onCreate(Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | setContentView(R.layout.activity_main); 32 | final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); 33 | stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { 34 | @Override 35 | public void onLayoutInflated(WatchViewStub stub) { 36 | mTextView = (TextView) stub.findViewById(R.id.text); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mobile/src/main/res/layout/layout_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 25 | 26 | 32 | 33 | 36 | 37 |