Skip to content

Commit

Permalink
feat: 키보드 이외 영역 터치 시 키보드 내려가도록 구현 (#214)
Browse files Browse the repository at this point in the history
* feat: 키보드외 화면 클릭 시 키보드 내려가도록 구현

* refactor: api변경에 다른 dto수정
  • Loading branch information
Namyunsuk authored Aug 7, 2024
1 parent 8594ccf commit febe598
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<activity
android:name=".presentation.view.MainActivity"
android:windowSoftInputMode="adjustPan"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
android:exported="true">

<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fun RemoteOffering.toDomain() =
totalCount = this.totalCount,
currentCount = this.currentCount,
dividedPrice = this.dividedPrice,
eachPrice = this.eachPrice,
eachPrice = this.originPrice,
condition = this.condition.toDomain(),
isOpen = this.isOpen,
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data class RemoteOffering(
@SerialName("totalCount") val totalCount: Int,
@SerialName("thumbnailUrl") val thumbnailUrl: String?,
@SerialName("dividedPrice") val dividedPrice: Int,
@SerialName("eachPrice") val eachPrice: Int?,
@SerialName("originPrice") val originPrice: Int?,
@SerialName("condition") val condition: RemoteOfferingCondition,
@SerialName("isOpen") val isOpen: Boolean,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.zzang.chongdae.presentation.view

import android.os.Bundle
import android.view.MotionEvent
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
Expand Down Expand Up @@ -46,6 +48,13 @@ class MainActivity : AppCompatActivity() {
binding.mainBottomNavigation.visibility = View.VISIBLE
}

override fun dispatchTouchEvent(motionEvent: MotionEvent): Boolean {
(getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager).apply {
this.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
}
return super.dispatchTouchEvent(motionEvent)
}

override fun onDestroy() {
super.onDestroy()
_binding = null
Expand Down

0 comments on commit febe598

Please sign in to comment.