Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions app/Providers/NativeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -60,6 +61,7 @@ public function plugins(): array
ToastKitServiceProvider::class,
ClipboardServiceProvider::class,
CallsServiceProvider::class,
LottieRefreshIndicatorServiceProvider::class,
...(config('devnull.apple_sign_in') ? [NativephpSocialAuthServiceProvider::class] : []),
];
}
Expand Down
11 changes: 10 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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"
},
Expand Down
102 changes: 90 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added resources/animations/refresh-dark.lottie
Binary file not shown.
Binary file added resources/animations/refresh.lottie
Binary file not shown.
2 changes: 2 additions & 0 deletions resources/views/native/partials/log-page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions tests/Feature/Screens/LogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])]))]);

Expand Down