Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android X (P) #2402

Merged
merged 7 commits into from
Feb 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
buildscript {
ext.kotlin_version = '1.3.11'

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

ext {
supportLibraryVersion = '27.1.1'
androidX = '1.0.0'
}

allprojects {
Expand All @@ -22,12 +25,6 @@ allprojects {
}
}

configurations.all {
resolutionStrategy {
force "com.android.support:support-annotations:${supportLibraryVersion}"
}
}

tasks.withType(Test) {
/// increased logging for tests
testLogging {
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
42 changes: 19 additions & 23 deletions owncloudApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,44 @@ apply plugin: 'com.android.application'
def commitSHA1 = 'COMMIT_SHA1'
def gitRemote = 'GIT_REMOTE'

configurations.all {
resolutionStrategy {
force "com.android.support:support-annotations:${supportLibraryVersion}"
}
}

dependencies {
/// dependencies for app building
implementation project(':owncloud-android-library:owncloudComLibrary')
implementation "com.android.support:support-v4:${supportLibraryVersion}"
implementation "com.android.support:design:${supportLibraryVersion}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.legacy:legacy-support-v4:$androidX"
implementation "androidx.annotation:annotation:1.0.1"
Copy link
Contributor Author

@hannesa2 hannesa2 Feb 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this line, only build release run into an issue. That's why build in debug was too less

implementation 'com.google.android.material:material:1.0.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation "com.android.support:customtabs:${supportLibraryVersion}"
implementation 'commons-io:commons-io:2.5'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.browser:browser:$androidX"
implementation 'commons-io:commons-io:2.6'
/// dependencies for local unit tests
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
/// dependencies for instrumented tests
// JUnit4 Rules
androidTestImplementation 'com.android.support.test:rules:0.5'
androidTestImplementation 'androidx.test:rules:1.1.1'
// Android JUnit Runner
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'androidx.test:runner:1.1.1'
// Espresso core
androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
// Espresso web
androidTestImplementation 'com.android.support.test.espresso:espresso-web:2.2.2'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.1'
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
androidTestImplementation 'androidx.annotation:annotation:1.0.1'
// Image loading
implementation('com.github.bumptech.glide:glide:4.6.1') {
exclude group: "com.android.support"
}

//Zooming Android ImageView.
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'

implementation 'com.gitlab.ownclouders:dav4android:oc_support'

Expand All @@ -60,19 +56,19 @@ tasks.withType(Test) {
}

android {
compileSdkVersion 26
compileSdkVersion 28

defaultConfig {
minSdkVersion 14
targetSdkVersion 26
minSdkVersion 15
hannesa2 marked this conversation as resolved.
Show resolved Hide resolved
targetSdkVersion 28

versionCode = 20900300
versionName = "2.9.3"

buildConfigField "String", gitRemote, "\"" + getGitOriginRemote() + "\""
buildConfigField "String", commitSHA1, "\"" + getLatestGitHash() + "\""

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// arguments to be passed to functional tests
testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.SystemClock;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import androidx.test.InstrumentationRegistry;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.UiDevice;
import android.test.suitebuilder.annotation.LargeTest;

import com.owncloud.android.R;
Expand All @@ -50,15 +50,15 @@

import java.lang.reflect.Field;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.replaceText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.isEnabled;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertTrue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
import android.os.Bundle;
import android.os.RemoteException;
import android.os.SystemClock;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.web.webdriver.Locator;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import androidx.test.InstrumentationRegistry;
import androidx.test.espresso.web.webdriver.Locator;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.UiDevice;
import android.test.suitebuilder.annotation.LargeTest;

import com.owncloud.android.R;
Expand All @@ -50,19 +50,19 @@

import java.lang.reflect.Field;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.replaceText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static android.support.test.espresso.web.sugar.Web.onWebView;
import static android.support.test.espresso.web.webdriver.DriverAtoms.findElement;
import static android.support.test.espresso.web.webdriver.DriverAtoms.webClick;
import static android.support.test.espresso.web.webdriver.DriverAtoms.webKeys;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.isEnabled;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.web.sugar.Web.onWebView;
import static androidx.test.espresso.web.webdriver.DriverAtoms.findElement;
import static androidx.test.espresso.web.webdriver.DriverAtoms.webClick;
import static androidx.test.espresso.web.webdriver.DriverAtoms.webKeys;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertTrue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
package com.owncloud.android.datamodel;

import android.os.Parcel;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Before;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
import android.os.Looper;
import android.os.RemoteException;
import android.os.SystemClock;
import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.FailureHandler;
import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.test.uiautomator.UiSelector;
import android.support.v4.content.ContextCompat;
import androidx.test.InstrumentationRegistry;
import androidx.test.espresso.FailureHandler;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObjectNotFoundException;
import androidx.test.uiautomator.UiSelector;
import androidx.core.content.ContextCompat;
import android.test.suitebuilder.annotation.LargeTest;
import android.view.View;

Expand All @@ -64,20 +64,20 @@
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.Espresso.pressBack;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.longClick;
import static android.support.test.espresso.action.ViewActions.replaceText;
import static android.support.test.espresso.action.ViewActions.scrollTo;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.hasSibling;
import static android.support.test.espresso.matcher.ViewMatchers.isChecked;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.Espresso.pressBack;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.action.ViewActions.longClick;
import static androidx.test.espresso.action.ViewActions.replaceText;
import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.hasSibling;
import static androidx.test.espresso.matcher.ViewMatchers.isChecked;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.SdkSuppress;
import android.support.test.runner.AndroidJUnit4;
import android.support.test.uiautomator.By;
import android.support.test.uiautomator.UiDevice;
import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiObjectNotFoundException;
import android.support.test.uiautomator.UiSelector;
import android.support.test.uiautomator.Until;
import androidx.test.InstrumentationRegistry;
import androidx.test.filters.SdkSuppress;
import androidx.test.runner.AndroidJUnit4;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject;
import androidx.test.uiautomator.UiObjectNotFoundException;
import androidx.test.uiautomator.UiSelector;
import androidx.test.uiautomator.Until;


import static org.hamcrest.CoreMatchers.notNullValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.owncloud.android.utils;

import android.support.test.uiautomator.UiObject;
import android.support.test.uiautomator.UiSelector;
import androidx.test.uiautomator.UiObject;
import androidx.test.uiautomator.UiSelector;

import com.owncloud.android.R;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.matcher.ViewMatchers.isDescendantOfA;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static org.hamcrest.Matchers.allOf;
import android.content.Context;

Expand Down
7 changes: 5 additions & 2 deletions owncloudApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,18 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<application
android:name=".MainApp"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity"
android:resizeableActivity="true"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsPictureInPicture="false"
android:theme="@style/Theme.ownCloud.Toolbar">
android:theme="@style/Theme.ownCloud.Toolbar"
tools:targetApi="n">
<activity
android:name=".ui.activity.FileDisplayActivity"
android:theme="@style/Theme.ownCloud.Toolbar.Drawer">
Expand Down Expand Up @@ -174,7 +177,7 @@

<!-- new provider used to generate URIs without file:// scheme (forbidden from Android 7) -->
<provider
android:name="android.support.v4.content.FileProvider"
android:name="androidx.core.content.FileProvider"
android:authorities="@string/file_provider_authority"
android:exported="false"
android:grantUriPermissions="true">
Expand Down
6 changes: 3 additions & 3 deletions owncloudApp/src/main/java/com/owncloud/android/AppRater.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

import android.content.Context;
import android.content.SharedPreferences;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.owncloud.android.ui.dialog.RateMeDialog;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import android.accounts.AccountAuthenticatorResponse;
import android.accounts.AccountManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;

/*
* Base class for implementing an Activity that is used to help implement an AbstractAccountAuthenticator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import android.content.SharedPreferences;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import androidx.annotation.Nullable;

import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.FileDataStorageManager;
Expand Down
Loading