-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#79 [fix] 자잘한 이슈 해결 #80
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
baba928
#79 [mod] toast 메시지 지속 시간 변경
emjayMJkim 9e6b808
#79 [add] 화면 클릭시 hidekeyboard & edt 포커스 해제
emjayMJkim 54eb242
#79 [ui] 테마 & 루틴 선택 리사이클러뷰 위치 조정
emjayMJkim f5d3027
#79 [fix] merge conflict 해결
emjayMJkim 6645f91
#79 [fix] merge conflict 해결
emjayMJkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,23 @@ import android.app.Activity | |
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Build | ||
import android.os.Handler | ||
import android.os.Looper | ||
import android.view.View | ||
import android.view.inputmethod.InputMethodManager | ||
import android.widget.EditText | ||
import android.widget.Toast | ||
import androidx.core.content.ContextCompat | ||
import androidx.fragment.app.Fragment | ||
import java.io.Serializable | ||
|
||
fun Context.hideKeyboard(view: View) { | ||
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager | ||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) | ||
fun Context.hideKeyboard(view: View?) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 키보드를 숨기는 메소드인가요?? 멋져요 |
||
if (view is EditText) { | ||
view.clearFocus() | ||
val inputMethodManager = | ||
getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager | ||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0) | ||
} | ||
} | ||
|
||
fun snackBar( | ||
|
@@ -24,7 +31,11 @@ fun snackBar( | |
} | ||
|
||
fun Context.toast(message: String) { | ||
Toast.makeText(this, message, Toast.LENGTH_SHORT).show() | ||
val toast = Toast.makeText(this, message, Toast.LENGTH_SHORT) | ||
toast.show() | ||
Handler(Looper.getMainLooper()).postDelayed({ | ||
run() { toast.cancel() } | ||
}, 1000) | ||
} | ||
|
||
fun Fragment.setStatusBarColor(colorResId: Int) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿짭입니다! 제가 놓쳤는데 잘 잡아주셨네요