Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
deckerst committed Mar 13, 2023
2 parents fd92d1b + faa20f3 commit 7b2f72c
Show file tree
Hide file tree
Showing 153 changed files with 2,417 additions and 1,372 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.

## <a id="unreleased"></a>[Unreleased]

## <a id="v1.8.3"></a>[v1.8.3] - 2023-03-13

### Added

- Collection: preview button when selecting items
- Collection: item size in list layout
- Vaults: custom pattern lock
- Video: picture-in-picture
- Video: handle skip next/previous media buttons
- TV: more media controls

### Changed

- scroll to show item when navigating from Info page
- upgraded Flutter to stable v3.7.7

### Fixed

- Accessibility: using accessibility services keeping snack bar beyond countdown
- Accessibility: navigation with TalkBack
- Vaults: crash when using fingerprint on older Android versions
- Vaults: sharing multiple items

## <a id="v1.8.2"></a>[v1.8.2] - 2023-02-28

### Added
Expand Down
13 changes: 12 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ This change eventually prevents building the app with Flutter v3.3.3.
<intent>
<action android:name="android.intent.action.MAIN" />
</intent>
<!-- necessary to resolve image editor apps that are not visible in the launcher -->
<intent>
<action android:name="android.intent.action.EDIT" />
<data android:mimeType="image/*" />
</intent>
<!-- necessary to resolve video editor apps that are not visible in the launcher -->
<intent>
<action android:name="android.intent.action.EDIT" />
<data android:mimeType="video/*" />
</intent>
<!--
from Android 11, `url_launcher` method `canLaunchUrl()` will return false,
if appropriate intents are not declared, cf https://pub.dev/packages/url_launcher#configuration=
Expand Down Expand Up @@ -96,6 +106,7 @@ This change eventually prevents building the app with Flutter v3.3.3.
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:supportsPictureInPicture="true"
android:theme="@style/NormalTheme"
android:windowSoftInputMode="adjustResize">
<intent-filter>
Expand Down Expand Up @@ -283,7 +294,7 @@ This change eventually prevents building the app with Flutter v3.3.3.
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- as of Flutter v3.3.0, background blur & icon shading fail with Impeller -->
<!-- as of Flutter v3.7.7, background blur yields black screen with Impeller -->
<meta-data
android:name="io.flutter.embedding.android.EnableImpeller"
android:value="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ import deckers.thibault.aves.channel.calls.*
import deckers.thibault.aves.channel.calls.window.ActivityWindowHandler
import deckers.thibault.aves.channel.calls.window.WindowHandler
import deckers.thibault.aves.channel.streams.ImageByteStreamHandler
import deckers.thibault.aves.channel.streams.MediaCommandStreamHandler
import deckers.thibault.aves.utils.FlutterUtils
import deckers.thibault.aves.utils.FlutterUtils.enableSoftwareRendering
import deckers.thibault.aves.utils.LogUtils
import deckers.thibault.aves.utils.getParcelableExtraCompat
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel

class WallpaperActivity : FlutterFragmentActivity() {
private lateinit var intentDataMap: MutableMap<String, Any?>
private lateinit var mediaSessionHandler: MediaSessionHandler

override fun onCreate(savedInstanceState: Bundle?) {
if (FlutterUtils.isSoftwareRenderingRequired()) {
Expand All @@ -42,12 +45,19 @@ class WallpaperActivity : FlutterFragmentActivity() {
super.configureFlutterEngine(flutterEngine)
val messenger = flutterEngine.dartExecutor

// notification: platform -> dart
val mediaCommandStreamHandler = MediaCommandStreamHandler().apply {
EventChannel(messenger, MediaCommandStreamHandler.CHANNEL).setStreamHandler(this)
}

// dart -> platform -> dart
// - need Context
mediaSessionHandler = MediaSessionHandler(this, mediaCommandStreamHandler)
MethodChannel(messenger, DeviceHandler.CHANNEL).setMethodCallHandler(DeviceHandler(this))
MethodChannel(messenger, EmbeddedDataHandler.CHANNEL).setMethodCallHandler(EmbeddedDataHandler(this))
MethodChannel(messenger, MediaFetchBytesHandler.CHANNEL, AvesByteSendingMethodCodec.INSTANCE).setMethodCallHandler(MediaFetchBytesHandler(this))
MethodChannel(messenger, MediaFetchObjectHandler.CHANNEL).setMethodCallHandler(MediaFetchObjectHandler(this))
MethodChannel(messenger, MediaSessionHandler.CHANNEL).setMethodCallHandler(mediaSessionHandler)
MethodChannel(messenger, MetadataFetchHandler.CHANNEL).setMethodCallHandler(MetadataFetchHandler(this))
MethodChannel(messenger, StorageHandler.CHANNEL).setMethodCallHandler(StorageHandler(this))
// - need ContextWrapper
Expand Down Expand Up @@ -79,6 +89,11 @@ class WallpaperActivity : FlutterFragmentActivity() {
}
}

override fun onDestroy() {
mediaSessionHandler.dispose()
super.onDestroy()
}

private fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
when (call.method) {
"getIntentData" -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class AppAdapterHandler(private val context: Context) : MethodCallHandler {
return
}

val uriList = ArrayList(urisByMimeType.values.flatten().mapNotNull { Uri.parse(it) })
val uriList = ArrayList(urisByMimeType.values.flatten().mapNotNull { getShareableUri(context, Uri.parse(it)) })
val mimeTypes = urisByMimeType.keys.toTypedArray()

// simplify share intent for a single item, as some apps can handle one item but not more
Expand All @@ -296,7 +296,7 @@ class AppAdapterHandler(private val context: Context) : MethodCallHandler {
Intent(Intent.ACTION_SEND)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType(mimeType)
.putExtra(Intent.EXTRA_STREAM, getShareableUri(context, uri))
.putExtra(Intent.EXTRA_STREAM, uri)
} else {
var mimeType = "*/*"
if (mimeTypes.size == 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ class MediaSessionHandler(private val context: Context, private val mediaCommand
val stateString = call.argument<String>("state")
val positionMillis = call.argument<Number>("positionMillis")?.toLong()
val playbackSpeed = call.argument<Number>("playbackSpeed")?.toFloat()
val canSkipToNext = call.argument<Boolean>("canSkipToNext")
val canSkipToPrevious = call.argument<Boolean>("canSkipToPrevious")

if (uri == null || title == null || durationMillis == null || stateString == null || positionMillis == null || playbackSpeed == null) {
if (uri == null || title == null || durationMillis == null || stateString == null || positionMillis == null || playbackSpeed == null || canSkipToNext == null || canSkipToPrevious == null) {
result.error(
"updateSession-args", "missing arguments: uri=$uri, title=$title, durationMillis=$durationMillis" +
", stateString=$stateString, positionMillis=$positionMillis, playbackSpeed=$playbackSpeed", null
", stateString=$stateString, positionMillis=$positionMillis, playbackSpeed=$playbackSpeed, canSkipToNext=$canSkipToNext, canSkipToPrevious=$canSkipToPrevious", null
)
return
}
Expand All @@ -90,6 +92,12 @@ class MediaSessionHandler(private val context: Context, private val mediaCommand
} else {
actions or PlaybackStateCompat.ACTION_PLAY
}
if (canSkipToNext) {
actions = actions or PlaybackStateCompat.ACTION_SKIP_TO_NEXT
}
if (canSkipToPrevious) {
actions = actions or PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS
}

val playbackState = PlaybackStateCompat.Builder()
.setState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ class MediaCommandStreamHandler : EventChannel.StreamHandler, MediaSessionCompat
success(hashMapOf(KEY_COMMAND to COMMAND_PAUSE))
}

override fun onSkipToNext() {
super.onSkipToNext()
success(hashMapOf(KEY_COMMAND to COMMAND_SKIP_TO_NEXT))
}

override fun onSkipToPrevious() {
super.onSkipToPrevious()
success(hashMapOf(KEY_COMMAND to COMMAND_SKIP_TO_PREVIOUS))
}

override fun onStop() {
super.onStop()
success(hashMapOf(KEY_COMMAND to COMMAND_STOP))
Expand All @@ -70,6 +80,8 @@ class MediaCommandStreamHandler : EventChannel.StreamHandler, MediaSessionCompat

const val COMMAND_PLAY = "play"
const val COMMAND_PAUSE = "pause"
const val COMMAND_SKIP_TO_NEXT = "skip_to_next"
const val COMMAND_SKIP_TO_PREVIOUS = "skip_to_previous"
const val COMMAND_STOP = "stop"
const val COMMAND_SEEK = "seek"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ object StorageUtils {

const val TRASH_PATH_PLACEHOLDER = "#trash"

// whether the provided path is on one of this app specific directories:
// - /storage/{volume}/Android/data/{package_name}/files
// - /data/user/0/{package_name}/files
private fun isAppFile(context: Context, path: String): Boolean {
val dirs = context.getExternalFilesDirs(null).filterNotNull()
val dirs = listOf(
*context.getExternalFilesDirs(null).filterNotNull().toTypedArray(),
context.filesDir,
)
return dirs.any { path.startsWith(it.path) }
}

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<style name="NormalTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>

<!-- API28+, draws next to the notch in fullscreen -->
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<style name="NormalTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">?android:colorBackground</item>

<!-- API28+, draws next to the notch in fullscreen -->
Expand Down
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/94.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In v1.8.3:
- view items in full-screen when selecting them
- watch videos using picture-in-picture
- navigate with TalkBack
Full changelog available on GitHub
5 changes: 5 additions & 0 deletions fastlane/metadata/android/en-US/changelogs/9401.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In v1.8.3:
- view items in full-screen when selecting them
- watch videos using picture-in-picture
- navigate with TalkBack
Full changelog available on GitHub
2 changes: 1 addition & 1 deletion fastlane/metadata/android/ru/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<b>Навигация и поиск</b> важные части <i>Aves</i>. Пользователи могут легко переходить от альбомов к фотографиям, тэгам, картам и т.д.

<i>Aves</i> интегрируется с Android (начиная с версии <b>API 19 до 33</b>, т.е. от KitKat до Android 13) предлагая такие возможности как <b>виджеты</b>, <b>пользовательские ярлыки</b>, <b>скринсейвер</b> и поддержку <b>глобального поиска</b>. Он так же работает как диалоговое окно для <b>просмотра и выбора медиа</b>.
<i>Aves</i> интегрируется с Android (от KitKat до Android 13, включая Android TV) предлагая такие возможности как <b>виджеты</b>, <b>пользовательские ярлыки</b>, <b>скринсейвер</b> и поддержку <b>глобального поиска</b>. Он так же работает как диалоговое окно для <b>просмотра и выбора медиа</b>.
5 changes: 5 additions & 0 deletions lib/app_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ extension ExtraAppMode on AppMode {
AppMode.pickMultipleMediaExternal,
}.contains(this);

bool get canEditEntry => {
AppMode.main,
AppMode.view,
}.contains(this);

bool get canSelectMedia => {
AppMode.main,
AppMode.pickMultipleMediaExternal,
Expand Down
62 changes: 61 additions & 1 deletion lib/l10n/app_cs.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1366,5 +1366,65 @@
"settingsViewerShowDescription": "Zobrazit popis",
"@settingsViewerShowDescription": {},
"settingsVideoGestureVerticalDragBrightnessVolume": "Potáhnout nahoru či dolů pro úpravu jasu/hlasitosti",
"@settingsVideoGestureVerticalDragBrightnessVolume": {}
"@settingsVideoGestureVerticalDragBrightnessVolume": {},
"settingsDisablingBinWarningDialogMessage": "Položky v koši budou navždy odstraněny.",
"@settingsDisablingBinWarningDialogMessage": {},
"chipActionLock": "Uzamknout",
"@chipActionLock": {},
"chipActionGoToPlacePage": "Zobrazit v místech",
"@chipActionGoToPlacePage": {},
"vaultLockTypePassword": "Heslo",
"@vaultLockTypePassword": {},
"settingsConfirmationVaultDataLoss": "Zobrazit varování o možnosti ztráty dat trezorů",
"@settingsConfirmationVaultDataLoss": {},
"lengthUnitPercent": "%",
"@lengthUnitPercent": {},
"albumTierVaults": "Trezory",
"@albumTierVaults": {},
"lengthUnitPixel": "px",
"@lengthUnitPixel": {},
"vaultLockTypePin": "PIN",
"@vaultLockTypePin": {},
"chipActionCreateVault": "Vytvořit trezor",
"@chipActionCreateVault": {},
"chipActionConfigureVault": "Upravit trezor",
"@chipActionConfigureVault": {},
"newVaultWarningDialogMessage": "Položky v trezorech jsou přístupné pouze této aplikaci a žádné jiné.\n\nPokud tuto aplikaci odinstalujete, nebo smažete její data, o všechny tyto položky přijdete.",
"@newVaultWarningDialogMessage": {},
"vaultLockTypePattern": "Vzor",
"@vaultLockTypePattern": {},
"vaultDialogLockTypeLabel": "Typ uzamčení",
"@vaultDialogLockTypeLabel": {},
"pinDialogEnter": "Zadejte PIN",
"@pinDialogEnter": {},
"patternDialogConfirm": "Potvrďte gesto",
"@patternDialogConfirm": {},
"patternDialogEnter": "Zadejte gesto",
"@patternDialogEnter": {},
"pinDialogConfirm": "Potvrďte PIN",
"@pinDialogConfirm": {},
"passwordDialogEnter": "Zadejte heslo",
"@passwordDialogEnter": {},
"passwordDialogConfirm": "Potvrďte heslo",
"@passwordDialogConfirm": {},
"exportEntryDialogWriteMetadata": "Zapsat metadata",
"@exportEntryDialogWriteMetadata": {},
"drawerPlacePage": "Místa",
"@drawerPlacePage": {},
"placePageTitle": "Místa",
"@placePageTitle": {},
"placeEmpty": "Žádná místa",
"@placeEmpty": {},
"authenticateToConfigureVault": "Pro úpravu teroru se ověřte",
"@authenticateToConfigureVault": {},
"authenticateToUnlockVault": "Ověřte se pro otevření trezoru",
"@authenticateToUnlockVault": {},
"newVaultDialogTitle": "Nový trezor",
"@newVaultDialogTitle": {},
"configureVaultDialogTitle": "Nastavit trezor",
"@configureVaultDialogTitle": {},
"vaultDialogLockModeWhenScreenOff": "Uzamknout při vypnutí displeje",
"@vaultDialogLockModeWhenScreenOff": {},
"vaultBinUsageDialogMessage": "Některé trezory používají koš.",
"@vaultBinUsageDialogMessage": {}
}
14 changes: 11 additions & 3 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@
"unitSystemMetric": "Metric",
"unitSystemImperial": "Imperial",

"vaultLockTypePin": "Pin",
"vaultLockTypePattern": "Pattern",
"vaultLockTypePin": "PIN",
"vaultLockTypePassword": "Password",

"settingsVideoEnablePip": "Picture-in-picture",

"videoControlsPlay": "Play",
"videoControlsPlaySeek": "Play & seek backward/forward",
"videoControlsPlayOutside": "Open with other player",
Expand Down Expand Up @@ -384,8 +387,11 @@
"vaultDialogLockModeWhenScreenOff": "Lock when screen turns off",
"vaultDialogLockTypeLabel": "Lock type",

"pinDialogEnter": "Enter pin",
"pinDialogConfirm": "Confirm pin",
"patternDialogEnter": "Enter pattern",
"patternDialogConfirm": "Confirm pattern",

"pinDialogEnter": "Enter PIN",
"pinDialogConfirm": "Confirm PIN",

"passwordDialogEnter": "Enter password",
"passwordDialogConfirm": "Confirm password",
Expand Down Expand Up @@ -792,6 +798,8 @@
"settingsVideoAutoPlay": "Auto play",
"settingsVideoLoopModeTile": "Loop mode",
"settingsVideoLoopModeDialogTitle": "Loop Mode",
"settingsVideoBackgroundMode": "Background mode",
"settingsVideoBackgroundModeDialogTitle": "Background Mode",

"settingsSubtitleThemeTile": "Subtitles",
"settingsSubtitleThemePageTitle": "Subtitles",
Expand Down
14 changes: 13 additions & 1 deletion lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1262,5 +1262,17 @@
"lengthUnitPercent": "%",
"@lengthUnitPercent": {},
"exportEntryDialogWriteMetadata": "Escribir metadatos",
"@exportEntryDialogWriteMetadata": {}
"@exportEntryDialogWriteMetadata": {},
"vaultLockTypePattern": "Patrón",
"@vaultLockTypePattern": {},
"patternDialogEnter": "Introduzca el patrón",
"@patternDialogEnter": {},
"patternDialogConfirm": "Confirme el patrón",
"@patternDialogConfirm": {},
"settingsVideoEnablePip": "Imagen-en-imagen",
"@settingsVideoEnablePip": {},
"settingsVideoBackgroundMode": "Reproducción de fondo",
"@settingsVideoBackgroundMode": {},
"settingsVideoBackgroundModeDialogTitle": "Background mode",
"@settingsVideoBackgroundModeDialogTitle": {}
}
Loading

0 comments on commit 7b2f72c

Please sign in to comment.