Skip to content
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

View/List #1

Open
wants to merge 56 commits into
base: next
Choose a base branch
from
Open

View/List #1

wants to merge 56 commits into from

Conversation

snowflake-1117
Copy link

뷰 폴더에 있는 Animation 클래스를 코틀린으로 재작성 해보았습니다.

안드로이드도 공부하는 중이고 코틀린도 공부하는 중이라 어떤 부분을 어떻게 손대야 할지 막막했지만 나름대로 고쳐봤어요!

@Pluu
Copy link

Pluu commented Jul 24, 2017

👍

- findViewById 제거
- run 사용
- ViewFlipper 변수 lateinit 적용: nullable -> notNull
@snowflake-1117 snowflake-1117 changed the title Convert Animation(in View folder) Java file into Kotlin file Convert AutoComplete1~3 and apply kotlin android extensions Jul 29, 2017
ArrayAdapter(this,
android.R.layout.simple_spinner_item, mStrings).let {
it.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
spinner.run { adapter = it }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spinner.run을 사용한다면 아래 onItemSelectedListener 도 한번에 묶는게 좋을듯합니다. scope 변환로직이 매번 일어날테니

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 네! 오늘 보니까 그렇더라구요 ㅋㅋㅋㅋ 감사합니다

@Pluu
Copy link

Pluu commented Jul 31, 2017

val (inAnim, outAnim) = when (position) {
            0 -> {
                arrayOf(AnimationUtils.loadAnimation(this, R.anim.push_up_in),
                        AnimationUtils.loadAnimation(this, R.anim.push_up_out))
            }
            1 -> {
                arrayOf(AnimationUtils.loadAnimation(this, R.anim.push_left_in),
                        AnimationUtils.loadAnimation(this, R.anim.push_left_out))
            }
            2 -> {
                arrayOf(AnimationUtils.loadAnimation(this, android.R.anim.fade_in),
                        AnimationUtils.loadAnimation(this, android.R.anim.fade_out))
            }
            else -> {
                arrayOf(AnimationUtils.loadAnimation(this, R.anim.hyperspace_in),
                        AnimationUtils.loadAnimation(this, R.anim.hyperspace_out))
            }
        }
        mFlipper!!.inAnimation = inAnim
        mFlipper!!.outAnimation= outAnim

when 내부에 Pair 처리가 되면 편할텐데, 잘안되서 arrayOf로 한번 바꿔봤습니다

@snowflake-1117
Copy link
Author

when 내부를 뭔가 바꿔보고 싶은 생각이 자꾸 들었는데 어떻게 해야 할지 모르겠더라구요. 그런데 이런 방법이 있었군요! 벌써 두번씩이나 ㅋㅋ 리뷰 감사합니다!!

@@ -4,11 +4,11 @@ apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
buildToolsVersion '26.0.0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

26.0.0의 버그가 수정된 26.0.1 이 나온 상태

val cursor = content.query(Contacts.CONTENT_URI,
CONTACT_PROJECTION, null, null, null)
// Here, thisActivity is the current activity
if (ContextCompat.checkSelfPermission(this,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

퍼미션 체크 로직은 자주 사용되므로

응용하는 방법도 좋을듯

@snowflake-1117 snowflake-1117 changed the title [DOING] Autocomplete4-5 [DONE] Autocomplete4-5 Aug 12, 2017
@snowflake-1117 snowflake-1117 changed the title [DONE] Autocomplete4-5 View/List Aug 26, 2017
@snowflake-1117
Copy link
Author

View 폴더에 있는 List 파일들 코틀린으로 변환했습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants