diff --git a/README.md b/README.md index def4e182..6554f743 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,11 @@ composer setup `nativephp/mobile-secure-storage` is a paid plugin from `plugins.nativephp.com`, so `composer install` needs your NativePHP plugin credentials. See below if you don't have access to the plugin. -For now the app tracks one unreleased package, which Composer pulls straight from GitHub: `victorycodedev/toastkit` from the `fix/android-toasts-above-sheets` branch of [simonhamp/toastkit](https://github.com/simonhamp/toastkit), which draws Android toasts above bottom sheets instead of behind them ([victorycodedev/toastkit#5](https://github.com/victorycodedev/toastkit/pull/5)). Once that is released, the app goes back to a tagged version. +For now the app tracks unreleased packages, which Composer pulls straight from GitHub. Once each is released, the app goes back to a tagged version. + +- `victorycodedev/toastkit` from the `fix/android-toasts-above-sheets` branch of [simonhamp/toastkit](https://github.com/simonhamp/toastkit), which draws Android toasts above bottom sheets instead of behind them ([victorycodedev/toastkit#5](https://github.com/victorycodedev/toastkit/pull/5)). +- `nativephp/mobile-ui` from the `feat/refresh-indicator-registry` branch of [jubianchi/mobile-ui](https://github.com/jubianchi/mobile-ui), which lets a plugin draw a list's pull-to-refresh indicator ([NativePHP/mobile-ui#198](https://github.com/NativePHP/mobile-ui/pull/198)). +- `jubianchi/nativephp-lottie-refresh-indicator` from the `main` branch of [jubianchi/nativephp-lottie-refresh-indicator](https://github.com/jubianchi/nativephp-lottie-refresh-indicator), the plugin that plays the logo animation when the Log is pulled. ### Without plugin credentials diff --git a/app/Providers/NativeServiceProvider.php b/app/Providers/NativeServiceProvider.php index 15a87320..daa2b14d 100644 --- a/app/Providers/NativeServiceProvider.php +++ b/app/Providers/NativeServiceProvider.php @@ -5,6 +5,7 @@ use Codingwithrk\NativephpSocialAuth\NativephpSocialAuthServiceProvider; use Devnull\Calls\CallsServiceProvider; use Illuminate\Support\ServiceProvider; +use Jubianchi\NativePHP\LottieRefreshIndicator\LottieRefreshIndicatorServiceProvider; use Native\Mobile\Providers\BrowserServiceProvider; use Native\Mobile\Providers\CameraServiceProvider; use Native\Mobile\Providers\MicrophoneServiceProvider; @@ -60,6 +61,7 @@ public function plugins(): array ToastKitServiceProvider::class, ClipboardServiceProvider::class, CallsServiceProvider::class, + LottieRefreshIndicatorServiceProvider::class, ...(config('devnull.apple_sign_in') ? [NativephpSocialAuthServiceProvider::class] : []), ]; } diff --git a/composer.json b/composer.json index 2c9c1ca0..07e68784 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,14 @@ "type": "vcs", "url": "https://github.com/simonhamp/toastkit" }, + { + "type": "vcs", + "url": "https://github.com/jubianchi/mobile-ui" + }, + { + "type": "vcs", + "url": "https://github.com/jubianchi/nativephp-lottie-refresh-indicator" + }, { "name": "nativephp-plugins", "type": "composer", @@ -30,6 +38,7 @@ "php": "^8.3", "codingwithrk/nativephp-social-auth": "^1.0", "devnull/nativephp-calls": "^1.0", + "jubianchi/nativephp-lottie-refresh-indicator": "dev-main", "laravel/boost": "^2.0", "laravel/framework": "^13.0", "laravel/tinker": "^3.0", @@ -41,7 +50,7 @@ "nativephp/mobile-microphone": "^1.2", "nativephp/mobile-secure-storage": "^1.1", "nativephp/mobile-share": "^1.1", - "nativephp/mobile-ui": "^0.9", + "nativephp/mobile-ui": "dev-feat/refresh-indicator-registry as 0.9.0", "s2br/nativephp-mobile-splashscreen": "^1.4", "victorycodedev/toastkit": "dev-fix/android-toasts-above-sheets as 1.4.0" }, diff --git a/composer.lock b/composer.lock index cc2ce130..c95543dc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "860c34d693a5afa83bca97fb6690af2c", + "content-hash": "2588425ca9159a6ccae695e685bdc40f", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1465,6 +1465,67 @@ ], "time": "2026-08-24T17:13:02+00:00" }, + { + "name": "jubianchi/nativephp-lottie-refresh-indicator", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/jubianchi/nativephp-lottie-refresh-indicator.git", + "reference": "974d66cd22f2bb5a031d84c60e7416185078906a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jubianchi/nativephp-lottie-refresh-indicator/zipball/974d66cd22f2bb5a031d84c60e7416185078906a", + "reference": "974d66cd22f2bb5a031d84c60e7416185078906a", + "shasum": "" + }, + "require": { + "ext-zip": "*", + "nativephp/mobile": "^4.7", + "nativephp/mobile-ui": "*", + "php": "^8.3" + }, + "require-dev": { + "orchestra/testbench": "^10.0", + "pestphp/pest": "^3.0" + }, + "default-branch": true, + "type": "nativephp-plugin", + "extra": { + "laravel": { + "providers": [ + "Jubianchi\\NativePHP\\LottieRefreshIndicator\\LottieRefreshIndicatorServiceProvider" + ] + }, + "nativephp": { + "manifest": "nativephp.json" + } + }, + "autoload": { + "psr-4": { + "Jubianchi\\NativePHP\\LottieRefreshIndicator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Jubianchi\\NativePHP\\LottieRefreshIndicator\\Tests\\": "tests/php/" + } + }, + "scripts": { + "test": [ + "pest" + ] + }, + "license": [ + "MIT" + ], + "description": "A Lottie pull-to-refresh indicator for nativephp/mobile-ui lists, on Android and iOS", + "support": { + "source": "https://github.com/jubianchi/nativephp-lottie-refresh-indicator/tree/main", + "issues": "https://github.com/jubianchi/nativephp-lottie-refresh-indicator/issues" + }, + "time": "2026-11-03T22:25:09+00:00" + }, { "name": "laravel/boost", "version": "v2.10.3", @@ -3237,16 +3298,16 @@ }, { "name": "nativephp/mobile-ui", - "version": "0.9.0", + "version": "dev-feat/refresh-indicator-registry", "source": { "type": "git", - "url": "https://github.com/NativePHP/mobile-ui.git", - "reference": "9cee87cbc676a6500247bec99be5d19f633a04e9" + "url": "https://github.com/jubianchi/mobile-ui.git", + "reference": "fcedb3145679c9d1982cfc9773a5154ca0874e08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/NativePHP/mobile-ui/zipball/9cee87cbc676a6500247bec99be5d19f633a04e9", - "reference": "9cee87cbc676a6500247bec99be5d19f633a04e9", + "url": "https://api.github.com/repos/jubianchi/mobile-ui/zipball/fcedb3145679c9d1982cfc9773a5154ca0874e08", + "reference": "fcedb3145679c9d1982cfc9773a5154ca0874e08", "shasum": "" }, "require": { @@ -3274,7 +3335,17 @@ "Native\\Mobile\\UI\\": "src/" } }, - "notification-url": "https://packagist.org/downloads/", + "scripts": { + "test": [ + "pest" + ], + "lint": [ + "pint" + ], + "lint:test": [ + "pint --test" + ] + }, "license": [ "MIT" ], @@ -3286,16 +3357,15 @@ ], "description": "Native SwiftUI and Jetpack Composer components for NativePHP", "support": { - "issues": "https://github.com/NativePHP/mobile-ui/issues", - "source": "https://github.com/NativePHP/mobile-ui/tree/0.9.0" + "source": "https://github.com/jubianchi/mobile-ui/tree/feat/refresh-indicator-registry" }, "funding": [ { - "url": "https://nativephp.com/sponsor", - "type": "other" + "type": "other", + "url": "https://nativephp.com/sponsor" } ], - "time": "2026-10-29T17:44:09+00:00" + "time": "2026-11-03T20:49:42+00:00" }, { "name": "nesbot/carbon", @@ -11444,6 +11514,12 @@ } ], "aliases": [ + { + "package": "nativephp/mobile-ui", + "version": "dev-feat/refresh-indicator-registry", + "alias": "0.9.0", + "alias_normalized": "0.9.0.0" + }, { "package": "victorycodedev/toastkit", "version": "dev-fix/android-toasts-above-sheets", @@ -11453,6 +11529,8 @@ ], "minimum-stability": "stable", "stability-flags": { + "jubianchi/nativephp-lottie-refresh-indicator": 20, + "nativephp/mobile-ui": 20, "victorycodedev/toastkit": 20 }, "prefer-stable": true, diff --git a/resources/animations/refresh-dark.lottie b/resources/animations/refresh-dark.lottie new file mode 100644 index 00000000..c435fc9c Binary files /dev/null and b/resources/animations/refresh-dark.lottie differ diff --git a/resources/animations/refresh.lottie b/resources/animations/refresh.lottie new file mode 100644 index 00000000..bb7774c8 Binary files /dev/null and b/resources/animations/refresh.lottie differ diff --git a/resources/views/native/partials/log-page.blade.php b/resources/views/native/partials/log-page.blade.php index ebee83bc..54cfba28 100644 --- a/resources/views/native/partials/log-page.blade.php +++ b/resources/views/native/partials/log-page.blade.php @@ -18,6 +18,8 @@ :ref="$page['showing'] ? 'log' : 'log-'.$page['log']" class="w-full flex-1 bg-theme-surface" on-refresh="load" + refresh-indicator="lottie" + :refresh-indicator-options="['asset' => 'animations/refresh.lottie', 'dark_asset' => 'animations/refresh-dark.lottie']" :on-end-reached="$page['showing'] ? 'loadMore' : null" :end-reached-buffer="5" :on-visible-range="$page['showing'] ? 'showRows' : null" diff --git a/tests/Feature/Screens/LogTest.php b/tests/Feature/Screens/LogTest.php index 9aff6fb6..f57faaee 100644 --- a/tests/Feature/Screens/LogTest.php +++ b/tests/Feature/Screens/LogTest.php @@ -114,6 +114,17 @@ expect(Http::recorded(fn (Request $request): bool => $request->url() === 'http://devnull.test/api/v1/log/following'))->toHaveCount(2); }); +it('draws the logo while pulling to refresh', function () { + Http::fake(['devnull.test/*' => Http::response(pageJson([]))]); + + Native::visit('/log') + ->assertElement('list', fn (array $node): bool => ($node['props']['refresh_indicator'] ?? null) === 'lottie' + && json_decode($node['props']['refresh_indicator_options'] ?? '[]', true) === [ + 'asset' => 'animations/refresh.lottie', + 'dark_asset' => 'animations/refresh-dark.lottie', + ]); +}); + it('marks pending commits', function () { Http::fake(['devnull.test/*' => Http::response(pageJson([commitJson(['status' => 'pending', 'body' => 'Waiting on a mod'])]))]);