Skip to content

Commit

Permalink
Upgrade AGP to v7.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yongce committed Oct 2, 2021
1 parent 842647a commit 2b80dbc
Show file tree
Hide file tree
Showing 41 changed files with 139 additions and 144 deletions.
1 change: 1 addition & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

2 changes: 1 addition & 1 deletion android_module_common.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* File: 'android_module_common.gradle'
* Location: https://raw.githubusercontent.com/yongce/AndroidLib/master/android_module_common.gradle
* Version: 2020.03.26
* Version: 2021.10.1
* All android projects can copy and include this file.
*/

Expand Down
98 changes: 51 additions & 47 deletions android_project_common.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* File: 'android_project_common.gradle'
* Location: https://raw.githubusercontent.com/yongce/AndroidLib/master/android_project_common.gradle
* Version: 2020.07.19
* Version: 2021.10.1
* All android projects can copy and include this file.
*/

Expand All @@ -22,6 +22,8 @@ allprojects {
details.useVersion versions.lifecycle
} else if (details.requested.group == 'androidx.room') {
details.useVersion versions.room
} else if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion versions.kotlin
}
}
}
Expand All @@ -33,84 +35,85 @@ ext {

versions = [
// compile
'compileSdk' : 30,
'compileSdk' : 31,

// Android official support
'kotlin' : '1.3.72',
'kotlinCoroutine' : "1.3.7",
'kotlin' : '1.5.31',
'kotlinCoroutine' : "1.4.1",
'multidexLib' : "2.0.1",
'androidxCore' : '1.3.0',
'fragment' : '1.2.4',
'preference' : "1.1.0",
'androidxCore' : '1.3.2',
'fragment' : '1.3.2',
'preference' : "1.1.1",
'palette' : "1.0.0",
'recyclerView' : "1.1.0",
'constraintLayout' : "1.1.3",
'recyclerView' : "1.2.0",
'constraintLayout' : "2.0.4",
'vectorDrawable' : "1.1.0",
'lintLib' : '27.0.0',
'lintLib' : '30.0.2',
'archCore' : "2.1.0",
'lifecycle' : "2.2.0",
'room' : '2.2.5',
'lifecycle' : "2.3.1",
'room' : '2.2.6',
'sqlite' : "2.1.0",
'navigation' : "2.2.1",
'paging' : "2.1.1",
'work' : "2.3.3",
'media2' : "1.0.3",
'navigation' : "2.3.5",
'paging' : "2.1.2",
'work' : "2.5.0",
'media2' : "1.1.2",

// test
'testCore' : "1.2.0",
'espresso' : "3.2.0",
'testCore' : "1.3.0",
'espresso' : "3.3.0",
'uiautomator' : "2.2.0",
'truth' : '1.0.1',
'hamcrest' : '2.2',
'mockito' : "2.19.0",
'mockito' : "3.5.11",
'powermock' : '1.6.6',
'robolectric' : '4.3.1',
'mockk' : "1.9.3",
'robolectric' : '4.5.1',
'mockk' : "1.10.0",

// google
'gms' : '18.0.0',
'wearableSupport' : "2.3.0",

// infrastructure
'butterknife' : "10.2.1",
'timber' : "4.7.1",
'butterknife' : "10.2.3",
'timber' : "5.0.1",
'guava' : "29.0-android",

// debug
'leakcanary' : "1.6.3",
'leakcanary' : "2.5",
'stetho' : '1.5.1',
'ktlint' : "0.36.0",
'ktlint' : "0.41.0",

// serializing
'gson' : '2.8.6',
'protobuf' : "3.1.0",

// network & image
'okhttp' : '4.7.2',
'okhttp' : '4.9.0',
'retrofit' : '2.9.0',
'glide' : '4.11.0',
'glideTrans' : "4.0.0",
'glideTrans' : "4.3.0",

// rx
'rxjava' : "2.2.6",
'rxjava' : "2.2.12",
'rxandroid' : "2.1.1",

// ycdev
'androidLib' : "1.8.1",
'androidLib' : "2.0.0",

// others
'zxing' : '3.4.0',
]
deps = [
// Android official support
'kotlin': [
'stdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}",
'stdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}",
'reflect' : "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}",
'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutine}",
'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutine}"
],
'androidx': [
// core
'annotation' : "androidx.annotation:annotation:1.1.0",
'annotation' : "androidx.annotation:annotation:1.2.0",
'core' : "androidx.core:core:${versions.androidxCore}",
'coreKtx' : "androidx.core:core-ktx:${versions.androidxCore}",
'fragment' : "androidx.fragment:fragment:${versions.fragment}",
Expand All @@ -119,8 +122,8 @@ ext {
'collection' : "androidx.collection:collection:1.1.0",
'collectionKtx' : "androidx.collection:collection-ktx:1.1.0",
// UI
'appcompat' : "androidx.appcompat:appcompat:1.1.0",
'material' : "com.google.android.material:material:1.1.0",
'appcompat' : "androidx.appcompat:appcompat:1.2.0",
'material' : "com.google.android.material:material:1.3.0",
'preference' : "androidx.preference:preference:${versions.preference}",
'preferenceKtx' : "androidx.preference:preference-ktx:${versions.preference}",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
Expand All @@ -132,20 +135,20 @@ ext {
'recyclerviewSelection' : "androidx.recyclerview:recyclerview:${versions.recyclerView}",
'percent' : "androidx.percentlayout:percentlayout:1.0.0",
'coordinatorLayout' : "androidx.coordinatorlayout:coordinatorlayout:1.1.0",
'drawerLayout' : "androidx.drawerlayout:drawerlayout:1.0.0",
'swipeRefreshLayout' : "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0",
'drawerLayout' : "androidx.drawerlayout:drawerlayout:1.1.1",
'swipeRefreshLayout' : "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
'viewPager' : "androidx.viewpager:viewpager:1.0.0",
'viewPager2' : "androidx.viewpager2:viewpager2:1.0.0",
'vectorDrawable' : "androidx.vectordrawable:vectordrawable:${versions.vectorDrawable}",
'animatedVectorDrawable' : "androidx.vectordrawable:vectordrawable-animated:${versions.vectorDrawable}",
'browser' : "androidx.browser:browser:1.0.0",
'transition' : "androidx.transition:transition:1.3.1",
'browser' : "androidx.browser:browser:1.3.0",
'transition' : "androidx.transition:transition:1.4.0",
// others
'multidex' : "androidx.multidex:multidex:${versions.multidexLib}",
'mediaSession' : "androidx.media2:media2-session:${versions.media2}",
'mediaExoPlayer' : "androidx.media2:media2-exoplayer:${versions.media2}",
'mediarouter' : "androidx.mediarouter:mediarouter:1.1.0",
'exifinterface' : "androidx.exifinterface:exifinterface:1.0.0",
'mediarouter' : "androidx.mediarouter:mediarouter:1.2.2",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.2",
'wear' : "androidx.wear:wear:1.0.0",
// legacy
'coreUtils' : "androidx.legacy:legacy-support-core-utils:1.0.0",
Expand Down Expand Up @@ -217,9 +220,9 @@ ext {
'monitor' : "androidx.test:monitor:${versions.testCore}",
'orchestrator' : "androidx.test:orchestrator:${versions.testCore}",
// ext
'junit' : "androidx.test.ext:junit:1.1.1",
'junitKtx' : "androidx.test.ext:junit-ktx:1.1.1",
'truthAndroidX' : 'androidx.test.ext:truth:1.2.0',
'junit' : "androidx.test.ext:junit:1.1.2",
'junitKtx' : "androidx.test.ext:junit-ktx:1.1.2",
'truthAndroidX' : "androidx.test.ext:truth:1.3.0",
'truth' : "com.google.truth:truth:${versions.truth}",
'truthJava8' : "com.google.truth.extensions:truth-java8-extension:${versions.truth}",
// espresso
Expand Down Expand Up @@ -273,7 +276,8 @@ ext {
'glideTrans' : "jp.wasabeef:glide-transformations:${versions.glideTrans}",

// UI
'flexbox' : "com.google.android:flexbox:2.0.1",
'flexbox' : "com.google.android.flexbox:flexbox:3.0.0",
'lottie' : "com.airbnb.android:lottie:3.4.4",

// rx
'rx': [
Expand All @@ -283,10 +287,10 @@ ext {

// ycdev
'ycdev': [
'androidBase' : "me.ycdev.android:common-base:${versions.androidLib}",
'androidArch' : "me.ycdev.android:common-arch:${versions.androidLib}",
'androidUi' : "me.ycdev.android:common-ui:${versions.androidLib}",
'androidTest' : "me.ycdev.android:common-test:${versions.androidLib}"
'androidBase' : "io.github.yongce:android-common-base:${versions.androidLib}",
'androidArch' : "io.github.yongce:android-common-arch:${versions.androidLib}",
'androidUi' : "io.github.yongce:android-common-ui:${versions.androidLib}",
'androidTest' : "io.github.yongce:android-common-test:${versions.androidLib}"
],

// others
Expand Down
4 changes: 1 addition & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "${androidModuleCommon}"
apply from: '../build_common.gradle'

android {
defaultConfig {
applicationId "me.ycdev.android.devtools"
minSdkVersion versions.minSdk
targetSdkVersion 30
targetSdkVersion 31

versionName getAppVersionNameBase() // + build type suffix
versionCode getAppVersionCodeBase() * 10000 + calculatedVersionCode
Expand Down Expand Up @@ -63,7 +62,6 @@ dependencies {
implementation deps.androidx.constraintLayout
implementation deps.androidx.recyclerview
implementation deps.lifecycle.runtimeKtx
implementation deps.lifecycle.extensions
implementation deps.lifecycle.viewModelKtx
implementation deps.lifecycle.liveDataKtx
implementation deps.gson
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down Expand Up @@ -49,7 +50,8 @@
<activity
android:name=".LauncherActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/AppTheme.NoActionBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import androidx.drawerlayout.widget.DrawerLayout
import com.google.android.material.navigation.NavigationView
import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener
import com.google.android.material.snackbar.Snackbar
import java.util.ArrayList
import me.ycdev.android.devtools.apps.installed.InstalledAppsActivity
import me.ycdev.android.devtools.apps.running.RunningAppsActivity
import me.ycdev.android.devtools.contacts.ContactsActivity
Expand All @@ -23,6 +22,7 @@ import me.ycdev.android.devtools.sampler.AppsSamplerActivity
import me.ycdev.android.devtools.security.SecurityScannerActivity
import me.ycdev.android.lib.commonui.activity.GridEntriesActivity
import timber.log.Timber
import java.util.ArrayList

open class LauncherActivity : GridEntriesActivity(), OnNavigationItemSelectedListener {
private lateinit var drawer: DrawerLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import java.util.Collections
import java.util.Comparator
import me.ycdev.android.devtools.R
import me.ycdev.android.devtools.apps.installed.InstalledAppsAdapter.ViewHolder
import me.ycdev.android.devtools.databinding.InstalledAppsItemBinding
import me.ycdev.android.lib.common.apps.AppInfo
import timber.log.Timber
import java.util.Collections
import java.util.Comparator

internal class InstalledAppsAdapter(cxt: Context) : RecyclerView.Adapter<ViewHolder>() {
private lateinit var defaultTextColor: ColorStateList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.ycdev.android.devtools.apps.running

import me.ycdev.android.lib.common.apps.AppInfo
import java.text.Collator
import java.util.ArrayList
import java.util.Comparator
import me.ycdev.android.lib.common.apps.AppInfo

data class RunningAppInfo(val pkgName: String) {
data class ProcInfo(val pid: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import java.util.ArrayList
import java.util.Collections
import java.util.HashMap
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
Expand All @@ -20,6 +17,9 @@ import kotlinx.coroutines.withContext
import me.ycdev.android.devtools.apps.running.RunningAppInfo.AppNameComparator
import me.ycdev.android.devtools.apps.running.RunningAppInfo.ProcInfo
import timber.log.Timber
import java.util.ArrayList
import java.util.Collections
import java.util.HashMap

class RunningAppsViewModel(val app: Application) : AndroidViewModel(app) {
private var _apps: MutableLiveData<List<RunningAppInfo>> = MutableLiveData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import java.util.ArrayList
import me.ycdev.android.arch.activity.AppCompatBaseActivity
import me.ycdev.android.devtools.R
import me.ycdev.android.devtools.apps.selector.AppsSelectorAdapter.SelectedAppsChangeListener
import me.ycdev.android.devtools.databinding.ActAppsSelectorBinding
import me.ycdev.android.lib.common.apps.AppInfo.AppNameComparator
import me.ycdev.android.lib.common.wrapper.IntentHelper
import timber.log.Timber
import java.util.ArrayList

class AppsSelectorActivity : AppCompatBaseActivity(), SelectedAppsChangeListener, OnClickListener {
private lateinit var binding: ActAppsSelectorBinding
Expand Down
Loading

0 comments on commit 2b80dbc

Please sign in to comment.