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;
|
2026-06-06 16:42:47 +09:00
|
|
|
import androidx.core.view.WindowCompat;
|
2026-06-06 15:49:07 +09:00
|
|
|
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
|
|
|
|
2026-06-06 16:42:47 +09:00
|
|
|
// targetSdk 35+ 의 에지투에지 강제 환경에서 콘텐츠가 상태바/소프트키 뒤로 깔리는 것을 방지.
|
|
|
|
|
// 구글 권장 패턴: 콘텐츠 루트에 시스템 바 인셋만큼 패딩을 적용하고 인셋을 소비(CONSUMED)한다.
|
|
|
|
|
// → 헤더는 상태바 아래, 하단 고정 내비는 소프트키 위에 위치.
|
|
|
|
|
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
|
|
|
|
|
final View content = findViewById(android.R.id.content);
|
|
|
|
|
ViewCompat.setOnApplyWindowInsetsListener(content, (v, windowInsets) -> {
|
|
|
|
|
Insets bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
|
|
|
|
|
v.setPadding(bars.left, bars.top, bars.right, bars.bottom);
|
|
|
|
|
return WindowInsetsCompat.CONSUMED;
|
|
|
|
|
});
|
|
|
|
|
ViewCompat.requestApplyInsets(content);
|
2026-06-03 18:55:48 +09:00
|
|
|
}
|
|
|
|
|
}
|