Skip to content

Commit

Permalink
GS-0 remove imgly (#2216)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkhoudor authored and github-actions[bot] committed Jul 21, 2023
1 parent 16ba739 commit eac9ad1
Show file tree
Hide file tree
Showing 37 changed files with 23 additions and 567 deletions.
1 change: 0 additions & 1 deletion assets/imgly/README.md

This file was deleted.

Empty file removed assets/imgly/pesdk_license.android
Empty file.
Empty file removed assets/imgly/pesdk_license.ios
Empty file.
Empty file.
Empty file.
24 changes: 0 additions & 24 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ PODS:
- GTMSessionFetcher/Core (2.3.0)
- image_picker_ios (0.0.1):
- Flutter
- imgly_sdk (2.7.1):
- Flutter
- imglyKit (~> 11.3)
- imglyKit (11.5.1)
- libwebp (1.2.4):
- libwebp/demux (= 1.2.4)
- libwebp/mux (= 1.2.4)
Expand All @@ -250,9 +246,6 @@ PODS:
- Flutter
- permission_handler_apple (9.0.4):
- Flutter
- photo_editor_sdk (2.7.1):
- Flutter
- imgly_sdk (= 2.7.1)
- photo_manager (2.0.0):
- Flutter
- FlutterMacOS
Expand Down Expand Up @@ -284,9 +277,6 @@ PODS:
- Flutter
- url_launcher_ios (0.0.1):
- Flutter
- video_editor_sdk (2.7.1):
- Flutter
- imgly_sdk (= 2.7.1)
- video_player_avfoundation (0.0.1):
- Flutter
- video_thumbnail (0.0.1):
Expand Down Expand Up @@ -325,11 +315,9 @@ DEPENDENCIES:
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/ios`)
- GoogleUtilities
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- imgly_sdk (from `.symlinks/plugins/imgly_sdk/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_ios (from `.symlinks/plugins/path_provider_ios/ios`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- photo_editor_sdk (from `.symlinks/plugins/photo_editor_sdk/ios`)
- photo_manager (from `.symlinks/plugins/photo_manager/ios`)
- recaptcha_verification (from `.symlinks/plugins/recaptcha_verification/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
Expand All @@ -339,7 +327,6 @@ DEPENDENCIES:
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_editor_sdk (from `.symlinks/plugins/video_editor_sdk/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`)
- video_thumbnail (from `.symlinks/plugins/video_thumbnail/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
Expand Down Expand Up @@ -368,7 +355,6 @@ SPEC REPOS:
- GoogleUtilities
- GTMAppAuth
- GTMSessionFetcher
- imglyKit
- libwebp
- nanopb
- PromisesObjC
Expand Down Expand Up @@ -428,16 +414,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/google_sign_in_ios/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
imgly_sdk:
:path: ".symlinks/plugins/imgly_sdk/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_ios:
:path: ".symlinks/plugins/path_provider_ios/ios"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
photo_editor_sdk:
:path: ".symlinks/plugins/photo_editor_sdk/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/ios"
recaptcha_verification:
Expand All @@ -456,8 +438,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_editor_sdk:
:path: ".symlinks/plugins/video_editor_sdk/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/ios"
video_thumbnail:
Expand Down Expand Up @@ -514,14 +494,11 @@ SPEC CHECKSUMS:
GTMAppAuth: 0ff230db599948a9ad7470ca667337803b3fc4dd
GTMSessionFetcher: 3a63d75eecd6aa32c2fc79f578064e1214dfdec2
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
imgly_sdk: e80792e7f6cc62a47d621e11c49f35182f8c2354
imglyKit: b1b3b827799a50b090433ca7c61f90b078944898
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
nanopb: b552cce312b6c8484180ef47159bc0f65a1f0431
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_ios: 14f3d2fd28c4fdb42f44e0f751d12861c43cee02
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
photo_editor_sdk: 35ba041a579abed60e0c1c10a249c632e6a544cb
photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604
PromisesObjC: 09985d6d70fbe7878040aa746d78236e6946d2ef
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
Expand All @@ -536,7 +513,6 @@ SPEC CHECKSUMS:
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
video_editor_sdk: 4988b0a0512e19d6f520971be79c0f833ea9b240
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
video_thumbnail: c4e2a3c539e247d4de13cd545344fd2d26ffafd1
wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f
Expand Down
30 changes: 0 additions & 30 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
import UIKit
import Flutter
import ImglyKit
import Firebase

// used by Img.ly to set up icon in the editor to specific size
private extension UIImage {
func icon(pt: CGFloat, alpha: CGFloat = 1) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(CGSize(width: pt, height: pt), false, scale)
let position = CGPoint(x: (pt - size.width) / 2, y: ((pt - size.height) / 2) + 3)
draw(at: position, blendMode: .normal, alpha: alpha)
let newImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()

return newImage
}
}

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
configureEditorIcons()
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

// https://support.img.ly/hc/en-us/articles/7772957651729-Can-I-customize-the-export-button-
func configureEditorIcons() -> Void {
let config = UIImage.SymbolConfiguration(scale: .large)

IMGLY.bundleImageBlock = { imageName in
switch imageName {
case "imgly_icon_save":
return UIImage(systemName: "paperplane.fill", withConfiguration: config)?.icon(pt: 44, alpha: 0.6)

default:
return nil
}
}
}

// This is a hacky fix to overcome an issue with Firebase auth. Currently, our Notification Extension
// that handles images in notification is somehow disabling handling push notifications by Firebase Auth. to
// overcome this issue, we manually forward notification to Firebase Auth.
Expand Down
81 changes: 0 additions & 81 deletions lib/core/data/imgly_initializer.dart

This file was deleted.

8 changes: 0 additions & 8 deletions lib/core/data/imgly_wrapper.dart

This file was deleted.

4 changes: 0 additions & 4 deletions lib/dependency_injection/app_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ import 'package:picnic_app/core/data/hive/hive_client_primitive_factory.dart';
import 'package:picnic_app/core/data/hive/hive_initializer.dart';
import 'package:picnic_app/core/data/hive/hive_path_provider.dart';
import 'package:picnic_app/core/data/hive_local_storage_repository.dart';
import 'package:picnic_app/core/data/imgly_initializer.dart';
import 'package:picnic_app/core/data/imgly_wrapper.dart';
import 'package:picnic_app/core/data/impl_deep_links_repository.dart';
import 'package:picnic_app/core/data/impl_session_expired_repository.dart';
import 'package:picnic_app/core/data/local_user_preferences_repository.dart';
Expand Down Expand Up @@ -356,7 +354,6 @@ void _configureGeneralDependencies(
..registerFactory(() => GraphQLLogger(getIt()))
..registerFactory(() => const GraphQLFailureMapper())
..registerFactory(() => GraphQLVariablesProcessor())
..registerFactory(() => ImglyWrapper())
..registerFactory(() => AssetsLoader())
..registerFactory(
() {
Expand Down Expand Up @@ -391,7 +388,6 @@ void _configureGeneralDependencies(
() => [
AppTrackingTransparencyInitializer(),
HiveInitializer(),
ImglyInitializer(getIt(), getIt()),
PhotoManagerInitializer(getIt()),
FirebaseDynamicLinksInitializer(getIt()),
UniversalLinksInitializer(),
Expand Down
4 changes: 1 addition & 3 deletions lib/features/circles/edit_circle/edit_circle_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'package:picnic_app/navigation/close_route.dart';
import 'package:picnic_app/navigation/close_with_result_route.dart';
import 'package:picnic_app/navigation/confirmation_bottom_sheet_route.dart';
import 'package:picnic_app/navigation/error_bottom_sheet_route.dart';
import 'package:picnic_app/navigation/image_editor_route.dart';
import 'package:picnic_app/ui/widgets/confirmation_bottom_sheet.dart';
import 'package:picnic_app/ui/widgets/picnic_bottom_sheet.dart';

Expand All @@ -25,8 +24,7 @@ class EditCircleNavigator
CloseRoute,
DiscardCircleInfoChangesRoute,
ChangeCircleAvatarRoute,
ImagePickerRoute,
ImageEditorRoute {
ImagePickerRoute {
EditCircleNavigator(this.appNavigator);

@override
Expand Down
14 changes: 2 additions & 12 deletions lib/features/circles/edit_circle/edit_circle_presenter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,15 @@ class EditCirclePresenter extends Cubit<EditCircleViewModel> {
if (image == null) {
return;
}
final imagePath = await navigator.showImageEditor(filePath: image.path, forceCrop: true);
if (imagePath == null) {
return;
}
tryEmit(_model.byUpdatingImage(imagePath));
tryEmit(_model.byUpdatingImage(image.path));
}

Future<void> onTapCoverEdit() async {
final cover = await navigator.openImagePicker(const ImagePickerInitialParams());
if (cover == null) {
return;
}
final coverPath = await navigator.showImageEditor(
filePath: cover.path,
);
if (coverPath == null) {
return;
}
tryEmit(_model.byUpdatingCover(coverPath));
tryEmit(_model.byUpdatingCover(cover.path));
}

Future<void> onTapUploadEmoji() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:picnic_app/features/seeds/about_elections/about_elections_naviga
import 'package:picnic_app/localization/app_localizations_utils.dart';
import 'package:picnic_app/navigation/app_navigator.dart';
import 'package:picnic_app/navigation/error_bottom_sheet_route.dart';
import 'package:picnic_app/navigation/image_editor_route.dart';
import 'package:picnic_app/ui/widgets/picnic_bottom_sheet.dart';
import 'package:picnic_app/ui/widgets/two_options_bottom_sheet.dart';

Expand All @@ -29,7 +28,6 @@ class CreateCircleNavigator
CircleCreationSuccessRoute,
ChangeCircleAvatarRoute,
ImagePickerRoute,
ImageEditorRoute,
AboutElectionsRoute,
CircleConfigRoute {
CreateCircleNavigator(this.appNavigator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@ class CreateCirclePresenter extends Cubit<CreateCircleViewModel> {
if (cover == null) {
return;
}
final coverPath = await navigator.showImageEditor(
filePath: cover.path,
);
if (coverPath == null) {
return;
}
tryEmit(
_model.byUpdatingForm(
(form) => form.copyWith(
coverImage: coverPath,
coverImage: cover.path,
userSelectedNewCover: true,
),
),
Expand All @@ -62,15 +56,11 @@ class CreateCirclePresenter extends Cubit<CreateCircleViewModel> {
if (image == null) {
return;
}
final imagePath = await navigator.showImageEditor(filePath: image.path, forceCrop: true);
if (imagePath == null) {
return;
}

tryEmit(
_model.byUpdatingForm(
(form) => form.copyWith(
image: imagePath,
image: image.path,
emoji: '',
userSelectedNewImage: true,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ import 'package:picnic_app/navigation/app_navigator.dart';
import 'package:picnic_app/navigation/close_route.dart';
import 'package:picnic_app/navigation/close_with_result_route.dart';
import 'package:picnic_app/navigation/error_bottom_sheet_route.dart';
import 'package:picnic_app/navigation/image_editor_route.dart';

//ignore_for_file: unused-code, unused-files
class CreateSliceNavigator
with
AvatarSelectionRoute,
ErrorBottomSheetRoute,
ImagePickerRoute,
ImageEditorRoute,
CloseRoute,
SliceDetailsRoute,
CloseWithResultRoute<bool> {
Expand Down
Loading

0 comments on commit eac9ad1

Please sign in to comment.