Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- koltin
- 개인앱홍보
- 시스템 프로세스
- Android인트로
- 랭킹2048
- 게임마케팅
- wow2048
- 2048 ranking
- android res 초기화
- 와우2048
- iBatis.Net for PostgreSQL
- 인트로전체화면
- 카운터 프로그램
- 광고수익화전략
- HTML&CSS
- 2048 game
- iBatis.Net
- iBatis.Net for Oralce
- 빌드시간단축
- wow 2048
- wow2048.com
- 패키지명변경
- iBatis.Net for MySql
- 개인앱
- 앱마케팅
- 앱홍보
- package변경
- RankingApps
- 2048
- 국가별앱현황
Archives
- Today
- Total
우짜짜's 코딩스토리
[Android/Kotlin]Intro/Splash Fullscreen 구현 방식 본문
반응형
앱 실행시 초기 인트로(Splash) 화면 구현에 필요한 방식은 2가지
1. 소스코드 추가
2. styles.xml 테마 속성 추가
UI/UX로 볼때 styles.xml 테마 속성을 추가하는 방식을 추천
1. 소스코드 적용 방식
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_intro)
//Fullscreen 적용
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LOW_PROFILE or
View.SYSTEM_UI_FLAG_FULLSCREEN or
View.SYSTEM_UI_FLAG_LAYOUT_STABLE or
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
}
2. xml Theme 적용 방식
① res > values > styles.xml 속성추가
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<!-- Fullscreen 적용 -->
<style name="AppTheme.NoActionBar.Fullscreen">
<item name="android:windowFullscreen">true</item>
<item name="windowNoTitle">true</item>
</style>
</resources>
② AndroidManifest.xml 테마적용
<activity
android:name=".IntroActivity"
android:theme="@style/AppTheme.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
★2초뒤 메인화면으로 넘어가는 방식 구현 예시
var handler: Handler? = null
var runnalbe: Runnable? = null
override fun onResume() {
super.onResume()
runnalbe = Runnable {
var intent = Intent(this, MainActivity::class.java)
startActivity(intent)
finish()
}
handler = Handler()
handler?.run {
postDelayed(runnalbe, 2000)
}
}
override fun onPause() {
super.onPause()
handler?.removeCallbacks(runnalbe)
}
반응형
'Input > 개발+App' 카테고리의 다른 글
[Kotlin] Scope functions(let, run, with, apply, also) (0) | 2020.07.29 |
---|---|
Android 패키지명 ( Package Name ) 변경 (0) | 2020.07.25 |
[펌][Android]안드로이드 프로젝트에서 git 삭제하기 (0) | 2020.05.17 |
[펌][Android]빌드시간 최적화하기(빌드시간 70%감소) (0) | 2020.05.16 |
[펌]안드로이드 이미지 Drawable 사용 원칙 -Densities- (0) | 2020.02.28 |
Comments