본문 바로가기

Project/Lifehelper

(7)
UI 디자인(AppBarLayout, CollapsingToolbarLayout, MaterialToolbar, style 변경) Material AppBarLayout, CollapsingToolbarLayout, MaterialToolbar 를 이용해 Toolbar가 CollaspsingToolbarLayout의 하단에 위치하여 드래그하면 MaterialToolbar를 감싸는 CollaspsingToolbarLayout가 접히는 기능 1. CollaspsingToolbarLayout 1. 속성 살펴보기 1-1. app:contentScrim="?attr/colorPrimary" : Toolbar가 최소화 되었을 때 툴바의 색상을 변경 1-2. app:layout_scrollFlags="scroll|exitUntilCollapsed|snap" scroll : 스크롤 이벤트에 반응할 모든 view에 반드시 이 플래그를 설정해줘야 합..
화면 캡처와 공유 (Bitmap, PixelCopy, File, FileOutputStream, FileProvider, Intent) Toolbar의 옵션메뉴에 공유 버튼을 클릭하면 현재 화면을 캡처한 후 공유하는 기능 1. getBitmapFromView() Usage getBitmapFromView(binding.root) { bitmap -> screenShot(bitmap) } 2. 화면 캡처 2-1. 고차함수 고차함수란 다른 함수를 인자로 받거나, 함수를 반환하는 함수입니다. 해당 예제에선 함수 반환 타입을 Unit으로 하여 객체를 반환함을 선언했습니다. 2-2. Bitmap Bitmap이란 안드로이드에서 이미지 파일을 다루는 객체 createBitmap() : Bitmap 생성합니다. Int : 생성할 Bitmap의 폭 Int : 생성할 Bitmap의 높이 Bitmap.Config : Bitmap의 구성을 의미(pixel별 ..
Branch : 06_FusedLocationProviderClient commit message : Request weather api as the return value of getLocation() commit message : Change API from openweather to WeatherAPI commit message : The icon url was loaded as an image using Glide 경로 : app/build.gradle implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.9" // 글라이드 이미지 라이브러리 def glide_version = "4.12.0" implementation "com.github.bumptech.glide:glide:$glid..
Branch : 05_checkPermission commit message : Checking Permission : ACCESS_FINE_LOCATION 경로 : app/src/main/AndroidManifest.xml 경로 : app/src/main/java/com/example/lifehelper/PresentationLayer/Activity/MainActivity.kt //권한 체크 : https://dunkey2615.tistory.com/100 class MainActivity : AppCompatActivity() { @SuppressLint("ObsoleteSdkInt") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) set..
Branch : 02_WeatherApiSetting_callback (Retrofit2, gson, OkHttp, OkHttp Interceptor) commit message : Establish communication with API by callback method using okhttp, okhttp interceptor, retrofit2 경로 : app/build.gradle //okhttp and okhttp interceotor def okhttp_version = "4.9.0" implementation "com.squareup.okhttp3:okhttp:$okhttp_version" implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version" //retrofit2 def retrofit_version = "2.9.0" implementation "com.squa..
Branch : 01_uiDesign (Navigation Component / BottomNavigation View) Localization commit message : Create HomeAcivity : Screen switching using Navigation Component and Bottom Navigation View 경로 : app/build.gradle //navigation Component def nav_version = "2.3.3" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" 경로 : app/src/main/res/drawable/ic_alarm.xml icon으로 사용하기위해 애플리케이..
Branch : 01_uiDesign (Localization / Ripple Effect) Localization commit message : strings.xml korean Localization 경로 : app/src/main/res/values-b+ko/strings.xml 생활 도우미 경로 : app/src/main/res/values/strings.xml Life helper Ripple Effect commit message : add ripple effect 경로 : app/src/main/res/drawable/ic_eco.xml Ripple Effect를 사용할 Button에 넣을 Vector 이미지 생성 경로 : app/src/main/java/com/example/lifehelper/MainActivity.kt class MainActivity : AppCompatAct..