내용으로 건너뛰기

시작하기

GitHub

AI 보조 설치를 사용하여 플러그인을 설치할 수 있습니다. 다음 명령어를 사용하여 AI 도구에 Capgo 기능을 추가하세요.

터미널 창
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

다음 명령어를 사용하여 AI 도구에 __CAPGO_KEEP_0__ 기능을 추가하세요.

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-native-loader` plugin in my project.

만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요.

  1. 패키지 설치

    터미널 창
    npm install @capgo/capacitor-native-loader
    npx cap sync
  2. 자바스크립트에서 원시 로더를 표시하세요

    import { NativeLoader } from '@capgo/capacitor-native-loader';
    const { id } = await NativeLoader.show({
    style: 'siri',
    placement: 'fullscreen',
    message: 'Preparing workspace',
    colors: ['#71f6ff', '#8b5cf6', '#ff4ecd', '#fff7ad'],
    scrimColor: 'rgba(3, 7, 18, 0.42)',
    interactionMode: 'block',
    });
    await doExpensiveWork();
    await NativeLoader.hide({ id });

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__
await NativeLoader.configure({
defaults: {
style: 'orbit',
placement: 'center',
size: 96,
colors: ['#38bdf8', '#a78bfa'],
reducedMotion: 'system',
interactionMode: 'passThrough',
},
});

__CAPGO_KEEP_3__

__CAPGO_KEEP_4__

__CAPGO_KEEP_5__ style: 'chrome' __CAPGO_KEEP_6__

const { id } = await NativeLoader.show({
style: 'chrome',
placement: 'top',
colors: ['#4285f4', '#34a853', '#fbbc05', '#ea4335'],
thickness: 4,
interactionMode: 'passThrough',
webView: {
mode: 'resize',
insets: { top: 12 },
restoreOnHide: true,
},
});
await NativeLoader.hide({ id, restoreWebView: true });

__CAPGO_KEEP_7__

__CAPGO_KEEP_8__

__CAPGO_KEEP_9__ style: 'siri-v2' 로딩 상태가 앱의 테두리 주변에서 원형으로 움직이는 원색으로 표시되어야 하는지 여부

const { id } = await NativeLoader.show({
style: 'siri-v2',
placement: 'fullscreen',
colors: ['#71f6ff', '#8b5cf6', '#ff4ecd', '#fff7ad'],
thickness: 10,
scrimColor: 'rgba(3, 7, 18, 0.10)',
interactionMode: 'passThrough',
});
await NativeLoader.hide({ id });

업데이트 진행 상황

업데이트 진행 상황
const { id } = await NativeLoader.show({
style: 'ring',
message: 'Uploading',
progress: 0,
});
for await (const progress of uploadFile(file)) {
await NativeLoader.setProgress({ id, progress });
}
await NativeLoader.hide({ id });

웹뷰 크기 조절

업데이트 진행 상황

클립보드에 복사 setWebViewLayout 원래 레이아웃을 원래 상태로 복원

await NativeLoader.setWebViewLayout({
mode: 'inset',
insets: { top: 96, bottom: 24 },
animated: true,
});
await NativeLoader.show({
style: 'wave',
placement: 'top',
size: 72,
message: 'Syncing',
interactionMode: 'passThrough',
});

Native Loader가 화면 일부를 차지하면서 웹 콘텐츠가 사용 가능하고 사용할 수 있는 상태로 유지되야 하는지 여부

await NativeLoader.hideAll({ restoreWebView: true });

로티와 이미지 로더

로티와 이미지 로더 섹션

로티 JSON 또는 이미지 자산을 네이티브 앱에 패키지하고 JavaScript에서 참조합니다.

await NativeLoader.show({
style: 'lottie',
placement: 'center',
asset: {
type: 'lottie',
source: 'rocket-loader.json',
loop: true,
},
});
await NativeLoader.show({
style: 'image',
placement: 'bottom',
asset: {
type: 'image',
source: 'loader-frame',
},
});

클립보드 복사

import CapgoCapacitorNativeLoader
let id = NativeLoader.shared.show(options: [
"style": "siri",
"placement": "fullscreen",
"message": "Opening secure session",
"interactionMode": "block"
])
NativeLoader.shared.setProgress(id: id, progress: 0.6)
NativeLoader.shared.hide(id: id)

자연스러운 Kotlin 호출

자연스러운 Kotlin 호출 섹션

다른 Android 플러그인은 Kotlin 또는 Java에서 공용 객체를 호출할 수 있습니다.

import app.capgo.nativeloader.NativeLoader
val id = NativeLoader.show(
activity = activity,
options = mapOf(
"style" to "orbit",
"placement" to "fullscreen",
"message" to "Loading profile",
"interactionMode" to "block",
),
webView = bridge.webView,
)
NativeLoader.setProgress(id, 0.6)
NativeLoader.hide(id)
옵션타입설명
style'siri' | 'siri-v2' | 'chrome' | 'orbit' | 'ring' | 'pulse' | 'dots' | 'bars' | 'wave' | 'halo' | 'lottie' | 'image'로더 렌더러
placement'center' | 'top' | 'bottom' | 'left' | 'right' | 'fullscreen' | 'around' | 'custom'자연 표면 위치
interactionMode'passThrough' | 'block' | 'loaderOnly'터치 처리
backgroundColorstring__CAPGO_KEEP_0__ 색상 (alpha 포함)
scrimColorstring__CAPGO_KEEP_0__ 색상 (전체 화면 또는 주변 화면 블러)
colorsstring[]__CAPGO_KEEP_0__ 색상 (Loader)
progressnumber__CAPGO_KEEP_0__ (정확도) 0 __CAPGO_KEEP_1__ 1
autoHidenumber__CAPGO_KEEP_2__
assetobject__CAPGO_KEEP_0__ (Lottie 또는 이미지)

__CAPGO_KEEP_0__ (사용자 플랫폼의 운동 설정을 존중하기 위해) reducedMotion: 'system' __CAPGO_KEEP_1__