2026-05-31 19:13:12 +09:00
|
|
|
package kr.sblog.slimbudget;
|
|
|
|
|
|
2026-06-03 18:55:48 +09:00
|
|
|
import android.os.Bundle;
|
2026-06-06 15:49:07 +09:00
|
|
|
import android.view.View;
|
|
|
|
|
|
|
|
|
|
import androidx.core.graphics.Insets;
|
|
|
|
|
import androidx.core.view.ViewCompat;
|
|
|
|
|
import androidx.core.view.WindowInsetsCompat;
|
2026-06-03 18:55:48 +09:00
|
|
|
|
2026-05-31 19:13:12 +09:00
|
|
|
import com.getcapacitor.BridgeActivity;
|
|
|
|
|
|
2026-06-03 18:55:48 +09:00
|
|
|
public class MainActivity extends BridgeActivity {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
registerPlugin(CardNotifPlugin.class);
|
|
|
|
|
super.onCreate(savedInstanceState);
|
2026-06-06 15:49:07 +09:00
|
|
|
|
|
|
|
|
// targetSdk 35+ 의 에지투에지 강제 환경에서 웹뷰가 상태바/소프트키(시스템 내비) 뒤로
|
|
|
|
|
// 깔리는 것을 방지한다. 시스템 바 인셋만큼 웹뷰에 패딩을 줘서 콘텐츠(하단 고정 내비 포함)가
|
|
|
|
|
// 항상 안전 영역 안에 오도록 한다. (CSS env(safe-area-*) 가 기기별로 0 을 반환하는 문제 회피)
|
|
|
|
|
final View webView = getBridge().getWebView();
|
|
|
|
|
if (webView != null) {
|
|
|
|
|
ViewCompat.setOnApplyWindowInsetsListener(webView, (v, insets) -> {
|
|
|
|
|
Insets bars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
|
|
|
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
|
|
|
|
return insets;
|
|
|
|
|
});
|
|
|
|
|
}
|
2026-06-03 18:55:48 +09:00
|
|
|
}
|
|
|
|
|
}
|