Browse Source

Merge pull request #2429 from nextcloud/AndroidStudio31

Update to Android Studio 3.1 tooling including build fixes
Andy Scherzinger 7 years ago
parent
commit
238b561159

+ 11 - 9
build.gradle

@@ -14,7 +14,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.0.1'
+        classpath 'com.android.tools.build:gradle:3.1.1'
         classpath 'com.google.gms:google-services:3.0.0'
     }
 }
@@ -30,8 +30,8 @@ configurations.all {
 }
 
 ext {
-    supportLibraryVersion = '26.1.0'
-    googleLibraryVersion = '11.2.2'
+    supportLibraryVersion = '27.1.1'
+    googleLibraryVersion = '12.0.1'
     androidLibraryVersion = '1.0.40'
 
     travisBuild = System.getenv("TRAVIS") == "true"
@@ -69,12 +69,12 @@ android {
         javaMaxHeapSize "4g"
     }
 
-    compileSdkVersion 26
-    buildToolsVersion '26.0.2'
+    compileSdkVersion 27
+    buildToolsVersion '27.0.3'
 
     defaultConfig {
         minSdkVersion 14
-        targetSdkVersion 26 
+        targetSdkVersion 27
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
@@ -194,7 +194,7 @@ android {
 
 dependencies {
     // dependencies for app building
-    implementation 'com.android.support:multidex:1.0.2'
+    implementation 'com.android.support:multidex:1.0.3'
 //    implementation project('nextcloud-android-library')
     genericImplementation "com.github.nextcloud:android-library:${androidLibraryVersion}"
     gplayImplementation "com.github.nextcloud:android-library:${androidLibraryVersion}"
@@ -226,7 +226,9 @@ dependencies {
     // implementation "com.google.firebase:firebase-core:${googleLibraryVersion}"
     implementation 'org.parceler:parceler-api:1.1.9'
     annotationProcessor 'org.parceler:parceler:1.1.9'
-    implementation 'com.github.bumptech.glide:glide:3.7.0'
+    implementation ('com.github.bumptech.glide:glide:3.7.0') {
+        exclude group: "com.android.support"
+    }
     implementation 'com.caverock:androidsvg:1.2.1'
     implementation "com.android.support:support-annotations:${supportLibraryVersion}"
     implementation 'com.google.code.gson:gson:2.8.2'
@@ -249,7 +251,7 @@ dependencies {
     //androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
     implementation 'org.jetbrains:annotations:15.0'
 
-    androidTestCompile 'tools.fastlane:screengrab:1.0.0'
+    androidTestImplementation 'tools.fastlane:screengrab:1.0.0'
 }
 
 configurations.all {

+ 0 - 1
gradle.properties

@@ -1 +0,0 @@
-android.enableAapt2=false

+ 2 - 2
gradle/wrapper/gradle-wrapper.properties

@@ -1,6 +1,6 @@
-#Fri May 05 19:09:31 CEST 2017
+#Tue Apr 03 16:56:17 CEST 2018
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

+ 1 - 1
scripts/lint/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 133 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 126 warnings</span>

+ 2 - 1
src/debug/AndroidManifest.xml

@@ -9,7 +9,8 @@
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
 
     <!-- Allows changing locales -->
-    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
+    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"
+        tools:ignore="ProtectedPermissions" />
 
     <application
         android:testOnly="false"

+ 1 - 1
src/main/java/com/owncloud/android/media/MediaService.java

@@ -34,7 +34,7 @@ import android.net.wifi.WifiManager;
 import android.net.wifi.WifiManager.WifiLock;
 import android.os.IBinder;
 import android.os.PowerManager;
-import android.support.v7.app.NotificationCompat;
+import android.support.v4.app.NotificationCompat;
 import android.widget.Toast;
 
 import com.owncloud.android.R;

+ 1 - 0
src/main/java/com/owncloud/android/widgets/ActionEditText.java

@@ -138,6 +138,7 @@ public class ActionEditText extends AppCompatEditText {
                 0xff0000);
         badgeClickCallback = a
                 .getString(R.styleable.ActionEditText_onBadgeClick);
+        a.recycle();
     }
 
 }

+ 26 - 26
src/main/res/layout-land/account_setup.xml

@@ -174,40 +174,40 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
 
-                    <EditText
-                        android:id="@+id/oAuthEntryPoint_1"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:ems="10"
-                        android:enabled="false"
-                        android:inputType="textUri"
+					<EditText
+						android:id="@+id/oAuthEntryPoint_1"
+						android:layout_width="match_parent"
+						android:layout_height="wrap_content"
+						android:ems="10"
+						android:enabled="false"
+						android:hint="@string/oauth_2_0_auth_end_point_address_hint"
+						android:inputType="textUri"
 						android:maxLines="1"
-                        android:text="@string/oauth2_url_endpoint_auth"
-                        android:textColor="@color/login_text_color"
-                        android:textColorHint="@color/login_text_hint_color"
-                        android:visibility="gone"/>
+						android:text="@string/oauth2_url_endpoint_auth"
+						android:textColor="@color/login_text_color"
+						android:textColorHint="@color/login_text_hint_color"
+						android:visibility="gone" />
 
-                </android.support.design.widget.TextInputLayout>
+				</android.support.design.widget.TextInputLayout>
 
                 <android.support.design.widget.TextInputLayout
                     android:id="@+id/input_layout_oAuthEntryPoint_2"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content">
 
-				<EditText
-					android:id="@+id/oAuthEntryPoint_2"
-					android:layout_width="match_parent"
-					android:layout_height="wrap_content"
-					android:ems="10"
-					android:enabled="false"
-					android:text="@string/oauth2_url_endpoint_access"
-					android:maxLines="1"
-					android:inputType="textUri"
-					android:textColor="@color/login_text_color"
-					android:textColorHint="@color/login_text_hint_color"
-					android:visibility="gone">
-					<requestFocus />
-				</EditText>
+					<EditText
+						android:id="@+id/oAuthEntryPoint_2"
+						android:layout_width="match_parent"
+						android:layout_height="wrap_content"
+						android:ems="10"
+						android:enabled="false"
+						android:hint="@string/oauth_2_0_access_end_point_address_hint"
+						android:inputType="textUri"
+						android:maxLines="1"
+						android:text="@string/oauth2_url_endpoint_access"
+						android:textColor="@color/login_text_color"
+						android:textColorHint="@color/login_text_hint_color"
+						android:visibility="gone" />
 
                 </android.support.design.widget.TextInputLayout>
 

+ 3 - 1
src/main/res/layout/account_setup.xml

@@ -173,6 +173,7 @@
                 android:layout_height="wrap_content"
                 android:ems="10"
                 android:enabled="false"
+                android:hint="@string/oauth_2_0_auth_end_point_address_hint"
                 android:inputType="textUri"
                 android:maxLines="1"
                 android:text="@string/oauth2_url_endpoint_auth"
@@ -193,12 +194,13 @@
                 android:layout_height="wrap_content"
                 android:ems="10"
                 android:enabled="false"
+                android:hint="@string/oauth_2_0_access_end_point_address_hint"
                 android:inputType="textUri"
                 android:maxLines="1"
                 android:text="@string/oauth2_url_endpoint_access"
                 android:textColor="@color/login_text_color"
                 android:textColorHint="@color/login_text_hint_color"
-                android:visibility="gone"/>
+                android:visibility="gone" />
 
         </android.support.design.widget.TextInputLayout>
 

+ 1 - 0
src/main/res/layout/edit_box_dialog.xml

@@ -29,6 +29,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:ems="10"
+        android:hint="@string/hint_name"
         android:inputType="textNoSuggestions|textCapSentences"/>
 
 </LinearLayout>

+ 6 - 5
src/main/res/layout/passcodelock.xml

@@ -24,7 +24,6 @@
     android:orientation="vertical"
     android:padding="@dimen/standard_padding" >
 
-
     <TextView
         android:id="@+id/header"
         android:layout_width="wrap_content"
@@ -56,28 +55,30 @@
             style="@style/PassCodeStyle"
             android:cursorVisible="true"
             android:imeOptions="flagNoExtractUi"
-            ><requestFocus/></EditText>
+            android:hint="@string/hidden_character">
+            <requestFocus/>
+        </EditText>
 
         <EditText
             android:id="@+id/txt1"
             style="@style/PassCodeStyle"
             android:cursorVisible="true"
             android:imeOptions="flagNoExtractUi"
-            />
+            android:hint="@string/hidden_character"/>
 
         <EditText
             android:id="@+id/txt2"
             style="@style/PassCodeStyle"
             android:cursorVisible="true"
             android:imeOptions="flagNoExtractUi"
-            />
+            android:hint="@string/hidden_character"/>
 
         <EditText
             android:id="@+id/txt3"
             style="@style/PassCodeStyle"
             android:cursorVisible="true"
             android:imeOptions="flagNoExtractUi"
-            />
+            android:hint="@string/hidden_character"/>
     </LinearLayout>
 
     <android.support.v7.widget.AppCompatButton

+ 1 - 0
src/main/res/layout/password_dialog.xml

@@ -33,6 +33,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:ems="10"
+            android:hint="@string/hint_password"
             android:inputType="textPassword"
             android:layout_margin="@dimen/standard_margin">
         </EditText>

+ 1 - 0
src/main/res/layout/upload_file_dialog.xml

@@ -38,6 +38,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:ems="10"
+        android:hint="@string/hint_name"
         android:inputType="textNoSuggestions|textCapSentences"/>
 
     <TextView

+ 1 - 1
src/main/res/values-v19/styles.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 
-    <style name="Theme.ownCloud.Overlay" parent="style/Theme.ownCloud">
+    <style name="Theme.ownCloud.Overlay" parent="Theme.ownCloud">
         <item name="android:actionBarStyle">@style/Theme.ownCloud.Overlay.ActionBar</item>
         <item name="android:windowActionBarOverlay">true</item>
         <item name="android:windowFullscreen">true</item>

+ 2 - 2
src/main/res/values/oauth2_configuration.xml

@@ -5,8 +5,8 @@
     <string name="oauth2_redirect_uri">owncloud://callback</string>
     
     <!-- values that should be provided by ownCloud server -->
-    <string name="oauth2_url_endpoint_auth">http://oauth2.authorization.server.org/paht/to/endpoint/for/authorization</string>
-    <string name="oauth2_url_endpoint_access">http://oauth2.authorization.server.org/paht/to/endpoint/for/access/token</string>
+    <string name="oauth2_url_endpoint_auth">http://oauth2.authorization.server.org/path/to/endpoint/for/authorization</string>
+    <string name="oauth2_url_endpoint_access">http://oauth2.authorization.server.org/path/to/endpoint/for/access/token</string>
     <string name="oauth2_scope">owncloud</string>
     <string name="oauth2_grant_type">authorization_code</string>	<!-- the only one supported right now -->
     <string name="oauth2_response_type">code</string>				<!-- depends on oauth2_grant_type -->

+ 5 - 0
src/main/res/values/strings.xml

@@ -774,4 +774,9 @@
     <string name="notification_channel_push_name">Push notifications</string>
     <string name="notification_channel_push_description">Show push notifications sent by the server: Mentions in comments, reception of new remote shares, announcements posted by an admin etc.</string>
     <string name="sendbutton_description">Send button icon</string>
+    <string name="oauth_2_0_auth_end_point_address_hint">Auth end point address</string>
+    <string name="oauth_2_0_access_end_point_address_hint">Access end point address</string>
+    <string name="hidden_character" translatable="false">*</string>
+    <string name="hint_name">Name</string>
+    <string name="hint_password">Password</string>
 </resources>

+ 11 - 11
src/main/res/values/styles.xml

@@ -126,7 +126,7 @@
 	</style>
 
 	<!-- separat translucent action bar style -->
-	<style name="Theme.ownCloud.Overlay" parent="style/Theme.ownCloud">
+	<style name="Theme.ownCloud.Overlay" parent="@style/Theme.ownCloud">
 		<item name="android:actionBarStyle">@style/Theme.ownCloud.Overlay.ActionBar</item>
 		<item name="android:windowActionBarOverlay">true</item>
 		<item name="android:windowFullscreen">true</item>
@@ -145,19 +145,19 @@
 	</style>
 
 	<!-- Progress bar -->
-	<style name="Widget.ownCloud.TopProgressBar" parent="style/Widget.AppCompat.ProgressBar.Horizontal">
+	<style name="Widget.ownCloud.TopProgressBar" parent="@style/Widget.AppCompat.ProgressBar.Horizontal">
 		<item name="android:progressDrawable">@drawable/actionbar_progress_horizontal</item>
 		<item name="android:indeterminateDrawable">@drawable/actionbar_progress_indeterminate_horizontal</item>
 	</style>
 
-	<style name="Theme.ownCloud.Fullscreen" parent="style/Theme.AppCompat">
+	<style name="Theme.ownCloud.Fullscreen" parent="@style/Theme.AppCompat">
         <item name="android:windowFullscreen">true</item>
 		<item name="colorAccent">@color/color_accent</item>
     </style>
 	
 	
 	<style name="Theme.ownCloud.Widget.ActionBar"
-		parent="style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
+		parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
 		<item name="android:background">@color/primary</item>
 		<item name="background">@color/primary</item>
     	<item name="android:textColor">#ffffff</item>
@@ -168,19 +168,19 @@
 	</style>
 
 	<!-- Dialogs -->
-	<style name="Theme.ownCloud.Dialog" parent="style/Theme.AppCompat.Light.Dialog.Alert">
+	<style name="Theme.ownCloud.Dialog" parent="@style/Theme.AppCompat.Light.Dialog.Alert">
 		<item name="windowNoTitle">false</item>
 		<item name="colorAccent">@color/color_accent</item>
 		<item name="buttonBarButtonStyle">@style/Theme.ownCloud.Dialog.ButtonBar.Button</item>
 		<item name="buttonBarStyle">@style/Theme.ownCloud.Dialog.ButtonBar</item>
 	</style>
 
-	<style name="Theme.ownCloud.Dialog.NoTitle" parent="style/Theme.ownCloud.Dialog">
+	<style name="Theme.ownCloud.Dialog.NoTitle" parent="@style/Theme.ownCloud.Dialog">
 		<item name="windowNoTitle">true</item>
 		<item name="colorAccent">@color/color_accent</item>
 	</style>
 
-	<style name="Theme.ownCloud.Dialog.NoButtonBarStyle" parent="style/Theme.AppCompat.Light.Dialog.Alert">
+	<style name="Theme.ownCloud.Dialog.NoButtonBarStyle" parent="@style/Theme.AppCompat.Light.Dialog.Alert">
 		<item name="windowNoTitle">false</item>
 		<item name="colorAccent">@color/color_accent</item>
 	</style>
@@ -200,7 +200,7 @@
 	fix see:
 		http://stackoverflow.com/questions/27187353/dialog-buttons-with-long-text-not-wrapping-squeezed-out-material-theme-on-an
 	 -->
-	<style name="Theme.ownCloud.Dialog.ButtonBar" parent="style/Widget.AppCompat.Button.ButtonBar.AlertDialog">
+	<style name="Theme.ownCloud.Dialog.ButtonBar" parent="@style/Widget.AppCompat.Button.ButtonBar.AlertDialog">
 		<!-- Making sure, the button bar uses parent width and is not restricted in height -->
 		<item name="android:layout_width">match_parent</item>
 		<item name="android:layout_height">wrap_content</item>
@@ -208,7 +208,7 @@
 		<item name="android:minHeight">@null</item>
 	</style>
 
-	<style name="Theme.ownCloud.Dialog.ButtonBar.Button" parent="style/Widget.AppCompat.Button.Borderless.Colored">
+	<style name="Theme.ownCloud.Dialog.ButtonBar.Button" parent="@style/Widget.AppCompat.Button.Borderless.Colored">
 		<!-- Setting the weight as follows should result in equally wide buttons filling the alert dialog width,
             but instead they span further out of the dialog, breaking in multiple lines though -->
 		<item name="android:layout_width">0dp</item>
@@ -237,10 +237,10 @@
     </style>
 
 	<!-- Text styles -->
-	<style name="NextcloudTextAppearanceHeadline" parent="style/TextAppearance.AppCompat.Headline">
+	<style name="NextcloudTextAppearanceHeadline" parent="@style/TextAppearance.AppCompat.Headline">
 		<item name="android:textSize">26sp</item>
 		<item name="android:textColor">#000000</item>
 	</style>
-	<style name="NextcloudTextAppearanceMedium" parent="style/TextAppearance.AppCompat.Medium">
+	<style name="NextcloudTextAppearanceMedium" parent="@style/TextAppearance.AppCompat.Medium">
 	</style>
 </resources>