From 1fc894829d08558ecf6a27d9373a8685fd4ffda3 Mon Sep 17 00:00:00 2001 From: anthonycicc Date: Fri, 2 Nov 2018 20:45:32 -0400 Subject: [PATCH] Added syncLibs command, does DependencyVersions way better. Also reformatted lots of code, to follow guidelines --- .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/gradle.xml | 3 +- .idea/misc.xml | 17 +- app/build.gradle | 79 +++--- app/src/main/AndroidManifest.xml | 28 +- .../financetracker/MainActivity.kt | 13 +- .../drawable-v24/ic_launcher_foreground.xml | 46 +-- .../res/drawable/ic_launcher_background.xml | 268 +++++++++--------- app/src/main/res/layout/activity_main.xml | 40 +-- app/src/main/res/layout/content_main.xml | 22 +- app/src/main/res/menu/menu_main.xml | 14 +- .../res/mipmap-anydpi-v26/ic_launcher.xml | 4 +- .../mipmap-anydpi-v26/ic_launcher_round.xml | 4 +- app/src/main/res/values/styles.xml | 4 +- build.gradle | 21 -- build.gradle.kts | 19 ++ buildSrc/.gitignore | 3 + buildSrc/build.gradle.kts | 2 +- buildSrc/settings.gradle.kts | 0 buildSrc/src/main/kotlin/Libs.kt | 90 ++++++ buildSrc/src/main/kotlin/Versions.kt | 52 ++++ .../financetracker/DependencyVersions.kt | 18 -- common/build.gradle.kts | 15 +- common/src/main/kotlin/Money.kt | 12 +- common/src/main/kotlin/Transaction.kt | 12 +- gradle.properties | 1 - gradle/wrapper/gradle-wrapper.jar | Bin 56177 -> 55746 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 2 +- gradlew.bat | 2 +- server/build.gradle | 43 --- server/build.gradle.kts | 53 ++++ server/settings.gradle | 2 - server/settings.gradle.kts | 2 + server/src/main/kotlin/Main.kt | 19 +- 35 files changed, 547 insertions(+), 370 deletions(-) create mode 100644 .idea/codeStyles/codeStyleConfig.xml delete mode 100644 build.gradle create mode 100644 build.gradle.kts create mode 100644 buildSrc/.gitignore create mode 100644 buildSrc/settings.gradle.kts create mode 100644 buildSrc/src/main/kotlin/Libs.kt create mode 100644 buildSrc/src/main/kotlin/Versions.kt delete mode 100644 buildSrc/src/main/kotlin/com/anthonycicchetti/financetracker/DependencyVersions.kt delete mode 100644 server/build.gradle create mode 100644 server/build.gradle.kts delete mode 100644 server/settings.gradle create mode 100644 server/settings.gradle.kts diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..a55e7a1 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index c4fa499..adc26be 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -6,7 +6,7 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index e257cd1..99b225f 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -5,26 +5,37 @@ - + diff --git a/app/build.gradle b/app/build.gradle index 644b238..29c42ac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,55 +1,56 @@ -import com.anthonycicchetti.financetracker.DependencyVersions - plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-android-extensions' + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-android-extensions' } repositories { - google() - jcenter() + google() + jcenter() } android { - signingConfigs { - } - compileSdkVersion 28 - defaultConfig { - applicationId "online.anthonycicchetti.financetracker" - minSdkVersion 24 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + signingConfigs { + } + compileSdkVersion 28 + defaultConfig { + applicationId "online.anthonycicchetti.financetracker" + minSdkVersion 24 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } } dependencies { - implementation project(':common') - implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation project(':common') + implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${DependencyVersions.Kotlin}" - implementation "org.jetbrains.kotlin:kotlin-reflect:${DependencyVersions.Kotlin}" + implementation(Libs.kotlin_stdlib_jdk8) + implementation(Libs.kotlin_reflect) - testImplementation "org.junit.jupiter:junit-jupiter-api:${DependencyVersions.Jupiter}" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${DependencyVersions.Jupiter}" + testImplementation(Libs.junit_jupiter_api) + testRuntimeOnly(Libs.junit_jupiter_engine) // implementation "com.android.support:design:${DependencyVersions.Android.SupportLibrary}" - implementation 'com.google.android.material:material:1.0.0-rc01' - implementation 'androidx.appcompat:appcompat:1.0.0' - implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.3' - implementation 'com.google.android.material:material:1.0.0' - androidTestImplementation 'androidx.test:runner:1.1.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' + implementation(Libs.material) + implementation(Libs.appcompat) + implementation(Libs.constraintlayout_solver) + androidTestImplementation(Libs.androidx_test_runner) + androidTestImplementation(Libs.espresso_core) } + +//tasks.named("clean") { +// delete(rootProject.buildDir) +//} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2007535..a4884fb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,24 +1,24 @@ + xmlns:tools="http://schemas.android.com/tools" + package="online.anthonycicchetti.financetracker"> - + android:roundIcon="@mipmap/ic_launcher_round" + android:supportsRtl="true" + android:theme="@style/AppTheme" + tools:node="replace"> + - + - + diff --git a/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt b/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt index c579c61..77e7490 100644 --- a/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt +++ b/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt @@ -20,8 +20,17 @@ class MainActivity : AppCompatActivity() { setSupportActionBar(toolbar) fab.setOnClickListener { view -> - Snackbar.make(view, Transaction(Money(3020), category = "Transportation", location = "Arian's", timestamp = "Jan 01, 2018 00:00").toString(), Snackbar.LENGTH_LONG) - .setAction("Action", null).show() + Snackbar.make( + view, + Transaction( + Money(3020), + category = "Transportation", + location = "Arian's", + timestamp = "Jan 01, 2018 00:00" + ).toString(), + Snackbar.LENGTH_LONG + ) + .setAction("Action", null).show() } } diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml index c7bd21d..6348baa 100644 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -1,34 +1,34 @@ + xmlns:aapt="http://schemas.android.com/aapt" + android:width="108dp" + android:height="108dp" + android:viewportHeight="108" + android:viewportWidth="108"> + android:fillType="evenOdd" + android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z" + android:strokeColor="#00000000" + android:strokeWidth="1"> + android:endX="78.5885" + android:endY="90.9159" + android:startX="48.7653" + android:startY="61.0927" + android:type="linear"> + android:color="#44000000" + android:offset="0.0"/> + android:color="#00000000" + android:offset="1.0"/> + android:fillColor="#FFFFFF" + android:fillType="nonZero" + android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z" + android:strokeColor="#00000000" + android:strokeWidth="1"/> diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml index d5fccc5..e86851d 100644 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -1,170 +1,170 @@ + android:width="108dp" + android:height="108dp" + android:viewportHeight="108" + android:viewportWidth="108"> + android:fillColor="#26A69A" + android:pathData="M0,0h108v108h-108z"/> + android:fillColor="#00000000" + android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> + android:fillColor="#00000000" + android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" + android:strokeWidth="0.8"/> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index aab5c91..d56640b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,33 +1,33 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context="online.anthonycicchetti.financetracker.MainActivity"> + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="?attr/colorPrimary" + app:popupTheme="@style/AppTheme.PopupOverlay"/> - + + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + android:layout_margin="@dimen/fab_margin" + app:srcCompat="@android:drawable/ic_dialog_email"/> diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml index 10f562a..815e499 100644 --- a/app/src/main/res/layout/content_main.xml +++ b/app/src/main/res/layout/content_main.xml @@ -1,17 +1,17 @@ + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" + tools:context="online.anthonycicchetti.financetracker.MainActivity" + tools:showIn="@layout/activity_main"> + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hello World!"/> diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml index 7057fb3..0837552 100644 --- a/app/src/main/res/menu/menu_main.xml +++ b/app/src/main/res/menu/menu_main.xml @@ -1,10 +1,10 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + tools:context="online.anthonycicchetti.financetracker.MainActivity"> + android:id="@+id/action_settings" + android:orderInCategory="100" + android:title="@string/action_settings" + app:showAsAction="never"/> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index eca70cf..bbd3e02 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index eca70cf..bbd3e02 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 545b9c6..177cefc 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -13,8 +13,8 @@ true -