merge main

This commit is contained in:
Conny Duck 2020-08-19 20:42:31 +02:00
commit 92333c8b57
11 changed files with 27 additions and 23 deletions

View File

@ -60,16 +60,16 @@ dependencies {
val moshiVersion = "1.9.2"
val daggerVersion = "2.27"
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.0")
implementation("androidx.core:core:1.3.0")
implementation("androidx.core:core:1.3.1")
implementation("androidx.appcompat:appcompat:1.3.0-alpha01")
implementation("androidx.activity:activity-ktx:1.2.0-alpha06")
implementation("androidx.fragment:fragment-ktx:1.3.0-alpha06")
implementation("com.google.android.material:material:1.2.0-beta01")
implementation("androidx.activity:activity-ktx:1.2.0-alpha07")
implementation("androidx.fragment:fragment-ktx:1.3.0-alpha07")
implementation("com.google.android.material:material:1.3.0-alpha02")
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.recyclerview:recyclerview:1.2.0-alpha04")
implementation("androidx.recyclerview:recyclerview:1.2.0-alpha05")
implementation("androidx.annotation:annotation:1.1.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
@ -77,7 +77,7 @@ dependencies {
implementation("androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion")
implementation("androidx.preference:preference:1.1.1")
implementation("androidx.emoji:emoji-bundled:1.1.0")
implementation("androidx.paging:paging-runtime-ktx:3.0.0-alpha02")
implementation("androidx.paging:paging-runtime-ktx:3.0.0-alpha04")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.room:room-ktx:$roomVersion")
@ -93,7 +93,7 @@ dependencies {
implementation("com.squareup.moshi:moshi-adapters:$moshiVersion")
kapt("com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
implementation("com.fxn769:pix:1.4.4")

View File

@ -25,7 +25,6 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.viewModels
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import at.connyduck.pixelcat.R
@ -105,14 +104,14 @@ class ComposeActivity : BaseActivity(), OnImageActionClickListener {
viewModel.imageLiveData.observe(
this,
Observer {
{
adapter.submitList(it)
}
)
viewModel.visibility.observe(
this,
Observer {
{
val visibilityString = when (it) {
VISIBILITY.PUBLIC -> R.string.compose_visibility_public
VISIBILITY.UNLISTED -> R.string.compose_visibility_unlisted

View File

@ -22,7 +22,6 @@ package at.connyduck.pixelcat.components.profile
import android.os.Bundle
import android.view.View
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import androidx.lifecycle.lifecycleScope
import androidx.paging.ExperimentalPagingApi
import androidx.recyclerview.widget.GridLayoutManager
@ -113,7 +112,7 @@ class ProfileFragment : DaggerFragment(R.layout.fragment_profile) {
viewModel.profile.observe(
viewLifecycleOwner,
Observer {
{
when (it) {
is Success -> onAccountChanged(it.data)
is Error -> showError()
@ -122,7 +121,7 @@ class ProfileFragment : DaggerFragment(R.layout.fragment_profile) {
)
viewModel.relationship.observe(
viewLifecycleOwner,
Observer {
{
when (it) {
is Success -> onRelationshipChanged(it.data)
is Error -> showError()

View File

@ -24,6 +24,7 @@ import android.view.View
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.paging.ExperimentalPagingApi
import androidx.paging.LoadState
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.SimpleItemAnimator
import at.connyduck.pixelcat.R
@ -76,8 +77,11 @@ class TimelineFragment : DaggerFragment(R.layout.fragment_timeline), TimeLineAct
adapter.refresh()
}
adapter.addDataRefreshListener {
binding.timelineSwipeRefresh.isRefreshing = false
adapter.addLoadStateListener {
if (it.refresh != LoadState.Loading) {
binding.timelineSwipeRefresh.isRefreshing = false
}
}
}

View File

@ -67,7 +67,7 @@ class AccountManager(db: AppDatabase) {
accountDao.insertOrReplace(it)
}
val maxAccountId = accounts.maxBy { it.id }?.id ?: 0
val maxAccountId = accounts.maxByOrNull { it.id }?.id ?: 0
val newAccountId = maxAccountId + 1
activeAccount = AccountEntity(
id = newAccountId,

View File

@ -7,7 +7,6 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import androidx.viewbinding.ViewBinding
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
@ -33,7 +32,7 @@ class FragmentViewBindingDelegate<T : ViewBinding>(
override fun onCreate(owner: LifecycleOwner) {
fragment.viewLifecycleOwnerLiveData.observe(
fragment,
Observer { t ->
{ t ->
t?.lifecycle?.addObserver(object : DefaultLifecycleObserver {
override fun onDestroy(owner: LifecycleOwner) {
binding = null

View File

@ -5,9 +5,9 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:4.0.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
classpath("org.jlleitschuh.gradle:ktlint-gradle:9.2.1")
classpath("com.android.tools.build:gradle:4.0.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
classpath("org.jlleitschuh.gradle:ktlint-gradle:9.3.0")
}
}

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2
gradlew vendored
View File

@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath

1
gradlew.bat vendored
View File

@ -84,6 +84,7 @@ set CMD_LINE_ARGS=%*
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%