mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Hide scheduled media from conversation settings.
This commit is contained in:
@@ -11,14 +11,13 @@ import androidx.annotation.MenuRes
|
|||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.appcompat.widget.Toolbar
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.fragment.app.Fragment
|
|
||||||
import androidx.recyclerview.widget.ConcatAdapter
|
import androidx.recyclerview.widget.ConcatAdapter
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import org.thoughtcrime.securesms.LoggingFragment
|
||||||
import org.thoughtcrime.securesms.R
|
import org.thoughtcrime.securesms.R
|
||||||
import org.thoughtcrime.securesms.util.Material3OnScrollHelper
|
import org.thoughtcrime.securesms.util.Material3OnScrollHelper
|
||||||
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
|
import org.thoughtcrime.securesms.util.adapter.mapping.MappingAdapter
|
||||||
import java.lang.UnsupportedOperationException
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The DSL API can be completely replaced by compose.
|
* The DSL API can be completely replaced by compose.
|
||||||
@@ -29,7 +28,7 @@ abstract class DSLSettingsFragment(
|
|||||||
@MenuRes private val menuId: Int = -1,
|
@MenuRes private val menuId: Int = -1,
|
||||||
@LayoutRes layoutId: Int = R.layout.dsl_settings_fragment,
|
@LayoutRes layoutId: Int = R.layout.dsl_settings_fragment,
|
||||||
protected var layoutManagerProducer: (Context) -> RecyclerView.LayoutManager = { context -> LinearLayoutManager(context) }
|
protected var layoutManagerProducer: (Context) -> RecyclerView.LayoutManager = { context -> LinearLayoutManager(context) }
|
||||||
) : Fragment(layoutId) {
|
) : LoggingFragment(layoutId) {
|
||||||
|
|
||||||
protected var recyclerView: RecyclerView? = null
|
protected var recyclerView: RecyclerView? = null
|
||||||
private set
|
private set
|
||||||
|
|||||||
@@ -111,7 +111,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
|
|||||||
(${AttachmentTable.DATA_FILE} IS NOT NULL OR (${AttachmentTable.CONTENT_TYPE} LIKE 'video/%' AND ${AttachmentTable.REMOTE_INCREMENTAL_DIGEST} IS NOT NULL) OR (${AttachmentTable.THUMBNAIL_FILE} IS NOT NULL)) AND
|
(${AttachmentTable.DATA_FILE} IS NOT NULL OR (${AttachmentTable.CONTENT_TYPE} LIKE 'video/%' AND ${AttachmentTable.REMOTE_INCREMENTAL_DIGEST} IS NOT NULL) OR (${AttachmentTable.THUMBNAIL_FILE} IS NOT NULL)) AND
|
||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/svg%' AND
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/svg%' AND
|
||||||
(${AttachmentTable.CONTENT_TYPE} LIKE 'image/%' OR ${AttachmentTable.CONTENT_TYPE} LIKE 'video/%') AND
|
(${AttachmentTable.CONTENT_TYPE} LIKE 'image/%' OR ${AttachmentTable.CONTENT_TYPE} LIKE 'video/%') AND
|
||||||
${MessageTable.LINK_PREVIEWS} IS NULL
|
${MessageTable.LINK_PREVIEWS} IS NULL AND
|
||||||
|
${MessageTable.SCHEDULED_DATE} < 0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -119,7 +120,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
|
|||||||
BASE_MEDIA_QUERY,
|
BASE_MEDIA_QUERY,
|
||||||
"""
|
"""
|
||||||
${AttachmentTable.DATA_FILE} IS NOT NULL AND
|
${AttachmentTable.DATA_FILE} IS NOT NULL AND
|
||||||
${AttachmentTable.CONTENT_TYPE} LIKE 'audio/%'
|
${AttachmentTable.CONTENT_TYPE} LIKE 'audio/%' AND
|
||||||
|
${MessageTable.SCHEDULED_DATE} < 0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -128,7 +130,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
|
|||||||
"""
|
"""
|
||||||
${AttachmentTable.DATA_FILE} IS NOT NULL AND
|
${AttachmentTable.DATA_FILE} IS NOT NULL AND
|
||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain' AND
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain' AND
|
||||||
${MessageTable.LINK_PREVIEWS} IS NULL
|
${MessageTable.LINK_PREVIEWS} IS NULL AND
|
||||||
|
${MessageTable.SCHEDULED_DATE} < 0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -142,7 +145,8 @@ class MediaTable internal constructor(context: Context?, databaseHelper: SignalD
|
|||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/%' AND
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'image/%' AND
|
||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'video/%' AND
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'video/%' AND
|
||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'audio/%' AND
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'audio/%' AND
|
||||||
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain'
|
${AttachmentTable.CONTENT_TYPE} NOT LIKE 'text/x-signal-plain' AND
|
||||||
|
${MessageTable.SCHEDULED_DATE} < 0
|
||||||
)
|
)
|
||||||
)"""
|
)"""
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.signal.core.util.ByteSize;
|
|||||||
import org.signal.core.util.DimensionUnit;
|
import org.signal.core.util.DimensionUnit;
|
||||||
import org.signal.core.util.concurrent.LifecycleDisposable;
|
import org.signal.core.util.concurrent.LifecycleDisposable;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
|
import org.thoughtcrime.securesms.LoggingFragment;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
import org.thoughtcrime.securesms.attachments.DatabaseAttachment;
|
||||||
import org.thoughtcrime.securesms.components.DeleteSyncEducationDialog;
|
import org.thoughtcrime.securesms.components.DeleteSyncEducationDialog;
|
||||||
@@ -56,7 +57,7 @@ import java.util.Objects;
|
|||||||
|
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
|
|
||||||
public final class MediaOverviewPageFragment extends Fragment
|
public final class MediaOverviewPageFragment extends LoggingFragment
|
||||||
implements MediaGalleryAllAdapter.ItemClickListener,
|
implements MediaGalleryAllAdapter.ItemClickListener,
|
||||||
MediaGalleryAllAdapter.AudioItemListener,
|
MediaGalleryAllAdapter.AudioItemListener,
|
||||||
LoaderManager.LoaderCallbacks<GroupedThreadMediaLoader.GroupedThreadMedia>
|
LoaderManager.LoaderCallbacks<GroupedThreadMediaLoader.GroupedThreadMedia>
|
||||||
|
|||||||
Reference in New Issue
Block a user