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