Merge branch 'develop' into proguard

This commit is contained in:
Phillip Thelen 2017-09-05 16:46:14 +02:00 committed by GitHub
commit 77a591c723
1653 changed files with 62317 additions and 37965 deletions

1
.gitignore vendored
View file

@ -55,3 +55,4 @@ Habitica/res/values/secret_strings.xml
habitica.properties
habitica.resources
Habitica/google-services.json
reports/

View file

@ -1,21 +1,29 @@
language: android
jdk: oraclejdk8
udo: required
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
before_install:
- $CXX --version
- export JAVA7_HOME=/usr/lib/jvm/java-7-oracle
- export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
- nvm install 4.1.1
- nvm use 4.1.1
- npm i -g npm@3
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
- sudo apt-get update
- sudo apt-get install mongodb-org-server
- git clone https://github.com/HabitRPG/habitrpg.git ../habitrpg
- until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 2; done
- cd ../habitrpg && cp config.json.example config.json && npm install
- npm start &
- until nc -z localhost 3000; do echo Waiting for Habitica Server; sleep 2; done
- cd -
- if [ $REQUIRES_SERVER ]; then nvm install 6.9.3; fi
- if [ $REQUIRES_SERVER ]; then nvm use 6.9.3; fi
- if [ $REQUIRES_SERVER ]; then npm i -g npm@4; fi
- if [ $REQUIRES_SERVER ]; then sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10; fi
- if [ $REQUIRES_SERVER ]; then echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list; fi
- if [ $REQUIRES_SERVER ]; then sudo apt-get update; fi
- if [ $REQUIRES_SERVER ]; then sudo apt-get install mongodb-org-server; fi
- if [ $REQUIRES_SERVER ]; then git clone https://github.com/HabitRPG/habitrpg.git ../habitrpg; fi
- if [ $REQUIRES_SERVER ]; then until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 2; done; fi
- if [ $REQUIRES_SERVER ]; then cd ../habitrpg && cp config.json.example config.json && npm install; fi
- if [ $REQUIRES_SERVER ]; then npm start; fi &
- if [ $REQUIRES_SERVER ]; then until nc -z localhost 3000; do echo Waiting for Habitica Server; sleep 2; done; fi
- if [ $REQUIRES_SERVER ]; then cd -; fi
android:
components:
# Uncomment the lines below if you want to
@ -24,7 +32,7 @@ android:
- tools
# The BuildTools version used by your project
- build-tools-24.0.3
- build-tools-25.0.3
# The SDK version used to compile your project
- android-25
@ -42,9 +50,16 @@ android:
- 'android-sdk-preview-license-52d11cd2'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'
before_script:
- cp habitica.properties.travis habitica.properties
- cp habitica.resources.example habitica.resources
- cp Habitica/google-services.json.example Habitica/google-services.json
script:
- cp habitica.properties.travis habitica.properties
- cp habitica.resources.example habitica.resources
- cp Habitica/google-services.json.example Habitica/google-services.json
- ./gradlew assembleDebug
- ./gradlew testDebugUnitTest --info
- ./gradlew $TEST
env:
global:
- CXX=g++-4.8
- DISABLE_REQUEST_LOGGING=true
matrix:
- TEST="assembleDebug -PdisablePreDex"
- TEST="testProdDebugUnitTest -PdisablePreDex --stacktrace" REQUIRES_SERVER=true

View file

@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = pt_BR: pt-rBR, zh_TW: zh-rTW, hr_HR: hr-rHR, pt_PT: pt-rPT, en_GB: en-rGB
lang_map = pt_BR: pt-rBR, zh_TW: zh-rTW, hr_HR: hr-rHR, pt_PT: pt-rPT, en_GB: en-rGB, he: iw, id: in
[habitica-android.store_stringsxml]
file_filter = translations/store_strings-<lang>.xml

View file

@ -2,22 +2,24 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.habitrpg.android.habitica"
android:versionCode="138"
android:versionName="0.0.35"
android:versionCode="1926"
android:versionName="1.1.6"
android:screenOrientation="portrait"
android:installLocation="auto" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="24" />
android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".HabiticaApplication"
@ -29,6 +31,7 @@
<activity
android:name=".ui.activities.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar.Transparent"
android:windowSoftInputMode="stateHidden|adjustPan"
android:screenOrientation="portrait">
<intent-filter>
@ -46,12 +49,13 @@
<activity
android:name=".ui.activities.LoginActivity"
android:label="@string/LoginActivityName"
android:theme="@style/AppThemeWithActionBarBlackText"
android:theme="@style/AppTheme.NoActionBar.Transparent"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".ui.activities.IntroActivity"
android:theme="@style/AppTheme.NoActionBar.Transparent"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait">
</activity>
@ -72,7 +76,9 @@
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data
android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
android:value="false"/>
<activity
android:name=".ui.activities.AboutActivity"
android:theme="@style/AppThemeWithActionBarBlackText"
@ -125,6 +131,27 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activities.MainActivity" />
</activity>
<activity
android:name=".ui.activities.ChallengeDetailActivity"
android:parentActivityName=".ui.activities.MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
tools:ignore="UnusedAttribute">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activities.MainActivity" />
</activity>
<activity
android:name=".ui.activities.CreateChallengeActivity"
android:theme="@style/AppTheme.ActionBar"
android:parentActivityName=".ui.activities.MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleTask"
tools:ignore="UnusedAttribute">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".ui.activities.MainActivity" />
</activity>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
@ -135,7 +162,7 @@
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".ui.activities.GemPurchaseActivity"
android:screenOrientation="portrait" />
<receiver android:process=":remote" android:name=".NotificationPublisher" />
<receiver android:process=":remote" android:name=".receivers.NotificationPublisher" />
<receiver
android:process=":remote"
@ -230,5 +257,4 @@
<service android:name=".widget.HabitButtonWidgetService"/>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

View file

@ -0,0 +1 @@
ALTER TABLE HabitRPGUser ADD COLUMN purchased_id varchar(255);

View file

@ -0,0 +1 @@
ALTER TABLE Task ADD COLUMN group_id varchar(255);

View file

@ -0,0 +1 @@
ALTER TABLE ItemData ADD COLUMN specialClass varchar(255);

View file

@ -0,0 +1,2 @@
ALTER TABLE Preferences ADD COLUMN dailyDueDefaultView bool;

View file

@ -0,0 +1 @@
ALTER TABLE Customization ADD COLUMN isBuyable bool;

View file

@ -0,0 +1 @@
ALTER TABLE Task ADD COLUMN isDue BOOLEAN;

View file

@ -0,0 +1 @@
ALTER TABLE Task ADD COLUMN nextDue DATE;

View file

@ -0,0 +1,2 @@
ALTER TABLE Task ADD COLUMN daysOfMonthString varchar(255);
ALTER TABLE Task ADD COLUMN weeksOfMonthString varchar(255);

View file

@ -2,17 +2,25 @@ apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'com.noveogroup.android.check'
apply plugin: 'realm-android'
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.21.5'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.1'
classpath 'io.fabric.tools:gradle:1.21.6'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath('com.noveogroup.android:check:1.2.3') {
exclude module: 'checkstyle'
exclude module: 'pmd-java'
}
classpath 'com.puppycrawl.tools:checkstyle:7.5'
classpath 'net.sourceforge.pmd:pmd-java:5.5.3'
}
}
@ -32,108 +40,93 @@ repositories {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
//Networking
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
//REST API handling
compile('com.squareup.retrofit2:retrofit:2.1.0') {
compile('com.squareup.retrofit2:retrofit:2.3.0') {
exclude module: 'okhttp'
}
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
//Crash Logging
releaseCompile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
releaseCompile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
// View Elements Binding :)
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.jakewharton:butterknife:8.6.0'
apt 'com.jakewharton:butterknife-compiler:8.6.0'
//Dependency Injection
compile 'com.google.dagger:dagger:2.7'
apt 'com.google.dagger:dagger-compiler:2.7'
compile 'com.google.dagger:dagger:2.11'
apt 'com.google.dagger:dagger-compiler:2.11'
provided 'org.glassfish:javax.annotation:10.0-b28'
//App Compatibility and Material Design
compile('com.mikepenz:materialdrawer:5.3.6@aar') {
compile('com.mikepenz:materialdrawer:5.8.3@aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.android.support:preference-v14:25.0.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:preference-v14:25.3.1'
compile 'com.android.support:multidex:1.0.1'
//QR Code
compile 'com.github.kenglxn.QRGen:android:2.2.0'
// Emojis
compile 'com.github.viirus:emoji-lib:0.0.3.2'
compile 'com.github.viirus:emoji-lib:0.0.4'
// Markdown
compile 'com.commonsware.cwac:anddown:0.2.4'
compile 'com.commonsware.cwac:anddown:0.3.0'
// About View for all dependent Libraries, we are using
compile('com.mikepenz:aboutlibraries:5.7.1@aar') {
compile('com.mikepenz:aboutlibraries:5.9.4@aar') {
transitive = true
}
// a better fab alternative
compile 'com.github.clans:fab:1.6.4'
// ORM
apt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
compile "com.raizlabs.android:DBFlow-Core:2.2.1"
compile "com.raizlabs.android:DBFlow:2.2.1"
//Eventbus
compile 'org.greenrobot:eventbus:3.0.0'
// IAP Handling / Verification
compile 'org.solovyev.android:checkout:0.7.5@aar'
compile 'org.solovyev.android:checkout:1.0.1'
//Facebook
compile('com.facebook.android:facebook-android-sdk:4.17.0') {
compile('com.facebook.android:facebook-android-sdk:4.19.0') {
transitive = true
}
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
// lodash/underscore
compile 'com.github.javadev:underscore:1.23'
//RxJava
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.2.0'
compile 'io.reactivex:rxjava:1.3.0'
//Analytics
compile 'com.amplitude:android-sdk:2.9.2'
compile 'com.amplitude:android-sdk:2.13.3'
// Fresco Image Management Library
compile('com.facebook.fresco:fresco:0.14.0') {
compile('com.facebook.fresco:fresco:1.3.0') {
exclude module: 'bolts-android'
}
compile('com.facebook.fresco:animated-gif:0.14.0') {
compile('com.facebook.fresco:animated-gif:1.3.0') {
exclude module: 'bolts-android'
}
//Tests
testCompile "junit:junit:4.10"
testCompile "org.assertj:assertj-core:1.7.0"
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile "org.robolectric:robolectric:3.1"
testCompile 'org.robolectric:shadows-multidex:3.1'
testCompile "org.robolectric:shadows-support-v4:3.1"
testCompile "org.mockito:mockito-core:1.10.19"
testCompile 'junit:junit:4.10'
testCompile 'org.assertj:assertj-core:1.7.0'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
testCompile 'org.robolectric:robolectric:3.3.2'
testCompile 'org.robolectric:shadows-multidex:3.3.2'
testCompile 'org.robolectric:shadows-support-v4:3.3.2'
testCompile 'org.mockito:mockito-core:2.8.9'
testCompile 'org.powermock:powermock-api-mockito2:1.7.0'
testCompile 'org.powermock:powermock-module-junit4-rule-agent:1.7.0'
testCompile 'org.powermock:powermock-module-junit4-rule:1.7.0'
testCompile 'org.powermock:powermock-module-junit4:1.7.0'
//Leak Detection
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
//Push Notifications
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'org.apmem.tools:layouts:1.10@aar'
compile 'com.roughike:bottom-bar:2.3.1'
compile 'io.realm:android-adapters:2.1.0'
compile(project(':seeds-sdk')) {
exclude group: 'com.google.android.gms'
exclude group: 'com.android.support', module: 'multidex'
@ -142,10 +135,12 @@ dependencies {
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.habitrpg.android.habitica"
vectorDrawables.useSupportLibrary = true
buildConfigField "String", "STORE", "\"google\""
}
lintOptions {
@ -164,13 +159,14 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
ext.alwaysUpdateBuildId = false
resValue "string", "content_provider", "com.habitrpg.android.habitica.debug.fileprovider"
resValue "string", "app_name", "Habitica Debug"
}
release {
signingConfig signingConfigs.release
debuggable false
multiDexEnabled false
multiDexEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "content_provider", "com.habitrpg.android.habitica.fileprovider"
@ -178,6 +174,19 @@ android {
}
}
productFlavors {
dev {
minSdkVersion 21
}
prod {
}
amazon {
buildConfigField "String", "STORE", "\"amazon\""
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
@ -204,12 +213,12 @@ android {
dexOptions {
preDexLibraries false
javaMaxHeapSize "4g" // Use gig increments depending on needs
incremental true
javaMaxHeapSize "6g" // Use gig increments depending on needs
}
lintOptions {
disable 'UnusedResources'
disable 'UnusedResources','MissingTranslation','UnusedAttribute','InvalidPackage'
enable 'LogConditional','IconExpectedSize','MissingRegistered','TypographyQuotes'
}
}
@ -272,12 +281,13 @@ if (HRPG_RES_FILE.canRead()) {
}
tasks.whenTaskAdded { task ->
if (task.name.equals("lint")) {
if (task.name == "lint") {
task.enabled = false
}
}
apply plugin: 'com.getkeepsafe.dexcount'
check { findbugs { skip true } }
apply plugin: 'com.android.application' //or apply plugin: 'java'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.google.gms.google-services'

View file

@ -0,0 +1,267 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!--
Checkstyle Configuration
Severity: EASY
-->
<module name="Checker">
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile -->
<module name="NewlineAtEndOfFile">
<property name="severity" value="ignore" />
</module>
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sourceforge.net/config_misc.html#Translation -->
<module name="Translation" />
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
<module name="FileLength" />
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sourceforge.net/config_misc.html -->
<module name="RegexpSingleline">
<property name="format" value="\s+$" />
<property name="minimum" value="0" />
<property name="maximum" value="0" />
<property name="message" value="Line has trailing spaces." />
<property name="severity" value="info" />
</module>
<module name="TreeWalker">
<!-- http://checkstyle.sourceforge.net/config_annotation.html -->
<module name="AnnotationLocation" />
<module name="AnonInnerLength">
<property name="max" value="60"/>
</module>
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
<module name="JavadocMethod">
<property name="scope" value="package" />
<property name="allowMissingParamTags" value="true" />
<property name="allowMissingThrowsTags" value="true" />
<property name="allowMissingReturnTag" value="true" />
<property name="allowThrowsTagsForSubclasses" value="true" />
<property name="allowUndeclaredRTE" value="true" />
<property name="allowMissingPropertyJavadoc" value="true" />
<property name="severity" value="ignore" />
</module>
<module name="JavadocType">
<property name="scope" value="package" />
<property name="severity" value="ignore" />
</module>
<module name="JavadocVariable">
<property name="scope" value="package" />
<property name="severity" value="ignore" />
</module>
<module name="JavadocStyle">
<property name="checkEmptyJavadoc" value="true" />
<property name="severity" value="ignore" />
</module>
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sourceforge.net/config_naming.html -->
<module name="ConstantName" />
<module name="LocalFinalVariableName" />
<module name="LocalVariableName">
<property name="allowOneCharVarInForLoop" value="true"/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-zA-Z0-9][a-zA-Z0-9]*$"/>
</module>
<module name="MethodName" />
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-zA-Z0-9][a-zA-Z0-9]*$"/>
<property name="accessModifiers" value="public"/>
</module>
<module name="StaticVariableName">
<property name="format" value="^[a-z][a-zA-Z0-9][a-zA-Z0-9]*$"/>
</module>
<module name="TypeName" />
<!-- Checks for imports -->
<!-- See http://checkstyle.sourceforge.net/config_import.html -->
<module name="AvoidStarImport" />
<module name="IllegalImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
<module name="LineLength">
<property name="severity" value="ignore" />
</module>
<module name="MethodLength" />
<module name="ParameterNumber" />
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
<module name="EmptyForIteratorPad" />
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoLineWrap"/>
<module name="NoWhitespaceAfter">
<property name="tokens" value="ARRAY_INIT"/>
<property name="tokens" value="BNOT"/>
<property name="tokens" value="DEC"/>
<property name="tokens" value="DOT"/>
<property name="tokens" value="INC"/>
<property name="tokens" value="LNOT"/>
<property name="tokens" value="UNARY_MINUS"/>
<property name="tokens" value="UNARY_PLUS"/>
<property name="tokens" value="ARRAY_DECLARATOR"/>
</module>
<module name="NoWhitespaceBefore"/>
<module name="SeparatorWrap">
<property name="tokens" value="COMMA"/>
<property name="option" value="eol"/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="SingleSpaceSeparator"/>
<module name="OperatorWrap" />
<module name="ParenPad" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround">
<property name="allowEmptyLambdas" value="true" />
</module>
<!-- Modifier Checks -->
<!-- See http://checkstyle.sourceforge.net/config_modifiers.html -->
<module name="ModifierOrder">
<property name="severity" value="ignore" />
</module>
<module name="RedundantModifier">
<property name="severity" value="ignore" />
</module>
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sourceforge.net/config_blocks.html -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true" />
</module>
<module name="EmptyBlock">
<property name="option" value="text" />
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="LeftCurly" />
<module name="NeedBraces" />
<module name="RightCurly" />
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sourceforge.net/config_coding.html -->
<module name="ArrayTrailingComma"/>
<module name="CovariantEquals"/>
<module name="DeclarationOrder"/>
<module name="DefaultComesLast"/>
<module name="EmptyStatement" />
<module name="EqualsAvoidNull"/>
<module name="EqualsHashCode" />
<module name="FallThrough"/>
<module name="HiddenField">
<property name="ignoreConstructorParameter" value="true"/>
<property name="ignoreSetter" value="true"/>
</module>
<module name="IllegalCatch"/>
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean"/>
</module>
<module name="IllegalThrows"/>
<module name="IllegalType"/>
<module name="InnerAssignment" />
<module name="MagicNumber">
<property name="severity" value="ignore" />
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 8, 10, 12, 16, 24, 30, 32, 60, 64, 100, 120, 128, 180, 256, 360, 1000" />
</module>
<module name="MissingSwitchDefault" />
<module name="MultipleStringLiterals">
<property name="allowedDuplicates" value="2"/>
<property name="ignoreStringsRegexp" value='^(("")|(", "))$'/>
</module>
<module name="MultipleVariableDeclarations"/>
<module name="NestedForDepth">
<property name="max" value="2"/>
</module>
<module name="NoClone"/>
<module name="NoFinalizer"/>
<module name="OneStatementPerLine"/>
<module name="PackageDeclaration"/>
<module name="ParameterAssignment"/>
<module name="RequireThis"/>
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sourceforge.net/config_design.html -->
<module name="HideUtilityClassConstructor" />
<module name="InnerTypeLast"/>
<module name="InterfaceIsType" />
<module name="OneTopLevelClass"/>
<module name="VisibilityModifier">
<property name="severity" value="ignore" />
</module>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sourceforge.net/config_misc.html -->
<module name="ArrayTypeStyle" />
<module name="CommentsIndentation"/>
<module name="OuterTypeFilename"/>
<module name="TodoComment">
<property name="format" value="(?i)\s+TODO\s+" />
<property name="severity" value="info" />
</module>
<module name="TodoComment">
<property name="format" value="(?i)\s+CR\s+" />
<property name="severity" value="info" />
</module>
<module name="UpperEll" />
</module>
<!-- Enable suppression comments -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="CHECKSTYLE IGNORE\s+(\S+)" />
<property name="onCommentFormat" value="CHECKSTYLE END IGNORE\s+(\S+)" />
<property name="checkFormat" value="$1" />
</module>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="SUPPRESS CHECKSTYLE (\w+)" />
<property name="checkFormat" value="$1" />
<property name="influenceFormat" value="1" />
</module>
</module>

138
Habitica/config/pmd.xml Normal file
View file

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
PMD Configuration
Severity: EASY
-->
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>POM rule set file</description>
<rule ref="rulesets/java/android.xml" />
<rule ref="rulesets/java/basic.xml">
<exclude name="CollapsibleIfStatements" />
<exclude name="AvoidUsingHardCodedIP" />
</rule>
<rule ref="rulesets/java/braces.xml">
</rule>
<rule ref="rulesets/java/clone.xml" />
<rule ref="rulesets/java/codesize.xml">
<exclude name="StdCyclomaticComplexity" />
<exclude name="ModifiedCyclomaticComplexity" />
</rule>
<rule ref="rulesets/java/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="20" />
</properties>
</rule>
<rule ref="rulesets/java/codesize.xml/TooManyMethods">
<properties>
<property name="maxmethods" value="25" />
</properties>
</rule>
<rule ref="rulesets/java/comments.xml">
<exclude name="CommentRequired" />
<exclude name="CommentSize" />
<exclude name="CommentDefaultAccessModifier" />
</rule>
<rule ref="rulesets/java/controversial.xml">
<!-- while ((x = update()) != null) { process(x); } -->
<exclude name="AtLeastOneConstructor" />
<exclude name="AvoidLiteralsInIfCondition" />
<exclude name="AvoidPrefixingMethodParameters" />
<exclude name="DataflowAnomalyAnalysis" />
<exclude name="NullAssignment" />
<exclude name="OnlyOneReturn" />
<exclude name="DefaultPackage" />
<exclude name="UseConcurrentHashMap" />
<exclude name="UseObjectForClearerAPI" />
</rule>
<rule ref="rulesets/java/coupling.xml">
<exclude name="LooseCoupling" />
<exclude name="ExcessiveImports" />
<exclude name="LawOfDemeter" />
<exclude name="LoosePackageCoupling" />
</rule>
<rule ref="rulesets/java/design.xml">
<!-- if (x != y) { short code block } else { long code block } -->
<exclude name="ConfusingTernary" />
<exclude name="SwitchStmtsShouldHaveDefault" />
<!-- Android listeners contain a lot of such switch statements -->
<exclude name="TooFewBranchesForASwitchStatement" />
<exclude name="ImmutableField" />
<exclude name="GodClass" />
<exclude name="SingularField" />
<exclude name="UncommentedEmptyMethodBody" />
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract" />
</rule>
<rule ref="rulesets/java/empty.xml" />
<rule ref="rulesets/java/finalizers.xml" />
<rule ref="rulesets/java/imports.xml" />
<rule ref="rulesets/java/junit.xml">
<exclude name="JUnitTestsShouldIncludeAssert" />
<exclude name="JUnitAssertionsShouldIncludeMessage" />
<exclude name="JUnitTestContainsTooManyAsserts" />
</rule>
<rule ref="rulesets/java/logging-jakarta-commons.xml">
<exclude name="GuardLogStatement" />
</rule>
<rule ref="rulesets/java/logging-java.xml">
<exclude name="GuardLogStatementJavaUtil" />
</rule>
<rule ref="rulesets/java/migrating.xml" />
<rule ref="rulesets/java/naming.xml">
<exclude name="AbstractNaming" />
<exclude name="AvoidFieldNameMatchingMethodName" />
<exclude name="LongVariable" />
<exclude name="ShortClassName" />
<exclude name="SuspiciousConstantFieldName" />
<exclude name="ShortVariable" />
<exclude name="VariableNamingConventions" />
</rule>
<rule ref="rulesets/java/optimizations.xml">
<exclude name="AvoidInstantiatingObjectsInLoops" />
<exclude name="LocalVariableCouldBeFinal" />
<exclude name="MethodArgumentCouldBeFinal" />
<exclude name="RedundantFieldInitializer" />
</rule>
<rule ref="rulesets/java/strictexception.xml">
<exclude name="AvoidCatchingGenericException" />
</rule>
<rule ref="rulesets/java/strings.xml" />
<rule ref="rulesets/java/typeresolution.xml">
<exclude name="LooseCoupling" />
</rule>
<rule ref="rulesets/java/unnecessary.xml">
<exclude name="UselessParentheses" />
<exclude name="UselessQualifiedThis" />
</rule>
<rule ref="rulesets/java/unusedcode.xml">
<exclude name="UnusedModifier" />
</rule>
</ruleset>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fromAlpha="0.0" android:toAlpha="1.0"
android:duration="500" />

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="750"
android:fromAlpha="1.0"
android:interpolator="@android:interpolator/accelerate_cubic"
android:startOffset="250"
android:toAlpha="0.0"
android:zAdjustment="top" />

View file

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="100%" android:toYDelta="0%"/>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200">
<translate
android:fromYDelta="100%"
android:toYDelta="0%"/>
</set>

View file

@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="0%" android:toYDelta="100%"/>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200">
<translate android:fromYDelta="0%"
android:toYDelta="100%"
/>
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 835 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Some files were not shown because too many files have changed in this diff Show more