diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d12f141 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,47 @@ +language: android +dist: trusty +jdk: openjdk11 + +env: + global: + + - SLAVE_AAPT_TIMEOUT=31 + - TERM=dumb + - GRADLE_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m -Dfile.encoding=UTF-8" + +matrix: + fast_finish: true + +android: + components: + + - platform-tools + - tools + - build-tools-33.0.0 + - android-33 + - extra-google-m2repository + - extra-android-m2repository + + # https://docs.travis-ci.com/user/languages/android/ + licenses: + - 'android-sdk-preview-license-.+' + - 'android-sdk-license-.+' + - 'google-gdk-license-.+' + +before_install: + - git submodule update --init --recursive + - chmod u+x gradlew + - sdkmanager --update + - android list sdk --no-ui --all --extended + - android list targets + - yes | sdkmanager "platforms;android-33" + +install: true + +script: + - ./gradlew clean build --stacktrace + +after_failure: true + +notifications: + email: false diff --git a/app/build.gradle b/app/build.gradle index 7984033..6ead975 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,18 +1,15 @@ apply plugin: 'com.android.application' - -repositories { - jcenter() - mavenCentral() -} +apply plugin: 'kotlin-android' android { - compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion + compileSdkVersion COMPILE_SDK_VERSION + buildToolsVersion BUILD_TOOLS_VERSION defaultConfig { + minSdkVersion MIN_SDK_VERSION + targetSdkVersion TARGET_SDK_VERSION applicationId "io.palaima.debugdrawer.app" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion + namespace 'io.palaima.debugdrawer.app' versionCode 1 versionName "1.0" multiDexEnabled true @@ -30,63 +27,53 @@ android { // more targeted fashion... warning 'InvalidPackage' } + + // region java compiler flags + + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + + // endregion + + // region compile options + + kotlinOptions { + jvmTarget = "11" + } + + // endregion } +apply from: "../buildSrc/module_dependencies.gradle" + dependencies { - implementation "com.android.support:appcompat-v7:$rootProject.ext.supportVersion" - implementation "com.android.support:support-v4:$rootProject.ext.supportVersion" - implementation "com.squareup.picasso:picasso:$rootProject.ext.picassoVersion" - implementation "com.jakewharton.picasso:picasso2-okhttp3-downloader:$rootProject.ext.picasso2Okhttp3Downloader" - implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okhttpVersion" - implementation "jp.wasabeef:takt:$rootProject.ext.taktVersion" - implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion" - implementation "com.jakewharton.scalpel:scalpel:$rootProject.ext.scalpelVersion" - implementation "com.google.android.gms:play-services-location:$rootProject.ext.playServiceVersion" - implementation "com.github.bumptech.glide:glide:$rootProject.ext.glideVersion" - implementation "com.github.pedrovgs:lynx:$rootProject.ext.lynxVersion" - debugImplementation "com.readystatesoftware.chuck:library:$rootProject.ext.chukVersion" - releaseImplementation "com.readystatesoftware.chuck:library-no-op:$rootProject.ext.chukVersion" - - /* - debugImplementation 'io.palaima.debugdrawer:debugdrawer:0.7.3' - debugImplementation 'io.palaima.debugdrawer:debugdrawer-view:0.7.3' - releaseImplementation 'io.palaima.debugdrawer:debugdrawer-no-op:0.7.3' - releaseImplementation 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.7.3' - //implementation 'io.palaima.debugdrawer:debugdrawer-okhttp:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-scalpel:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-picasso:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-glide:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-location:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-timber:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-fps:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-actions:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-commons:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-logs:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-network-quality:0.7.3' - implementation 'io.palaima.debugdrawer:debugdrawer-base:0.7.3' - */ - - /*debugImplementation 'io.palaima.debugdrawer:debugdrawer:0.7.1-SNAPSHOT' - debugImplementation 'io.palaima.debugdrawer:debugdrawer-view:0.7.1-SNAPSHOT' - releaseImplementation 'io.palaima.debugdrawer:debugdrawer-no-op:0.7.1-SNAPSHOT' - releaseImplementation 'io.palaima.debugdrawer:debugdrawer-view-no-op:0.7.1-SNAPSHOT' - //implementation 'io.palaima.debugdrawer:debugdrawer-okhttp:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-okhttp3:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-scalpel:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-picasso:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-glide:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-location:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-timber:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-fps:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-actions:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-commons:0.7.1-SNAPSHOT' - implementation 'io.palaima.debugdrawer:debugdrawer-base:0.7.1-SNAPSHOT'*/ - releaseImplementation project(':debugdrawer-no-op') +// debugImplementation getLibrary("com.squareup.leakcanary:leakcanary-android") + + debugImplementation getLibrary("com.readystatesoftware.chuck:library") + releaseImplementation getLibrary("com.readystatesoftware.chuck:library-no-op") + + implementation getLibrary("com.google.android.material:material") + implementation getLibrary("androidx.appcompat:appcompat") + implementation getLibrary("androidx.annotation:annotation") + implementation getLibrary("com.squareup.picasso:picasso") + implementation getLibrary("com.squareup.okhttp3:okhttp") + implementation getLibrary("com.jakewharton.timber:timber") + implementation getLibrary("com.jakewharton.scalpel:scalpel") + implementation getLibrary("com.google.android.gms:play-services-location") + implementation getLibrary("com.github.bumptech.glide:glide") + implementation getLibrary("com.github.pedrovgs:lynx") +// implementation "com.jakewharton.picasso:picasso2-okhttp3-downloader:$rootProject.ext.picasso2Okhttp3Downloader" +// implementation "jp.wasabeef:takt:$rootProject.ext.taktVersion" + + debugImplementation project(':debugdrawer-view') releaseImplementation project(':debugdrawer-view-no-op') + debugImplementation project(':debugdrawer') - debugImplementation project(':debugdrawer-view') + releaseImplementation project(':debugdrawer-no-op') + implementation project(':debugdrawer-base') implementation project(':debugdrawer-commons') implementation project(':debugdrawer-actions') @@ -96,11 +83,8 @@ dependencies { implementation project(':debugdrawer-scalpel') implementation project(':debugdrawer-location') implementation project(':debugdrawer-timber') - implementation project(':debugdrawer-fps') +// implementation project(':debugdrawer-fps') implementation project(':debugdrawer-glide') implementation project(':debugdrawer-logs') implementation project(':debugdrawer-network-quality') - - debugImplementation "com.squareup.leakcanary:leakcanary-android:$rootProject.ext.leakCanaryVersion" - releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$rootProject.ext.leakCanaryVersion" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5399a85..c0e7e04 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,25 +1,26 @@ - + - - - - - - - - + + + + + + + + + + android:theme="@style/AppTheme"> + android:exported="true" + android:label="@string/app_name"> @@ -27,7 +28,9 @@ - + diff --git a/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java b/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java index f59b2d2..e4076e7 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/DebugDrawerApplication.java @@ -1,9 +1,7 @@ package io.palaima.debugdrawer.app; import android.app.Application; -import android.support.multidex.MultiDex; -import com.squareup.leakcanary.LeakCanary; import io.palaima.debugdrawer.timber.data.LumberYard; import timber.log.Timber; @@ -13,8 +11,6 @@ public class DebugDrawerApplication extends Application { @Override public void onCreate() { super.onCreate(); - MultiDex.install(this); - LeakCanary.install(this); LumberYard lumberYard = LumberYard.getInstance(this); lumberYard.cleanUp(); diff --git a/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java b/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java index b9f2cdf..71d183b 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/DebugViewActivity.java @@ -3,12 +3,13 @@ import android.app.Application; import android.net.Uri; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.util.Log; import android.widget.Toast; -import com.jakewharton.picasso.OkHttp3Downloader; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + +import com.squareup.picasso.OkHttp3Downloader; import com.squareup.picasso.Picasso; import java.io.File; @@ -23,16 +24,14 @@ import io.palaima.debugdrawer.commons.DeviceModule; import io.palaima.debugdrawer.commons.NetworkModule; import io.palaima.debugdrawer.commons.SettingsModule; -import io.palaima.debugdrawer.fps.FpsModule; import io.palaima.debugdrawer.location.LocationModule; import io.palaima.debugdrawer.logs.LogsModule; import io.palaima.debugdrawer.network.quality.NetworkQualityModule; import io.palaima.debugdrawer.okhttp3.OkHttp3Module; import io.palaima.debugdrawer.picasso.PicassoModule; -import io.palaima.debugdrawer.scalpel.ScalpelModule; +//import io.palaima.debugdrawer.scalpel.ScalpelModule; import io.palaima.debugdrawer.timber.TimberModule; import io.palaima.debugdrawer.view.DebugView; -import jp.wasabeef.takt.Takt; import okhttp3.Cache; import okhttp3.OkHttpClient; import timber.log.Timber; @@ -90,11 +89,11 @@ public void onItemSelected(String value) { debugView.modules( new ActionsModule(switchAction, buttonAction, spinnerAction), - new FpsModule(Takt.stock(getApplication())), +// new FpsModule(Takt.stock(getApplication())), new PicassoModule(picasso), new LocationModule(), new LogsModule(), - new ScalpelModule(this), +// new ScalpelModule(this), new TimberModule(), new OkHttp3Module(okHttpClient), new NetworkQualityModule(this), diff --git a/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java b/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java index 8e79116..39c94cd 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/ImageAdapter.java @@ -1,7 +1,7 @@ package io.palaima.debugdrawer.app; import android.content.Context; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; diff --git a/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java b/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java index 27100be..397b77e 100644 --- a/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java +++ b/app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java @@ -3,13 +3,14 @@ import android.app.Application; import android.content.Intent; import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.widget.ListView; import android.widget.Toast; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; + import com.bumptech.glide.Glide; import java.io.File; @@ -27,15 +28,13 @@ import io.palaima.debugdrawer.commons.DeviceModule; import io.palaima.debugdrawer.commons.NetworkModule; import io.palaima.debugdrawer.commons.SettingsModule; -import io.palaima.debugdrawer.fps.FpsModule; import io.palaima.debugdrawer.glide.GlideModule; import io.palaima.debugdrawer.location.LocationModule; import io.palaima.debugdrawer.logs.LogsModule; import io.palaima.debugdrawer.network.quality.NetworkQualityModule; import io.palaima.debugdrawer.okhttp3.OkHttp3Module; -import io.palaima.debugdrawer.scalpel.ScalpelModule; +//import io.palaima.debugdrawer.scalpel.ScalpelModule; import io.palaima.debugdrawer.timber.TimberModule; -import jp.wasabeef.takt.Takt; import okhttp3.Cache; import okhttp3.OkHttpClient; import timber.log.Timber; @@ -82,10 +81,10 @@ public void onItemSelected(String value) { new DebugDrawer.Builder(this).modules( new GlideModule(Glide.get(this)), new ActionsModule(switchAction, buttonAction, spinnerAction), - new FpsModule(Takt.stock(getApplication())), +// new FpsModule(Takt.stock(getApplication())), new LocationModule(), new LogsModule(), - new ScalpelModule(this), +// new ScalpelModule(this), new TimberModule(), new OkHttp3Module(okHttpClient), new NetworkQualityModule(this), @@ -93,7 +92,7 @@ public void onItemSelected(String value) { new BuildModule(), new NetworkModule(), new SettingsModule() - ).withTheme(R.style.Theme_AppCompat).build(); + ).withTheme(R.style.AppTheme).build(); showDummyLog(); diff --git a/app/src/main/res/layout/activity_debugview.xml b/app/src/main/res/layout/activity_debugview.xml index 1b0974c..e900372 100644 --- a/app/src/main/res/layout/activity_debugview.xml +++ b/app/src/main/res/layout/activity_debugview.xml @@ -1,12 +1,11 @@ - - + + android:background="#ee212121" /> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index fd37bef..c0f331f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,16 +1,15 @@ - - + + android:layout_height="match_parent" /> diff --git a/app/src/main/res/layout/image_item.xml b/app/src/main/res/layout/image_item.xml index 8f49e03..b20be89 100644 --- a/app/src/main/res/layout/image_item.xml +++ b/app/src/main/res/layout/image_item.xml @@ -1,12 +1,12 @@ + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + android:layout_height="wrap_content" /> diff --git a/app/src/main/res/layout/toolbar.xml b/app/src/main/res/layout/toolbar.xml index d5233ce..e1ba323 100644 --- a/app/src/main/res/layout/toolbar.xml +++ b/app/src/main/res/layout/toolbar.xml @@ -1,14 +1,15 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content"> - + diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 282ff47..46c9038 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -1,9 +1,10 @@ - + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + tools:context=".MainActivity"> + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 83b032f..36f95c9 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,6 +1,6 @@ -