Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
firefox-android
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
The Tor Project
Applications
firefox-android
Commits
7a94beac
Verified
Commit
7a94beac
authored
Jun 30, 2023
by
Noah Bond
Committed by
ma1
Jan 10, 2024
Browse files
Options
Downloads
Patches
Plain Diff
Bug 1840896 - Remove `rememberSaveable` since bitmaps are not serializable
parent
65c66210
No related branches found
No related tags found
1 merge request
!56
Bug 42363: Backport tab thumbnails enhancements
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fenix/app/src/main/java/org/mozilla/fenix/compose/ThumbnailImage.kt
+3
-6
3 additions, 6 deletions
...src/main/java/org/mozilla/fenix/compose/ThumbnailImage.kt
with
3 additions
and
6 deletions
fenix/app/src/main/java/org/mozilla/fenix/compose/ThumbnailImage.kt
+
3
−
6
View file @
7a94beac
...
...
@@ -5,7 +5,6 @@
package
org.mozilla.fenix.compose
import
android.graphics.Bitmap
import
android.os.Parcelable
import
androidx.compose.foundation.Image
import
androidx.compose.foundation.background
import
androidx.compose.foundation.layout.Box
...
...
@@ -13,8 +12,8 @@ import androidx.compose.runtime.Composable
import
androidx.compose.runtime.DisposableEffect
import
androidx.compose.runtime.getValue
import
androidx.compose.runtime.mutableStateOf
import
androidx.compose.runtime.remember
import
androidx.compose.runtime.rememberCoroutineScope
import
androidx.compose.runtime.saveable.rememberSaveable
import
androidx.compose.runtime.setValue
import
androidx.compose.ui.Alignment
import
androidx.compose.ui.Modifier
...
...
@@ -26,7 +25,6 @@ import androidx.compose.ui.tooling.preview.Preview
import
androidx.compose.ui.unit.Dp
import
androidx.compose.ui.unit.dp
import
kotlinx.coroutines.launch
import
kotlinx.parcelize.Parcelize
import
mozilla.components.concept.base.images.ImageLoadRequest
import
org.mozilla.fenix.components.components
import
org.mozilla.fenix.theme.FirefoxTheme
...
...
@@ -56,7 +54,7 @@ fun ThumbnailImage(
val
thumbnailSize
=
LocalDensity
.
current
.
run
{
size
.
toPx
().
toInt
()
}
val
request
=
ImageLoadRequest
(
key
,
thumbnailSize
)
val
storage
=
components
.
core
.
thumbnailStorage
var
state
by
remember
Saveable
{
mutableStateOf
(
ThumbnailImageState
(
null
,
false
))
}
var
state
by
remember
{
mutableStateOf
(
ThumbnailImageState
(
null
,
false
))
}
val
scope
=
rememberCoroutineScope
()
DisposableEffect
(
Unit
)
{
...
...
@@ -102,11 +100,10 @@ fun ThumbnailImage(
/**
* State wrapper for [ThumbnailImage].
*/
@Parcelize
private
data class
ThumbnailImageState
(
val
bitmap
:
Bitmap
?,
val
hasLoaded
:
Boolean
,
)
:
Parcelable
)
/**
* This preview does not demo anything. This is to ensure that [ThumbnailImage] does not break other previews.
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment