Skip to content

Commit

Permalink
Merge pull request #138 from arcao/dev
Browse files Browse the repository at this point in the history
Release version 3.0.9
  • Loading branch information
arcao authored Nov 15, 2022
2 parents da5f6b7 + 95c3484 commit 66f9e2d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 19 deletions.
14 changes: 14 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

<!-- Remove AD_ID permission, we don't use ads in app -->
<uses-permission
android:name="com.google.android.gms.permission.AD_ID"
tools:node="remove" />

<supports-screens
android:anyDensity="true"
android:largeScreens="true"
Expand Down Expand Up @@ -371,5 +376,14 @@
<intent>
<action android:name="android.settings.LOCATION_SOURCE_SETTINGS" />
</intent>

<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.support.customtabs.action.CustomTabsService" />
</intent>
</queries>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.paging.LoadState
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -89,19 +91,26 @@ class BookmarkFragment : BaseBookmarkFragment() {
var savedState = savedInstanceState

viewLifecycleOwner.lifecycleScope.launch {
viewModel.pagerFlow.collectLatest { data ->
adapter.submitData(data)
repeatOnLifecycle(Lifecycle.State.RESUMED) {
viewModel.pagerFlow.collectLatest { data ->
adapter.submitData(data)

if (savedState != null) {
adapter.tracker.onRestoreInstanceState(savedState)
savedState = null
if (savedState != null) {
adapter.tracker.onRestoreInstanceState(savedState)
savedState = null
}
}
}
adapter.loadStateFlow.collect { state ->
val isListEmpty = state.refresh is LoadState.NotLoading && adapter.itemCount == 0
binding.isEmpty = isListEmpty
binding.isLoading = state.source.refresh is LoadState.Loading
state.handleErrors(viewModel::handleLoadError)
}
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) {
adapter.loadStateFlow.collect { state ->
val isListEmpty =
state.refresh is LoadState.NotLoading && adapter.itemCount == 0
binding.isEmpty = isListEmpty
binding.isLoading = state.source.refresh is LoadState.Loading
state.handleErrors(viewModel::handleLoadError)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.paging.LoadState
import androidx.recyclerview.widget.LinearLayoutManager
import com.arcao.geocaching4locus.R
Expand Down Expand Up @@ -63,14 +65,21 @@ class BookmarkListFragment : BaseBookmarkFragment() {
}

viewLifecycleOwner.lifecycleScope.launch {
viewModel.pagerFlow.collectLatest { data ->
adapter.submitData(data)
repeatOnLifecycle(Lifecycle.State.RESUMED) {
viewModel.pagerFlow.collectLatest { data ->
adapter.submitData(data)
}
}
adapter.loadStateFlow.collect { state ->
val isListEmpty = state.refresh is LoadState.NotLoading && adapter.itemCount == 0
binding.isEmpty = isListEmpty
binding.isLoading = state.source.refresh is LoadState.Loading
state.handleErrors(viewModel::handleLoadError)
}
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) {
adapter.loadStateFlow.collect { state ->
val isListEmpty =
state.refresh is LoadState.NotLoading && adapter.itemCount == 0
binding.isEmpty = isListEmpty
binding.isLoading = state.source.refresh is LoadState.Loading
state.handleErrors(viewModel::handleLoadError)
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions versions.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
version_name = '3.0.8'
version_name = '3.0.9'

min_sdk_version = 21
compile_sdk_version = 32
Expand Down Expand Up @@ -27,7 +27,7 @@ ext {
paging_version = '3.1.1'
preference_version = '1.2.0'
recycler_view_version = '1.2.1'
desugar_jdk_libs_version = '1.1.0'
desugar_jdk_libs_version = '1.1.8'

// google
crashlytics_version = '2.10.1'
Expand Down

0 comments on commit 66f9e2d

Please sign in to comment.