Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into independent
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 committed Oct 25, 2022
2 parents 446144a + 9782209 commit f54bc18
Show file tree
Hide file tree
Showing 47 changed files with 710 additions and 625 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 32
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -47,7 +47,7 @@ android {
defaultConfig {
applicationId "io.ente.photos"
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
71 changes: 44 additions & 27 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="io.ente.photos">
<application android:name="${applicationName}" android:label="@string/app_name" android:icon="@mipmap/launcher_icon" android:usesCleartextTraffic="true" android:requestLegacyExternalStorage="true" android:allowBackup="false" android:fullBackupContent="false" android:largeHeap="true">

<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
<activity android:name=".MainActivity" android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:exported="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="ente"/>
</intent-filter>

<!--Filter to support sharing images into our app-->
<intent-filter android:label="@string/backup">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*"/>
</intent-filter>

<intent-filter android:label="@string/backup">
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="image/*"/>
</intent-filter>

<intent-filter android:label="@string/backup">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="video/*"/>
</intent-filter>

<intent-filter android:label="@string/backup">
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="video/*"/>
</intent-filter>

</activity>
Expand All @@ -53,24 +58,36 @@
</provider>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data android:name="flutterEmbedding" android:value="2" />
<meta-data android:name="asset_statements" android:resource="@string/asset_statements" />
<meta-data android:name="io.sentry.dsn" android:value="https://[email protected]/4" />
<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />
<meta-data android:name="flutterEmbedding" android:value="2"/>
<meta-data android:name="asset_statements"
android:resource="@string/asset_statements"/>
<meta-data android:name="io.sentry.dsn"
android:value="https://[email protected]/4"/>
<meta-data android:name="firebase_analytics_collection_deactivated"
android:value="true"/>
</application>

<!-- Android 11: https://developer.android.com/preview/privacy/package-visibility -->
<!-- https://developer.android.com/training/package-visibility/use-cases -->
<queries>
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<action android:name="android.intent.action.SENDTO"/>
<data android:scheme="mailto"/>
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
<uses-permission
android:name="android.permission.READ_MEDIA_IMAGES"/> <!-- If you want to read images-->
<uses-permission
android:name="android.permission.READ_MEDIA_VIDEO"/> <!-- If you want to read videos-->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29"
tools:ignore="ScopedStorage"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.android.vending.BILLING"/>
</manifest>
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ SPEC CHECKSUMS:
FirebaseInstallations: 0a115432c4e223c5ab20b0dbbe4cbefa793a0e8e
FirebaseMessaging: 732623518591384f61c287e3d8f65294beb7ffb3
fk_user_agent: 1f47ec39291e8372b1d692b50084b0d54103c545
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
flutter_email_sender: 02d7443217d8c41483223627972bfdc09f74276b
flutter_image_compress: 5a5e9aee05b6553048b8df1c3bc456d0afaac433
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
Expand Down
6 changes: 4 additions & 2 deletions lib/db/device_files_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,10 @@ extension DeviceFiles on FilesDB {
deviceCollections.add(deviceCollection);
}
if (includeCoverThumbnail) {
deviceCollections.sort((a, b) =>
b.thumbnail.creationTime.compareTo(a.thumbnail.creationTime));
deviceCollections.sort(
(a, b) =>
b.thumbnail.creationTime.compareTo(a.thumbnail.creationTime),
);
}
return deviceCollections;
} catch (e) {
Expand Down
6 changes: 6 additions & 0 deletions lib/events/tab_changed_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ enum TabChangedEventSource {
collectionsPage,
backButton,
}

class TabDoubleTapEvent extends Event {
final int selectedIndex;

TabDoubleTapEvent(this.selectedIndex);
}
4 changes: 2 additions & 2 deletions lib/services/remote_sync_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class RemoteSyncService {
// session are not processed now
sync();
} else {
debugPrint("Fire backup completed event");
Bus.instance.fire(SyncStatusUpdate(SyncStatus.completedBackup));
}
} else {
Expand Down Expand Up @@ -259,7 +260,6 @@ class RemoteSyncService {
await _db.getDevicePathIDToLocalIDMap();
bool moreFilesMarkedForBackup = false;
for (final deviceCollection in deviceCollections) {
_logger.fine("processing ${deviceCollection.name}");
final Set<String> localIDsToSync =
pathIdToLocalIDs[deviceCollection.id] ?? {};
if (deviceCollection.uploadStrategy == UploadStrategy.ifMissing) {
Expand Down Expand Up @@ -400,7 +400,7 @@ class RemoteSyncService {
if (collectionByID == null || collectionByID.isDeleted) {
_logger.info(
"Collection $deviceCollectionID either deleted or missing "
"for path ${deviceCollection.name}",
"for path ${deviceCollection.id}",
);
deviceCollectionID = -1;
}
Expand Down
16 changes: 16 additions & 0 deletions lib/theme/text_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ const FontWeight _regularWeight = FontWeight.w500;
const FontWeight _boldWeight = FontWeight.w600;
const String _fontFamily = 'Inter';

const TextStyle brandStyleSmall = TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Montserrat',
fontSize: 21,
);

const TextStyle brandStyleMedium = TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Montserrat',
fontSize: 24,
);
const TextStyle brandStyleLarge = TextStyle(
fontWeight: FontWeight.bold,
fontFamily: 'Montserrat',
fontSize: 28,
);
const TextStyle h1 = TextStyle(
fontSize: 48,
height: 48 / 28,
Expand Down
15 changes: 3 additions & 12 deletions lib/ui/account/verify_recovery_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,14 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
SizedBox(
width: double.infinity,
child: Text(
'Verify recovery key',
'Confirm recovery key',
style: enteTheme.textTheme.h3Bold,
textAlign: TextAlign.left,
),
),
const SizedBox(height: 18),
Text(
"If you forget your password, your recovery key is the "
"only way to recover your photos.\n\nPlease verify that "
"you have safely backed up your 24 word recovery key by re-entering it.",
"Your recovery key is the only way to recover your photos if you forget your password. You can find your recovery key in Settings > Account.\n\nPlease enter your recovery key here to verify that you have saved it correctly.",
style: enteTheme.textTheme.small
.copyWith(color: enteTheme.colorScheme.textMuted),
),
Expand Down Expand Up @@ -187,12 +185,6 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
},
),
const SizedBox(height: 12),
Text(
"If you saved the recovery key from older app versions, you might have a 64 character recovery code instead of 24 words. You can enter that too.",
style: enteTheme.textTheme.mini
.copyWith(color: enteTheme.colorScheme.textMuted),
),
const SizedBox(height: 8),
Expanded(
child: Container(
alignment: Alignment.bottomCenter,
Expand All @@ -204,8 +196,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
children: [
GradientButton(
onTap: _verifyRecoveryKey,
text: "Verify",
iconData: Icons.shield_outlined,
text: "Confirm",
),
const SizedBox(height: 8),
],
Expand Down
49 changes: 0 additions & 49 deletions lib/ui/collections/ente_section_title.dart

This file was deleted.

54 changes: 38 additions & 16 deletions lib/ui/collections/section_title.dart
Original file line number Diff line number Diff line change
@@ -1,35 +1,57 @@
// @dart=2.9

import 'package:flutter/material.dart';
import 'package:photos/theme/ente_theme.dart';
import 'package:photos/theme/text_style.dart';

class SectionTitle extends StatelessWidget {
final String title;
final Alignment alignment;
final double opacity;
final String? title;
final RichText? titleWithBrand;

const SectionTitle(
this.title, {
this.opacity = 0.8,
Key key,
this.alignment = Alignment.centerLeft,
const SectionTitle({
this.title,
this.titleWithBrand,
Key? key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
final enteTextTheme = getEnteTextTheme(context);
Widget child;
if (titleWithBrand != null) {
child = titleWithBrand!;
} else if (title != null) {
child = Text(
title!,
style: enteTextTheme.largeBold,
);
} else {
child = const SizedBox.shrink();
}
return Container(
margin: const EdgeInsets.fromLTRB(16, 12, 0, 0),
child: Column(
children: [
Align(
alignment: alignment,
child: Text(
title,
style:
Theme.of(context).textTheme.headline6.copyWith(fontSize: 22),
),
alignment: Alignment.centerLeft,
child: child,
),
],
),
);
}
}

RichText onEnteSection = RichText(
text: const TextSpan(
children: [
TextSpan(
text: "On ",
style: TextStyle(
fontWeight: FontWeight.w600,
fontFamily: 'Inter',
fontSize: 21,
),
),
TextSpan(text: "ente", style: brandStyleSmall),
],
),
);
Loading

0 comments on commit f54bc18

Please sign in to comment.