Repository: vauvenal5/yaga
Branch: master
Commit: 0ac666be88c9
Files: 349
Total size: 496.8 KB
Directory structure:
gitextract_rmnzmdnm/
├── .fvm/
│ └── fvm_config.json
├── .github/
│ └── workflows/
│ ├── build-android.yml
│ └── publish-play-store.yml
├── .gitignore
├── .metadata
├── .vscode/
│ └── launch.json
├── Gemfile
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android/
│ ├── .gitignore
│ ├── app/
│ │ ├── build.gradle
│ │ └── src/
│ │ ├── debug/
│ │ │ └── AndroidManifest.xml
│ │ ├── dev/
│ │ │ └── res/
│ │ │ └── drawable/
│ │ │ └── ic_launcher_background.xml
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin/
│ │ │ │ └── com/
│ │ │ │ └── github/
│ │ │ │ └── vauvenal5/
│ │ │ │ └── yaga/
│ │ │ │ └── MainActivity.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── ic_launcher_foreground.xml
│ │ │ │ └── launch_background.xml
│ │ │ ├── drawable-anydpi-v24/
│ │ │ │ └── ic_bg_service_small.xml
│ │ │ ├── drawable-v21/
│ │ │ │ └── launch_background.xml
│ │ │ ├── mipmap-anydpi-v26/
│ │ │ │ └── ic_launcher.xml
│ │ │ ├── values/
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── values-night/
│ │ │ │ └── styles.xml
│ │ │ └── xml/
│ │ │ └── file_paths_yaga.xml
│ │ └── profile/
│ │ └── AndroidManifest.xml
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ └── gradle-wrapper.properties
│ ├── gradle.properties
│ ├── settings.gradle
│ └── settings_aar.gradle
├── assets/
│ ├── icon/
│ │ └── readme.md
│ └── news.md
├── build.yaml
├── fastlane/
│ ├── Appfile
│ ├── Fastfile
│ └── metadata/
│ └── android/
│ └── en-US/
│ ├── changelogs/
│ │ ├── 134.txt
│ │ ├── 140.txt
│ │ ├── 141.txt
│ │ ├── 142.txt
│ │ ├── 143.txt
│ │ ├── 144.txt
│ │ ├── 145.txt
│ │ ├── 146.txt
│ │ ├── 147.txt
│ │ ├── 150.txt
│ │ ├── 151.txt
│ │ ├── 1510.txt
│ │ ├── 1511.txt
│ │ ├── 152.txt
│ │ ├── 153.txt
│ │ ├── 154.txt
│ │ ├── 155.txt
│ │ ├── 156.txt
│ │ ├── 157.txt
│ │ ├── 158.txt
│ │ ├── 159.txt
│ │ ├── 1600.txt
│ │ ├── 1601.txt
│ │ ├── 1602.txt
│ │ ├── 1603.txt
│ │ ├── 1700.txt
│ │ ├── 1701.txt
│ │ ├── 1702.txt
│ │ ├── 1703.txt
│ │ ├── 1704.txt
│ │ ├── 1705.txt
│ │ ├── 1800.txt
│ │ ├── 1801.txt
│ │ ├── 1802.txt
│ │ ├── 1900.txt
│ │ ├── 1901.txt
│ │ ├── 2000.txt
│ │ ├── 2001.txt
│ │ ├── 2002.txt
│ │ ├── 2003.txt
│ │ ├── 2100.txt
│ │ ├── 2101.txt
│ │ ├── 2102.txt
│ │ ├── 2103.txt
│ │ ├── 2104.txt
│ │ ├── 2105.txt
│ │ ├── 2200.txt
│ │ ├── 2201.txt
│ │ ├── 2202.txt
│ │ ├── 2203.txt
│ │ ├── 2204.txt
│ │ ├── 2205.txt
│ │ ├── 2206.txt
│ │ ├── 2207.txt
│ │ ├── 2208.txt
│ │ ├── 2300.txt
│ │ ├── 2301.txt
│ │ ├── 2302.txt
│ │ ├── 2303.txt
│ │ ├── 2304.txt
│ │ ├── 2305.txt
│ │ ├── 2306.txt
│ │ ├── 2307.txt
│ │ ├── 2308.txt
│ │ ├── 2309.txt
│ │ ├── 2310.txt
│ │ ├── 2311.txt
│ │ ├── 2312.txt
│ │ ├── 2400.txt
│ │ ├── 2500.txt
│ │ ├── 2501.txt
│ │ ├── 2502.txt
│ │ ├── 2503.txt
│ │ ├── 2600.txt
│ │ ├── 2601.txt
│ │ ├── 2700.txt
│ │ ├── 2701.txt
│ │ ├── 2800.txt
│ │ ├── 2801.txt
│ │ ├── 2802.txt
│ │ ├── 2803.txt
│ │ ├── 2804.txt
│ │ ├── 2805.txt
│ │ ├── 2900.txt
│ │ ├── 2901.txt
│ │ ├── 2902.txt
│ │ ├── 3000.txt
│ │ ├── 3001.txt
│ │ ├── 3002.txt
│ │ ├── 3003.txt
│ │ ├── 4000.txt
│ │ ├── 4001.txt
│ │ ├── 4002.txt
│ │ ├── 4003.txt
│ │ ├── 4004.txt
│ │ ├── 4005.txt
│ │ ├── 4100.txt
│ │ ├── 4200.txt
│ │ ├── 4201.txt
│ │ ├── 4300.txt
│ │ └── 4301.txt
│ ├── full_description.txt
│ ├── short_description.txt
│ └── title.txt
├── ios/
│ ├── .gitignore
│ ├── Flutter/
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Runner/
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets/
│ │ │ ├── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ └── LaunchImage.imageset/
│ │ │ ├── Contents.json
│ │ │ └── README.md
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── Runner-Bridging-Header.h
│ ├── Runner.xcodeproj/
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace/
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── xcschemes/
│ │ └── Runner.xcscheme
│ └── Runner.xcworkspace/
│ └── contents.xcworkspacedata
├── lib/
│ ├── main.dart
│ ├── managers/
│ │ ├── file_manager/
│ │ │ ├── file_manager.dart
│ │ │ ├── file_manager_base.dart
│ │ │ └── isolateable/
│ │ │ ├── file_action_manager.dart
│ │ │ └── isolated_file_manager.dart
│ │ ├── file_service_manager/
│ │ │ ├── favorite_not_supported_mixin.dart
│ │ │ ├── file_service_manager.dart
│ │ │ ├── isolateable/
│ │ │ │ ├── local_file_manager.dart
│ │ │ │ ├── nextcloud_background_file_manager.dart
│ │ │ │ └── nextcloud_file_manger.dart
│ │ │ └── media_file_manager.dart
│ │ ├── global_settings_manager.dart
│ │ ├── isolateable/
│ │ │ ├── isolated_global_settings_manager.dart
│ │ │ ├── isolated_settings_manager.dart
│ │ │ ├── mapping_manager.dart
│ │ │ ├── sort_manager.dart
│ │ │ └── sync_manager.dart
│ │ ├── navigation_manager.dart
│ │ ├── nextcloud_manager.dart
│ │ ├── settings_manager.dart
│ │ ├── settings_manager_base.dart
│ │ ├── tab_manager.dart
│ │ └── widget_local/
│ │ └── file_list_local_manager.dart
│ ├── model/
│ │ ├── category_view_config.dart
│ │ ├── fetched_file.dart
│ │ ├── general_view_config.dart
│ │ ├── local_file.dart
│ │ ├── mapping_node.dart
│ │ ├── nc_file.dart
│ │ ├── nc_login_data.dart
│ │ ├── nc_origin.dart
│ │ ├── preferences/
│ │ │ ├── action_preference.dart
│ │ │ ├── bool_preference.dart
│ │ │ ├── choice_preference.dart
│ │ │ ├── complex_preference.dart
│ │ │ ├── int_preference.dart
│ │ │ ├── mapping_preference.dart
│ │ │ ├── preference.dart
│ │ │ ├── section_preference.dart
│ │ │ ├── serializable_preference.dart
│ │ │ ├── serializers/
│ │ │ │ ├── base_type_serializer.dart
│ │ │ │ ├── int_serializer.dart
│ │ │ │ └── uri_serializer.dart
│ │ │ ├── string_list_preference.dart
│ │ │ ├── string_preference.dart
│ │ │ ├── uri_preference.dart
│ │ │ └── value_preference.dart
│ │ ├── preview_fetch_meta.dart
│ │ ├── route_args/
│ │ │ ├── choice_selector_screen_arguments.dart
│ │ │ ├── directory_navigation_screen_arguments.dart
│ │ │ ├── focus_view_arguments.dart
│ │ │ ├── image_screen_arguments.dart
│ │ │ ├── navigatable_screen_arguments.dart
│ │ │ ├── path_selector_screen_arguments.dart
│ │ │ └── settings_screen_arguments.dart
│ │ ├── sort_config.dart
│ │ ├── sorted_category_list.dart
│ │ ├── sorted_file_folder_list.dart
│ │ ├── sorted_file_list.dart
│ │ ├── sync_file.dart
│ │ └── system_location.dart
│ ├── services/
│ │ ├── file_provider_service.dart
│ │ ├── intent_service.dart
│ │ ├── isolateable/
│ │ │ ├── local_file_service.dart
│ │ │ ├── nextcloud_service.dart
│ │ │ └── system_location_service.dart
│ │ ├── media_file_service.dart
│ │ ├── name_exchange_service.dart
│ │ ├── secure_storage_service.dart
│ │ ├── service.dart
│ │ ├── shared_preferences_service.dart
│ │ └── uri_name_resolver.dart
│ ├── utils/
│ │ ├── background_worker/
│ │ │ ├── background_channel.dart
│ │ │ ├── background_commands.dart
│ │ │ ├── background_worker.dart
│ │ │ ├── json_convertable.dart
│ │ │ ├── messages/
│ │ │ │ ├── background_downloaded_request.dart
│ │ │ │ └── background_init_msg.dart
│ │ │ └── work_tracker.dart
│ │ ├── download_file_image.dart
│ │ ├── forground_worker/
│ │ │ ├── bridges/
│ │ │ │ ├── file_manager_bridge.dart
│ │ │ │ ├── nextcloud_manager_bridge.dart
│ │ │ │ └── settings_manager_bridge.dart
│ │ │ ├── foreground_worker.dart
│ │ │ ├── handlers/
│ │ │ │ ├── file_list_request_handler.dart
│ │ │ │ ├── nextcloud_file_manager_handler.dart
│ │ │ │ └── user_handler.dart
│ │ │ ├── isolate_handler_regestry.dart
│ │ │ ├── isolate_msg_handler.dart
│ │ │ ├── isolateable.dart
│ │ │ └── messages/
│ │ │ ├── download_file_request.dart
│ │ │ ├── download_preview_complete.dart
│ │ │ ├── download_preview_request.dart
│ │ │ ├── file_list_done.dart
│ │ │ ├── file_list_message.dart
│ │ │ ├── file_list_request.dart
│ │ │ ├── file_list_response.dart
│ │ │ ├── file_update_msg.dart
│ │ │ ├── files_action/
│ │ │ │ ├── delete_files_request.dart
│ │ │ │ ├── destination_action_files_request.dart
│ │ │ │ ├── favorite_files_request.dart
│ │ │ │ ├── files_action_done.dart
│ │ │ │ └── files_action_request.dart
│ │ │ ├── flush_logs_message.dart
│ │ │ ├── image_update_msg.dart
│ │ │ ├── init_msg.dart
│ │ │ ├── login_state_msg.dart
│ │ │ ├── merge_sort_done.dart
│ │ │ ├── merge_sort_request.dart
│ │ │ ├── message.dart
│ │ │ ├── preference_msg.dart
│ │ │ ├── single_file_message.dart
│ │ │ └── sort_request.dart
│ │ ├── log_error_file_handler.dart
│ │ ├── logger.dart
│ │ ├── navigation/
│ │ │ ├── yaga_route_information_parser.dart
│ │ │ ├── yaga_router.dart
│ │ │ └── yaga_router_delegate.dart
│ │ ├── ncfile_stream_extensions.dart
│ │ ├── nextcloud_client_factory.dart
│ │ ├── nextcloud_colors.dart
│ │ ├── self_signed_cert_handler.dart
│ │ ├── service_locator.dart
│ │ └── uri_utils.dart
│ └── views/
│ ├── screens/
│ │ ├── browse_view.dart
│ │ ├── category_view_screen.dart
│ │ ├── choice_selector_screen.dart
│ │ ├── directory_screen.dart
│ │ ├── directory_traversal_screen.dart
│ │ ├── favorites_view.dart
│ │ ├── focus_view.dart
│ │ ├── home_view.dart
│ │ ├── image_screen.dart
│ │ ├── nc_address_screen.dart
│ │ ├── nc_login_screen.dart
│ │ ├── path_selector_screen.dart
│ │ ├── settings_screen.dart
│ │ ├── splash_screen.dart
│ │ └── yaga_home_screen.dart
│ └── widgets/
│ ├── action_danger_dialog.dart
│ ├── address_form_advanced.dart
│ ├── address_form_simple.dart
│ ├── avatar_widget.dart
│ ├── circle_avatar_icon.dart
│ ├── favorite_icon.dart
│ ├── folder_icon.dart
│ ├── image_search.dart
│ ├── image_view_container.dart
│ ├── image_views/
│ │ ├── category_view.dart
│ │ ├── category_view_exp.dart
│ │ ├── nc_grid_view.dart
│ │ ├── nc_list_view.dart
│ │ └── utils/
│ │ ├── grid_delegate.dart
│ │ └── view_configuration.dart
│ ├── list_menu_entry.dart
│ ├── path_widget.dart
│ ├── preferences/
│ │ ├── action_preference_widget.dart
│ │ ├── bool_preference_widget.dart
│ │ ├── choice_preference_widget.dart
│ │ ├── int_preference_widget.dart
│ │ ├── mapping_preference_widget.dart
│ │ ├── preference_list_tile_widget.dart
│ │ ├── section_preference_widget.dart
│ │ ├── string_preference_widget.dart
│ │ └── uri_preference_widget.dart
│ ├── remote_folder_widget.dart
│ ├── remote_image_widget.dart
│ ├── search_icon_button.dart
│ ├── select_cancel_bottom_navigation.dart
│ ├── selection_action_cancel_dialog.dart
│ ├── selection_app_bar.dart
│ ├── selection_popup_menu_button.dart
│ ├── selection_select_all.dart
│ ├── selection_title.dart
│ ├── selection_will_pop_scope.dart
│ ├── yaga_about_dialog.dart
│ ├── yaga_bottom_nav_bar.dart
│ ├── yaga_drawer.dart
│ └── yaga_popup_menu_button.dart
├── linux/
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter/
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
├── pubspec.yaml
└── test/
├── managers/
│ └── isolateable/
│ └── mapping_manager_test.dart
├── utils/
│ └── uri_utils_test.dart
└── widget_test.dart
================================================
FILE CONTENTS
================================================
================================================
FILE: .fvm/fvm_config.json
================================================
{
"flutterSdkVersion": "3.16.3",
"flavors": {}
}
================================================
FILE: .github/workflows/build-android.yml
================================================
name: Build Android
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Android Keystore
id: android_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'yaga.jks'
encodedString: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
- name: Create key.properties
run: |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties
echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.3'
channel: 'stable'
cache: false
- run: flutter pub get
- run: flutter pub run build_runner build --delete-conflicting-outputs
- run: flutter build appbundle --flavor play
- uses: actions/upload-artifact@v3
with:
name: app-play-release.aab
path: ./build/app/outputs/bundle/playRelease/app-play-release.aab
- name: Convert aab to apk
id: convert_aab
uses: mukeshsolanki/bundletool-action@v1.0.2
with:
aabFile: ./build/app/outputs/bundle/playRelease/app-play-release.aab
base64Keystore: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
keystorePassword: ${{ secrets.STORE_PASSWORD }}
keystoreAlias: ${{ secrets.KEY_ALIAS }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
bundletoolVersion: '1.15.6'
- uses: actions/upload-artifact@v3
with:
name: app-play-release.apk
path: ${{ steps.convert_aab.outputs.apkPath }}
internal:
needs: build
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'internal'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
alpha:
needs: internal
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'alpha'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
github:
needs: internal
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'github'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
beta:
needs: alpha
uses: vauvenal5/yaga/.github/workflows/publish-play-store.yml@master
with:
stage: 'beta'
secrets:
googlePlayJsonBase64: ${{ secrets.GOOGLE_PLAY_JSON_BASE64 }}
================================================
FILE: .github/workflows/publish-play-store.yml
================================================
name: Publish to Play Store
on:
workflow_call:
inputs:
stage:
required: true
type: string
secrets:
googlePlayJsonBase64:
required: true
jobs:
publish:
environment: ${{ inputs.stage }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
if: ${{ inputs.stage == 'internal' || inputs.stage == 'github'}}
with:
name: app-play-release.aab
path: ./build/app/outputs/bundle/playRelease
- uses: actions/download-artifact@v3
if: ${{ inputs.stage == 'github' }}
with:
name: app-play-release.apk
path: ./build/app/outputs/flutter-apk
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Create Android Keystore
id: android_keystore
uses: timheuer/base64-to-file@v1.2
with:
fileName: 'google-play.json'
fileDir: './android/'
encodedString: ${{ secrets.googlePlayJsonBase64 }}
- run: cd fastlane
- run: bundle exec fastlane ${{ inputs.stage }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .gitignore
================================================
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
docker
docker/.dev
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
android/key.properties
fastlane/README.md
fastlane/report.xml
android/google-play.json
**/*.g.dart
.env
# Generated by flutter_launcher_icons package
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
.fvm/flutter_sdk
/yaga.jks
/yaga.jks.base64
================================================
FILE: .metadata
================================================
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: "b0366e0a3f089e15fd89c97604ab402fe26b724c"
channel: "stable"
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
- platform: linux
create_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
base_revision: b0366e0a3f089e15fd89c97604ab402fe26b724c
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
================================================
FILE: .vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"args": [
"--flavor",
"play"
],
"type": "dart"
},
{
"name": "Flutter Profile",
"request": "launch",
"args": [
"--flavor",
"play"
],
"type": "dart",
"flutterMode": "profile"
}
]
}
================================================
FILE: Gemfile
================================================
source "https://rubygems.org"
gem "fastlane"
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: README.md
================================================
# Nextcloud Yaga - Yet Another Gallery App
## Table of Contents
* [State of Yaga](#state-of-yaga)
* [Features](#features)
* [Next Steps](#next-steps)
* [Getting Started](#getting-started)
* [Recomendations](#recomendations)
* [iOS Support](#ios-support)
* [Necessary work](#necessary-work)
## State of Yaga
This app is in an open beta stage. It is tested and fairly stable on an Android One device with Android version 10. You can download it from Google Play. For more information on how to use the app [read the docs](https://vauvenal5.github.io/yaga-docs/).
[
](https://play.google.com/store/apps/details?id=com.github.vauvenal5.yaga)
[
](https://f-droid.org/packages/com.github.vauvenal5.yaga)
### Features
- Nextcloud login flow is implemented
- Flutter WebView is used and some strange behavior can come from bugs in there. Usually retrying fixes the issue.
- Login token is being persisted with the `flutter_secure_storage` plugin.
- Category view
- Displays images in groups sorted by date modified, as list, or as simple grid.
- Path to display can be set in the view settings.
- Path can be local or remote.
- Browse view
- Allows for browsing local and remote directories.
- Has a focus mode implemented which allows to view current folder like in Category view without changing settings.
- Image view
- Opening an image from the category or browse view will result in a image view, displaying the image.
- If opened from category view, displayed images are currently limited to the choosen date.
- If opened from browser view, displayed images are limited to the current folder.
- Images can be shared with other apps from this view.
- Root Mapping
- Allows to set directory mappings between local and remote directories. Basically allowing you to chose where to store your downloaded images or a subset of them.
- Default mapping points to app folder.
- Currently limited to one mapping.
- Previews are always mapped to cache.
### Next Steps
My current plan is to release a stable `v1.0.0` version around christmas this year. For this release I am aming to complete all features that are required for the app to feel like a complete gallery app with respect to the provided functionality.
You can track planned features, current issues as well as what is sceduled for `v1.0.0` in the [issues](https://github.com/vauvenal5/yaga/issues) section.
## Building from Sources
- Generate your own keystore as described in the flutter docs.
- The project uses generation for some classes so you have to first run `flutter pub run build_runner build --delete-conflicting-outputs`
- From the main directory then run: `flutter build apk --flavor play`
- Copy the app to your device and make a local installation.
## Recomendations
It is highly recommended to configure the image preview generator plugin on your Nextcloud server. This will significantly improve fetching times of previews.
## APK Signature
If you decide to download the APK file attached to a Github release, you can verify the APK signature in the following way:
```
apksigner verify --print-certs app-play-release.apk
```
The output should look like this:
```
Signer #1 certificate DN: CN=vauvenal5, OU=Unknown, O=Unknown, L=Unknown, ST=Unknown, C=Unknown
Signer #1 certificate SHA-256 digest: dd1652817e4ed5cbd341336add61a10851fd93b2b79c93124ec9d584fdc54b06
Signer #1 certificate SHA-1 digest: 1c54e02710c9ef669c0e75950e25825a5a11a349
Signer #1 certificate MD5 digest: 7f8367b3ebbc8618b1dc0dff81e225b9
```
## iOS Support
I am physically unable to support iOS. I simply do not own the hardware and I also do not intend buying it. If Apple changes its policies about development SDKs I will gladly add iOS support.
If somebody is willing to contribute the necessary steps for iOS support fell free to open a PR.
### Necessary work
- It will be necessary to recheck the used libraries to see if they support iOS. (This I might do at some point in the future.)
- Some things rely on Android only implementations, for example the storage paths. They need to be changed to a OS independent implementation. (This I might do at some point in the future.)
- Necessary build configuration in the iOS project files. (Not going to happen for the time being.)
- Publishing in the app store. (Not going to happen for the time being.)
================================================
FILE: analysis_options.yaml
================================================
include: package:lint/analysis_options.yaml
linter:
rules:
sort_pub_dependencies: false
================================================
FILE: android/.gitignore
================================================
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
/google-play.json.base64
================================================
FILE: android/app/build.gradle
================================================
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 34
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.github.vauvenal5.yaga"
minSdkVersion 24
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
flavorDimensions "deploy"
productFlavors {
dev {
dimension "deploy"
applicationIdSuffix '.dev'
versionNameSuffix "-dev"
resValue "string", "app_name", "Yaga Dev"
}
play {
dimension "deploy"
resValue "string", "app_name", "Yaga"
}
// fdroid {
// dimension "deploy"
// resValue "string", "app_name", "Yaga"
// signingConfig null
// }
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
================================================
FILE: android/app/src/debug/AndroidManifest.xml
================================================
================================================
FILE: android/app/src/dev/res/drawable/ic_launcher_background.xml
================================================
================================================
FILE: android/app/src/main/AndroidManifest.xml
================================================
================================================
FILE: android/app/src/main/kotlin/com/github/vauvenal5/yaga/MainActivity.kt
================================================
package com.github.vauvenal5.yaga
import android.content.Intent
import android.net.Uri
import android.util.Log
import android.widget.Toast
import androidx.annotation.NonNull
import androidx.core.content.FileProvider
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugins.GeneratedPluginRegistrant
import java.io.File
import java.lang.IllegalArgumentException
class MainActivity: FlutterActivity() {
private val INTENT_CHANNEL = "yaga.channel.intent";
private val GET_INTENT_ACTION_METHOD = "getIntentAction";
private val GET_INTENT_TYPE_METHOD = "getIntentType";
private val GET_INTENT_SET_RESULT = "setSelectedFile";
private val ATTACH_DATA = "attachData";
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
val intent = getIntent();
//todo: check if granted
//todo: check if Android verison is high enough
// Intent(Settings.ACTION_REQUEST_MANAGE_MEDIA).apply {
// data = Uri.parse("package:$packageName")
// try {
// startActivityForResult(this, 303)
// } catch (e: Exception) {
// }
// }
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, INTENT_CHANNEL).setMethodCallHandler {
call, result ->
if(call.method.contentEquals(GET_INTENT_ACTION_METHOD)) {
result.success(intent.getAction());
} else if (call.method.contentEquals(GET_INTENT_TYPE_METHOD)) {
result.success(intent.getType());
} else if (call.method.contentEquals(GET_INTENT_SET_RESULT)) {
handleShareSelectedImageIntent(call, result)
} else if (call.method.contentEquals(ATTACH_DATA)) {
attachData(call, result)
} else {
result.notImplemented()
}
}
}
private fun attachData(call: MethodCall, resultChannel: MethodChannel.Result) {
val resultIntent = prepIntent(call, resultChannel)
resultIntent.setAction(Intent.ACTION_ATTACH_DATA)
this.startActivity(Intent.createChooser(resultIntent, "Use picture as..."))
resultChannel.success(null)
}
private fun handleShareSelectedImageIntent(call: MethodCall, resultChannel: MethodChannel.Result) {
val resultIntent = prepIntent(call, resultChannel)
setResult(RESULT_OK, resultIntent)
resultChannel.success(true)
finish()
}
private fun prepIntent(call: MethodCall, resultChannel: MethodChannel.Result): Intent {
val resultIntent = Intent();
val path = call.argument("path");
val mime = call.argument("mime");
if(path == null || mime == null) {
shareSelectedImageFailed(resultIntent, resultChannel)
}
val fileUri: Uri? = try {
FileProvider.getUriForFile(
this,
this.packageName + ".fileprovider",
File(path!!)
)
} catch (e: IllegalArgumentException) {
Log.e("File Provider", "Could not retrieve content url for file.", e)
null
}
if(fileUri == null) {
shareSelectedImageFailed(resultIntent, resultChannel)
}
resultIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
resultIntent.setDataAndType(fileUri, mime)
return resultIntent;
}
private fun shareSelectedImageFailed(resultIntent: Intent, resultChannel: MethodChannel.Result) {
Toast.makeText(activity, "Failed to share image.", Toast.LENGTH_SHORT).show()
resultIntent.setDataAndType(null, "")
setResult(RESULT_CANCELED, resultIntent)
resultChannel.success(false)
finish()
}
//todo: this code might solve the copy issue
// private fun addItem(name: String, filePath: String, mime: String): Uri {
// val collection = if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
//// MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY)
// MediaStore.Images.Media.getContentUri(MediaStore.VOLUME_INTERNAL)
// } else {
// MediaStore.Images.Media.EXTERNAL_CONTENT_URI
// }
//
// var relativePath = filePath.split("/0/").last()
// relativePath = relativePath.substring(0, relativePath.length - name.length - 1)
// Log.i("MediaStore", relativePath);
//
// val values = ContentValues().apply {
// put(MediaStore.Images.Media.DISPLAY_NAME, name)
// put(MediaStore.Images.Media.MIME_TYPE, mime)
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
//// put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_PICTURES + File.separator + "Yaga")
// put(MediaStore.MediaColumns.RELATIVE_PATH, relativePath)
// put(MediaStore.Images.Media.IS_PENDING, 1)
// }
// }
//
// val resolver = applicationContext.contentResolver
// val uri = resolver.insert(collection, values)!!
//
// try {
//// resolver.openOutputStream(uri).use { os ->
//// File(filePath).inputStream().use { it.copyTo(os!!) }
//// }
//
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// values.clear()
// values.put(MediaStore.Images.Media.IS_PENDING, 0)
// resolver.update(uri, values, null, null)
// }
// } catch (ex: IOException) {
// Log.e("MediaStore", ex.message, ex)
// }
//
// return uri;
// }
}
================================================
FILE: android/app/src/main/res/drawable/ic_launcher_background.xml
================================================
================================================
FILE: android/app/src/main/res/drawable/ic_launcher_foreground.xml
================================================
================================================
FILE: android/app/src/main/res/drawable/launch_background.xml
================================================
================================================
FILE: android/app/src/main/res/drawable-anydpi-v24/ic_bg_service_small.xml
================================================
================================================
FILE: android/app/src/main/res/drawable-v21/launch_background.xml
================================================
================================================
FILE: android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
================================================
FILE: android/app/src/main/res/values/colors.xml
================================================
#0082c9
================================================
FILE: android/app/src/main/res/values/styles.xml
================================================
================================================
FILE: android/app/src/main/res/values-night/styles.xml
================================================
================================================
FILE: android/app/src/main/res/xml/file_paths_yaga.xml
================================================
================================================
FILE: android/app/src/profile/AndroidManifest.xml
================================================
================================================
FILE: android/build.gradle
================================================
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
================================================
FILE: android/gradle/wrapper/gradle-wrapper.properties
================================================
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
================================================
FILE: android/gradle.properties
================================================
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
================================================
FILE: android/settings.gradle
================================================
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
================================================
FILE: android/settings_aar.gradle
================================================
include ':app'
================================================
FILE: assets/icon/readme.md
================================================
# Android Icons
The SVG files found in this directory are the lead files for the app icons.
For API 26+ changes to the SVGs have to be manually propagated to the respective VectorDrawables in `../android/app/src/main/resources/drawable`.
For APIs smaller then 26 a `icon.png` has to be created from `icon.svg`. Then run the following command to generate the required icons.
```sh
flutter pub run flutter_launcher_icons:main -f pubspec.yaml
```
================================================
FILE: assets/news.md
================================================
## What's New
**Breaking Changes:** Started with refactoring for Android 11+ support.
This has major impact on the app, please consider raising any issues you discover on Github.
Refer to the docs for more information.
**FDroid release will not be updated for the time being if you need any of the removed features and are still on Android 10 (API Level 29) or lower consider installing from there.**
## Changelog
- targeting Android 12 (API Level 31)
- refactoring to MediaStore API for local file access
- root mapping deprecated: will be refactored in future when full MediaStore API support is implemented
- automatically resetting root mapping to revert back to default app directory
- local move/copy are currently not supported
- local delete is supported but requires user confirmation
- on Android 12 (API 31+) you can assign MANAGE_MEDIA rights to the app to avoid delete confirmation dialog
- SD card support is broken
- file provider for other apps is fixed
- about app dialog was updated to support news
================================================
FILE: build.yaml
================================================
targets:
$default:
auto_apply_builders: true
builders:
"built_value_generator:built_value":
enabled: true
generate_for:
- lib/model/preferences/*.dart
================================================
FILE: fastlane/Appfile
================================================
json_key_file("./android/google-play.json") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("com.github.vauvenal5.yaga") # e.g. com.krausefx.app
================================================
FILE: fastlane/Fastfile
================================================
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:android)
platform :android do
lane :internal do
# Dir.chdir("..") do
# sh("flutter build appbundle --flavor play")
# end
upload_to_play_store(
track: 'internal',
aab: './build/app/outputs/bundle/playRelease/app-play-release.aab',
skip_upload_apk: 'true',
skip_upload_metadata: 'true',
skip_upload_images: 'true',
skip_upload_screenshots: 'true',
)
end
lane :alpha do
upload_to_play_store(
track: 'internal',
track_promote_to: 'alpha',
version_code: get_code(),
skip_upload_aab: 'true',
skip_upload_apk: 'true',
skip_upload_metadata: 'true',
skip_upload_images: 'true',
skip_upload_screenshots: 'true',
)
end
lane :beta do
upload_to_play_store(
track: 'alpha',
track_promote_to: 'beta',
version_code: get_code(),
skip_upload_aab: 'true',
skip_upload_apk: 'true',
skip_upload_metadata: 'true',
skip_upload_images: 'true',
skip_upload_screenshots: 'true',
)
end
lane :meta do
upload_to_play_store(
track: 'beta',
version_code: get_code(),
skip_upload_aab: 'true',
skip_upload_apk: 'true',
)
end
lane :github do
# Dir.chdir("..") do
# sh("flutter build apk --flavor play")
# end
version = get_version()
code = get_code()
set_github_release(
repository_name: "vauvenal5/yaga",
# api_token: ENV["GITHUB_TOKEN"], # for local use
api_bearer: ENV["GITHUB_TOKEN"], # for Github actions
name: version,
tag_name: version,
description: (File.read("metadata/android/en-US/changelogs/"+code.to_s+".txt") rescue "No changelog provided."),
commitish: "master",
upload_assets: ["./build/app/outputs/flutter-apk/app-play-release.apk"]
)
end
def get_version_or_code(capture)
pubspec = File.read('../pubspec.yaml')
regex = /version:\s(\d+\.\d+\.\d+)\+(\d+)/
return pubspec[regex, capture]
end
def get_version()
return "v"+get_version_or_code(1)
end
def get_code()
return get_version_or_code(2).to_i
end
end
================================================
FILE: fastlane/metadata/android/en-US/changelogs/134.txt
================================================
- fixed general settings login/logout bug
- added splashscreen
================================================
FILE: fastlane/metadata/android/en-US/changelogs/140.txt
================================================
- introduced focus mode to browse view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/141.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
================================================
FILE: fastlane/metadata/android/en-US/changelogs/142.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
- minor improvement to drop down menus
================================================
FILE: fastlane/metadata/android/en-US/changelogs/143.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
- minor improvement to drop down menus
- fix isolates to properly shutdown/startup on app state change
================================================
FILE: fastlane/metadata/android/en-US/changelogs/144.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
- minor improvement to drop down menus
- fix isolates to properly shutdown/startup on app state change
- fix isolate startup
================================================
FILE: fastlane/metadata/android/en-US/changelogs/145.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
- minor improvement to drop down menus
- fix isolates to properly shutdown/startup on app state change
- fix isolate startup
- minor visual improvements
- code improvements
================================================
FILE: fastlane/metadata/android/en-US/changelogs/146.txt
================================================
- introduced focus mode to browse view
- fix title in focus mode
- minor improvement to drop down menus
- fix isolates to properly shutdown/startup on app state change
- fix isolate startup
- minor visual improvements
- code improvements
- fix to laoding mapper setting
================================================
FILE: fastlane/metadata/android/en-US/changelogs/147.txt
================================================
- fix recursive loading when offline
- fix recursive loading for local device
================================================
FILE: fastlane/metadata/android/en-US/changelogs/150.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
================================================
FILE: fastlane/metadata/android/en-US/changelogs/151.txt
================================================
- add ACTION_PICK filter
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1510.txt
================================================
- fix memory leak when downloading a lot of previews
- fix UI freeze when loading a lot of directories recursively
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1511.txt
================================================
- fix mapping manager when mapping non root folder
- fix url validation
================================================
FILE: fastlane/metadata/android/en-US/changelogs/152.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
================================================
FILE: fastlane/metadata/android/en-US/changelogs/153.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
- fix removal of upstream removed folders
================================================
FILE: fastlane/metadata/android/en-US/changelogs/154.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
- fix removal of upstream removed folders
- fix recursive update issue from browse to home view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/155.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
- fix removal of upstream removed folders
- fix recursive update issue from browse to home view
- fix memory leak
================================================
FILE: fastlane/metadata/android/en-US/changelogs/156.txt
================================================
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
- fix removal of upstream removed folders
- fix recursive update issue from browse to home view
- fix memory leak
- fix browse view recursive issue when entering focus view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/157.txt
================================================
This release is identical to v0.15.6. There were build changes for FDroid support.
- implement GET_CONTENT handler
- introduce navigator 2.0 to directory traversal
- add ACTION_PICK filter
- open default screen for image select
- fix removal of upstream removed folders
- fix recursive update issue from browse to home view
- fix memory leak
- fix browse view recursive issue when entering focus view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/158.txt
================================================
- fix memory leak when downloading a lot of previews
- fix UI freeze when loading a lot of directories recursively
================================================
FILE: fastlane/metadata/android/en-US/changelogs/159.txt
================================================
- fix memory leak when downloading a lot of previews
- fix UI freeze when loading a lot of directories recursively
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1600.txt
================================================
- add switch to disable URL validation in login mask
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1601.txt
================================================
- enable production logging for warn and err
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1602.txt
================================================
- enable production logging for warn and err
- correctly set log level
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1603.txt
================================================
- fix username handling with special characters
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1700.txt
================================================
- introducing multi-select
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1701.txt
================================================
- introducing multi-select
- allow sharing of multiple images
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1702.txt
================================================
- introducing multi-select
- allow sharing of multiple images
- fix ripple effect on image tiles
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1703.txt
================================================
- introducing multi-select
- allow sharing of multiple images
- fix ripple effect on image tiles
- fix NC behinde subpath issue
- fix fixedOrigin propagation for root mapping
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1704.txt
================================================
- introducing multi-select
- allow sharing of multiple images
- fix ripple effect on image tiles
- fix NC behinde subpath issue
- fix fixedOrigin propagation for root mapping
- replace button bar with bottom nav to align style and fix reder issue
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1705.txt
================================================
- introducing multi-select
- allow sharing of multiple images
- fix ripple effect on image tiles
- fix NC behinde subpath issue
- fix fixedOrigin propagation for root mapping
- replace button bar with bottom nav to align style and fix reder issue
- fix issue of app not being properly navigated to grant access site
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1800.txt
================================================
- delete file locally and remotely
- fix recursive remove on server detection
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1801.txt
================================================
- delete file locally and remotely
- fix recursive remove on server detection
- fix broken communication after background
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1802.txt
================================================
- fix bug when login name and user name are not the same
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1900.txt
================================================
- add browser based login flow as alternative to webview
================================================
FILE: fastlane/metadata/android/en-US/changelogs/1901.txt
================================================
- fix broken cancel button on login screen
- fix endless loading indicator when preview download fails
- fix show user agent in browser login flow
- fix persisting unchanged mapping issue
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2000.txt
================================================
- implement support for copying files
- implement support for moving files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2001.txt
================================================
- implement support for copying files
- implement support for moving files
- !!! please note: if file exists in destination it will be overwritten !!!
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2002.txt
================================================
- implement support for copying files
- implement support for moving files
- ignore same destination actions
- !!! please note: if file exists in destination it will be overwritten !!!
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2003.txt
================================================
- implement support for copying files
- implement support for moving files
- ignore same destination actions
- ask for overwrite mode
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2100.txt
================================================
- implement avatar caching
- disable multi-select in path selector view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2101.txt
================================================
- implement avatar caching
- disable multi-select in path selector view
- add warning dialog for root mapping
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2102.txt
================================================
- fix lost data issue by making delete syncs optional
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2103.txt
================================================
- move sorting to background
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2104.txt
================================================
- move sorting to background
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2105.txt
================================================
- move sorting to background
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2200.txt
================================================
- introducing simple support for self-signed certificates
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2201.txt
================================================
- fix local name handling if file/folder containes encoded chars (#86)
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2202.txt
================================================
- fix local name handling if file/folder containes encoded chars (#86)
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2203.txt
================================================
- improve logging
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2204.txt
================================================
- fix minor issue in special char handling
- improve logging
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2205.txt
================================================
- fix color gradient
- refactor icon
- fix jumping splash screen
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2206.txt
================================================
- fix color gradient
- refactor icon
- fix jumping splash screen
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2207.txt
================================================
- fix color gradient
- refactor icon
- fix jumping splash screen
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2208.txt
================================================
- remove host check from unsigned cert checks
- fix bug in auto-revoking on exception
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2300.txt
================================================
- add ability to send logs from within app
- improve logging
- improve self-signed cert usability
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2301.txt
================================================
- add ability to send logs from within app
- improve logging
- improve self-signed cert usability
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2302.txt
================================================
- add ability to send logs from within app
- improve logging
- improve self-signed cert usability
- fix for fdroid build
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2303.txt
================================================
- improve logging in list error cases
- replace loading indicator for previews with default image
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2304.txt
================================================
- improve performance when loading previews for many files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2305.txt
================================================
- improve performance when loading previews for many files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2306.txt
================================================
- improve performance when loading previews for many files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2307.txt
================================================
- improve performance when loading previews for many files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2308.txt
================================================
- improve performance when loading previews for many files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2309.txt
================================================
- fix broken preview of local files
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2310.txt
================================================
- fix image scroll controler
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2311.txt
================================================
- move download to background
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2312.txt
================================================
- move download to background
- fix bug in category search
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2400.txt
================================================
- implement switch for auto persist on download
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2500.txt
================================================
- implement download files select action
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2501.txt
================================================
- fix url validation issue
- improve logging
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2502.txt
================================================
- major upgrade of dependencies
- fixes folder names that look like ports issue
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2503.txt
================================================
- add confirmation dialog for logout
- re-work preview fetching
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2600.txt
================================================
- experimental sd card support, pls read https://github.com/vauvenal5/yaga/issues/23
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2601.txt
================================================
- experimental sd card support, pls read https://github.com/vauvenal5/yaga/issues/23
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2700.txt
================================================
- targeting Android 12 (API Level 31)
- refactoring to MediaStore API for local file access
- root mapping deprecated
- automatically resetting root mapping
- local move/copy are currently not supported
- local delete is supported but requires user confirmation
- on Android 12 (API 31+) you can assign MANAGE_MEDIA rights to avoid delete confirmation dialog
- SD card support is broken
- file provider for other apps is fixed
- about app dialog was updated to support news
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2701.txt
================================================
- targeting Android 12 (API Level 31)
- refactoring to MediaStore API for local file access
- root mapping deprecated
- automatically resetting root mapping
- local move/copy are currently not supported
- local delete is supported but requires user confirmation
- on Android 12 (API 31+) you can assign MANAGE_MEDIA rights to avoid delete confirmation dialog
- SD card support is broken
- file provider for other apps fixed
- about app dialog was updated to support news
- privacy policy link added
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2800.txt
================================================
- moved file actions into background thread
- background feature can be switched on and off in general settings
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2801.txt
================================================
- moved file actions into background thread
- background feature can be switched on and off in general settings
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2802.txt
================================================
- add support for attach to functionality of Android (needed for wallpapers)
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2803.txt
================================================
- enable hidding of app bar in image view by tap
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2804.txt
================================================
- enable hidding of app bar in image view by tap
- enable hidding of android overlays
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2805.txt
================================================
- enable hidding of app bar in image view by tap
- enable hidding of android overlays
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2900.txt
================================================
- implement slideshow feature
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2901.txt
================================================
- implement slideshow feature
- add wakelock
================================================
FILE: fastlane/metadata/android/en-US/changelogs/2902.txt
================================================
- implement slideshow feature
- add wakelock
- add random mode
- add back to beginning
- add auto stop at end
================================================
FILE: fastlane/metadata/android/en-US/changelogs/3000.txt
================================================
- replace deprecated NC client with new one
================================================
FILE: fastlane/metadata/android/en-US/changelogs/3001.txt
================================================
- replace deprecated NC client with new one
- fix file action dialog in foreground worker mode
================================================
FILE: fastlane/metadata/android/en-US/changelogs/3002.txt
================================================
- replace deprecated NC client with new one
- fix file action dialog in foreground worker mode
- refactor background bridge
================================================
FILE: fastlane/metadata/android/en-US/changelogs/3003.txt
================================================
- minor fixes in file action handling
- new Nextcloud client version
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4000.txt
================================================
- implement favorites view
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4001.txt
================================================
- mark favorites in lists and grids
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4002.txt
================================================
- fix favorites icon color
- migrate to newest nextcloud client version
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4003.txt
================================================
- fix minor issue with special characters in folder names
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4004.txt
================================================
- fix minor issue with special characters in folder names
- internal testing of Github releases
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4005.txt
================================================
- fix minor issue with special characters in folder names
- internal testing of Github releases
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4100.txt
================================================
- add minimal linux support
- refactor views to support big screens
- fix missing permission bug
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4200.txt
================================================
- favorites can be set and removed from app
- reworked select all to smart select
- some code clean up
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4201.txt
================================================
- fix bug when persisting image is disabled
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4300.txt
================================================
- add download button to image view
- add favorite button to image view
- add keybindings for linux (left/right arrow --- navigate, page up/down --- navigate, f --- Favorite)
================================================
FILE: fastlane/metadata/android/en-US/changelogs/4301.txt
================================================
- fix offline support
================================================
FILE: fastlane/metadata/android/en-US/full_description.txt
================================================
Nextcloud Yaga is a Nextcloud first gallery app. It aimes to give you the full functionality of a modern gallery app while utilizing your private Nextcloud server as backend.
You can find the documentation here: https://vauvenal5.github.io/yaga-docs/
For details on the development state and currently implemented features, have a look on the Github page. https://github.com/vauvenal5/yaga
================================================
FILE: fastlane/metadata/android/en-US/short_description.txt
================================================
A Nextcloud first gallery app.
================================================
FILE: fastlane/metadata/android/en-US/title.txt
================================================
Nextcloud Yaga
================================================
FILE: ios/.gitignore
================================================
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
================================================
FILE: ios/Flutter/AppFrameworkInfo.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
App
CFBundleIdentifier
io.flutter.flutter.app
CFBundleInfoDictionaryVersion
6.0
CFBundleName
App
CFBundlePackageType
FMWK
CFBundleShortVersionString
1.0
CFBundleSignature
????
CFBundleVersion
1.0
MinimumOSVersion
8.0
================================================
FILE: ios/Flutter/Debug.xcconfig
================================================
#include "Generated.xcconfig"
================================================
FILE: ios/Flutter/Release.xcconfig
================================================
#include "Generated.xcconfig"
================================================
FILE: ios/Runner/AppDelegate.swift
================================================
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
================================================
FILE: ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
================================================
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
================================================
FILE: ios/Runner/Base.lproj/LaunchScreen.storyboard
================================================
================================================
FILE: ios/Runner/Base.lproj/Main.storyboard
================================================
================================================
FILE: ios/Runner/Info.plist
================================================
CFBundleDevelopmentRegion
$(DEVELOPMENT_LANGUAGE)
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
yaga
CFBundlePackageType
APPL
CFBundleShortVersionString
$(FLUTTER_BUILD_NAME)
CFBundleSignature
????
CFBundleVersion
$(FLUTTER_BUILD_NUMBER)
LSRequiresIPhoneOS
UILaunchStoryboardName
LaunchScreen
UIMainStoryboardFile
Main
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UISupportedInterfaceOrientations~ipad
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIViewControllerBasedStatusBarAppearance
================================================
FILE: ios/Runner/Runner-Bridging-Header.h
================================================
#import "GeneratedPluginRegistrant.h"
================================================
FILE: ios/Runner.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
);
sourceTree = "";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "";
};
97C146F11CF9000F007C117D /* Supporting Files */ = {
isa = PBXGroup;
children = (
);
name = "Supporting Files";
sourceTree = "";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = {
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = Runner;
productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
CreatedOnToolsVersion = 7.3.1;
LastSwiftMigration = 1100;
};
};
};
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 97C146E51CF9000F007C117D;
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
97C146ED1CF9000F007C117D /* Runner */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
97C146EC1CF9000F007C117D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
97C146EA1CF9000F007C117D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C146FB1CF9000F007C117D /* Base */,
);
name = Main.storyboard;
sourceTree = "";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Profile;
};
249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.vauvenal5.yaga;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Profile;
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.vauvenal5.yaga;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.github.vauvenal5.yaga;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,
97C147041CF9000F007C117D /* Release */,
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147061CF9000F007C117D /* Debug */,
97C147071CF9000F007C117D /* Release */,
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
================================================
FILE: ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
================================================
================================================
FILE: ios/Runner.xcworkspace/contents.xcworkspacedata
================================================
================================================
FILE: lib/main.dart
================================================
import 'package:catcher_2/catcher_2.dart';
import 'package:flutter/material.dart';
import 'package:yaga/managers/global_settings_manager.dart';
import 'package:yaga/managers/settings_manager.dart';
import 'package:yaga/model/preferences/choice_preference.dart';
import 'package:yaga/services/shared_preferences_service.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/navigation/yaga_router_delegate.dart';
import 'package:yaga/utils/nextcloud_colors.dart';
import 'package:yaga/utils/service_locator.dart';
import 'package:yaga/utils/navigation/yaga_route_information_parser.dart';
import 'package:yaga/views/screens/splash_screen.dart';
Future main() async {
await YagaLogger.init();
setupServiceLocator();
final Catcher2Options releaseOptions = Catcher2Options(SilentReportMode(), [
YagaLogger.fileHandler,
]);
Catcher2(
rootWidget: MyApp(),
debugConfig: releaseOptions,
releaseConfig: releaseOptions,
enableLogger: false,
);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final ThemeData dark = ThemeData(
useMaterial3: false,
brightness: Brightness.dark,
colorScheme: ColorScheme.fromSwatch(
accentColor: NextcloudColors.lightBlue,
brightness: Brightness.dark,
),
);
final ThemeData light = ThemeData(
useMaterial3: false,
// brightness: Brightness.light,
colorScheme: ColorScheme.fromSwatch(
accentColor: NextcloudColors.lightBlue,
brightness: Brightness.light,
),
);
const String title = "Nextcloud Yaga";
return FutureBuilder(
future: YagaLogger.printBaseLog().then(
(_) => getIt.allReady(),
),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return MaterialApp(
title: title,
theme: light,
darkTheme: dark,
home: SplashScreen(),
);
}
final settingsManager = getIt.get();
return StreamBuilder(
initialData: getIt
.get()
.loadPreferenceFromString(GlobalSettingsManager.theme),
stream: settingsManager.updateSettingCommand
.where((event) => event.key == GlobalSettingsManager.theme.key)
.where((event) => event is ChoicePreference)
.map((event) => event as ChoicePreference),
builder: (context, snapshot) {
if (snapshot.data!.value == "system") {
return MaterialApp.router(
title: title,
theme: light,
darkTheme: dark,
routeInformationParser: YagaRouteInformationParser(),
routerDelegate: YagaRouterDelegate(),
);
}
return MaterialApp.router(
title: title,
theme: snapshot.data!.value == "light" ? light : dark,
routeInformationParser: YagaRouteInformationParser(),
routerDelegate: YagaRouterDelegate(),
);
},
);
},
);
}
}
================================================
FILE: lib/managers/file_manager/file_manager.dart
================================================
import 'dart:io';
import 'package:rx_command/rx_command.dart';
import 'package:rxdart/rxdart.dart';
import 'package:yaga/managers/file_manager/file_manager_base.dart';
import 'package:yaga/managers/file_service_manager/media_file_manager.dart';
import 'package:yaga/managers/global_settings_manager.dart';
import 'package:yaga/model/fetched_file.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/services/shared_preferences_service.dart';
import 'package:yaga/utils/background_worker/background_worker.dart';
import 'package:yaga/utils/forground_worker/foreground_worker.dart';
import 'package:yaga/utils/forground_worker/messages/download_file_request.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_request.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/delete_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_done.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_request.dart';
import 'package:yaga/utils/forground_worker/messages/sort_request.dart';
import 'package:yaga/utils/ncfile_stream_extensions.dart';
class FileManager extends FileManagerBase {
RxCommand downloadImageCommand = RxCommand.createSync((param) => param);
RxCommand fetchFileListCommand = RxCommand.createSync((param) => param);
RxCommand sortFilesListCommand = RxCommand.createSync((param) => param);
RxCommand filesActionCommand = RxCommand.createSync((param) => param);
final MediaFileManager _mediaFileManager;
final SharedPreferencesService _sharedPreferencesService;
final ForegroundWorker _foregroundWorker;
final BackgroundWorker _backgroundWorker;
FileManager(
this._mediaFileManager,
this._sharedPreferencesService,
this._foregroundWorker,
this._backgroundWorker,
) {
registerFileManager(_mediaFileManager);
fetchFileListCommand
.where((event) => _mediaFileManager.isRelevant(event.uri.scheme))
.flatMap(
(value) => _mediaFileManager
.listFiles(value.uri)
.collectToList()
.map((event) => SortRequest(value.key, event, value)),
)
.listen((event) {
sortFilesListCommand(event);
});
filesActionCommand
.where((event) => event is DeleteFilesRequest)
.map((event) => event as DeleteFilesRequest)
.where((event) => event.sourceDir.scheme == _mediaFileManager.scheme)
.listen(_handleLocalDeleteRequest);
filesActionCommand.where((event) => event.sourceDir.scheme != _mediaFileManager.scheme).listen(_handleFilesAction);
//todo: re-enable when copy/move support is added
// fileActionCommand
// .where((event) => event is DestinationActionFilesRequest)
// .map((event) => event as DestinationActionFilesRequest)
// .listen((event) {
// if(event.action == DestinationAction.copy) {
// _mediaFileManager.copyFile(event.files.first, event.destination);
// } else {
// _mediaFileManager.moveFile(event.files.first, event.destination);
// }
// });
downloadImageCommand.listen(_handleDownload);
}
@override
Stream listFiles(Uri uri, {bool recursive = false}) {
// not supported in UI branch because to computational intensive
throw UnimplementedError();
}
void _handleLocalDeleteRequest(DeleteFilesRequest request) async {
_mediaFileManager.deleteFiles(request.files).then((files) {
for (var file in files) {
fileUpdateMessage(FileUpdateMsg("", file));
}
}).whenComplete(
() => filesActionDoneCommand(FilesActionDone(request.key, request.sourceDir)),
);
}
void _handleFilesAction(FilesActionRequest request) async {
final useBackground = _sharedPreferencesService
.loadPreferenceFromBool(
GlobalSettingsManager.useBackground,
)
.value;
useBackground ? _backgroundWorker.sendRequest(request) : _foregroundWorker.sendRequest(request);
}
void _handleDownload(DownloadFileRequest request) async {
final NcFile ncFile = request.file;
// if file exists locally and download is not forced then load the local file
if (!request.forceDownload && ncFile.localFile != null && await ncFile.localFile!.file.exists()) {
ncFile.localFile!.exists = true;
//todo: why are we directly reading the file in here and not in the service?
fetchedFileCommand(
FetchedFile(
ncFile,
await (ncFile.localFile!.file as File).readAsBytes(),
),
);
return;
}
final autoPersist = _sharedPreferencesService
.loadPreferenceFromBool(
GlobalSettingsManager.autoPersist,
)
.value;
final useBackground = _sharedPreferencesService
.loadPreferenceFromBool(
GlobalSettingsManager.useBackground,
)
.value;
request.persist = request.forceDownload || autoPersist;
if (useBackground && request.persist) {
// in case persistence is active download in true background
_backgroundWorker.sendRequest(request);
} else {
// otherwise download in foreground worker
_foregroundWorker.sendRequest(request);
}
}
}
================================================
FILE: lib/managers/file_manager/file_manager_base.dart
================================================
import 'package:flutter/foundation.dart';
import 'package:rx_command/rx_command.dart';
import 'package:yaga/managers/file_service_manager/file_service_manager.dart';
import 'package:yaga/model/fetched_file.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_message.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_done.dart';
/// File Managers provide files functions, i.e. copy/delete/move/download
/// with context of required actions over multiple services
abstract class FileManagerBase {
RxCommand updateImageCommand = RxCommand.createSync((param) => param);
late RxCommand fetchedFileCommand;
//todo: Background: this should be moved out of here because it does not concern FileActionsManager
RxCommand updateFilesCommand = RxCommand.createSync((param) => param);
// responses
RxCommand filesActionDoneCommand = RxCommand.createSync((param) => param);
RxCommand fileUpdateMessage = RxCommand.createSync((param) => param);
@protected
Map fileServiceManagers = {};
FileManagerBase() {
fetchedFileCommand = RxCommand.createSync((param) {
updateImageCommand(param.file);
return param;
});
}
void registerFileManager(FileServiceManager fileServiceManager) {
fileServiceManagers.putIfAbsent(fileServiceManager.scheme, () => fileServiceManager);
}
//todo: fileManager refactoring: this method should not be callable from the UI
Stream listFiles(Uri uri, {bool recursive = false});
}
================================================
FILE: lib/managers/file_manager/isolateable/file_action_manager.dart
================================================
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:nextcloud/nextcloud.dart';
import 'package:rx_command/rx_command.dart';
import 'package:rxdart/rxdart.dart';
import 'package:yaga/managers/file_manager/file_manager_base.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/services/isolateable/local_file_service.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/utils/background_worker/background_channel.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/delete_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/destination_action_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/favorite_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_done.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_request.dart';
import 'package:yaga/utils/forground_worker/messages/image_update_msg.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/service_locator.dart';
import 'package:yaga/utils/uri_utils.dart';
class FileActionManager extends FileManagerBase {
final _logger = YagaLogger.getLogger(FileActionManager);
RxCommand cancelActionCommand = RxCommand.createSyncNoParam(() => true);
Future initBackground(
BackgroundChannel backgroundToMain,
) async {
updateImageCommand.listen(
(file) => backgroundToMain.send(ImageUpdateMsg("", file)),
);
return this;
}
Future downloadFile(NcFile file, {bool persist = false}) async {
return getIt.get().downloadImage(file.uri).then((value) async {
if (persist) {
await getIt.get().createFile(
file: file.localFile!.file as File,
bytes: value,
lastModified: file.lastModified,
);
file.localFile!.exists = true;
}
return value;
});
}
Future deleteFiles(DeleteFilesRequest message) async => _cancelableAction(
message,
(file) async => fileServiceManagers[file.uri.scheme]?.deleteFile(file, local: message.local),
);
Future copyMoveRequest(DestinationActionFilesRequest message) =>
message.action == DestinationAction.copy ? _copyFiles(message) : _moveFiles(message);
Future _copyFiles(DestinationActionFilesRequest message) async => _cancelableAction(
message,
(file) async => fileServiceManagers[file.uri.scheme]?.copyFile(
file,
message.destination,
overwrite: message.overwrite,
),
filter: (file) => _destinationFilter(file, message.destination),
);
Future _moveFiles(DestinationActionFilesRequest message) async => _cancelableAction(
message,
(file) async => fileServiceManagers[file.uri.scheme]
?.moveFile(
file,
message.destination,
overwrite: message.overwrite,
)
.then(
(value) => fileUpdateMessage(FileUpdateMsg("", file)),
),
filter: (file) => _destinationFilter(file, message.destination),
);
Future toggleFavorites(FavoriteFilesRequest message) => Stream.fromIterable(message.files)
.asyncMap(
(file) => fileServiceManagers[file.uri.scheme]?.toggleFavorite(file).then((file) => updateImageCommand(file)),
)
.toList();
bool _destinationFilter(NcFile file, Uri destination) => !compareFilePathToTargetFilePath(file, destination);
Future _cancelableAction(
FilesActionRequest request,
Future Function(NcFile) action, {
bool Function(NcFile file)? filter,
}) =>
Stream.fromIterable(request.files)
.where((event) => filter == null || filter(event))
.asyncMap(
(file) => action(file).catchError(
(err) => null,
test: (err) => err is DynamiteApiException || err is FileSystemException,
),
)
.where((event) => event != null)
.takeUntil(
cancelActionCommand.doOnData((event) => _logger.finest("Canceling action!")),
)
.toList()
.whenComplete(
() => filesActionDoneCommand(FilesActionDone(request.key, request.sourceDir)),
);
@override
Stream listFiles(Uri uri, {bool recursive = false}) {
// not supported in true background because not needed when app not in foreground
throw UnimplementedError();
}
}
================================================
FILE: lib/managers/file_manager/isolateable/isolated_file_manager.dart
================================================
import 'dart:isolate';
import 'package:rx_command/rx_command.dart';
import 'package:yaga/managers/file_manager/isolateable/file_action_manager.dart';
import 'package:yaga/managers/isolateable/sort_manager.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/model/sort_config.dart';
import 'package:yaga/model/sorted_file_list.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_message.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_response.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/image_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/init_msg.dart';
import 'package:yaga/utils/logger.dart';
import 'package:rxdart/rxdart.dart';
class IsolatedFileManager extends FileActionManager
with Isolateable {
final _logger = YagaLogger.getLogger(IsolatedFileManager);
final SortManager _sortManager;
RxCommand updateFilesCommand = RxCommand.createSync((param) => param);
IsolatedFileManager(this._sortManager);
@override
Future initIsolated(
InitMsg init,
SendPort isolateToMain,
) async {
//todo: we probably can improve the capsuling of front end and foreground_worker communication further
//--> check if it is possible to completely hide communications in bridges
updateImageCommand.listen(
(file) => isolateToMain.send(ImageUpdateMsg("", file)),
);
updateFilesCommand.listen((event) => isolateToMain.send(event));
return this;
}
Future listFileLists(
String requestKey,
Uri uri,
SortConfig sortConfig, {
bool recursive = false,
bool favorites = false,
}) async {
return fileServiceManagers[uri.scheme]
?.listFileList(uri, recursive: recursive, favorites: favorites)
.map((event) => _sortManager.sortList(event, sortConfig))
.fold(
null,
(SortedFileList>? previous, element) {
if (previous == null) {
updateFilesCommand(
FileListResponse(requestKey, uri, element, recursive: recursive),
);
return element;
}
if (_sortManager.mergeSort(previous, element)) {
updateFilesCommand(
FileListResponse(requestKey, uri, previous, recursive: recursive),
);
}
return previous;
},
).then((value) => value);
}
@override
Stream listFiles(Uri uri, {bool recursive = false}) {
//todo: throw when scheme is not registered
return fileServiceManagers[uri.scheme]?.listFiles(uri).flatMap((file) =>
file.isDirectory && recursive
? listFiles(file.uri, recursive: recursive)
: Stream.value(file)) ??
const Stream.empty();
}
}
================================================
FILE: lib/managers/file_service_manager/favorite_not_supported_mixin.dart
================================================
import 'package:yaga/model/nc_file.dart';
mixin FavoriteNotSupportedMixin {
Future toggleFavorite(NcFile file,) => throw UnimplementedError();
}
================================================
FILE: lib/managers/file_service_manager/file_service_manager.dart
================================================
import 'package:yaga/model/nc_file.dart';
/// FileServiceManagers are providing basic file manager functions
/// encapsulating required actions for one specific source.
abstract class FileServiceManager {
final String scheme = "";
Stream listFiles(Uri uri, {bool recursive = false});
Stream> listFileList(Uri uri, {bool recursive = false, bool favorites = false,});
Future deleteFile(NcFile file, {required bool local});
Future copyFile(NcFile file, Uri destination, {bool overwrite = false});
Future moveFile(NcFile file, Uri destination, {bool overwrite = false});
Future toggleFavorite(NcFile file,);
}
================================================
FILE: lib/managers/file_service_manager/isolateable/local_file_manager.dart
================================================
import 'dart:io';
import 'package:mime/mime.dart';
import 'package:yaga/managers/file_manager/file_manager_base.dart';
import 'package:yaga/managers/file_service_manager/favorite_not_supported_mixin.dart';
import 'package:yaga/managers/file_service_manager/file_service_manager.dart';
import 'package:yaga/model/local_file.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/services/isolateable/local_file_service.dart';
import 'package:yaga/services/isolateable/system_location_service.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/ncfile_stream_extensions.dart';
import 'package:yaga/utils/uri_utils.dart';
import 'package:rxdart/rxdart.dart';
// this class is still needed for offline support
class LocalFileManager
with Isolateable, FavoriteNotSupportedMixin
implements FileServiceManager {
final FileManagerBase _fileManager;
final LocalFileService _localFileService;
final SystemLocationService _systemPathService;
@override
String get scheme => _systemPathService.internalStorage.origin.scheme;
LocalFileManager(
this._fileManager, this._localFileService, this._systemPathService) {
_fileManager.registerFileManager(this);
}
@override
//todo: should add a wrapper around uri to distinguish between internal and absolute uri
// --> for example this serivce requires a internal uri but the call from within the nextcloudFileManager passes an absolute uri!
Stream listFiles(
Uri uri, {
bool recursive = false,
}) {
//todo: add uri check? or simply handle exception?
return _listLocalFiles(uri)
.recursively(_listLocalFiles, recursive: recursive);
}
@override
Stream> listFileList(
Uri uri, {
bool recursive = false,
bool favorites = false,
}) {
return listFiles(uri, recursive: recursive).collectToList();
}
Stream _listLocalFiles(Uri uri, {bool favorites = false}) {
//todo: add uri check? or simply handle exception?
return Stream.value(uri)
.map(_systemPathService.absoluteUriFromInternal)
.map((uri) => Directory.fromUri(uri))
.flatMap((dir) => _localFileService.list(dir))
.map((event) {
final Uri uri = _systemPathService.internalUriFromAbsolute(event.uri);
final NcFile file = _createFile(uri, event);
file.localFile = LocalFile(event, event.existsSync());
return file;
});
}
NcFile _createFile(Uri uri, FileSystemEntity event) {
if (event is Directory) {
final NcFile file = NcFile.directory(
uri,
getNameFromUri(uri),
);
//todo: think about this!
file.lastModified = DateTime.now();
return file;
}
final NcFile file = NcFile.file(
uri,
getNameFromUri(uri),
lookupMimeType(event.path),
);
//todo: this value is not necessarily correct(!)
file.lastModified = (event as File).lastModifiedSync().toUtc();
return file;
}
@override
Future deleteFile(NcFile file, {required bool local}) async {
_localFileService.deleteFile(file.localFile!.file);
_fileManager.fileUpdateMessage(FileUpdateMsg("", file));
return file;
}
@override
Future copyFile(NcFile file, Uri destination,
{bool overwrite = false}) async {
_localFileService.copyFile(
file,
_systemPathService.absoluteUriFromInternal(destination),
overwrite: overwrite,
);
return file;
}
@override
Future moveFile(NcFile file, Uri destination,
{bool overwrite = false}) async {
_localFileService.moveFile(
file,
_systemPathService.absoluteUriFromInternal(destination),
overwrite: overwrite,
);
return file;
}
}
================================================
FILE: lib/managers/file_service_manager/isolateable/nextcloud_background_file_manager.dart
================================================
import 'package:flutter/foundation.dart';
import 'package:yaga/managers/file_manager/file_manager_base.dart';
import 'package:yaga/managers/file_service_manager/file_service_manager.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/services/isolateable/local_file_service.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/logger.dart';
class NextcloudBackgroundFileManager implements FileServiceManager {
final _logger = YagaLogger.getLogger(NextcloudBackgroundFileManager);
@protected
final NextCloudService nextCloudService;
@protected
final LocalFileService localFileService;
@protected
final FileManagerBase fileManager;
NextcloudBackgroundFileManager(this.nextCloudService, this.localFileService, this.fileManager);
Future initBackground() async {
fileManager.registerFileManager(this);
return this;
}
//todo: background: clean up file manager mess
@override
Future deleteFile(NcFile file, {required bool local}) async {
if (local) {
localFileService.deleteFile(file.localFile!.file);
file.localFile!.exists = false;
fileManager.updateImageCommand(file);
return file;
}
return nextCloudService
.deleteFile(file)
.then((value) => deleteLocalFile(file))
.then((file) {
fileManager.fileUpdateMessage(FileUpdateMsg("", file));
return file;
});
}
@protected
Future deleteLocalFile(NcFile file) async {
_logger.warning("Removing local file! (${file.uri.path})");
localFileService.deleteFile(file.localFile!.file);
localFileService.deleteFile(file.previewFile!.file);
return file;
}
@override
Stream> listFileList(Uri uri, {bool recursive = false, bool favorites = false,}) {
// not supported in true background since listing files makes only sense when app in foreground
throw UnimplementedError();
}
@override
Stream listFiles(Uri uri, {bool recursive = false}) {
// not supported in true background since listing files makes only sense when app in foreground
throw UnimplementedError();
}
@override
Future copyFile(NcFile file, Uri destination,
{bool overwrite = false}) =>
nextCloudService.copyFile(file, destination, overwrite: overwrite);
@override
Future moveFile(NcFile file, Uri destination,
{bool overwrite = false}) =>
nextCloudService
.moveFile(file, destination, overwrite: overwrite)
// this is a very simplified fix for a complex problem:
// if we want to move existing files locally we need to decide if it
// is really necessary to do this in the background
// if yes, we have also to consider the implications on the UI:
// * dialog has to be removed
// * this makes the action non cancelable
// technical requirements:
// * MappingManger has to be refactored to be usable in background
.then((value) => deleteLocalFile(value));
@override
Future toggleFavorite(NcFile file) => nextCloudService.toggleFavorite(file);
@override
String get scheme => nextCloudService.scheme;
}
================================================
FILE: lib/managers/file_service_manager/isolateable/nextcloud_file_manger.dart
================================================
import 'dart:io';
import 'package:nextcloud/nextcloud.dart';
import 'package:rx_command/rx_command.dart';
import 'package:rxdart/rxdart.dart';
import 'package:yaga/managers/file_manager/file_manager_base.dart';
import 'package:yaga/managers/file_service_manager/isolateable/nextcloud_background_file_manager.dart';
import 'package:yaga/managers/isolateable/mapping_manager.dart';
import 'package:yaga/managers/isolateable/sync_manager.dart';
import 'package:yaga/model/local_file.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/model/preview_fetch_meta.dart';
import 'package:yaga/services/isolateable/local_file_service.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/ncfile_stream_extensions.dart';
class NextcloudFileManager extends NextcloudBackgroundFileManager
with Isolateable {
final _logger = YagaLogger.getLogger(NextcloudFileManager);
final MappingManager _mappingManager;
final SyncManager _syncManager;
final RxCommand _getPreviewCommand =
RxCommand.createSync((param) => param);
final RxCommand _readyForNextPreviewRequest =
RxCommand.createSync((param) => param);
final RxCommand downloadPreviewCommand =
RxCommand.createSync((param) => param);
final RxCommand updatePreviewCommand =
RxCommand.createSync((param) => param);
final RxCommand downloadPreviewFaildCommand =
RxCommand.createSync((param) => param);
NextcloudFileManager(
FileManagerBase fileManager,
NextCloudService nextCloudService,
LocalFileService localFileService,
this._mappingManager,
this._syncManager,
) : super(nextCloudService, localFileService, fileManager){
fileManager.registerFileManager(this);
_getPreviewCommand
.zipWith(
// this stream is managing the amount of allowed parallel downloads of previews (currently 10)
_readyForNextPreviewRequest.doOnData(
(event) => _logger.info("Arming preview index: $event"),
),
(ncFile, int number) => PreviewFetchMeta(ncFile, number),
)
.doOnData(
(event) => _logger.info(
"Fetching preview index: ${event.fetchIndex}",
),
)
// debounce requests which have been added multiple times due to scrolling
.where((ncFileMeta) {
if (ncFileMeta.file.previewFile!.file.existsSync()) {
_logger.info("Preview exists index: ${ncFileMeta.fetchIndex}");
_readyForNextPreviewRequest(ncFileMeta.fetchIndex);
return false;
}
return true;
})
.flatMap(
(ncFileMeta) => Stream.fromFuture(
nextCloudService.getPreview(ncFileMeta.file.uri).then(
(value) async {
ncFileMeta.file.previewFile!.file =
await localFileService.createFile(
file: ncFileMeta.file.previewFile!.file as File,
bytes: value,
lastModified: ncFileMeta.file.lastModified);
ncFileMeta.file.previewFile!.exists = true;
_logger.info("Preview fetched index: ${ncFileMeta.fetchIndex}");
_logger.fine("Preview fetched: (${ncFileMeta.file.uri})");
return ncFileMeta;
},
//todo: do we really need both error handlers
onError: (err, StackTrace stacktrace) {
if(err is DynamiteApiException && err.statusCode == 404) {
_logger.warning(
"Preview not found for file: ${ncFileMeta.file.name}",
);
} else {
_logger.warning(
"Preview fetching failed, index: ${ncFileMeta.fetchIndex}",
);
_logger.severe(
"Unexpected error while loading preview",
err,
stacktrace,
);
}
downloadPreviewFaildCommand(ncFileMeta.file);
return PreviewFetchMeta(ncFileMeta.file, ncFileMeta.fetchIndex,
success: false);
},
),
),
)
.doOnData((event) => _readyForNextPreviewRequest(event.fetchIndex))
.where((event) => event.success)
.listen(
(ncFileMeta) => updatePreviewCommand(ncFileMeta.file),
onError: (error, StackTrace stacktrace) {
final int index = (_readyForNextPreviewRequest.lastResult! + 1) % 10;
_logger.warning("Error on stream. Reintroducing index: $index");
_readyForNextPreviewRequest(index);
_logger.severe(
"Unexpected error in preview stream",
error,
stacktrace,
);
},
);
//init preview stream for 10 simultanious requests
RangeStream(1, 10).listen((event) => _readyForNextPreviewRequest(event));
downloadPreviewCommand.listen((ncFile) {
if (ncFile.previewFile != null && ncFile.previewFile!.file.existsSync()) {
ncFile.previewFile!.exists = true;
updatePreviewCommand(ncFile);
return;
}
_getPreviewCommand(ncFile);
});
}
@override
String get scheme => nextCloudService.scheme;
@override
Stream listFiles(
Uri uri, {
bool recursive = false,
}) {
//todo: add uri check
return _syncManager.addUri(uri).asStream().flatMap((value) => Rx.merge([
_listLocalFileList(uri, recursive),
_listNextcloudFiles(uri, recursive),
]).doOnDone(() => _finishSync(uri))) as Stream;
}
@override
Stream> listFileList(
Uri uri, {
bool recursive = false,
bool favorites = false,
}) {
//todo: add uri check
_logger.finer("Listing... ($uri)");
return _syncManager.addUri(uri).asStream().flatMap((_) => Rx.merge([
_listLocalFileList(uri, recursive),
_listNextcloudFiles(uri, recursive, favorites: favorites).collectToList(),
]).doOnData((event) {
_logger.finer("Emiting list! ($uri)");
}).doOnDone(() => _finishSync(uri)));
}
Stream _listNextcloudFiles(Uri uri, bool recursive, {bool favorites = false}) {
return _listNextcloudFilesUpstream(uri, favorites: favorites)
.recursively(_listNextcloudFilesUpstream, recursive: recursive, favorites: favorites)
.doOnData((file) => _syncManager.addRemoteFile(uri, file))
.doOnError((err, stack) => _syncManager.removeUri(uri));
}
Stream _listNextcloudFilesUpstream(Uri uri, {bool favorites = false}) {
return nextCloudService.list(uri, favorites).asyncMap((file) async {
if (!file.isDirectory) {
file.localFile = await _createLocalFile(file.uri);
file.previewFile = await _createTmpFile(file.uri);
}
return file;
});
}
Stream> _listLocalFileList(Uri uri, bool recursive) {
return Rx.merge([
_listTmpFiles(uri, recursive),
_listLocalFiles(uri, recursive),
])
.doOnData((file) => _syncManager.addFile(uri, file))
.distinctUnique()
.toList()
.asStream();
}
Stream _listLocalFiles(Uri uri, bool recursive) =>
_listFromLocalFileManager(
uri,
recursive,
_mappingManager.mapToLocalUri,
(file) async {
file.uri = await _mappingManager.mapToRemoteUri(file.uri, uri);
//todo: should this be a FileSystemEntity?
// file.localFile = await _mappingManager.mapToLocalFile(file.uri);
if (!file.isDirectory) {
file.previewFile = await _createTmpFile(file.uri);
}
return file;
},
);
Stream _listTmpFiles(Uri uri, bool recursive) =>
_listFromLocalFileManager(
uri,
recursive,
_mappingManager.mapToTmpUri,
(file) async {
file.uri = await _mappingManager.mapTmpToRemoteUri(file.uri, uri);
//todo: should this be a FileSystemEntity?
if (!file.isDirectory) {
file.previewFile = file.localFile;
file.localFile = await _createLocalFile(file.uri);
}
// file.previewFile = _localFileService.getTmpFile(file.uri.path);
return file;
},
);
Stream _listFromLocalFileManager(
Uri uri,
bool recursive,
Future Function(Uri) mappingCall,
Future Function(NcFile) resultMapping) {
return mappingCall(uri)
.asStream()
.flatMap((value) => fileManager.listFiles(value, recursive: recursive))
.asyncMap(resultMapping);
}
Future _finishSync(Uri uri) {
return _syncManager.syncUri(uri).then((files) async {
for (final NcFile file in files) {
if (await _mappingManager.isSyncDelete(file.uri)) {
deleteLocalFile(file);
} else {
fileManager.fileUpdateMessage(FileUpdateMsg("", file));
}
}
});
}
Future _createLocalFile(Uri uri) async {
File file = File.fromUri(await _mappingManager.mapToLocalUri(uri));
return LocalFile(file, file.existsSync());
}
Future _createTmpFile(Uri uri) async {
File file = File.fromUri(await _mappingManager.mapToTmpUri(uri));
return LocalFile(file, file.existsSync());
}
}
================================================
FILE: lib/managers/file_service_manager/media_file_manager.dart
================================================
import 'dart:io';
import 'package:yaga/managers/file_service_manager/favorite_not_supported_mixin.dart';
import 'package:yaga/managers/file_service_manager/file_service_manager.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/services/media_file_service.dart';
class MediaFileManager with FavoriteNotSupportedMixin implements FileServiceManager {
final MediaFileService _mediaFileService;
MediaFileManager(this._mediaFileService);
@override
Future deleteFile(NcFile file, {required bool local}) {
return deleteFiles(List.filled(1, file)).then((value) => value.first);
}
Future> deleteFiles(List files) {
return _mediaFileService.deleteFile(files);
}
@override
Stream> listFileList(Uri uri, {bool recursive = false, bool favorites = false}) {
// TODO: implement listFileList
throw UnimplementedError();
}
@override
Stream listFiles(Uri uri, {bool recursive = false}) {
return _mediaFileService.listFiles(uri);
}
@override
// todo: currently this is reusing the file-scheme which is meant for local access probably should use a different one?
String get scheme => _mediaFileService.scheme;
@override
Future copyFile(NcFile file, Uri destination,
{bool overwrite = false}) {
// TODO: implement copyFile
throw UnimplementedError();
}
@override
Future moveFile(NcFile file, Uri destination,
{bool overwrite = false}) {
// TODO: implement moveFile
throw UnimplementedError();
}
bool isRelevant(String scheme) {
return Platform.isAndroid && scheme == this.scheme;
}
}
================================================
FILE: lib/managers/global_settings_manager.dart
================================================
import 'dart:io';
import 'package:rx_command/rx_command.dart';
import 'package:yaga/managers/nextcloud_manager.dart';
import 'package:yaga/managers/settings_manager.dart';
import 'package:yaga/model/nc_login_data.dart';
import 'package:yaga/model/preferences/action_preference.dart';
import 'package:yaga/model/preferences/bool_preference.dart';
import 'package:yaga/model/preferences/choice_preference.dart';
import 'package:yaga/model/preferences/int_preference.dart';
import 'package:yaga/model/preferences/mapping_preference.dart';
import 'package:yaga/model/preferences/preference.dart';
import 'package:yaga/model/preferences/section_preference.dart';
import 'package:yaga/model/preferences/string_preference.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/services/isolateable/system_location_service.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/uri_utils.dart';
class GlobalSettingsManager {
final List _globalSettingsCache = [];
static const String _MAPPING_KEY = "mapping";
static SectionPreference ncSection = SectionPreference((b) => b
..key = "nc"
..title = "Nextcloud");
static BoolPreference autoPersist = BoolPreference((b) => b
..key = ncSection.prepareKey("autoPersist")
..title = "Persist on View Image"
..value = true);
static SectionPreference appSection = SectionPreference((b) => b
..key = "app"
..title = "General");
static ChoicePreference theme = ChoicePreference((b) => b
..key = appSection.prepareKey("theme")
..title = "Theme"
..value = "system"
..choices = {
"system": "Follow System Theme",
"light": "Light Theme",
"dark": "Dark Theme"
});
static ActionPreference sendLogs = ActionPreference((b) => b
..key = appSection.prepareKey("logs")
..title = "Send Logs"
..action = YagaLogger.shareLogs
..enabled = Platform.isAndroid);
static ActionPreference? reset;
static StringPreference newsSeenVersion = StringPreference(
(b) => b
..key = appSection.prepareKey("newsSeen")
..title = "News Seen Version"
..value = "",
);
static BoolPreference useBackground = BoolPreference(
(b) => b
..key = ncSection.prepareKey("useBackground")
..title = "File actions in background"
..value = Platform.isAndroid
..enabled = Platform.isAndroid,
);
static SectionPreference slideshowSection = SectionPreference(
(b) => b
..key = "show"
..title = "Slideshow",
);
static IntPreference slideShowInterval = IntPreference(
(b) => b
..key = slideshowSection.prepareKey("interval")
..title = "Interval in seconds"
..value = 5,
);
static BoolPreference slideShowRandom = BoolPreference(
(b) => b..key = slideshowSection.prepareKey("random")
..title = "Random order"
..value = false,
);
static BoolPreference slideShowAutoStop = BoolPreference(
(b) => b..key = slideshowSection.prepareKey("autoStop")
..title = "Stop at end"
..value = false,
);
RxCommand registerGlobalSettingCommand =
RxCommand.createSync((param) => param);
late RxCommand removeGlobalSettingCommand;
RxCommand, List> updateGlobalSettingsCommand =
RxCommand.createSync((param) => param);
RxCommand updateRootMappingPreference =
RxCommand.createSync((param) => param);
final NextCloudManager _nextcloudManager;
final SettingsManager _settingsManager;
final NextCloudService _nextCloudService;
final SystemLocationService _systemLocationService;
GlobalSettingsManager(this._nextcloudManager, this._settingsManager,
this._nextCloudService, this._systemLocationService) {
registerGlobalSettingCommand.listen((pref) {
if (_globalSettingsCache.contains(pref)) {
return;
}
_globalSettingsCache.add(pref);
updateGlobalSettingsCommand(_globalSettingsCache);
});
removeGlobalSettingCommand = RxCommand.createSync((param) =>
_globalSettingsCache
.removeWhere((element) => element.key == param.key));
removeGlobalSettingCommand.listen((value) {
updateGlobalSettingsCommand(_globalSettingsCache);
});
_nextcloudManager.updateLoginStateCommand
.listen((value) => _handleLoginState(value));
_nextcloudManager.logoutCommand.listen((value) {
final MappingPreference mapping = getDefaultMappingPreference(
local: _systemLocationService.internalStorage.uri,
remote: Uri(),
);
_settingsManager.removeMappingPreferenceCommand(mapping);
removeGlobalSettingCommand(mapping);
removeGlobalSettingCommand(reset);
removeGlobalSettingCommand(autoPersist);
removeGlobalSettingCommand(ncSection);
});
_settingsManager.updateSettingCommand
.where((event) => event.key == ncSection.prepareKey(_MAPPING_KEY))
.listen(
(event) => updateRootMappingPreference(event as MappingPreference));
}
Future init() async {
registerGlobalSettingCommand(appSection);
registerGlobalSettingCommand(useBackground);
registerGlobalSettingCommand(theme);
registerGlobalSettingCommand(sendLogs);
registerGlobalSettingCommand(slideshowSection);
registerGlobalSettingCommand(slideShowInterval);
registerGlobalSettingCommand(slideShowRandom);
registerGlobalSettingCommand(slideShowAutoStop);
_handleLoginState(
_nextcloudManager.updateLoginStateCommand.lastResult!,
);
return this;
}
MappingPreference getDefaultMappingPreference({
required Uri local,
required Uri remote,
}) {
return MappingPreference(
(b) => b
..key = ncSection.prepareKey(_MAPPING_KEY)
..title = "Root Mapping"
..value = false
..local.value = local
..local.enabled = false
..remote.value = remote
..remote.enabled = false,
);
}
void _handleLoginState(NextCloudLoginData loginData) {
if (_nextCloudService.isLoggedIn()) {
final MappingPreference mapping = getDefaultMappingPreference(
local: fromUri(
uri: _systemLocationService.internalStorage.uri,
path:
"${_systemLocationService.internalStorage.uri.path}/${_nextCloudService.origin!.userDomain}",
),
remote: _nextCloudService.origin!.userEncodedDomainRoot,
);
reset = ActionPreference(
(b) => b
..key = ncSection.prepareKey("reset")
..title = "Reset Root Mapping"
..action = () {
_settingsManager.persistMappingPreferenceCommand(mapping);
_settingsManager.loadMappingPreferenceCommand(mapping);
},
);
registerGlobalSettingCommand(ncSection);
registerGlobalSettingCommand(mapping);
// registerGlobalSettingCommand(reset);
registerGlobalSettingCommand(autoPersist);
//instead of loading the root mapping we are resetting it here to default values
//_settingsManager.loadMappingPreferenceCommand(mapping);
reset!.action.call();
}
}
}
================================================
FILE: lib/managers/isolateable/isolated_global_settings_manager.dart
================================================
import 'dart:isolate';
import 'package:yaga/managers/global_settings_manager.dart';
import 'package:yaga/managers/isolateable/isolated_settings_manager.dart';
import 'package:yaga/model/preferences/bool_preference.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/init_msg.dart';
class IsolatedGlobalSettingsManager
with Isolateable {
@override
Future initIsolated(
InitMsg init,
SendPort isolateToMain,
) async {
_autoPersist = init.autoPersist;
return this;
}
final IsolatedSettingsManager _settingsManager;
late BoolPreference _autoPersist;
BoolPreference get autoPersist => _autoPersist;
IsolatedGlobalSettingsManager(this._settingsManager) {
_settingsManager.updateSettingCommand
.where((event) => event.key == GlobalSettingsManager.autoPersist.key)
.map((event) => event as BoolPreference)
.listen((value) => _autoPersist = value);
}
}
================================================
FILE: lib/managers/isolateable/isolated_settings_manager.dart
================================================
import 'dart:isolate';
import 'package:yaga/managers/settings_manager_base.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/init_msg.dart';
class IsolatedSettingsManager extends SettingsManagerBase
with Isolateable {
@override
Future initIsolated(
InitMsg init,
SendPort isolateToMain,
) async {
if(init.mapping != null) {
updateSettingCommand(init.mapping);
}
return this;
}
}
================================================
FILE: lib/managers/isolateable/mapping_manager.dart
================================================
import 'dart:isolate';
import 'package:rx_command/rx_command.dart';
import 'package:yaga/managers/settings_manager_base.dart';
import 'package:yaga/model/mapping_node.dart';
import 'package:yaga/model/preferences/mapping_preference.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/services/isolateable/system_location_service.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/forground_worker/messages/init_msg.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/uri_utils.dart';
class MappingManager with Isolateable {
final _logger = YagaLogger.getLogger(MappingManager);
final NextCloudService _nextCloudService;
final SystemLocationService _systemLocationService;
final SettingsManagerBase _settingsManager;
RxCommand mappingUpdatedCommand =
RxCommand.createSync((param) => param);
MappingNode root = MappingNode();
Map mappings = {};
MappingManager(this._settingsManager, this._nextCloudService,
this._systemLocationService) {
_settingsManager.updateSettingCommand
.where((event) => event is MappingPreference)
.listen((event) => handleMappingUpdate(event as MappingPreference));
}
@override
Future initIsolated(
InitMsg init,
SendPort isolateToMain,
) async {
handleMappingUpdate(init.mapping);
return this;
}
//todo: use a bridge and commands to handle incoming msgs in forgraound worker
// @visibleForTesting
void handleMappingUpdate(MappingPreference? event) {
if (event == null) {
return;
}
if (mappings.containsKey(event.key)) {
_removeFromTree(mappings[event.key]!.remote.value.pathSegments, 0, root);
}
//todo: somehow/somewhere the view needs to be refreshed when the mapping changes
_addMappingPreferenceToTree(event, 0, root);
mappings[event.key!] = event;
mappingUpdatedCommand(event);
}
void _removeFromTree(List path, int index, MappingNode current) {
if (index == path.length) {
current.mapping = null;
return;
}
_removeFromTree(path, index + 1, current.nodes[path[index]]!);
}
void _addMappingPreferenceToTree(
MappingPreference pref, int pathIndex, MappingNode currentNode) {
if (pathIndex >= pref.remote.value.pathSegments.length - 1) {
currentNode.mapping = pref;
return;
}
final String pathSegment = pref.remote.value.pathSegments[pathIndex];
currentNode.nodes.putIfAbsent(pathSegment, () => MappingNode());
_addMappingPreferenceToTree(
pref, pathIndex + 1, currentNode.nodes[pathSegment]!);
}
MappingPreference _getMappingPrefernce(Uri uri, MappingPreference selected,
int pathIndex, MappingNode? currentNode) {
if (currentNode == null) {
return selected;
}
if (uri.pathSegments.length == pathIndex) {
return currentNode.mapping ?? selected;
}
return _getMappingPrefernce(uri, currentNode.mapping ?? selected,
pathIndex + 1, currentNode.nodes[uri.pathSegments[pathIndex]]);
}
MappingPreference _getRootMappingPreference(Uri remoteUri) =>
_getMappingPrefernce(
remoteUri,
_getDefaultMapping(_systemLocationService.internalStorage.uri),
0,
root);
String _appendLocalMappingFolder(String path) {
return chainPathSegments(
path,
_nextCloudService.origin!.userDomain,
);
}
Future isSyncDelete(Uri remoteUri) async => _getRootMappingPreference(
remoteUri,
).syncDeletes.value;
Future mapToLocalUri(Uri remoteUri) async => _mapUri(
remoteUri,
_getRootMappingPreference(remoteUri),
);
Future mapToTmpUri(Uri remoteUri) async {
return _mapUri(remoteUri,
_getDefaultMapping(_systemLocationService.internalCache.uri));
}
Uri _mapUri(Uri remoteUri, MappingPreference mapping) {
_logger.fine("Mapping remoteUri: $remoteUri");
_logger.fine("Mapping local: ${mapping.local.value}");
_logger.fine("Mapping remote: ${mapping.remote.value}");
final Uri mappedUri = fromPathList(uri: mapping.local.value, paths: [
mapping.local.value.path,
remoteUri.path.replaceFirst(mapping.remote.value.path, "")
]);
_logger.fine("Mapped uri: $mappedUri");
//todo: is returning an absolute uri from mapping manager the best option?
return _systemLocationService.absoluteUriFromInternal(mappedUri);
}
//todo: check what we are doing with this
MappingPreference _getDefaultMapping(Uri root) {
return MappingPreference(
(builder) => builder
..key = "default"
..title = "default"
..remote.value = _nextCloudService.origin!.userEncodedDomainRoot
..local.value = fromUri(
uri: root,
path: _appendLocalMappingFolder(root.path),
),
);
}
Future mapToRemoteUri(Uri local, Uri remote) async {
final MappingPreference mapping = _getRootMappingPreference(remote);
final String relativePath = local.path.replaceFirst(
mapping == null
? _systemLocationService.internalStorage.uri.path
: mapping.local.value.path,
"",
);
return fromPathList(
uri: remote, paths: [mapping.remote.value.path, relativePath]);
}
Future mapTmpToRemoteUri(Uri local, Uri remote) async {
final Uri defaultInternal = _systemLocationService.internalCache.uri;
final String relativePath = local.path
.replaceFirst(_appendLocalMappingFolder(defaultInternal.path), "");
return fromUri(uri: remote, path: relativePath);
}
}
================================================
FILE: lib/managers/isolateable/sort_manager.dart
================================================
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/model/sort_config.dart';
import 'package:yaga/model/sorted_category_list.dart';
import 'package:yaga/model/sorted_file_folder_list.dart';
import 'package:yaga/model/sorted_file_list.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
class SortManager with Isolateable {
final Map<
SortType,
SortedFileList Function(
List files,
List folders,
SortConfig config,
)> _sortHandlers = {};
final Map)> _sortListHandlers = {};
final Map
_mergeSortHandlers = {};
final Map
_mixedMergeHandlers = {};
SortManager() {
_sortHandlers[SortType.list] = _sortFileFolders;
_sortHandlers[SortType.category] = _sortCategory;
_sortListHandlers[SortProperty.name] = _sortListByName;
_sortListHandlers[SortProperty.dateModified] = _sortListByDateModified;
_mergeSortHandlers[SortType.list] =
(SortedFileList main, SortedFileList addition) {
if (main is SortedFileFolderList) {
return _mergeFileFolders(main, addition);
}
return false;
};
_mergeSortHandlers[SortType.category] =
(SortedFileList main, SortedFileList addition) {
if (main is SortedCategoryList && addition is SortedCategoryList) {
return _mergeCategories(main, addition);
}
return false;
};
_mixedMergeHandlers[SortType.list] = _mergeSortHandlers[SortType.list]!;
_mixedMergeHandlers[SortType.category] =
(SortedFileList main, SortedFileList addition) {
if(main is SortedCategoryList && addition is SortedFileFolderList) {
return _mixedMergeCategoryList(main, addition);
}
return false;
};
}
bool mergeSort(SortedFileList main, SortedFileList addition) {
if (main.config.sortType == addition.config.sortType) {
return _mergeSortHandlers[main.config.sortType]!(main, addition);
}
return _mixedMergeHandlers[main.config.sortType]!(main, addition);
}
bool _mixedMergeCategoryList(
SortedCategoryList main,
SortedFileFolderList addition,
) {
final bool changed = _mergeLists(main.folders, addition.folders, null);
final SortedCategoryList convertedAddition = sortList(
addition.files,
main.config,
) as SortedCategoryList;
return _mergeCategories(main, convertedAddition) || changed;
}
bool _mergeFileFolders(
SortedFileFolderList main,
SortedFileList addition,
) {
final bool changed = _mergeLists(
main.files,
addition.files,
main.config.fileSortProperty,
);
return _mergeLists(
main.folders,
addition.folders,
main.config.folderSortProperty,
) ||
changed;
}
bool _mergeCategories(SortedCategoryList main, SortedCategoryList addition) {
bool changed = false;
addition.categories
.where((key) => main.categories.contains(key))
.map(
(key) => _mergeLists(
main.categorizedFiles[key]!,
addition.categorizedFiles[key]!,
main.config.fileSortProperty,
),
)
.forEach((catChanged) => changed = changed || catChanged);
addition.categories.where((key) => !main.categories.contains(key)).forEach(
(key) {
changed = true;
main.categories.add(key);
main.categorizedFiles[key] = addition.categorizedFiles[key]!;
},
);
_sortCategories(main.categories);
return _mergeLists(main.folders, addition.folders, null) || changed;
}
bool _mergeLists(
List main,
List addition,
SortProperty? prop,
) {
final size = main.length;
addition
.where((element) => !main.contains(element))
.forEach((element) => main.add(element));
if (prop != null) {
_sortListHandlers[prop]!(main);
}
return size < main.length;
}
SortedFileList sortList(List files, SortConfig config) {
final List filesToSort = [];
final List foldersToSort = [];
for (final file in files) {
if (file.isDirectory) {
foldersToSort.add(file);
} else {
filesToSort.add(file);
}
}
return _sortHandlers[config.sortType]!(filesToSort, foldersToSort, config);
}
SortedFileFolderList _sortFileFolders(
List files,
List folders,
SortConfig config,
) {
_sortListHandlers[config.fileSortProperty]!(files);
_sortListHandlers[config.folderSortProperty]!(folders);
return SortedFileFolderList(config, files, folders);
}
SortedCategoryList _sortCategory(
List files,
List folders,
SortConfig config,
) {
final sorted = SortedCategoryList(config, folders: folders);
for (final file in files) {
final String key = SortedCategoryList.createKey(file);
if (!sorted.categories.contains(key)) {
sorted.categories.add(key);
}
sorted.categorizedFiles.putIfAbsent(key, () => []);
if (!sorted.categorizedFiles[key]!.contains(file)) {
sorted.categorizedFiles[key]!.add(file);
}
}
_sortCategories(sorted.categories);
sorted.categorizedFiles
.forEach((key, value) => _sortListByDateModified(value));
return sorted;
}
void _sortListByDateModified(List list) => list.sort(
(a, b) => b.lastModified!.compareTo(a.lastModified!),
);
void _sortListByName(List list) => list.sort(
(a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()),
);
void _sortCategories(List categories) =>
categories.sort((date1, date2) => date2.compareTo(date1));
}
================================================
FILE: lib/managers/isolateable/sync_manager.dart
================================================
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/model/sync_file.dart';
import 'package:yaga/utils/forground_worker/isolateable.dart';
import 'package:yaga/utils/logger.dart';
class SyncManager with Isolateable {
final _logger = YagaLogger.getLogger(SyncManager);
final Map> _syncMatrix = {};
Future addUri(Uri key) async {
_syncMatrix.putIfAbsent(key, () => {});
}
SyncFile? _addFile(Uri key, NcFile file) {
return _syncMatrix[key]?.putIfAbsent(file.uri, () => SyncFile(file));
}
Future addFile(Uri key, NcFile file) async {
_logger.fine("Adding file ${file.uri.path}");
_addFile(key, file);
}
Future addRemoteFile(Uri key, NcFile file) async {
_logger.fine("Adding remote file ${file.uri.path}");
_addFile(key, file)?.remote = true;
}
Future> syncUri(Uri key) async {
return _syncMatrix
.remove(key)
?.values
.where((file) => !file.remote)
.map((e) => e.file)
.toList() ??
const [];
}
Future removeUri(Uri key) async {
_syncMatrix.remove(key);
}
}
================================================
FILE: lib/managers/navigation_manager.dart
================================================
import 'package:rx_command/rx_command.dart';
import 'package:yaga/model/route_args/directory_navigation_screen_arguments.dart';
class NavigationManager {
RxCommand showDirectoryNavigation =
RxCommand.createSync((param) => param, initialLastResult: null);
}
================================================
FILE: lib/managers/nextcloud_manager.dart
================================================
import 'dart:async';
import 'dart:io';
import 'package:rx_command/rx_command.dart';
import 'package:yaga/model/nc_login_data.dart';
import 'package:rxdart/rxdart.dart';
import 'package:yaga/services/isolateable/local_file_service.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/services/isolateable/system_location_service.dart';
import 'package:yaga/services/secure_storage_service.dart';
import 'package:yaga/utils/self_signed_cert_handler.dart';
import 'package:yaga/utils/uri_utils.dart';
class NextCloudManager {
late RxCommand loginCommand;
late RxCommand _internalLoginCommand;
//todo: this command has a bad naming since it only gets triggered on login not logout
late RxCommand
updateLoginStateCommand;
late RxCommand logoutCommand;
late RxCommand updateAvatarCommand;
final SecureStorageService _secureStorageService;
final NextCloudService _nextCloudService;
final LocalFileService _localFileService;
final SystemLocationService _systemLocationService;
final SelfSignedCertHandler _selfSignedCertHandler;
NextCloudManager(
this._nextCloudService,
this._secureStorageService,
this._localFileService,
this._systemLocationService,
this._selfSignedCertHandler,
) {
loginCommand = RxCommand.createFromStream(
(param) => _createLoginDataPersisStream(param!));
loginCommand.listen((value) => _internalLoginCommand(value));
_internalLoginCommand = RxCommand.createSync((param) => param);
_internalLoginCommand.listen((event) async {
final origin = await _nextCloudService.login(event);
if (event.id == "" || event.displayName == "") {
await _selfSignedCertHandler.persistCert();
await _secureStorageService.savePreference(
NextCloudLoginDataKeys.id, origin.username);
await _secureStorageService.savePreference(
NextCloudLoginDataKeys.displayName, origin.displayName);
}
updateLoginStateCommand(event);
updateAvatarCommand();
});
updateLoginStateCommand = RxCommand.createSync(
(param) => param,
initialLastResult: NextCloudLoginData.empty(),
);
logoutCommand = RxCommand.createFromStream(
(_) => _createLoginDataPersisStream(NextCloudLoginData.empty()),
);
logoutCommand
.doOnData((event) => _nextCloudService.logout())
.listen((value) {
_selfSignedCertHandler.revokeCert();
updateLoginStateCommand(value);
updateAvatarCommand();
});
updateAvatarCommand = RxCommand.createAsync((_) => _handleAvatarUpdate(),
initialLastResult: _avatarFile);
}
Future _handleAvatarUpdate() async {
final File avatar = _avatarFile;
if (_nextCloudService.isLoggedIn()) {
return _nextCloudService
.getAvatar()
.then(
(value) => _localFileService.createFile(
file: avatar,
bytes: value,
),
)
.catchError((_) => avatar);
}
_localFileService.deleteFile(avatar);
return avatar;
}
File get _avatarFile => File(
chainPathSegments(
_systemLocationService
.absoluteUriFromInternal(_systemLocationService.internalCache.uri)
.path,
"${_nextCloudService.origin?.userDomain}.avatar",
),
);
Future init() async {
final String server = await _secureStorageService
.loadPreference(NextCloudLoginDataKeys.server);
final String user =
await _secureStorageService.loadPreference(NextCloudLoginDataKeys.user);
final String password = await _secureStorageService
.loadPreference(NextCloudLoginDataKeys.password);
final String userId =
await _secureStorageService.loadPreference(NextCloudLoginDataKeys.id);
final String displayName = await _secureStorageService
.loadPreference(NextCloudLoginDataKeys.displayName);
if (server != "" && user != "" && password != "") {
final Completer login = Completer();
updateLoginStateCommand
.where((event) => !login.isCompleted)
.listen((value) => login.complete(this));
_internalLoginCommand(NextCloudLoginData(
Uri.parse(server),
user,
password,
id: userId,
displayName: displayName,
));
return login.future;
}
return this;
}
Stream _createLoginDataPersisStream(
NextCloudLoginData data) {
//todo: Background: can we persist this as a json? json support was added as part of the background worker
return ForkJoinStream.list([
_secureStorageService
.savePreference(NextCloudLoginDataKeys.server, data.server.toString())
.asStream(),
_secureStorageService
.savePreference(NextCloudLoginDataKeys.user, data.user)
.asStream(),
_secureStorageService
.savePreference(NextCloudLoginDataKeys.password, data.password)
.asStream(),
_secureStorageService
.savePreference(NextCloudLoginDataKeys.id, data.id)
.asStream(),
_secureStorageService
.savePreference(NextCloudLoginDataKeys.displayName, data.displayName)
.asStream(),
]).map((_) => data);
}
}
================================================
FILE: lib/managers/settings_manager.dart
================================================
import 'package:rx_command/rx_command.dart';
import 'package:yaga/managers/settings_manager_base.dart';
import 'package:yaga/model/preferences/bool_preference.dart';
import 'package:yaga/model/preferences/int_preference.dart';
import 'package:yaga/model/preferences/mapping_preference.dart';
import 'package:yaga/model/preferences/preference.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/uri_preference.dart';
import 'package:yaga/model/preferences/value_preference.dart';
import 'package:yaga/services/shared_preferences_service.dart';
typedef PrefFunction = T Function(T);
class SettingsManager extends SettingsManagerBase {
final SharedPreferencesService _sharedPreferencesService;
late RxCommand, void>
persistStringSettingCommand;
late RxCommand persistBoolSettingCommand;
late RxCommand
persistMappingPreferenceCommand;
late RxCommand
removeMappingPreferenceCommand;
late RxCommand
loadMappingPreferenceCommand;
late RxCommand persistIntSettingCommand;
SettingsManager(this._sharedPreferencesService) {
persistStringSettingCommand = RxCommand.createAsync((param) =>
_sharedPreferencesService.savePreferenceToString(param).then((value) =>
_checkPersistResult(value, param,
_sharedPreferencesService.loadPreferenceFromString)));
persistBoolSettingCommand = RxCommand.createAsync((param) =>
_sharedPreferencesService.savePreferenceToBool(param).then((value) =>
_checkPersistResult(value, param,
_sharedPreferencesService.loadPreferenceFromBool)));
persistIntSettingCommand = RxCommand.createAsync(
(param) => _sharedPreferencesService.savePreferenceToInt(param).then(
(value) => _checkPersistResult(
value,
param,
_sharedPreferencesService.loadPreferenceFromInt,
),
),
);
persistMappingPreferenceCommand = RxCommand.createSync((param) => param);
persistMappingPreferenceCommand.listen((value) async {
//todo: add error handling in case one of those fails
// await _sharedPreferencesService.saveComplexPreference(value,
// overrideValue: false);
await _sharedPreferencesService.savePreferenceToBool(value);
await _sharedPreferencesService.savePreferenceToString(value.remote);
await _sharedPreferencesService.savePreferenceToString(value.local);
await _sharedPreferencesService.savePreferenceToBool(value.syncDeletes);
// _sharedPreferencesService.saveComplexPreference(value).then((res) =>
_sharedPreferencesService.savePreferenceToBool(value).then((res) =>
_checkPersistResult(
res, value, _sharedPreferencesService.loadPreferenceFromBool));
});
removeMappingPreferenceCommand = RxCommand.createSync((param) => param);
removeMappingPreferenceCommand.listen((value) async {
await _sharedPreferencesService.removePreference(value.local);
await _sharedPreferencesService.removePreference(value.remote);
await _sharedPreferencesService.removePreference(value.syncDeletes);
await _sharedPreferencesService.removePreference(value);
});
loadMappingPreferenceCommand = RxCommand.createSync((param) => param);
loadMappingPreferenceCommand.listen((value) {
final UriPreference remote =
_sharedPreferencesService.loadPreferenceFromString(value.remote);
final UriPreference local =
_sharedPreferencesService.loadPreferenceFromString(value.local);
final BoolPreference syncDeletes =
_sharedPreferencesService.loadPreferenceFromBool(value.syncDeletes);
updateSettingCommand(_sharedPreferencesService.loadPreferenceFromBool(
value.rebuild(
(b) => b
..remote = remote.toBuilder()
..local = local.toBuilder()
..syncDeletes = syncDeletes.toBuilder(),
),
));
});
}
void _checkPersistResult(
bool res, T defaultPref, T Function(T) onLoadPref) {
if (!res) {
//todo: add error handling if value==false
//return;
}
updateSettingCommand(onLoadPref(defaultPref));
}
}
================================================
FILE: lib/managers/settings_manager_base.dart
================================================
import 'package:rx_command/rx_command.dart';
import 'package:yaga/model/preferences/preference.dart';
abstract class SettingsManagerBase {
late RxCommand updateSettingCommand;
SettingsManagerBase() {
updateSettingCommand = RxCommand.createSync((param) => param);
}
}
================================================
FILE: lib/managers/tab_manager.dart
================================================
import 'package:rx_command/rx_command.dart';
import 'package:yaga/views/screens/yaga_home_screen.dart';
class TabManager {
RxCommand tabChangedCommand =
RxCommand.createSync((param) => param);
}
================================================
FILE: lib/managers/widget_local/file_list_local_manager.dart
================================================
import 'dart:async';
import 'package:rx_command/rx_command.dart';
import 'package:uuid/uuid.dart';
import 'package:yaga/managers/file_manager/file_manager.dart';
import 'package:yaga/managers/isolateable/mapping_manager.dart';
import 'package:yaga/managers/settings_manager.dart';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/model/preferences/bool_preference.dart';
import 'package:yaga/model/preferences/mapping_preference.dart';
import 'package:yaga/model/sort_config.dart';
import 'package:yaga/model/sorted_category_list.dart';
import 'package:yaga/model/sorted_file_folder_list.dart';
import 'package:yaga/model/sorted_file_list.dart';
import 'package:yaga/services/isolateable/nextcloud_service.dart';
import 'package:yaga/utils/forground_worker/foreground_worker.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_done.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_request.dart';
import 'package:yaga/utils/forground_worker/messages/file_list_response.dart';
import 'package:yaga/utils/forground_worker/messages/file_update_msg.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/delete_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/destination_action_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/favorite_files_request.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_done.dart';
import 'package:yaga/utils/forground_worker/messages/files_action/files_action_request.dart';
import 'package:yaga/utils/forground_worker/messages/merge_sort_done.dart';
import 'package:yaga/utils/forground_worker/messages/merge_sort_request.dart';
import 'package:yaga/utils/forground_worker/messages/message.dart';
import 'package:yaga/utils/logger.dart';
import 'package:yaga/utils/service_locator.dart';
// this is a widget local manager, meaning that it is intendet to exist per widget that needs its functionality
// however this also means that the owning widget has to manage init and disposal
// treat it like local state
class FileListLocalManager {
final _logger = YagaLogger.getLogger(FileListLocalManager);
BoolPreference recursive;
List selected = [];
final bool allowSelecting;
SortConfig _sortConfig;
RxCommand loadingChangedCommand = RxCommand.createSync((param) => param, initialLastResult: false);
late RxCommand filesChangedCommand;
late RxCommand selectFileCommand = RxCommand.createSync((param) => param);
late RxCommand selectionModeChanged = RxCommand.createSync((param) => param, initialLastResult: false);
late RxCommand, List> selectionChangedCommand = RxCommand.createSync((param) => param);
StreamSubscription? _updatedMappingPreferenceCommandSubscription;
StreamSubscription? _updateFileListSubscripton;
StreamSubscription? _updateRecursiveSubscription;
//todo: we are here directly using the worker, we should be going over the file manager bridge
final ForegroundWorker _worker;
final FileManager _fileManager;
StreamSubscription? _foregroundMessageCommandSubscription;
StreamSubscription? _foregroundMergeSortSubscription;
Uri _uri;
late String managerKey;
final bool favorites;
bool get isInSelectionMode => selected.isNotEmpty;
FileListLocalManager(this._uri,
this.recursive,
this._sortConfig, {
this.allowSelecting = true,
this.favorites = false,
})
: _worker = getIt.get(),
_fileManager = getIt.get() {
filesChangedCommand = RxCommand.createSync(
(param) => param,
initialLastResult: emptyFileList,
);
Uuid uuid = const Uuid();
managerKey = uuid.v1();
}
SortedFileList get sorted => filesChangedCommand.lastResult!;
Uri get uri => _uri;
SortConfig get sortConfig => _sortConfig;
SortedFileList get emptyFileList {
if (_sortConfig.sortType == SortType.list) {
return SortedFileFolderList.empty(_sortConfig);
} else {
return SortedCategoryList.empty(_sortConfig);
}
}
void dispose() {
_foregroundMessageCommandSubscription?.cancel();
_updatedMappingPreferenceCommandSubscription?.cancel();
_updateFileListSubscripton?.cancel();
_updateRecursiveSubscription?.cancel();
_foregroundMergeSortSubscription?.cancel();
}
void updateFilesAndFolders() {
//cancel old subscription
_foregroundMessageCommandSubscription?.cancel();
_updateFileListSubscripton?.cancel();
loadingChangedCommand(true);
//todo: why are we still rebuilding this subScriptions on refetch?
//todo: in future communication with the background worker should be done by bridges & handlers, and not directly
_foregroundMessageCommandSubscription = _fileManager.updateFilesCommand
.where((event) =>
//file list may contain recursively loaded files; this is done so we minimize the UI thread merging of lists
//todo: maybe there is a better approach to this
(event.uri == uri) || (recursive.value && event.uri.toString().startsWith(uri.toString())))
.listen((event) {
if (event is FileListResponse) {
_logger.warning(
"${event.key} (received list - #images: ${event.files.files.length})",
);
// if uri is not equal then it could be a sub dir loaded by the copy command for example
if (event.key == managerKey && event.uri == uri) {
_showNewFiles(event.files);
} else {
// in this case we are interested in the data but can not tell if the data is not missing crutial parts
// todo: can we build a bridge for this?
_sendMergeSortRequest(
MergeSortRequest(
managerKey,
//primarely to counter hot reloads
filesChangedCommand.lastResult ?? emptyFileList,
event.files,
uri: uri,
recursive: recursive.value,
),
);
}
}
if (event is FileListDone && event.key == managerKey) {
_logger.warning("$managerKey (done - manager key)");
_logger.warning("${event.key} (done - event key)");
loadingChangedCommand(false);
}
});
_updateFileListSubscripton = _fileManager.fileUpdateMessage.listen((event) => _removeFileFromList(event.file));
_logger.warning("$managerKey (start)");
_fileManager.fetchFileListCommand(FileListRequest(
managerKey,
uri,
_sortConfig,
recursive: recursive.value,
favorites: favorites,
));
}
void _showNewFiles(SortedFileList files) {
if (files.config == _sortConfig) {
filesChangedCommand(files);
} else {
_sendMergeSortRequest(
MergeSortRequest(
managerKey,
emptyFileList,
files,
),
);
}
}
void _sendMergeSortRequest(MergeSortRequest request) => _worker.sendRequest(request);
//todo: changing the view type while fetching the list will not fetch all files
bool setSortConfig(SortConfig sortConfig) {
final changed = sortConfig != _sortConfig;
_sortConfig = sortConfig;
if (loadingChangedCommand.lastResult!) {
return changed;
}
if (changed) {
//todo: loading changed has to be improved... currently if we are fetching a list and changing the config simulatniously the first to be done will stop the loading indicator
loadingChangedCommand(true);
_sendMergeSortRequest(
MergeSortRequest(
managerKey,
emptyFileList,
filesChangedCommand.lastResult!,
updateLoading: true,
),
);
}
return changed;
}
void _removeFileFromList(NcFile file) {
_logger.warning("$managerKey (delete)");
final SortedFileList files = filesChangedCommand.lastResult!;
//todo: delete and re-sort are interfearing with each other
if (files.remove(file)) {
//todo: what happens is that the deletes might be triggered on states before the resort is done
filesChangedCommand(files);
}
}
/* bool _fileIsFromThisManager(String eventKey) {
return eventKey.startsWith(managerKey);
} */
void refetch({Uri? uri}) {
_uri = uri ?? _uri;
updateFilesAndFolders();
}
void initState() {
updateFilesAndFolders();
_updatedMappingPreferenceCommandSubscription = getIt
.get()
.mappingUpdatedCommand
.listen(
(value) {
// currently local file is not checked when comparing two NcFiles
// thats why we have to clear the entire list and repopulate it
// otherwise availability icons will not be refreshed
// because NcFiles in list will not be refreshed and will still point to old local files
removeAll();
refetch();
},
);
_updateRecursiveSubscription = getIt
.get()
.updateSettingCommand
.where((event) => event.key == recursive.key)
.map((event) => event as BoolPreference)
.where((event) => event.value != recursive.value)
.listen((event) {
recursive = event;
refetch();
});
selectFileCommand.where((_) => allowSelecting).listen((file) {
final bool selectionMode = isInSelectionMode;
file.selected = !file.selected;
file.selected ? selected.add(file) : selected.remove(file);
//using updateImageCommand is more effective then filesChangedCommand since it is not updating the whole list
//however, keep in mind that this will update all widgets displaying this file not only the one in the current view
//it might be a good idea to create a view local version of this command that relays global updates
getIt.get().updateImageCommand(file);
if (selectionMode != isInSelectionMode) {
selectionModeChanged(isInSelectionMode);
} else {
selectionChangedCommand(selected);
}
});
_foregroundMergeSortSubscription = _worker.isolateResponseCommand
.where((event) => event.key == managerKey)
.where((event) => event is MergeSortDone)
.map((event) => event as MergeSortDone)
.listen((event) {
_showNewFiles(event.sorted);
if (event.updateLoading) {
loadingChangedCommand(false);
}
});
}
Future removeAll() async {
filesChangedCommand(filesChangedCommand.lastResult!
..removeAll());
}
bool isAllSelected() {
final hasSelectedFolders = this.hasSelectedFolders;
final hasSelectedFiles = this.hasSelectedFiles;
if (hasSelectedFiles && hasSelectedFolders) {
return selected.length == sorted.length;
}
if (hasSelectedFiles) {
return selected.length == sorted.files.length;
}
return selected.length == sorted.folders.length;
}
Future toggleSelect() => isAllSelected() ? deselectAll() : selectAll();
Future deselectAll() async {
final fileManager = getIt.get();
for (final file in selected) {
file.selected = false;
fileManager.updateImageCommand(file);
}
selected = [];
selectionModeChanged(isInSelectionMode);
}
Future selectAll() async {
final fileManager = getIt.get();
final hasSelectedFolders = this.hasSelectedFolders;
final hasSelectedFiles = this.hasSelectedFiles;
final sorted = filesChangedCommand.lastResult;
selected = [];
if (hasSelectedFiles) {
selected.addAll(sorted!.files);
}
if (hasSelectedFolders) {
selected.addAll(sorted!.folders);
}
for (final file in selected) {
file.selected = true;
fileManager.updateImageCommand(file);
}
selectionChangedCommand(selected);
}
Future deleteSelected({required bool local}) =>
_executeActionForSelection(
DeleteFilesRequest(
key: managerKey,
files: selected,
local: local,
sourceDir: uri,
),
);
Future favoriteSelected() =>
_executeActionForSelection(
FavoriteFilesRequest(
key: managerKey,
files: selected,
sourceDir: uri,
),
);
Future copySelected(Uri destination, {bool overwrite = false}) =>
_executeActionForSelection(
DestinationActionFilesRequest(
key: managerKey,
files: selected,
destination: destination,
overwrite: overwrite,
sourceDir: uri,
),
);
Future moveSelected(Uri destination, {bool overwrite = false}) =>
_executeActionForSelection(
DestinationActionFilesRequest(
key: managerKey,
files: selected,
destination: destination,
action: DestinationAction.move,
overwrite: overwrite,
sourceDir: uri,
),
);
Future _executeActionForSelection(FilesActionRequest action) async {
final Completer jobDone = Completer();
_fileManager.filesActionCommand(action);
final StreamSubscription actionSub =
_fileManager.filesActionDoneCommand.where((event) => event.key == managerKey).listen((event) {
jobDone.complete(true);
_fileManager.fetchFileListCommand(FileListRequest(
managerKey,
event.destination,
_sortConfig,
));
});
return jobDone.future.whenComplete(() => actionSub.cancel()).whenComplete(() => deselectAll());
}
void cancelSelectionAction() {
_worker.sendRequest(FilesActionDone(managerKey, _uri));
}
bool get isRemoteUri => getIt.get().isUriOfService(uri);
bool get hasSelectedFolders =>
selected
.where((e) => e.isDirectory)
.firstOrNull
?.isDirectory ?? false;
bool get hasSelectedFiles =>
!(selected
.where((e) => !e.isDirectory)
.firstOrNull
?.isDirectory ?? true);
}
================================================
FILE: lib/model/category_view_config.dart
================================================
import 'package:yaga/model/general_view_config.dart';
import 'package:yaga/views/screens/yaga_home_screen.dart';
class CategoryViewConfig {
// final Uri defaultPath;
final String pref;
final YagaHomeTab? selectedTab;
final bool? hasDrawer;
final bool favorites;
// final bool pathEnabled;
final String? title;
final GeneralViewConfig generalViewConfig;
CategoryViewConfig({
required Uri defaultPath,
required this.pref,
this.selectedTab,
this.hasDrawer,
required bool pathEnabled,
this.title,
this.favorites = false
}) : generalViewConfig =
GeneralViewConfig(pref, defaultPath, pathEnabled: pathEnabled);
}
================================================
FILE: lib/model/fetched_file.dart
================================================
import 'dart:typed_data';
import 'package:yaga/model/nc_file.dart';
import 'package:yaga/utils/forground_worker/messages/message.dart';
class FetchedFile extends Message {
final NcFile file;
final Uint8List data;
FetchedFile(this.file, this.data) : super("FetchedFile");
}
================================================
FILE: lib/model/general_view_config.dart
================================================
import 'package:flutter/material.dart';
import 'package:yaga/model/preferences/preference.dart';
import 'package:yaga/model/preferences/section_preference.dart';
import 'package:yaga/model/preferences/uri_preference.dart';
class GeneralViewConfig {
final SectionPreference general;
final UriPreference path;
factory GeneralViewConfig(
String pref,
Uri defaultPath, {
required bool pathEnabled,
}) {
final SectionPreference general = SectionPreference((b) => b
..key = Preference.prefixKey(pref, "general")
..title = "General");
final UriPreference path = UriPreference((b) => b
..key = general.prepareKey("path")
..title = "Path"
..value = defaultPath
..enabled = pathEnabled);
return GeneralViewConfig.internal(general, path);
}
@protected
GeneralViewConfig.internal(this.general, this.path);
}
================================================
FILE: lib/model/local_file.dart
================================================
import 'dart:io';
class LocalFile {
static const _jsonFileUrl = "fileUrl";
static const _jsonExists = "exists";
FileSystemEntity file;
bool exists;
LocalFile(this.file, this.exists);
LocalFile.fromJson(Map json, {required bool isDirectory})
: file = isDirectory
? Directory.fromUri(Uri.parse(json[_jsonFileUrl] as String))
: File.fromUri(Uri.parse(json[_jsonFileUrl] as String)),
exists = json[_jsonExists] as bool;
Map toJson() {
return {
_jsonFileUrl: file.uri.toString(),
_jsonExists: exists,
};
}
}
================================================
FILE: lib/model/mapping_node.dart
================================================
import 'package:yaga/model/preferences/mapping_preference.dart';
class MappingNode {
Map nodes = {};
MappingPreference? mapping;
}
================================================
FILE: lib/model/nc_file.dart
================================================
import 'package:mime/mime.dart';
import 'package:path/path.dart' as p;
import 'package:yaga/model/local_file.dart';
class NcFile {
static const String _jsonIsDirectory = "isDirectory";
static const String _jsonName = "name";
static const String _jsonFileExtension = "fileExtension";
static const String _jsonUri = "uri";
static const String _jsonUpstreamId = "upstreamId";
static const String _jsonLocalFile = "localFile";
static const String _jsonPreviewFile = "previewFile";
static const String _jsonLastModified = "lastModified";
static const String _jsonSelected = "selected";
static const String _jsonFavorite = "favorite";
final bool isDirectory;
final String name;
final String fileExtension;
Uri uri;
String? upstreamId;
LocalFile? localFile;
LocalFile? previewFile;
DateTime? lastModified;
bool selected = false;
bool favorite = false;
NcFile(this.uri, this.name, this.fileExtension,
{required this.isDirectory, this.upstreamId});
NcFile.fromJson(Map json)
: isDirectory = json[_jsonIsDirectory] as bool,
name = json[_jsonName] as String,
fileExtension = json[_jsonFileExtension] as String,
uri = Uri.parse(json[_jsonUri] as String),
upstreamId = json[_jsonUpstreamId] == null
? null
: json[_jsonUpstreamId] as String,
localFile = json[_jsonLocalFile] == null
? null
: LocalFile.fromJson(
json[_jsonLocalFile] as Map,
isDirectory: json[_jsonIsDirectory] as bool,
),
previewFile = json[_jsonPreviewFile] == null
? null
: LocalFile.fromJson(
json[_jsonPreviewFile] as Map,
isDirectory: json[_jsonIsDirectory] as bool,
),
lastModified = json[_jsonLastModified] == null
? null
: DateTime.parse(json[_jsonLastModified] as String),
selected = json[_jsonSelected] as bool,
favorite = json[_jsonFavorite] as bool;
factory NcFile.file(Uri uri, String name, String? mime) {
String ext = p.extension(name).replaceAll('.', '');
if (ext.isEmpty) {
ext = extensionFromMime(mime ?? '');
}
return NcFile(uri, name, ext, isDirectory: false);
}
factory NcFile.directory(Uri uri, String name, {String? upstreamId}) =>
NcFile(
uri,
name,
'',
isDirectory: true,
upstreamId: upstreamId,
);
@override
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false;
return other is NcFile &&
other.uri.toString() == uri.toString() &&
other.upstreamId == upstreamId;
}
@override
int get hashCode => Object.hash(uri, upstreamId);
Map toJson() {
return {
_jsonIsDirectory: isDirectory,
_jsonName: name,
_jsonFileExtension: fileExtension,
_jsonUri: uri.toString(),
_jsonUpstreamId: upstreamId,
_jsonLocalFile: localFile?.toJson(),
_jsonPreviewFile: previewFile?.toJson(),
_jsonLastModified: lastModified?.toString(),
_jsonSelected: selected,
_jsonFavorite: favorite
};
}
}
================================================
FILE: lib/model/nc_login_data.dart
================================================
class NextCloudLoginDataKeys {
static const String server = "server";
static const String user = "user";
static const String password = "password";
static const String id = "id";
static const String displayName = "displayName";
}
class NextCloudLoginData {
final Uri? server;
final String user;
final String password;
final String id;
final String displayName;
NextCloudLoginData(
this.server,
this.user,
this.password, {
this.id = "",
this.displayName = "",
});
factory NextCloudLoginData.empty() => NextCloudLoginData(null, "", "",);
//todo: Background: use auto-generation for formJson/toJson?
NextCloudLoginData.fromJson(Map json)
: server = Uri.parse(json[NextCloudLoginDataKeys.server] as String),
user = json[NextCloudLoginDataKeys.user] as String,
password = json[NextCloudLoginDataKeys.password] as String,
id = json[NextCloudLoginDataKeys.id] as String,
displayName = json[NextCloudLoginDataKeys.displayName] as String;
Map toJson() {
return {
NextCloudLoginDataKeys.server: server.toString(),
NextCloudLoginDataKeys.user: user,
NextCloudLoginDataKeys.password: password,
NextCloudLoginDataKeys.id: id,
NextCloudLoginDataKeys.displayName: displayName,
};
}
}
================================================
FILE: lib/model/nc_origin.dart
================================================
class NcOrigin {
/// This uri represents the original server uri with port and path if specified.
/// Only the scheme is changed to 'nc'.
///
/// In case of a local file: file://device.local
///
/// Examples for valid [uri] values:
/// * cloud.com: Domain
/// * nc.cloud.com: Subdomain
/// * www.cloud.com: Equal to subdomain.
/// * www.cloud.com/nc: Nextcloud root behind subpath.
/// * www.cloud.com:7443: Nextcloud root behind different port.
final Uri uri;
/// Examples for valid [username] values:
/// * Simple username: xyz
/// * Username with special characters: xyz@email.com
/// * LDAP UUID: 2522ba7c2-xxxxxxxx-yyyyyy
final String username;
/// Display name, username, loign name can be different things in Nextcloud.
/// Display name can be equal to the username or anything else like: Forename Lastname
final String displayName;
/// Can be an email or an username.
final String loginName;
NcOrigin(
this.uri,
this.username,
this.displayName,
this.loginName,
);
String get domain => uri.host;
//todo: when refactoring, how will we handle subpaths in origin for user home folder in app directory?
/// We are using the login name for backwards compability however if a user logs out and in again with different login names
/// then this user will not be mapped back to the right data folder.
String get userDomain => "$loginName@${uri.host}";
/// This is the old representation of root. Still needed for the [MappingManager] to work properly.
/// Returns uri in form: nc://user@host/
/// With user being encoded.
/// We are using the login name for backwards compability however if a user logs out and in again with different login names
/// then this user will not be mapped back to the right data folder.
Uri get userEncodedDomainRoot => Uri(
scheme: uri.scheme,
userInfo: Uri.encodeComponent(loginName),
host: uri.host,
path: "/",
);
}
================================================
FILE: lib/model/preferences/action_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/preference.dart';
part 'action_preference.g.dart';
abstract class ActionPreference
implements Preference, Built {
Function() get action;
static void _initializeBuilder(ActionPreferenceBuilder b) =>
Preference.initBuilder(b);
factory ActionPreference([void Function(ActionPreferenceBuilder) updates]) =
_$ActionPreference;
ActionPreference._();
}
================================================
FILE: lib/model/preferences/bool_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'bool_preference.g.dart';
abstract class BoolPreference
with BaseTypeSerializer
implements
SerializablePreference,
Built {
static void _initializeBuilder(BoolPreferenceBuilder b) =>
ValuePreference.initBuilder(b);
factory BoolPreference([void Function(BoolPreferenceBuilder) updates]) =
_$BoolPreference;
BoolPreference._();
}
================================================
FILE: lib/model/preferences/choice_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'choice_preference.g.dart';
abstract class ChoicePreference
with BaseTypeSerializer
implements
SerializablePreference,
Built {
Map get choices;
static void _initializeBuilder(ChoicePreferenceBuilder b) =>
ValuePreference.initBuilder(b);
factory ChoicePreference([void Function(ChoicePreferenceBuilder) updates]) =
_$ChoicePreference;
ChoicePreference._();
}
================================================
FILE: lib/model/preferences/complex_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:flutter/foundation.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'complex_preference.g.dart';
//todo: is the bool value ever used?
@BuiltValue(instantiable: false)
abstract class ComplexPreference
implements SerializablePreference {
@protected
static T initBuilder(T b) =>
ValuePreference.initBuilder(b);
@override
ComplexPreference rebuild(void Function(ComplexPreferenceBuilder) updates);
@override
ComplexPreferenceBuilder toBuilder();
}
================================================
FILE: lib/model/preferences/int_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/serializers/int_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'int_preference.g.dart';
abstract class IntPreference
with BaseTypeSerializer
implements
SerializablePreference,
Built {
static void _initializeBuilder(IntPreferenceBuilder b) =>
ValuePreference.initBuilder(b);
factory IntPreference([void Function(IntPreferenceBuilder) updates]) =
_$IntPreference;
IntPreference._();
}
================================================
FILE: lib/model/preferences/mapping_preference.dart
================================================
//todo: Preference clone functions should be unified
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/bool_preference.dart';
import 'package:yaga/model/preferences/complex_preference.dart';
import 'package:yaga/model/preferences/preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/uri_preference.dart';
part 'mapping_preference.g.dart';
abstract class MappingPreference
with BaseTypeSerializer
implements
ComplexPreference,
Built {
UriPreference get remote;
UriPreference get local;
BoolPreference get syncDeletes;
//todo: still need a solution for key prefixes
static void _initializeBuilder(MappingPreferenceBuilder b) =>
ComplexPreference.initBuilder(b)
..value = true
..remote.key = "remote"
..remote.title = "Remote Path"
//todo: scheme has to be retrieved from actual service
..remote.schemeFilter = "nc"
..local.key = "local"
..local.title = "Local Path"
..local.schemeFilter = "file"
..syncDeletes.key = "syncDeletes"
..syncDeletes.title = "Sync Server Deletes"
..syncDeletes.value = true;
static void _finalizeBuilder(MappingPreferenceBuilder b) => b
..remote.key = Preference.prefixKey(b.key!, b.remote.key!)
..local.key = Preference.prefixKey(b.key!, b.local.key!)
..syncDeletes.key = Preference.prefixKey(b.key!, b.syncDeletes.key!);
factory MappingPreference([void Function(MappingPreferenceBuilder) updates]) =
_$MappingPreference;
MappingPreference._();
}
================================================
FILE: lib/model/preferences/preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:flutter/foundation.dart';
part 'preference.g.dart';
@BuiltValue(instantiable: false)
abstract class Preference {
String? get key;
String? get title;
bool? get enabled;
static String prefixKey(String prefix, String key) =>
key.startsWith(prefix) ? key : "$prefix:$key";
@protected
static PreferenceBuilder initBuilder(
PreferenceBuilder b) =>
b..enabled = true;
Preference rebuild(void Function(PreferenceBuilder) updates);
PreferenceBuilder toBuilder();
}
================================================
FILE: lib/model/preferences/section_preference.dart
================================================
//todo: refactor all preferences to respect enabled
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/preference.dart';
part 'section_preference.g.dart';
abstract class SectionPreference
implements Preference, Built {
String prepareKey(String keyPart) => Preference.prefixKey(key!, keyPart);
static void _initializeBuilder(SectionPreferenceBuilder b) =>
Preference.initBuilder(b);
factory SectionPreference([void Function(SectionPreferenceBuilder) updates]) =
_$SectionPreference;
SectionPreference._();
}
================================================
FILE: lib/model/preferences/serializable_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:flutter/foundation.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'serializable_preference.g.dart';
@BuiltValue(instantiable: false)
abstract class SerializablePreference>
implements ValuePreference {
@protected
static T initBuilder(
ValuePreferenceBuilder b) =>
ValuePreference.initBuilder(b);
SerializableType serialize();
PreferenceType deserialize(SerializableType? value);
@override
PreferenceType rebuild(
void Function(
SerializablePreferenceBuilder)
updates);
@override
SerializablePreferenceBuilder
toBuilder();
}
================================================
FILE: lib/model/preferences/serializers/base_type_serializer.dart
================================================
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/value_preference.dart';
mixin BaseTypeSerializer>
implements SerializablePreference {
@override
T serialize() {
return value;
}
@override
P deserialize(T? value) {
return (value == null ? this : rebuild((b) => b..value = value)) as P;
}
}
================================================
FILE: lib/model/preferences/serializers/int_serializer.dart
================================================
import 'package:yaga/model/preferences/int_preference.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
mixin IntSerializer
implements SerializablePreference {
@override
String serialize() {
return value.toString();
}
@override
IntPreference deserialize(String? value) {
return value == null
? this as IntPreference
: rebuild((b) => b..value = int.parse(value));
}
}
================================================
FILE: lib/model/preferences/serializers/uri_serializer.dart
================================================
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/uri_preference.dart';
mixin UriSerializer
implements SerializablePreference {
@override
String serialize() {
return value.toString();
}
@override
UriPreference deserialize(String? value) {
return value == null
? this as UriPreference
: rebuild((b) => b..value = Uri.parse(value));
}
}
================================================
FILE: lib/model/preferences/string_list_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'string_list_preference.g.dart';
abstract class StringListPreference
with
BaseTypeSerializer, StringListPreference>
implements
SerializablePreference, List,
StringListPreference>,
Built {
static void _initializeBuilder(StringListPreferenceBuilder b) =>
ValuePreference.initBuilder(b);
factory StringListPreference(
[void Function(StringListPreferenceBuilder) updates]) =
_$StringListPreference;
StringListPreference._();
}
================================================
FILE: lib/model/preferences/string_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/base_type_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'string_preference.g.dart';
abstract class StringPreference
with BaseTypeSerializer
implements
SerializablePreference,
Built {
static void _initializeBuilder(StringPreferenceBuilder b) =>
ValuePreference.initBuilder(b);
factory StringPreference([void Function(StringPreferenceBuilder) updates]) =
_$StringPreference;
StringPreference._();
}
================================================
FILE: lib/model/preferences/uri_preference.dart
================================================
library preference;
import 'package:built_value/built_value.dart';
import 'package:yaga/model/preferences/serializable_preference.dart';
import 'package:yaga/model/preferences/serializers/uri_serializer.dart';
import 'package:yaga/model/preferences/value_preference.dart';
part 'uri_preference.g.dart';
abstract class UriPreference
with UriSerializer
implements
SerializablePreference,
Built {
bool get fixedOrigin;
String get schemeFilter;
static void _initializeBuilder(UriPreferenceBuilder b) =>
ValuePreference.initBuilder