Skip to content
Snippets Groups Projects
Unverified Commit 26302881 authored by mueller-ma's avatar mueller-ma Committed by GitHub
Browse files

Update dependencies to Api 28 (#1020)


* Migrate to AndroidX
* Fix import of "LargeTest"
* Reorder imports
* Adapt checkstyle

Signed-off-by: default avatarmueller-ma <mueller-ma@users.noreply.github.com>
parent c21d1903
Branches
No related tags found
No related merge requests found
Showing
with 108 additions and 126 deletions
#
# Copyright (c) 2010-2018, openHAB.org and others.
#
# All rights reserved. This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available
# at https://www.eclipse.org/legal/epl-v10.html
#
android.enableJetifier=true
android.useAndroidX=true
\ No newline at end of file
...@@ -25,8 +25,8 @@ if(!isFoss) { ...@@ -25,8 +25,8 @@ if(!isFoss) {
apply plugin: 'witness' apply plugin: 'witness'
android { android {
buildToolsVersion '27.0.3' buildToolsVersion '28.0.3'
compileSdkVersion 27 compileSdkVersion 28
useLibrary 'org.apache.http.legacy' useLibrary 'org.apache.http.legacy'
defaultConfig { defaultConfig {
...@@ -36,7 +36,7 @@ android { ...@@ -36,7 +36,7 @@ android {
versionCode 85 versionCode 85
versionName "2.3.3-beta" versionName "2.3.3-beta"
multiDexEnabled true multiDexEnabled true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
} }
buildTypes { buildTypes {
def IS_DEVELOPER = "IS_DEVELOPER" def IS_DEVELOPER = "IS_DEVELOPER"
...@@ -99,11 +99,11 @@ repositories { ...@@ -99,11 +99,11 @@ repositories {
} }
dependencies { dependencies {
implementation "com.android.support:appcompat-v7:27.1.1" implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.android.support:support-v4:27.1.1" implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "com.android.support:recyclerview-v7:27.1.1" implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "com.android.support:design:27.1.1" implementation "com.google.android.material:material:1.0.0"
implementation 'com.android.support:multidex:1.0.3' implementation 'androidx.multidex:multidex:2.0.0'
implementation 'org.jmdns:jmdns:3.5.4' implementation 'org.jmdns:jmdns:3.5.4'
implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.github.heremaps:oksse:0.9.0' implementation 'com.github.heremaps:oksse:0.9.0'
...@@ -145,13 +145,13 @@ dependencies { ...@@ -145,13 +145,13 @@ dependencies {
testImplementation 'org.powermock:powermock-module-junit4:1.7.4' testImplementation 'org.powermock:powermock-module-junit4:1.7.4'
// Espresso UI tests // Espresso UI tests
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2', { androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta01', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
} }
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'androidx.test:runner:1.1.0-beta01'
androidTestImplementation 'com.android.support.test:rules:1.0.2' androidTestImplementation 'androidx.test:rules:1.1.0-beta01'
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2' androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0-beta01'
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2', { androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0-beta01', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
} }
......
/*
* Copyright (c) 2010-2016, openHAB.org and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.habdroid;
import android.app.Application;
import android.test.ApplicationTestCase;
/*
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
package org.openhab.habdroid; package org.openhab.habdroid;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import android.support.test.espresso.IdlingResource; import androidx.fragment.app.Fragment;
import android.support.v4.app.Fragment; import androidx.fragment.app.FragmentManager;
import android.support.v4.app.FragmentManager; import androidx.test.espresso.IdlingResource;
import org.openhab.habdroid.ui.WidgetListFragment; import org.openhab.habdroid.ui.WidgetListFragment;
import org.openhab.habdroid.ui.activity.ContentController; import org.openhab.habdroid.ui.activity.ContentController;
......
package org.openhab.habdroid; package org.openhab.habdroid;
import android.support.test.espresso.IdlingRegistry;
import android.support.test.espresso.IdlingResource;
import android.support.test.espresso.intent.rule.IntentsTestRule;
import android.view.View; import android.view.View;
import androidx.test.espresso.IdlingRegistry;
import androidx.test.espresso.IdlingResource;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
......
package org.openhab.habdroid; package org.openhab.habdroid;
import android.support.annotation.NonNull;
import android.support.test.espresso.IdlingResource;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull;
import androidx.test.espresso.IdlingResource;
public class ProgressbarIdlingResource implements IdlingResource { public class ProgressbarIdlingResource implements IdlingResource {
private String mName; private String mName;
......
package org.openhab.habdroid; package org.openhab.habdroid;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import org.openhab.habdroid.util.Constants; import org.openhab.habdroid.util.Constants;
......
...@@ -2,7 +2,7 @@ package org.openhab.habdroid; ...@@ -2,7 +2,7 @@ package org.openhab.habdroid;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import org.junit.Before; import org.junit.Before;
import org.openhab.habdroid.util.Constants; import org.openhab.habdroid.util.Constants;
......
package org.openhab.habdroid.screengrab; package org.openhab.habdroid.screengrab;
import android.support.test.espresso.ViewInteraction; import androidx.test.espresso.ViewInteraction;
import android.support.test.espresso.contrib.RecyclerViewActions; import androidx.test.espresso.contrib.RecyclerViewActions;
import android.support.test.runner.AndroidJUnit4; import androidx.test.filters.LargeTest;
import android.test.suitebuilder.annotation.LargeTest; import androidx.test.runner.AndroidJUnit4;
import org.junit.ClassRule; import org.junit.ClassRule;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.TestWithoutIntro; import org.openhab.habdroid.TestWithoutIntro;
import tools.fastlane.screengrab.locale.LocaleTestRule; import tools.fastlane.screengrab.locale.LocaleTestRule;
import static android.support.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.pressBack; import static androidx.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static tools.fastlane.screengrab.Screengrab.screenshot; import static tools.fastlane.screengrab.Screengrab.screenshot;
@LargeTest @LargeTest
......
package org.openhab.habdroid.ui; package org.openhab.habdroid.ui;
import android.support.annotation.IdRes;
import android.support.test.espresso.DataInteraction;
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.support.test.espresso.ViewInteraction;
import android.support.test.espresso.contrib.RecyclerViewActions;
import android.support.test.espresso.matcher.BoundedMatcher;
import android.support.test.runner.AndroidJUnit4;
import android.support.v7.widget.RecyclerView;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View; import android.view.View;
import androidx.annotation.IdRes;
import androidx.recyclerview.widget.RecyclerView;
import androidx.test.espresso.DataInteraction;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.espresso.ViewInteraction;
import androidx.test.espresso.matcher.BoundedMatcher;
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Matcher; import org.hamcrest.Matcher;
...@@ -20,16 +19,16 @@ import org.openhab.habdroid.BuildConfig; ...@@ -20,16 +19,16 @@ import org.openhab.habdroid.BuildConfig;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.TestWithoutIntro; import org.openhab.habdroid.TestWithoutIntro;
import static android.support.test.espresso.Espresso.onData; import static androidx.test.espresso.Espresso.onData;
import static android.support.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition; import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
import static android.support.test.espresso.contrib.RecyclerViewActions.scrollToPosition; import static androidx.test.espresso.contrib.RecyclerViewActions.scrollToPosition;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withClassName; import static androidx.test.espresso.matcher.ViewMatchers.withClassName;
import static android.support.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText; import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.anything; import static org.hamcrest.Matchers.anything;
import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.is;
......
package org.openhab.habdroid.ui; package org.openhab.habdroid.ui;
import android.support.test.espresso.ViewInteraction; import androidx.test.espresso.ViewInteraction;
import android.support.test.runner.AndroidJUnit4; import androidx.test.filters.LargeTest;
import android.test.suitebuilder.annotation.LargeTest; import androidx.test.runner.AndroidJUnit4;
import org.hamcrest.CoreMatchers;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.TestWithIntro; import org.openhab.habdroid.TestWithIntro;
import static android.support.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
import static android.support.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withParent; import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static android.support.test.espresso.matcher.ViewMatchers.withText; import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.allOf;
import static org.openhab.habdroid.TestUtils.childAtPosition; import static org.openhab.habdroid.TestUtils.childAtPosition;
@LargeTest @LargeTest
......
package org.openhab.habdroid.ui; package org.openhab.habdroid.ui;
import android.content.Context; import android.content.Context;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import android.support.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import android.support.test.espresso.ViewInteraction; import androidx.test.espresso.ViewInteraction;
import android.support.test.espresso.contrib.RecyclerViewActions; import androidx.test.espresso.contrib.RecyclerViewActions;
import android.support.test.runner.AndroidJUnit4; import androidx.test.filters.LargeTest;
import android.test.suitebuilder.annotation.LargeTest; import androidx.test.runner.AndroidJUnit4;
import org.hamcrest.core.IsInstanceOf; import org.hamcrest.core.IsInstanceOf;
import org.junit.Test; import org.junit.Test;
...@@ -14,14 +14,14 @@ import org.junit.runner.RunWith; ...@@ -14,14 +14,14 @@ import org.junit.runner.RunWith;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.TestWithoutIntro; import org.openhab.habdroid.TestWithoutIntro;
import static android.support.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click; import static androidx.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.longClick; import static androidx.test.espresso.action.ViewActions.longClick;
import static android.support.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition; import static androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText; import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.allOf;
@LargeTest @LargeTest
......
...@@ -2,9 +2,9 @@ package org.openhab.habdroid.ui; ...@@ -2,9 +2,9 @@ package org.openhab.habdroid.ui;
import android.content.Context; import android.content.Context;
import android.speech.SpeechRecognizer; import android.speech.SpeechRecognizer;
import android.support.test.InstrumentationRegistry; import androidx.test.InstrumentationRegistry;
import android.support.test.espresso.ViewInteraction; import androidx.test.espresso.ViewInteraction;
import android.support.test.rule.ActivityTestRule; import androidx.test.rule.ActivityTestRule;
import org.junit.Before; import org.junit.Before;
import org.junit.Rule; import org.junit.Rule;
...@@ -12,11 +12,11 @@ import org.junit.Test; ...@@ -12,11 +12,11 @@ import org.junit.Test;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.TestWithoutIntro; import org.openhab.habdroid.TestWithoutIntro;
import static android.support.test.espresso.Espresso.onView; import static androidx.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withId; import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static org.hamcrest.CoreMatchers.allOf; import static org.hamcrest.CoreMatchers.allOf;
import static org.junit.Assume.assumeTrue; import static org.junit.Assume.assumeTrue;
......
package org.openhab.habdroid.ui; package org.openhab.habdroid.ui;
import android.content.Context; import android.content.Context;
import android.support.test.InstrumentationRegistry; import androidx.appcompat.view.ContextThemeWrapper;
import android.support.v7.view.ContextThemeWrapper; import androidx.test.InstrumentationRegistry;
import org.junit.Test; import org.junit.Test;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
......
...@@ -11,7 +11,7 @@ package org.openhab.habdroid.core; ...@@ -11,7 +11,7 @@ package org.openhab.habdroid.core;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.core.connection.CloudConnection; import org.openhab.habdroid.core.connection.CloudConnection;
......
...@@ -11,7 +11,7 @@ package org.openhab.habdroid.core; ...@@ -11,7 +11,7 @@ package org.openhab.habdroid.core;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.support.annotation.StringRes; import androidx.annotation.StringRes;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.core.connection.CloudConnection; import org.openhab.habdroid.core.connection.CloudConnection;
......
...@@ -23,12 +23,11 @@ import android.os.Build; ...@@ -23,12 +23,11 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import androidx.core.content.ContextCompat;
import com.google.android.gms.gcm.GcmListenerService; import com.google.android.gms.gcm.GcmListenerService;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.core.connection.Connection; import org.openhab.habdroid.core.connection.Connection;
import org.openhab.habdroid.core.connection.ConnectionFactory; import org.openhab.habdroid.core.connection.ConnectionFactory;
......
...@@ -16,13 +16,12 @@ import android.content.Intent; ...@@ -16,13 +16,12 @@ import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.v4.app.JobIntentService;
import android.util.Log; import android.util.Log;
import androidx.annotation.NonNull;
import androidx.core.app.JobIntentService;
import com.google.android.gms.gcm.GoogleCloudMessaging; import com.google.android.gms.gcm.GoogleCloudMessaging;
import com.google.android.gms.iid.InstanceID; import com.google.android.gms.iid.InstanceID;
import org.openhab.habdroid.core.connection.CloudConnection; import org.openhab.habdroid.core.connection.CloudConnection;
import org.openhab.habdroid.core.connection.Connection; import org.openhab.habdroid.core.connection.Connection;
import org.openhab.habdroid.core.connection.ConnectionFactory; import org.openhab.habdroid.core.connection.ConnectionFactory;
......
...@@ -14,7 +14,6 @@ import com.google.android.gms.maps.model.LatLng; ...@@ -14,7 +14,6 @@ import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.LatLngBounds; import com.google.android.gms.maps.model.LatLngBounds;
import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.MarkerOptions;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.core.connection.Connection; import org.openhab.habdroid.core.connection.Connection;
import org.openhab.habdroid.model.Item; import org.openhab.habdroid.model.Item;
......
...@@ -24,23 +24,24 @@ ...@@ -24,23 +24,24 @@
package de.duenndns.ssl; package de.duenndns.ssl;
import java.util.logging.Level;
import java.util.logging.Logger;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.*; import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import androidx.appcompat.app.AlertDialog;
import org.openhab.habdroid.R; import org.openhab.habdroid.R;
import org.openhab.habdroid.util.Util; import org.openhab.habdroid.util.Util;
import java.util.logging.Level;
import java.util.logging.Logger;
public class MemorizingActivity extends Activity public class MemorizingActivity extends Activity
implements OnClickListener,OnCancelListener { implements OnClickListener,OnCancelListener {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment