Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f583a2e
bump gradle 6.8.2
sphrak Mar 3, 2021
f2f3206
bump kotlin 1.4.31
sphrak Mar 3, 2021
ffeb902
bump androidx fragment 1.3.0
sphrak Mar 3, 2021
35a79a3
bump androidx navigation 2.3.3
sphrak Mar 3, 2021
3478603
bump androidx room 2.2.6
sphrak Mar 3, 2021
608853d
bump androidx lifecycle 2.3.0
sphrak Mar 3, 2021
4bec855
bump dagger 2.33
sphrak Mar 3, 2021
7cef404
bump androidx constraintlayout 2.0.4
sphrak Mar 3, 2021
b95ff12
bump leakcanary 2.6
sphrak Mar 3, 2021
4bbc33d
bump material components 1.3.0
sphrak Mar 3, 2021
1e65080
bump kotlinx coroutines 1.4.3
sphrak Mar 3, 2021
96c7338
bump coil 1.1.1
sphrak Mar 3, 2021
43b5318
bump kotlinx serialization 1.1.0
sphrak Mar 3, 2021
3fd1cf9
bump android gradle plugin 4.1.2
sphrak Mar 3, 2021
a8b2e92
bump firebase crashlytics 2.5.1
sphrak Mar 3, 2021
a9a4d82
bump google services 4.3.5
sphrak Mar 3, 2021
26a8b58
bump permissions dispatcher 4.8.0
sphrak Mar 3, 2021
ad8c73b
bump threeten bp 1.5.0
sphrak Mar 3, 2021
71b07e5
replace lifecycle-compiler with lifecycle-common-java8
sphrak Mar 3, 2021
1f1d5d6
bump androidx navigation 2.3.4
sphrak Mar 11, 2021
439bf9d
bump osmdroid 6.1.10
sphrak Mar 11, 2021
c503453
bump androidx fragment 1.3.1
sphrak Mar 11, 2021
c8910e5
bump corbind 1.5.0
sphrak Mar 11, 2021
e668ecb
bump gradle 6.8.3
sphrak Mar 11, 2021
ea0be89
bump jdk target 11
sphrak Mar 11, 2021
2243dff
replace kotlinx synthetic with viewbinding
sphrak Mar 11, 2021
ec78c71
s/kotlin-stdlib-jdk7/kotlin-stdlib-jdk8
sphrak Mar 11, 2021
3158165
release/2.0.3
sphrak Mar 11, 2021
95f9606
Require JDK 11 in Github Actions
sphrak Mar 11, 2021
4bcec64
Create dependabot.yml (#250)
sphrak Mar 12, 2021
348978d
remove deprecated kotlinx parcelize import
sphrak Mar 14, 2021
9d7886f
bump android gradle plugin 7.0.0-alpha10
sphrak Mar 21, 2021
bc9277f
bump android gradle plugin 7.0.0-alpha12
sphrak Mar 29, 2021
68d3b5e
bump kotlin 1.4.32
sphrak Mar 29, 2021
8b479c2
bump androidx fragment 1.3.2
sphrak Mar 29, 2021
ab92d56
bump ktlint 0.41.0
sphrak Mar 29, 2021
456521b
bump firebase crashlytics gradle 2.5.2
sphrak Mar 29, 2021
9eab7df
fix NPE in weather forecast fragment
sphrak Mar 29, 2021
8223da2
bugfix: correctly set theme when activity is recreated
sphrak Mar 29, 2021
0e6cd54
fix search adapter issue with viewbinding
sphrak Mar 29, 2021
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Run ktlint
run: ./gradlew ktlint
tests:
Expand All @@ -31,9 +31,9 @@ jobs:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "${GOOGLE_SERVICES_JSON}" | base64 --decode > app/google-services.json
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Tests
run: ./gradlew test
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: |
echo "${GOOGLE_SERVICES_JSON}" | base64 --decode > app/google-services.json
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Assemble release
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
Expand Down
59 changes: 30 additions & 29 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'
apply plugin: 'kotlinx-serialization'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
Expand Down Expand Up @@ -33,17 +33,15 @@ def getGitSha = { ->
}

android {

compileSdkVersion 30
androidExtensions {
experimental = true
}
buildToolsVersion '29.0.3'
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "fi.kroon.vadret"
minSdkVersion 21
targetSdkVersion 30
versionCode 29
versionName "2.0.2"
versionCode 30
versionName "2.0.3"
vectorDrawables.useSupportLibrary = true
flavorDimensions "default"
testInstrumentationRunner "androidx.top.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -116,11 +114,14 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11.toString()
}
buildFeatures {
viewBinding true
}
}

Expand All @@ -132,39 +133,39 @@ dependencies {

def APPCOMPAT_VERSION = "1.2.0"
def ASSERTJ_VERSION = "3.14.0"
def COIL_VERSION = "0.13.0"
def COIL_VERSION = "1.1.1"
def COMMONS_CSV_VERSION = "1.7"
def CONSTRAINT_LAYOUT_VERSION = "2.0.2"
def CORBIND_VERSION = "1.4.0"
def CONSTRAINT_LAYOUT_VERSION = "2.0.4"
def CORBIND_VERSION = "1.5.0"
def CORE_KTX_VERSION = "1.3.2"
def COROUTINES_VERSION = "1.4.2"
def DAGGER_VERSION = "2.30.1"
def COROUTINES_VERSION = "1.4.3"
def DAGGER_VERSION = "2.33"
def EITHER_VERSION = "1.2.0"
def FRAGMENT_VERSION = "1.3.0-beta01"
def FRAGMENT_VERSION = "1.3.2"
def JUNIT_VERSION = "4.13"
def KOTLIN_STDLIB_VERSION = "1.4.10"
def KOTLINX_SERIALIZATION = "1.0.1"
def KTLINT_VERSION = "0.40.0"
def MATERIAL_VERSION = "1.2.1"
def KOTLIN_STDLIB_VERSION = "1.4.32"
def KOTLINX_SERIALIZATION = "1.1.0"
def KTLINT_VERSION = "0.41.0"
def MATERIAL_VERSION = "1.3.0"
def MOCKITO_CORE_VERSION = "3.1.0"
def MOSHI_VERSION = "1.9.2"
def NAVIGATION_VERSION = "2.3.2"
def NAVIGATION_VERSION = "2.3.4"
def OKHTTP_VERSION = "4.2.2"
def OKIO_VERSION = "2.6.0"
def OSMDROID_VERSION = "6.1.2"
def PERMISSIONS_DISPATCHER_VERSION = "4.7.0"
def OSMDROID_VERSION = "6.1.10"
def PERMISSIONS_DISPATCHER_VERSION = "4.8.0"
def PREFERENCE_VERSION = "1.1.1"
def RETROFIT_VERSION = "2.9.0"
def ROOM_VERSION = "2.2.5"
def ROOM_VERSION = "2.2.6"
def RXANDROID_VERSION = "2.1.1"
def RXBINDING_VERSION = "3.1.0"
def RXJAVA_VERSION = "2.2.19"
def RXKOTLIN_VERSION = "2.4.0"
def RXK_PREFS_VERSION = "1.2.5"
def THREETEN_ABP_VERSION = "1.2.1"
def THREETEN_BP_VERSION = "1.4.0"
def THREETEN_BP_VERSION = "1.5.0"
def TIMBER_VERSION = "4.7.1"
def LIFECYCLE_VERSION = "2.2.0"
def LIFECYCLE_VERSION = "2.3.0"

implementation fileTree(dir: 'libs', include: ['*.jar'])

Expand All @@ -181,7 +182,7 @@ dependencies {
// Lifecycle
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$LIFECYCLE_VERSION"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$LIFECYCLE_VERSION"
kapt "androidx.lifecycle:lifecycle-compiler:$LIFECYCLE_VERSION"
kapt "androidx.lifecycle:lifecycle-common-java8:$LIFECYCLE_VERSION"

// Coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${COROUTINES_VERSION}"
Expand Down Expand Up @@ -231,7 +232,7 @@ dependencies {
implementation "com.afollestad:rxkprefs:${RXK_PREFS_VERSION}"
implementation "io.coil-kt:coil:${COIL_VERSION}"
implementation "org.apache.commons:commons-csv:${COMMONS_CSV_VERSION}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${KOTLIN_STDLIB_VERSION}"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${KOTLIN_STDLIB_VERSION}"
implementation "org.osmdroid:osmdroid-android:${OSMDROID_VERSION}"
implementation "io.github.sphrak:either:${EITHER_VERSION}"
implementation "org.permissionsdispatcher:permissionsdispatcher:${PERMISSIONS_DISPATCHER_VERSION}"
Expand All @@ -242,7 +243,7 @@ dependencies {
testImplementation "org.threeten:threetenbp:${THREETEN_BP_VERSION}"

// Debugging, Testing, Linting, Analytics
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.5"
debugImplementation "com.squareup.leakcanary:leakcanary-android:2.6"
googleImplementation platform('com.google.firebase:firebase-bom:26.0.0')
googleImplementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation "com.jakewharton.timber:timber:${TIMBER_VERSION}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fi.kroon.vadret.data.autocomplete.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class AutoCompleteItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.DatabaseView
import fi.kroon.vadret.presentation.warning.filter.model.IFilterable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
@DatabaseView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.DatabaseView
import fi.kroon.vadret.presentation.warning.filter.model.IFilterable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
@DatabaseView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fi.kroon.vadret.data.nominatim.model
import android.os.Parcelable
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
@JsonClass(generateAdapter = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fi.kroon.vadret.data.nominatim.model
import android.os.Parcelable
import androidx.annotation.StringRes
import fi.kroon.vadret.R
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class Locality(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fi.kroon.vadret.data.nominatim.model
import android.os.Parcelable
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
@JsonClass(generateAdapter = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fi.kroon.vadret.data.nominatim.model

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class NominatimList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Parcelable
import fi.kroon.vadret.util.PMP3G_CATEGORY
import fi.kroon.vadret.util.POINT_GEOTYPE
import fi.kroon.vadret.util.SMHI_BASE_API_VERSION
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

@Parcelize
data class WeatherOut(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
package fi.kroon.vadret.presentation.aboutapp

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import fi.kroon.vadret.R
import fi.kroon.vadret.databinding.AboutAppFragmentBinding
import fi.kroon.vadret.presentation.aboutapp.di.AboutAppComponent
import fi.kroon.vadret.presentation.aboutapp.di.DaggerAboutAppComponent
import fi.kroon.vadret.util.extension.lazyAndroid
import kotlinx.android.synthetic.main.about_app_fragment.*
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import timber.log.Timber

@ExperimentalCoroutinesApi
class AboutAppFragment : Fragment(R.layout.about_app_fragment) {
class AboutAppFragment : Fragment() {

private var _binding: AboutAppFragmentBinding? = null
private val binding: AboutAppFragmentBinding get() = _binding!!

private lateinit var aboutAppFragmentPagerAdapter: AboutAppFragmentPagerAdapter

Expand All @@ -28,36 +31,41 @@ class AboutAppFragment : Fragment(R.layout.about_app_fragment) {
component.provideViewModel()
}

override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
_binding = AboutAppFragmentBinding.inflate(inflater, container, false)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

lifecycleScope
.launch {
viewModel
.viewState
.collect(::render)
}
viewModel
.viewState
.onEach(::render)
.launchIn(viewLifecycleOwner.lifecycleScope)

setupRecyclerView()
}

override fun onDestroyView() {
super.onDestroyView()
Timber.d("ON VIEW DESTROY")
aboutAppViewPager?.apply {
adapter = null
}
binding.aboutAppViewPager.adapter = null
_binding = null
}

private fun setupRecyclerView() {
aboutAppFragmentPagerAdapter = AboutAppFragmentPagerAdapter(
childFragmentManager,
requireContext()
)
aboutAppViewPager?.adapter = aboutAppFragmentPagerAdapter

aboutAppTabLayout?.apply {
setupWithViewPager(aboutAppViewPager)
binding.apply {
aboutAppViewPager.adapter = aboutAppFragmentPagerAdapter
aboutAppTabLayout.setupWithViewPager(aboutAppViewPager)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fi.kroon.vadret.presentation.aboutapp

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

object AboutAppView {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package fi.kroon.vadret.presentation.aboutapp

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.launch
import javax.inject.Inject

@ExperimentalCoroutinesApi
class AboutAppViewModel @Inject constructor(
private val state: MutableSharedFlow<AboutAppView.State>,
private var stateModel: AboutAppView.State,
Expand Down
Loading