chore(mobile): thumbnail image ui improvements (#13655)
Some checks are pending
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker / pre-job (push) Waiting to run
Docker / Re-Tag ML () (push) Blocked by required conditions
Docker / Re-Tag ML (-armnn) (push) Blocked by required conditions
Docker / Re-Tag ML (-cuda) (push) Blocked by required conditions
Docker / Re-Tag ML (-openvino) (push) Blocked by required conditions
Docker / Re-Tag Server () (push) Blocked by required conditions
Docker / Build and Push ML (armnn, linux/arm64, -armnn) (push) Blocked by required conditions
Docker / Build and Push ML (cpu, linux/amd64,linux/arm64) (push) Blocked by required conditions
Docker / Build and Push ML (cuda, linux/amd64, -cuda) (push) Blocked by required conditions
Docker / Build and Push ML (openvino, linux/amd64, -openvino) (push) Blocked by required conditions
Docker / Build and Push Server (cpu, linux/amd64,linux/arm64) (push) Blocked by required conditions
Docker / Docker Build & Push Server Success (push) Blocked by required conditions
Docker / Docker Build & Push ML Success (push) Blocked by required conditions
Docs build / pre-job (push) Waiting to run
Docs build / Docs Build (push) Blocked by required conditions
Static Code Analysis / pre-job (push) Waiting to run
Static Code Analysis / Run Dart Code Analysis (push) Blocked by required conditions
Test / pre-job (push) Waiting to run
Test / Test & Lint Server (push) Blocked by required conditions
Test / Unit Test CLI (push) Blocked by required conditions
Test / Unit Test CLI (Windows) (push) Blocked by required conditions
Test / Test & Lint Web (push) Blocked by required conditions
Test / End-to-End Lint (push) Blocked by required conditions
Test / Medium Tests (Server) (push) Blocked by required conditions
Test / End-to-End Tests (Server & CLI) (push) Blocked by required conditions
Test / End-to-End Tests (Web) (push) Blocked by required conditions
Test / Unit Test Mobile (push) Blocked by required conditions
Test / Unit Test ML (push) Blocked by required conditions
Test / ShellCheck (push) Waiting to run
Test / OpenAPI Clients (push) Waiting to run
Test / TypeORM Checks (push) Waiting to run

improve ui for thumbnail image

Co-authored-by: dvbthien <dvbthien@gmail.com>
This commit is contained in:
dvbthien
2024-10-22 04:36:15 +07:00
committed by GitHub
parent 21d7cf6de6
commit 16f2364e93

View File

@@ -138,11 +138,32 @@ class ThumbnailImage extends ConsumerWidget {
tag: isFromDto tag: isFromDto
? '${asset.remoteId}-$heroOffset' ? '${asset.remoteId}-$heroOffset'
: asset.id + heroOffset, : asset.id + heroOffset,
child: ImmichThumbnail( child: Stack(
children: [
ImmichThumbnail(
asset: asset, asset: asset,
height: 250, height: 250,
width: 250, width: 250,
), ),
Container(
height: 250,
width: 250,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [
Color.fromRGBO(0, 0, 0, 0.1),
Colors.transparent,
Colors.transparent,
Color.fromRGBO(0, 0, 0, 0.1),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [0, 0.3, 0.6, 1],
),
),
),
],
),
), ),
); );
if (!multiselectEnabled || !isSelected) { if (!multiselectEnabled || !isSelected) {
@@ -153,11 +174,8 @@ class ThumbnailImage extends ConsumerWidget {
color: canDeselect ? assetContainerColor : Colors.grey, color: canDeselect ? assetContainerColor : Colors.grey,
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.all(
topRight: Radius.circular(15.0), Radius.circular(15.0),
bottomRight: Radius.circular(15.0),
bottomLeft: Radius.circular(15.0),
topLeft: Radius.zero,
), ),
child: image, child: image,
), ),
@@ -177,16 +195,9 @@ class ThumbnailImage extends ConsumerWidget {
) )
: const Border(), : const Border(),
), ),
child: buildImage(), child: Stack(
), children: [
if (multiselectEnabled) buildImage(),
Padding(
padding: const EdgeInsets.all(3.0),
child: Align(
alignment: Alignment.topLeft,
child: buildSelectionIcon(asset),
),
),
if (showStorageIndicator) if (showStorageIndicator)
Positioned( Positioned(
right: 8, right: 8,
@@ -204,12 +215,23 @@ class ThumbnailImage extends ConsumerWidget {
child: Icon( child: Icon(
Icons.favorite, Icons.favorite,
color: Colors.white, color: Colors.white,
size: 18, size: 16,
), ),
), ),
if (!asset.isImage) buildVideoIcon(), if (!asset.isImage) buildVideoIcon(),
if (asset.stackCount > 0) buildStackIcon(), if (asset.stackCount > 0) buildStackIcon(),
], ],
),
),
if (multiselectEnabled)
Padding(
padding: const EdgeInsets.all(3.0),
child: Align(
alignment: Alignment.topLeft,
child: buildSelectionIcon(asset),
),
),
],
); );
} }
} }