From 0d580d3241e649fed2c309d7ebe9dd6fff4e0556 Mon Sep 17 00:00:00 2001 From: Yuichi Araki Date: Tue, 24 Sep 2019 16:44:07 +0900 Subject: [PATCH] DeviceOwner: Bump dependencies - SDK version 29 - AndroidX --- DeviceOwner/Application/build.gradle | 73 +++++-------------- .../Application/src/main/AndroidManifest.xml | 14 ++-- .../deviceowner/DeviceOwnerFragment.java | 4 +- .../deviceowner/InstructionFragment.java | 4 +- .../android/deviceowner/MainActivity.java | 6 +- ...tivity_main_real.xml => activity_main.xml} | 5 +- .../main/res/layout/fragment_device_owner.xml | 24 +++--- .../main/res/layout/fragment_instruction.xml | 2 +- .../res/values-sw600dp/template-dimens.xml | 24 ------ .../res/values-sw600dp/template-styles.xml | 25 ------- .../src/main/res/values-v21/base-colors.xml | 21 ------ .../res/values-v21/base-template-styles.xml | 24 ------ .../src/main/res/values/base-strings.xml | 32 -------- .../template-styles.xml => values/dimens.xml} | 5 +- .../src/main/res/values/strings.xml | 9 +++ .../src/main/res/values/template-dimens.xml | 32 -------- .../src/main/res/values/template-styles.xml | 42 ----------- DeviceOwner/build.gradle | 44 ++++++++--- DeviceOwner/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.properties | 3 +- 20 files changed, 97 insertions(+), 298 deletions(-) rename DeviceOwner/Application/src/main/res/layout/{activity_main_real.xml => activity_main.xml} (96%) delete mode 100644 DeviceOwner/Application/src/main/res/values-sw600dp/template-dimens.xml delete mode 100644 DeviceOwner/Application/src/main/res/values-sw600dp/template-styles.xml delete mode 100644 DeviceOwner/Application/src/main/res/values-v21/base-colors.xml delete mode 100644 DeviceOwner/Application/src/main/res/values-v21/base-template-styles.xml delete mode 100644 DeviceOwner/Application/src/main/res/values/base-strings.xml rename DeviceOwner/Application/src/main/res/{values-v11/template-styles.xml => values/dimens.xml} (86%) delete mode 100644 DeviceOwner/Application/src/main/res/values/template-dimens.xml delete mode 100644 DeviceOwner/Application/src/main/res/values/template-styles.xml diff --git a/DeviceOwner/Application/build.gradle b/DeviceOwner/Application/build.gradle index ba01c35..7377900 100644 --- a/DeviceOwner/Application/build.gradle +++ b/DeviceOwner/Application/build.gradle @@ -1,68 +1,35 @@ - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} +/* + * Copyright (C) 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ apply plugin: 'com.android.application' -repositories { - google() - jcenter() -} - -dependencies { - - - implementation "com.android.support:support-v4:28.0.0" - implementation "com.android.support:support-v13:28.0.0" - implementation "com.android.support:cardview-v7:28.0.0" - implementation "com.android.support:appcompat-v7:28.0.0" - - - - - - -} - -// The sample build uses multiple directories to -// keep boilerplate and common code separate from -// the main sample code. -List dirs = [ - 'main', // main sample code; look here for the interesting stuff. - 'common', // components that are reused by multiple samples - 'template'] // boilerplate code that is generated by the sample template process - android { - compileSdkVersion 28 + compileSdkVersion 29 defaultConfig { minSdkVersion 21 - targetSdkVersion 28 + targetSdkVersion 29 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } +} - sourceSets { - main { - dirs.each { dir -> - java.srcDirs "src/${dir}/java" - res.srcDirs "src/${dir}/res" - } - } - androidTest.setRoot('tests') - androidTest.java.srcDirs = ['tests/src'] - - } - +dependencies { + implementation 'androidx.appcompat:appcompat:1.1.0' } diff --git a/DeviceOwner/Application/src/main/AndroidManifest.xml b/DeviceOwner/Application/src/main/AndroidManifest.xml index d81d85a..221b9a1 100644 --- a/DeviceOwner/Application/src/main/AndroidManifest.xml +++ b/DeviceOwner/Application/src/main/AndroidManifest.xml @@ -15,8 +15,9 @@ limitations under the License. --> @@ -24,14 +25,15 @@ android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" - android:theme="@style/Theme.DeviceOwner"> + android:theme="@style/Theme.DeviceOwner" + tools:ignore="GoogleAppIndexingWarning"> - - + + @@ -42,9 +44,9 @@ android:permission="android.permission.BIND_DEVICE_ADMIN"> + android:resource="@xml/device_owner_receiver" /> - + diff --git a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/DeviceOwnerFragment.java b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/DeviceOwnerFragment.java index b496257..579f563 100644 --- a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/DeviceOwnerFragment.java +++ b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/DeviceOwnerFragment.java @@ -27,8 +27,8 @@ import android.content.pm.ResolveInfo; import android.os.Bundle; import android.provider.Settings; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/InstructionFragment.java b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/InstructionFragment.java index 39ae248..e4af0bc 100644 --- a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/InstructionFragment.java +++ b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/InstructionFragment.java @@ -17,8 +17,8 @@ package com.example.android.deviceowner; import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/MainActivity.java b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/MainActivity.java index 01298e4..cbc3e08 100644 --- a/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/MainActivity.java +++ b/DeviceOwner/Application/src/main/java/com/example/android/deviceowner/MainActivity.java @@ -19,8 +19,8 @@ import android.app.admin.DevicePolicyManager; import android.content.Context; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v7.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.appcompat.app.AppCompatActivity; import android.util.Log; public class MainActivity extends AppCompatActivity { @@ -30,7 +30,7 @@ public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main_real); + setContentView(R.layout.activity_main); if (savedInstanceState == null) { DevicePolicyManager manager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); diff --git a/DeviceOwner/Application/src/main/res/layout/activity_main_real.xml b/DeviceOwner/Application/src/main/res/layout/activity_main.xml similarity index 96% rename from DeviceOwner/Application/src/main/res/layout/activity_main_real.xml rename to DeviceOwner/Application/src/main/res/layout/activity_main.xml index 384e9f9..ac1947c 100644 --- a/DeviceOwner/Application/src/main/res/layout/activity_main_real.xml +++ b/DeviceOwner/Application/src/main/res/layout/activity_main.xml @@ -15,10 +15,9 @@ limitations under the License. --> + tools:context="com.example.android.deviceowner.MainActivity" /> diff --git a/DeviceOwner/Application/src/main/res/layout/fragment_device_owner.xml b/DeviceOwner/Application/src/main/res/layout/fragment_device_owner.xml index aeae219..211a7e6 100644 --- a/DeviceOwner/Application/src/main/res/layout/fragment_device_owner.xml +++ b/DeviceOwner/Application/src/main/res/layout/fragment_device_owner.xml @@ -29,7 +29,7 @@ @@ -37,9 +37,9 @@ android:id="@+id/switch_auto_time" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="@dimen/margin_medium" - android:paddingEnd="@dimen/margin_medium" - android:paddingStart="@dimen/margin_medium" + android:layout_margin="@dimen/spacing_medium" + android:paddingEnd="@dimen/spacing_medium" + android:paddingStart="@dimen/spacing_medium" android:text="@string/label_auto_time" android:textAppearance="?android:attr/textAppearanceMedium"/> @@ -47,20 +47,20 @@ android:id="@+id/switch_auto_time_zone" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_margin="@dimen/margin_medium" - android:paddingEnd="@dimen/margin_medium" - android:paddingStart="@dimen/margin_medium" + android:layout_margin="@dimen/spacing_medium" + android:paddingEnd="@dimen/spacing_medium" + android:paddingStart="@dimen/spacing_medium" android:text="@string/label_auto_time_zone" android:textAppearance="?android:attr/textAppearanceMedium"/> + android:layout_height="@dimen/spacing_medium"/> @@ -68,14 +68,14 @@ android:id="@+id/available_launchers" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/margin_medium" - android:layout_marginTop="@dimen/margin_medium"/> + android:layout_marginStart="@dimen/spacing_medium" + android:layout_marginTop="@dimen/spacing_medium"/>