lingxia-platform 0.6.3

Platform abstraction layer for LingXia framework (Android, iOS, HarmonyOS)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::error::PlatformError;
use crate::traits::pull_to_refresh::PullToRefresh;
use lingxia_webview::platform::harmony::tsfn;

use super::Platform;

impl PullToRefresh for Platform {
    fn start_pull_down_refresh(&self, app_id: &str, path: &str) -> Result<(), PlatformError> {
        tsfn::call_arkts("startPullDownRefresh", &[app_id, path])
            .map_err(|e| PlatformError::Platform(e.to_string()))
    }

    fn stop_pull_down_refresh(&self, app_id: &str, path: &str) -> Result<(), PlatformError> {
        tsfn::call_arkts("stopPullDownRefresh", &[app_id, path])
            .map_err(|e| PlatformError::Platform(e.to_string()))
    }
}