Skip to content

Commit

Permalink
Merge pull request #140 from mateusz-bak/remove_in_app_changelog
Browse files Browse the repository at this point in the history
Removed in app changelog, upgraded dependencies.
  • Loading branch information
mateusz-bak authored Aug 17, 2022
2 parents b010959 + de66c59 commit 35e1077
Show file tree
Hide file tree
Showing 38 changed files with 63 additions and 1,519 deletions.
32 changes: 14 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ plugins {
}

android {
compileSdkVersion 32
compileSdkVersion 33
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "software.mdev.bookstracker"
minSdkVersion 24
targetSdkVersion 32
targetSdkVersion 33
versionCode 27
versionName "1.16.0"

Expand Down Expand Up @@ -74,33 +74,32 @@ android {
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.6.0-beta01'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

def room_version= "2.4.2"
def room_version= "2.4.3"
def kodein_version="6.4.0"

// ROOM AND ARCHITECTURAL COMPONENTS
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// kapt "androidx.lifecycle:lifecycle-compiler:2.4.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.1"
implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"

// COROUTINES
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1"

// KODEIN
implementation "org.kodein.di:kodein-di-generic-jvm:$kodein_version"
Expand All @@ -121,7 +120,7 @@ dependencies {
implementation 'io.github.everythingme:overscroll-decor-android:1.1.1'

// https://stackoverflow.com/questions/7145606/how-do-you-save-store-objects-in-sharedpreferences-on-android
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.google.code.gson:gson:2.9.0'

// https://github.com/square/picasso
implementation 'com.squareup.picasso:picasso:2.8'
Expand All @@ -140,9 +139,6 @@ dependencies {
// https://github.com/zhanghai/MaterialRatingBar
implementation 'me.zhanghai.android.materialratingbar:library:1.4.0'

// https://www.section.io/engineering-education/bottom-sheet-dialogs-using-android-studio/
implementation 'com.google.android.material:material:1.6.0'

// https://github.com/doyaaaaaken/kotlin-csv
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.2.0") //for JVM platform

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,95 +171,95 @@ class BookListAdapter(
Constants.SORT_ORDER_TITLE_ASC
)) {
Constants.SORT_ORDER_TITLE_ASC -> viewModel.getSortedBooksByTitleAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_TITLE_DESC -> viewModel.getSortedBooksByTitleDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_AUTHOR_ASC -> viewModel.getSortedBooksByAuthorAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_AUTHOR_DESC -> viewModel.getSortedBooksByAuthorDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_RATING_ASC -> viewModel.getSortedBooksByRatingAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_RATING_DESC -> viewModel.getSortedBooksByRatingDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_PAGES_ASC -> viewModel.getSortedBooksByPagesAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_PAGES_DESC -> viewModel.getSortedBooksByPagesDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_START_DATE_ASC -> viewModel.getSortedBooksByStartDateAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_START_DATE_DESC -> viewModel.getSortedBooksByStartDateDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_FINISH_DATE_ASC -> viewModel.getSortedBooksByFinishDateAsc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
}
})

Constants.SORT_ORDER_FINISH_DATE_DESC -> viewModel.getSortedBooksByFinishDateDesc(status)
.observe(booksFragment?.requireActivity(), Observer { some_books ->
.observe(booksFragment.requireActivity(), Observer { some_books ->
if (booksFragment != null && adapter != null && some_books != null) {
var booksFilteredForFav = filterBooksForFav(booksFragment.requireActivity() as ListActivity, some_books)
functions.filterBooksList(booksFragment.requireActivity() as ListActivity, adapter, booksFilteredForFav, itemView?.rvBooks, scroll)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ object Constants {
const val KEY_EXPORT = "KEY_EXPORT"
const val KEY_EXPORT_LOCAL = "KEY_EXPORT_LOCAL"
const val KEY_IMPORT = "KEY_IMPORT"
const val KEY_CHANGELOG = "KEY_CHANGELOG"
const val KEY_FEEDBACK = "KEY_FEEDBACK"
const val KEY_CSV_IMPORT = "KEY_CSV_IMPORT"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import android.os.Bundle
import android.view.KeyEvent
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.animation.AnimationUtils
import android.view.inputmethod.InputMethodManager
import android.widget.*
import androidx.activity.addCallback
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import androidx.constraintlayout.widget.ConstraintLayout
Expand Down Expand Up @@ -70,7 +72,7 @@ class AddEditBookDialog : DialogFragment() {
private var bookStartDateMs: Long? = null
private var animateRating = false
private var whatIsClicked = Constants.BOOK_STATUS_NOTHING
private lateinit var takePhoto: ActivityResultLauncher<Void>
private lateinit var takePhoto: ActivityResultLauncher<Void?>
private lateinit var choosePhoto: ActivityResultLauncher<String>
private lateinit var barcodeLauncher: ActivityResultLauncher<ScanOptions>

Expand Down Expand Up @@ -100,22 +102,6 @@ class AddEditBookDialog : DialogFragment() {
return inflater.inflate(R.layout.dialog_add_edit_book, container, false)
}

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return object : Dialog(requireActivity(), theme) {
override fun onBackPressed() {
if (dpBookStartDate.visibility == View.VISIBLE ||
dpBookFinishDate.visibility == View.VISIBLE
) {
startDatePickerVis(false)
finishDatePickerVis(false)
svEditor.visibility = View.VISIBLE
} else
dismiss()
}
}
}


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

Expand All @@ -130,6 +116,26 @@ class AddEditBookDialog : DialogFragment() {
}

super.onViewCreated(view, savedInstanceState)

requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) {
if (dpBookStartDate.visibility == View.VISIBLE ||
dpBookFinishDate.visibility == View.VISIBLE
) {
startDatePickerVis(false)
finishDatePickerVis(false)
svEditor.visibility = View.VISIBLE
} else
dismiss()
}

dialog?.setOnKeyListener { _, keyCode, event ->
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_UP) {
requireActivity().onBackPressed()
return@setOnKeyListener true
}
false
}

viewModel = (activity as ListActivity).booksViewModel
listActivity = activity as ListActivity

Expand Down
Loading

0 comments on commit 35e1077

Please sign in to comment.