Merge branch 'profile_perf_fix' into 'master'
Fix profile feed performance problems See merge request pixeldroid/PixelDroid!422
This commit is contained in:
commit
151f51f1da
@ -28,8 +28,8 @@ android {
|
|||||||
applicationId "org.pixeldroid.app"
|
applicationId "org.pixeldroid.app"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 31
|
targetSdkVersion 31
|
||||||
versionCode 8
|
versionCode 9
|
||||||
versionName "1.0.beta8"
|
versionName "1.0.beta$versionCode"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
testInstrumentationRunnerArguments clearPackageData: 'true'
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
||||||
@ -117,7 +117,7 @@ dependencies {
|
|||||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'
|
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'
|
||||||
implementation 'androidx.paging:paging-runtime-ktx:3.1.0'
|
implementation 'androidx.paging:paging-runtime-ktx:3.1.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
|
||||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.1'
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.1'
|
||||||
@ -133,7 +133,7 @@ dependencies {
|
|||||||
|
|
||||||
|
|
||||||
// Use the most recent version of CameraX
|
// Use the most recent version of CameraX
|
||||||
def cameraX_version = '1.1.0-beta01'
|
def cameraX_version = '1.1.0-beta02'
|
||||||
implementation "androidx.camera:camera-core:$cameraX_version"
|
implementation "androidx.camera:camera-core:$cameraX_version"
|
||||||
implementation "androidx.camera:camera-camera2:$cameraX_version"
|
implementation "androidx.camera:camera-camera2:$cameraX_version"
|
||||||
// CameraX Lifecycle library
|
// CameraX Lifecycle library
|
||||||
@ -142,7 +142,7 @@ dependencies {
|
|||||||
// CameraX View class
|
// CameraX View class
|
||||||
implementation "androidx.camera:camera-view:$cameraX_version"
|
implementation "androidx.camera:camera-view:$cameraX_version"
|
||||||
|
|
||||||
def room_version = "2.4.1"
|
def room_version = "2.4.2"
|
||||||
implementation "androidx.room:room-runtime:$room_version"
|
implementation "androidx.room:room-runtime:$room_version"
|
||||||
kapt "androidx.room:room-compiler:$room_version"
|
kapt "androidx.room:room-compiler:$room_version"
|
||||||
implementation "androidx.room:room-ktx:$room_version"
|
implementation "androidx.room:room-ktx:$room_version"
|
||||||
|
@ -23,6 +23,7 @@ import org.pixeldroid.app.utils.di.PixelfedAPIHolder
|
|||||||
import org.pixeldroid.app.utils.api.objects.Notification
|
import org.pixeldroid.app.utils.api.objects.Notification
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
import java.lang.Exception
|
||||||
import java.lang.NullPointerException
|
import java.lang.NullPointerException
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@ -77,6 +78,8 @@ class NotificationsRemoteMediator @Inject constructor(
|
|||||||
return MediatorResult.Error(exception)
|
return MediatorResult.Error(exception)
|
||||||
} catch (exception: HttpException) {
|
} catch (exception: HttpException) {
|
||||||
return MediatorResult.Error(exception)
|
return MediatorResult.Error(exception)
|
||||||
|
} catch (exception: Exception){
|
||||||
|
return MediatorResult.Error(exception)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -77,7 +77,7 @@ class ProfileActivity : BaseActivity() {
|
|||||||
accountId
|
accountId
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).get(FeedViewModel::class.java) as FeedViewModel<Status>
|
)[FeedViewModel::class.java] as FeedViewModel<Status>
|
||||||
|
|
||||||
profileAdapter = ProfilePostsAdapter()
|
profileAdapter = ProfilePostsAdapter()
|
||||||
initAdapter(binding.profileProgressBar, binding.profileRefreshLayout,
|
initAdapter(binding.profileProgressBar, binding.profileRefreshLayout,
|
||||||
|
@ -84,9 +84,8 @@ class SettingsActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceCha
|
|||||||
|
|
||||||
//Hide Notification setting for Android versions where it doesn't work
|
//Hide Notification setting for Android versions where it doesn't work
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
preferenceManager.findPreference<Preference?>("notification")?.let {
|
preferenceManager.findPreference<Preference>("notification")
|
||||||
preferenceScreen.removePreference(it)
|
?.let { preferenceScreen.removePreference(it) }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,31 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/profileRefreshLayout"
|
|
||||||
tools:context=".profile.ProfileActivity">
|
tools:context=".profile.ProfileActivity">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
|
android:id="@+id/app_bar_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||||
|
android:id="@+id/collapsing_toolbar_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/background"
|
||||||
|
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:layout_collapseMode="parallax"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/nbFollowersTextView"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/profilePictureImageView"
|
android:id="@+id/profilePictureImageView"
|
||||||
@ -36,6 +47,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/default_nposts"
|
android:text="@string/default_nposts"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/descriptionTextView" />
|
app:layout_constraintTop_toBottomOf="@+id/descriptionTextView" />
|
||||||
|
|
||||||
@ -43,10 +55,10 @@
|
|||||||
android:id="@+id/nbFollowersTextView"
|
android:id="@+id/nbFollowersTextView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/default_nfollowers"
|
android:text="@string/default_nfollowers"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/nbPostsTextView"
|
app:layout_constraintBottom_toBottomOf="@+id/nbPostsTextView"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/nbFollowingTextView"
|
app:layout_constraintEnd_toStartOf="@+id/nbFollowingTextView"
|
||||||
app:layout_constraintStart_toEndOf="@+id/nbPostsTextView"
|
app:layout_constraintStart_toEndOf="@+id/nbPostsTextView"
|
||||||
@ -57,10 +69,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/default_nfollowing"
|
android:text="@string/default_nfollowing"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/nbFollowersTextView"
|
app:layout_constraintBottom_toBottomOf="@+id/nbFollowersTextView"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/nbFollowersTextView" />
|
app:layout_constraintTop_toTopOf="@+id/nbFollowersTextView" />
|
||||||
@ -69,9 +81,9 @@
|
|||||||
android:id="@+id/accountNameTextView"
|
android:id="@+id/accountNameTextView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginRight="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:text="@string/no_username"
|
android:text="@string/no_username"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@ -94,15 +106,14 @@
|
|||||||
android:id="@+id/followButton"
|
android:id="@+id/followButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
android:backgroundTint="@color/colorButtonBg"
|
android:backgroundTint="@color/colorButtonBg"
|
||||||
android:text="@string/follow"
|
android:text="@string/follow"
|
||||||
android:textColor="@color/colorButtonText"
|
android:textColor="@color/colorButtonText"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
|
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginEnd="20dp"
|
app:layout_constraintTop_toTopOf="@+id/profilePictureImageView" />
|
||||||
app:layout_constraintTop_toTopOf="@+id/profilePictureImageView"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/editButton"
|
android:id="@+id/editButton"
|
||||||
@ -115,53 +126,55 @@
|
|||||||
app:icon="@drawable/ic_baseline_open_in_browser_24"
|
app:icon="@drawable/ic_baseline_open_in_browser_24"
|
||||||
app:iconTint="@color/colorButtonText"
|
app:iconTint="@color/colorButtonText"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
|
app:layout_constraintBottom_toBottomOf="@+id/profilePictureImageView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@+id/profilePictureImageView"
|
app:layout_constraintStart_toEndOf="@+id/profilePictureImageView"
|
||||||
app:layout_constraintTop_toTopOf="@+id/profilePictureImageView"
|
app:layout_constraintTop_toTopOf="@+id/profilePictureImageView" />
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/profileProgressBar"
|
android:id="@+id/profileProgressBar"
|
||||||
style="?android:attr/progressBarStyle"
|
style="?android:attr/progressBarStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_gravity="center"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_marginTop="16dp" />
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/nbFollowersTextView" />
|
|
||||||
|
|
||||||
|
|
||||||
<androidx.constraintlayout.motion.widget.MotionLayout
|
<androidx.constraintlayout.motion.widget.MotionLayout
|
||||||
android:id="@+id/motionLayout"
|
android:id="@+id/motionLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="18dp"
|
android:layout_marginTop="18dp"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
app:layoutDescription="@xml/error_layout_xml_error_scene"
|
app:layoutDescription="@xml/error_layout_xml_error_scene"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/nbFollowersTextView"
|
app:layout_constraintTop_toBottomOf="@id/nbFollowersTextView">
|
||||||
tools:visibility="visible">
|
|
||||||
|
|
||||||
<include
|
<include
|
||||||
android:id="@+id/profileErrorLayout"
|
android:id="@+id/profileErrorLayout"
|
||||||
layout="@layout/error_layout"
|
layout="@layout/error_layout"
|
||||||
tools:layout_editor_absoluteX="50dp" />
|
tools:layout_editor_absoluteX="50dp" />
|
||||||
|
</androidx.constraintlayout.motion.widget.MotionLayout>
|
||||||
|
|
||||||
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
|
android:id="@+id/profileRefreshLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/profilePostsRecyclerView"
|
android:id="@+id/profilePostsRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="5dp"
|
android:clipToPadding="false"
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
app:layoutManager="LinearLayoutManager"
|
app:layoutManager="LinearLayoutManager"
|
||||||
app:layout_constraintTop_toBottomOf="@id/errorLayout"
|
|
||||||
tools:listitem="@layout/fragment_profile_posts" />
|
tools:listitem="@layout/fragment_profile_posts" />
|
||||||
|
|
||||||
</androidx.constraintlayout.motion.widget.MotionLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
@ -121,7 +121,7 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/postPagerHost"
|
app:layout_constraintTop_toTopOf="@+id/postPagerHost"
|
||||||
tools:src="@color/browser_actions_bg_grey" />
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
@ -5,5 +5,6 @@
|
|||||||
|
|
||||||
<color name="colorText">#000000</color>
|
<color name="colorText">#000000</color>
|
||||||
<color name="colorDrawing">#FFFFFF</color>
|
<color name="colorDrawing">#FFFFFF</color>
|
||||||
|
<color name="background">#000000</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -16,4 +16,5 @@
|
|||||||
<color name="colorText">#FFFFFF</color>
|
<color name="colorText">#FFFFFF</color>
|
||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="colorDrawing">#000000</color>
|
<color name="colorDrawing">#000000</color>
|
||||||
|
<color name="background">#FFFFFF</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -7,7 +7,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.1.1'
|
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
3
fastlane/metadata/android/en-US/changelogs/9.txt
Normal file
3
fastlane/metadata/android/en-US/changelogs/9.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
* Fix crash when showing licenses list
|
||||||
|
* Greatly improve performance in profile activity
|
||||||
|
* Update dependencies
|
Loading…
x
Reference in New Issue
Block a user