mirror of
https://gitlab.shinice.net/pixeldroid/PixelDroid
synced 2025-02-03 17:07:31 +01:00
Merge branch 'hide_self_report' into 'master'
Hide self report See merge request pixeldroid/PixelDroid!268
This commit is contained in:
commit
c6958a705b
@ -79,7 +79,7 @@ dependencies {
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
|
||||
implementation 'androidx.paging:paging-runtime-ktx:3.0.0-alpha10'
|
||||
implementation 'androidx.paging:paging-runtime-ktx:3.0.0-alpha11'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0'
|
||||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
|
||||
@ -87,16 +87,16 @@ dependencies {
|
||||
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
||||
|
||||
// Use the most recent version of CameraX
|
||||
def camerax_version = '1.0.0-beta12'
|
||||
implementation "androidx.camera:camera-core:${camerax_version}"
|
||||
implementation "androidx.camera:camera-camera2:${camerax_version}"
|
||||
def cameraX_version = '1.0.0-rc01'
|
||||
implementation "androidx.camera:camera-core:${cameraX_version}"
|
||||
implementation "androidx.camera:camera-camera2:${cameraX_version}"
|
||||
// CameraX Lifecycle library
|
||||
implementation "androidx.camera:camera-lifecycle:$camerax_version"
|
||||
implementation "androidx.camera:camera-lifecycle:$cameraX_version"
|
||||
|
||||
// CameraX View class
|
||||
implementation 'androidx.camera:camera-view:1.0.0-alpha19'
|
||||
implementation 'androidx.camera:camera-view:1.0.0-alpha20'
|
||||
|
||||
def room_version = "2.3.0-alpha03"
|
||||
def room_version = "2.3.0-alpha04"
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
kapt "androidx.room:room-compiler:$room_version"
|
||||
implementation "androidx.room:room-ktx:$room_version"
|
||||
|
@ -15,7 +15,6 @@ import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.LifecycleCoroutineScope
|
||||
import androidx.paging.RemoteMediator
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import at.connyduck.sparkbutton.SparkButton
|
||||
@ -27,8 +26,6 @@ import com.h.pixeldroid.R
|
||||
import com.h.pixeldroid.ReportActivity
|
||||
import com.h.pixeldroid.api.PixelfedAPI
|
||||
import com.h.pixeldroid.db.AppDatabase
|
||||
import com.h.pixeldroid.db.entities.HomeStatusDatabaseEntity
|
||||
import com.h.pixeldroid.db.entities.PublicFeedStatusDatabaseEntity
|
||||
import com.h.pixeldroid.objects.Attachment
|
||||
import com.h.pixeldroid.objects.Context
|
||||
import com.h.pixeldroid.objects.Status
|
||||
@ -440,8 +437,10 @@ class StatusViewHolder(val view: View) : RecyclerView.ViewHolder(view) {
|
||||
menu.setGroupVisible(R.id.post_more_group_picture, false)
|
||||
}
|
||||
if(status?.account?.id == db.userDao().getActiveUser()!!.user_id){
|
||||
//make sure to enable deleting post if it's the user's
|
||||
// Enable deleting post if it's the user's
|
||||
menu.setGroupVisible(R.id.post_more_menu_group_delete, true)
|
||||
// And disable reporting your own post (just delete it if you don't like it :P)
|
||||
menu.setGroupVisible(R.id.post_more_menu_group_report, false)
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ open class CachedFeedFragment<T: FeedContentDatabase> : BaseFragment() {
|
||||
private var job: Job? = null
|
||||
|
||||
|
||||
@ExperimentalPagingApi
|
||||
internal fun launch() {
|
||||
// Make sure we cancel the previous job before creating a new one
|
||||
job?.cancel()
|
||||
|
@ -37,6 +37,7 @@ class FeedContentRepository<T: FeedContentDatabase> @ExperimentalPagingApi
|
||||
* [FeedContentDatabase], exposed as a stream of data that will emit
|
||||
* every time we get more data from the network.
|
||||
*/
|
||||
@ExperimentalPagingApi
|
||||
fun stream(): Flow<PagingData<T>> {
|
||||
|
||||
val pagingSourceFactory = {
|
||||
|
@ -30,6 +30,7 @@ class FeedViewModel<T: FeedContentDatabase>(private val repository: FeedContentR
|
||||
|
||||
private var currentResult: Flow<PagingData<T>>? = null
|
||||
|
||||
@ExperimentalPagingApi
|
||||
fun flow(): Flow<PagingData<T>> {
|
||||
val lastResult = currentResult
|
||||
if (lastResult != null) {
|
||||
|
@ -1,8 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@+id/post_more_menu_report"
|
||||
android:title="@string/report" />
|
||||
<group android:id="@+id/post_more_menu_group_report">
|
||||
<item android:id="@+id/post_more_menu_report"
|
||||
android:title="@string/report" />
|
||||
</group>
|
||||
|
||||
<item android:id="@+id/post_more_menu_share_link"
|
||||
android:title="@string/share_link" />
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.4.20'
|
||||
ext.kotlin_version = '1.4.21'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
Loading…
x
Reference in New Issue
Block a user