Skip to content

AndroidX support #109

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
112 changes: 48 additions & 64 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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')
Expand All @@ -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"
}
31 changes: 17 additions & 14 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.palaima.debugdrawer.app" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".DebugDrawerApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name=".DebugDrawerApplication">
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name=".DebugViewActivity"/>
<activity
android:name=".DebugViewActivity"
android:exported="false" />

</application>

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
15 changes: 7 additions & 8 deletions app/src/main/java/io/palaima/debugdrawer/app/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -82,18 +81,18 @@ 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),
new DeviceModule(),
new BuildModule(),
new NetworkModule(),
new SettingsModule()
).withTheme(R.style.Theme_AppCompat).build();
).withTheme(R.style.AppTheme).build();

showDummyLog();

Expand Down
7 changes: 3 additions & 4 deletions app/src/main/res/layout/activity_debugview.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".DebugViewActivity">

<include layout="@layout/toolbar"/>
<include layout="@layout/toolbar" />

<ScrollView
android:layout_width="match_parent"
Expand All @@ -17,7 +16,7 @@
android:id="@+id/debug_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ee212121"/>
android:background="#ee212121" />

</ScrollView>

Expand Down
Loading