Skip to content

Commit

Permalink
Gradle upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
7LPdWcaW committed Jun 18, 2022
1 parent cb75313 commit 748388b
Show file tree
Hide file tree
Showing 33 changed files with 385 additions and 314 deletions.
24 changes: 12 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'

repositories {
mavenCentral()
Expand Down Expand Up @@ -44,10 +44,11 @@ android {
vectorDrawables.useSupportLibrary = true
}

lintOptions {
abortOnError false
buildFeatures {
viewBinding true
}


flavorDimensions "default"

productFlavors {
Expand All @@ -63,7 +64,7 @@ android {
}

en {
resConfig "en"
resConfigs 'en'
buildConfigField "Boolean", "DISCRETE", "false"

manifestPlaceholders = [
Expand Down Expand Up @@ -114,6 +115,9 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
lint {
abortOnError false
}
}

dependencies {
Expand All @@ -134,7 +138,7 @@ dependencies {
implementation 'com.google.android.material:material:1.7.0-alpha01'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation 'com.esotericsoftware:kryo:3.0.3'
implementation 'com.squareup.moshi:moshi-kotlin:1.9.2'
implementation 'com.squareup.moshi:moshi-kotlin:1.13.0'
implementation 'com.squareup:otto:1.3.8'
// api 'com.github.PhilJay:MPAndroidChart:v2.1.6'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
Expand All @@ -143,12 +147,8 @@ dependencies {

implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

api "org.jetbrains.kotlin:kotlin-reflect:1.5.20"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.30"

kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.12.0'
}
api "org.jetbrains.kotlin:kotlin-reflect:1.6.21"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21"

androidExtensions {
experimental = true
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.13.0'
}
Binary file added app/discrete/release/app-discrete-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/discrete/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "me.anon.grow",
"variantName": "discreteRelease",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 2631,
"versionName": "2.6.4",
"outputFile": "app-discrete-release.apk"
}
],
"elementType": "File"
}
Binary file added app/en/release/app-en-release.apk
Binary file not shown.
20 changes: 20 additions & 0 deletions app/en/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "me.anon.grow",
"variantName": "enRelease",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 2631,
"versionName": "2.6.4",
"outputFile": "app-en-release.apk"
}
],
"elementType": "File"
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.PopupMenu;
import androidx.recyclerview.widget.RecyclerView;
import kotlinx.android.parcel.Parcelize;
import kotlinx.parcelize.Parcelize;
import me.anon.grow.R;
import me.anon.lib.DateRenderer;
import me.anon.lib.TempUnit;
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/me/anon/grow/ActionsActivity.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import me.anon.grow.databinding.FragmentHolderBinding
import me.anon.grow.fragment.ActionsListFragment

class ActionsActivity : BaseActivity()
Expand All @@ -11,7 +11,8 @@ class ActionsActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)
val binding = FragmentHolderBinding.inflate(layoutInflater)
setSupportActionBar(binding.toolbar)

if (intent.extras == null || !intent.hasExtra("plant"))
{
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/me/anon/grow/AddWateringActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package me.anon.grow

import android.os.Bundle
import androidx.appcompat.app.AlertDialog
import kotlinx.android.synthetic.main.fragment_holder.*
import me.anon.grow.fragment.WateringFragment

class AddWateringActivity : BaseActivity()
Expand All @@ -12,7 +11,7 @@ class AddWateringActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)
setSupportActionBar(findViewById(R.id.toolbar))

var plantIndex: IntArray? = intent.extras?.getIntArray("plant_index") ?: intArrayOf(-1)
var gardenIndex: Int = intent.extras?.getInt("garden_index", -1) ?: -1
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/me/anon/grow/FeedingScheduleActivity.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import android.view.View
import androidx.appcompat.widget.Toolbar
import me.anon.grow.fragment.FeedingScheduleListFragment

/**
Expand All @@ -19,7 +20,7 @@ class FeedingScheduleActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)
setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)
setTitle(R.string.feeding_schedules_title)

if (supportFragmentManager.findFragmentByTag(TAG_FRAGMENT) == null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import android.view.View
import androidx.appcompat.widget.Toolbar
import me.anon.grow.fragment.FeedingScheduleDetailsFragment

/**
Expand All @@ -19,7 +20,7 @@ class FeedingScheduleDetailsActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)
setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)
setTitle(R.string.schedule_details_title)

if (supportFragmentManager.findFragmentByTag(TAG_FRAGMENT) == null)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/me/anon/grow/PlantDetailsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import android.content.Intent
import android.os.Bundle
import android.view.MenuItem
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import com.google.android.material.appbar.AppBarLayout
import kotlinx.android.synthetic.main.fragment_holder.toolbar
import kotlinx.android.synthetic.main.fragment_holder.toolbar_layout
import kotlinx.android.synthetic.main.tabbed_fragment_holder.*
import com.google.android.material.bottomnavigation.BottomNavigationView
import me.anon.grow.fragment.ActionsListFragment
import me.anon.grow.fragment.PlantDetailsFragment
import me.anon.grow.fragment.StatisticsFragment2
Expand All @@ -18,7 +17,7 @@ import me.anon.model.Plant

class PlantDetailsActivity : BaseActivity()
{
public val toolbarLayout: AppBarLayout by lazy { toolbar_layout }
public val toolbarLayout: AppBarLayout by lazy { findViewById(R.id.toolbar_layout) }
private lateinit var plant: Plant

override fun onCreate(savedInstanceState: Bundle?)
Expand All @@ -28,9 +27,10 @@ class PlantDetailsActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.tabbed_fragment_holder)
setSupportActionBar(toolbar)
setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_done_white_24dp)
val tabs = findViewById<BottomNavigationView>(R.id.tabs)

supportFragmentManager.findFragmentByTag(TAG_FRAGMENT) ?: let {
val fragment = when (intent.extras?.get("forward"))
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/me/anon/grow/ScheduleDateDetailsActivity.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import android.view.View
import androidx.appcompat.widget.Toolbar
import me.anon.grow.fragment.ScheduleDateDetailsFragment

/**
Expand All @@ -19,7 +20,8 @@ class ScheduleDateDetailsActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)

setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)
setTitle(R.string.schedule_date_title)

if (supportFragmentManager.findFragmentByTag(TAG_FRAGMENT) == null)
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/me/anon/grow/StatisticsActivity.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import me.anon.grow.fragment.StatisticsFragment
import android.view.View
import androidx.appcompat.widget.Toolbar
import me.anon.grow.fragment.StatisticsFragment2
import me.anon.lib.manager.PlantManager

Expand All @@ -13,7 +13,7 @@ class StatisticsActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)
setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)

// if (intent.extras == null || !intent.hasExtra("plant"))
// {
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/me/anon/grow/ViewPhotosActivity.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package me.anon.grow

import android.os.Bundle
import kotlinx.android.synthetic.main.fragment_holder.*
import android.view.View
import androidx.appcompat.widget.Toolbar
import me.anon.grow.fragment.ViewPhotosFragment

class ViewPhotosActivity : BaseActivity()
Expand All @@ -11,7 +12,8 @@ class ViewPhotosActivity : BaseActivity()
super.onCreate(savedInstanceState)

setContentView(R.layout.fragment_holder)
setSupportActionBar(toolbar)

setSupportActionBar(findViewById<View>(R.id.toolbar) as Toolbar)

if (intent.extras == null || !intent.hasExtra("plant_index") && !intent.hasExtra("plant"))
{
Expand Down
11 changes: 5 additions & 6 deletions app/src/main/java/me/anon/grow/fragment/ExportDialogFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@ package me.anon.grow.fragment

import android.app.Dialog
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.ArrayAdapter
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
import kotlinx.android.synthetic.main.export_dialog.view.*
import me.anon.grow.R
import me.anon.grow.databinding.ExportDialogBinding
import me.anon.lib.export.ExportProcessor
import me.anon.lib.export.MarkdownProcessor

class ExportDialogFragment(val callback: (processor: Class<out ExportProcessor>, includeImages: Boolean) -> Unit) : DialogFragment()
{
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog
{
val view = LayoutInflater.from(activity).inflate(R.layout.export_dialog, null)
val dialog = AlertDialog.Builder(context!!)
val binding = ExportDialogBinding.inflate(layoutInflater)
val dialog = AlertDialog.Builder(requireContext())

val options = arrayOf("Markdown")//, "HTML")
val optionCls = arrayOf(MarkdownProcessor::class.java)//, HtmlProcessor::class.java)
view.formatters.adapter = ArrayAdapter<String>(activity!!, android.R.layout.simple_list_item_1, options)
binding.formatters.adapter = ArrayAdapter<String>(requireActivity(), android.R.layout.simple_list_item_1, options)

dialog.setTitle(R.string.menu_export)
dialog.setPositiveButton(R.string.menu_export) { dialog, which ->
callback(optionCls[view.formatters.selectedItemPosition], view.include_images.isChecked)
callback(optionCls[binding.formatters.selectedItemPosition], binding.includeImages.isChecked)
}

dialog.setView(view)
Expand Down
Loading

0 comments on commit 748388b

Please sign in to comment.