Merge pull request #301 from ente-io/fix-broken-iPad-albums
Album fixes on iPad
This commit is contained in:
commit
1857af3e4c
3 changed files with 32 additions and 18 deletions
1
.vscode/launch.json
vendored
1
.vscode/launch.json
vendored
|
@ -4,6 +4,7 @@
|
|||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Android Prod",
|
||||
"request": "launch",
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:async';
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
|
@ -133,7 +132,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
|
||||
Widget _getCollectionsGalleryWidget(CollectionItems items) {
|
||||
const double horizontalPaddingOfGridRow = 16;
|
||||
const double crossAxisSpacingOfGrid = 5;
|
||||
const double crossAxisSpacingOfGrid = 9;
|
||||
final TextStyle trashAndHiddenTextStyle = Theme.of(context)
|
||||
.textTheme
|
||||
.subtitle1
|
||||
|
@ -142,7 +141,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
|
|||
);
|
||||
Size size = MediaQuery.of(context).size;
|
||||
int albumsCountInOneRow = max(size.width ~/ 220.0, 2);
|
||||
final double sideOfThumbnail = (size.width / 2) -
|
||||
final double sideOfThumbnail = (size.width / albumsCountInOneRow) -
|
||||
horizontalPaddingOfGridRow -
|
||||
((crossAxisSpacingOfGrid / 2) * (albumsCountInOneRow - 1));
|
||||
return SingleChildScrollView(
|
||||
|
@ -643,10 +642,16 @@ class CollectionItem extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const double horizontalPaddingOfGridRow = 16;
|
||||
const double crossAxisSpacingOfGrid = 9;
|
||||
Size size = MediaQuery.of(context).size;
|
||||
int albumsCountInOneRow = max(size.width ~/ 220.0, 2);
|
||||
double totalWhiteSpaceOfRow = (horizontalPaddingOfGridRow * 2) +
|
||||
(albumsCountInOneRow - 1) * crossAxisSpacingOfGrid;
|
||||
TextStyle albumTitleTextStyle =
|
||||
Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 14);
|
||||
final double sideOfThumbnail =
|
||||
(MediaQuery.of(context).size.width / 2) - 18.5;
|
||||
final double sideOfThumbnail = (size.width / albumsCountInOneRow) -
|
||||
(totalWhiteSpaceOfRow / albumsCountInOneRow);
|
||||
return GestureDetector(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:async';
|
|||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:photos/core/configuration.dart';
|
||||
|
@ -112,12 +111,13 @@ class _SharedCollectionGalleryState extends State<SharedCollectionGallery>
|
|||
|
||||
Widget _getSharedCollectionsGallery(SharedCollections collections) {
|
||||
const double horizontalPaddingOfGridRow = 16;
|
||||
const double crossAxisSpacingOfGrid = 5;
|
||||
const double crossAxisSpacingOfGrid = 9;
|
||||
Size size = MediaQuery.of(context).size;
|
||||
int albumsCountInOneRow = max(size.width ~/ 220.0, 2);
|
||||
final double sideOfThumbnail = (size.width / 2) -
|
||||
horizontalPaddingOfGridRow -
|
||||
((crossAxisSpacingOfGrid / 2) * (albumsCountInOneRow - 1));
|
||||
double totalWhiteSpaceOfRow = (horizontalPaddingOfGridRow * 2) +
|
||||
(albumsCountInOneRow - 1) * crossAxisSpacingOfGrid;
|
||||
final double sideOfThumbnail = (size.width / albumsCountInOneRow) -
|
||||
(totalWhiteSpaceOfRow / albumsCountInOneRow);
|
||||
return SingleChildScrollView(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 50),
|
||||
|
@ -391,10 +391,16 @@ class IncomingCollectionItem extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const double horizontalPaddingOfGridRow = 16;
|
||||
const double crossAxisSpacingOfGrid = 9;
|
||||
TextStyle albumTitleTextStyle =
|
||||
Theme.of(context).textTheme.subtitle1.copyWith(fontSize: 14);
|
||||
final double sideOfThumbnail =
|
||||
(MediaQuery.of(context).size.width / 2) - 18.5;
|
||||
Size size = MediaQuery.of(context).size;
|
||||
int albumsCountInOneRow = max(size.width ~/ 220.0, 2);
|
||||
double totalWhiteSpaceOfRow = (horizontalPaddingOfGridRow * 2) +
|
||||
(albumsCountInOneRow - 1) * crossAxisSpacingOfGrid;
|
||||
final double sideOfThumbnail = (size.width / albumsCountInOneRow) -
|
||||
(totalWhiteSpaceOfRow / albumsCountInOneRow);
|
||||
return GestureDetector(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -451,14 +457,16 @@ class IncomingCollectionItem extends StatelessWidget {
|
|||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData && snapshot.data > 0) {
|
||||
return RichText(
|
||||
text: TextSpan(
|
||||
style: albumTitleTextStyle.copyWith(
|
||||
color:
|
||||
albumTitleTextStyle.color.withOpacity(0.5)),
|
||||
children: [
|
||||
text: TextSpan(
|
||||
style: albumTitleTextStyle.copyWith(
|
||||
color: albumTitleTextStyle.color.withOpacity(0.5),
|
||||
),
|
||||
children: [
|
||||
TextSpan(text: " \u2022 "),
|
||||
TextSpan(text: snapshot.data.toString()),
|
||||
]));
|
||||
],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Container();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue