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

Kotlin migration utils #52

Merged
merged 3 commits into from
Nov 13, 2019
Merged

Conversation

dylan-muszel
Copy link
Contributor

No description provided.

Copy link
Contributor

@igsosa92 igsosa92 left a comment

Choose a reason for hiding this comment

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

Everything is ok. I guess you created KeyboardManager to replace KeyboardUtils. Great idea an implementation :)

Comment on lines +13 to +43
/** [tag] used to identify the source of a log message. */
var tag: String? = null

/** Send a [Log.VERBOSE] log a [message] and an [exception] with a [tag] to identify the source of it. */
fun v(tag: String?, message: String, exception: Throwable? = null) = Log.v(tag, message, exception)

/** Send a [Log.VERBOSE] log a [message] and an [exception] using the predefined [tag]. */
fun v(message: String, exception: Throwable? = null) = v(tag, message, exception)

/** Send a [Log.DEBUG] log a [message] and an [exception] with a [tag] to identify the source of it. */
fun d(tag: String?, message: String, exception: Throwable? = null) = Log.d(tag, message, exception)

/** Send a [Log.DEBUG] log a [message] and an [exception] using the predefined [tag]. */
fun d(message: String, exception: Throwable? = null) = d(tag, message, exception)

/** Send a [Log.INFO] log a [message] and an [exception] with a [tag] to identify the source of it. */
fun i(tag: String?, message: String, exception: Throwable? = null) = Log.i(tag, message, exception)

/** Send a [Log.INFO] log a [message] and an [exception] using the predefined [tag]. */
fun i(message: String, exception: Throwable? = null) = i(tag, message, exception)

/** Send a [Log.WARN] log a [message] and an [exception] with a [tag] to identify the source of it. */
fun w(tag: String?, message: String, exception: Throwable? = null) = Log.w(tag, message, exception)

/** Send a [Log.WARN] log a [message] and an [exception] using the predefined [tag]. */
fun w(message: String, exception: Throwable? = null) = w(tag, message, exception)

/** Send a [Log.ERROR] log a [message] and an [exception] with a [tag] to identify the source of it. */
fun e(tag: String?, message: String, exception: Throwable? = null) = Log.e(tag, message, exception)

/** Send a [Log.ERROR] log a [message] and an [exception] using the predefined [tag]. */

Choose a reason for hiding this comment

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

Why use multiline comments (/* */) for just one line instead of // ?
And even if so, maybe it would look better if you removed the second * after /*?

Choose a reason for hiding this comment

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

Just asking, because I noticed it looks like that on the rest of the PRs as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's like a convention of how to make documentation: https://kotlinlang.org/docs/reference/coding-conventions.html#documentation-comments
In fact, they don't do oneline commets, but I think is a good idea, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep @Horkur, as @igsosa92 said, it's a Kotlin convention for the comments.

Copy link

@Pavlo-Holota Pavlo-Holota left a comment

Choose a reason for hiding this comment

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

Everything looks great 👍 just a left a comment about a possible minor formatting change.

@dylan-muszel dylan-muszel merged commit c56f5f5 into kotlin-migration Nov 13, 2019
@dylan-muszel dylan-muszel deleted the kotlin-migration-utils branch November 13, 2019 18:37
@dylan-muszel dylan-muszel mentioned this pull request Dec 19, 2019
dylan-muszel added a commit that referenced this pull request Jan 8, 2020
* Kotlin Migration - Adapter and DI (#50)

* Adapter

* DI

* Converting object to class

* Fix pair

* Migrate BasePresenter

* Migrate LceView and add copyright to BasePresenter

* Migrate LeView

* Migrate BasePresenterTest

* Add deprecated to runIfViewAttached, replace apply for run in tests, clean code

* Migration of permissionsManager

* Migration of permissionListener

* Fix redundant private set

* Refactor to clean code

* More refactor

* Kotlin migration utils (#52)

* Keyboard

* Logger

* Shared preferences

* Migration (#53)

* WolmoActivityHandler converted to kotlin (#51)

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* Kotlin migration fragments (#56)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Reverting get image fragment

* changing imports

* Last migration (#58)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Last migration

* Kotlin migration fixes - update versions (#59)

* Fixing overriding base presenter

* Presenter as val

* Fix tests

* Get presnter instead of require

* Fixing wolmo fragment inject

* DefaultModule as class

* Shared preferences string nullable

* Android core as api

* Reverting modules

* Updating version

* Updating versions

* Fixing tests

* Using implmentation

* API insteda of implementation revert

* Rollback handler and minor changes (#61)

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

Co-authored-by: igsosa92 <43349271+igsosa92@users.noreply.github.com>
Co-authored-by: patofernandez <49655621+patofernandez@users.noreply.github.com>
dylan-muszel added a commit that referenced this pull request Jan 8, 2020
* Kotlin Migration - Adapter and DI (#50)

* Adapter

* DI

* Converting object to class

* Fix pair

* Migrate BasePresenter

* Migrate LceView and add copyright to BasePresenter

* Migrate LeView

* Migrate BasePresenterTest

* Add deprecated to runIfViewAttached, replace apply for run in tests, clean code

* Migration of permissionsManager

* Migration of permissionListener

* Fix redundant private set

* Refactor to clean code

* More refactor

* Kotlin migration utils (#52)

* Keyboard

* Logger

* Shared preferences

* Migration (#53)

* WolmoActivityHandler converted to kotlin (#51)

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* Kotlin migration fragments (#56)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Reverting get image fragment

* changing imports

* Last migration (#58)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Last migration

* Kotlin migration fixes - update versions (#59)

* Fixing overriding base presenter

* Presenter as val

* Fix tests

* Get presnter instead of require

* Fixing wolmo fragment inject

* DefaultModule as class

* Shared preferences string nullable

* Android core as api

* Reverting modules

* Updating version

* Updating versions

* Fixing tests

* Using implmentation

* API insteda of implementation revert

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Adding coroutine base presenter

* Coroutines and more

* updating get image fragment

* Fixing doc

* Updating get image fragment

* Rollback handler and minor changes (#61)

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Removing wrong comment

* Updating get image

* Moving all get image stuff to a helper

* Fixing issues

* Some fixes

* Removing wrong test

* Serializable

* Importing

* Fixing

* Reverting image provider

* Provider change

* More fixes

* Removing wrong arguments

* More navigation utils

* Updating kapt

* Removing getimagekt

* Reverting get image fragment

* Reverting get image fragment test

* Reverting spaces

* More reverts

* More reverts

* Reverting tests

* More test reverts

* Minor fixes

* More comments

* Removing log

* Single lines

* Removing imports

* Updating gradle

* More tests

* Adding comments to orElse, removing .unit

* More tests

* Reformat code

* removing unused material

Co-authored-by: igsosa92 <43349271+igsosa92@users.noreply.github.com>
Co-authored-by: patofernandez <49655621+patofernandez@users.noreply.github.com>
dylan-muszel added a commit that referenced this pull request Jan 8, 2020
* Kotlin Migration - Adapter and DI (#50)

* Adapter

* DI

* Converting object to class

* Fix pair

* Migrate BasePresenter

* Migrate LceView and add copyright to BasePresenter

* Migrate LeView

* Migrate BasePresenterTest

* Add deprecated to runIfViewAttached, replace apply for run in tests, clean code

* Migration of permissionsManager

* Migration of permissionListener

* Fix redundant private set

* Refactor to clean code

* More refactor

* Kotlin migration utils (#52)

* Keyboard

* Logger

* Shared preferences

* Migration (#53)

* WolmoActivityHandler converted to kotlin (#51)

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* Kotlin migration fragments (#56)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Reverting get image fragment

* changing imports

* Last migration (#58)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Last migration

* Kotlin migration fixes - update versions (#59)

* Fixing overriding base presenter

* Presenter as val

* Fix tests

* Get presnter instead of require

* Fixing wolmo fragment inject

* DefaultModule as class

* Shared preferences string nullable

* Android core as api

* Reverting modules

* Updating version

* Updating versions

* Fixing tests

* Using implmentation

* API insteda of implementation revert

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Adding coroutine base presenter

* Coroutines and more

* updating get image fragment

* Fixing doc

* Updating get image fragment

* Rollback handler and minor changes (#61)

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Removing wrong comment

* Updating get image

* Moving all get image stuff to a helper

* Fixing issues

* Some fixes

* Removing wrong test

* Serializable

* Importing

* Fixing

* Reverting image provider

* Provider change

* More fixes

* Removing wrong arguments

* More navigation utils

* Updating kapt

* Removing getimagekt

* Reverting get image fragment

* Reverting get image fragment test

* Reverting spaces

* More reverts

* More reverts

* Reverting tests

* More test reverts

* Minor fixes

* More comments

* Removing log

* Single lines

* Removing imports

* Updating gradle

* More tests

* Features readme

* Reformat

* View extensions readme

* Removing wrong blank line

Co-authored-by: igsosa92 <43349271+igsosa92@users.noreply.github.com>
Co-authored-by: patofernandez <49655621+patofernandez@users.noreply.github.com>
dylan-muszel added a commit that referenced this pull request Jan 8, 2020
* Kotlin Migration - Adapter and DI (#50)

* Adapter

* DI

* Converting object to class

* Fix pair

* Migrate BasePresenter

* Migrate LceView and add copyright to BasePresenter

* Migrate LeView

* Migrate BasePresenterTest

* Add deprecated to runIfViewAttached, replace apply for run in tests, clean code

* Migration of permissionsManager

* Migration of permissionListener

* Fix redundant private set

* Refactor to clean code

* More refactor

* Kotlin migration utils (#52)

* Keyboard

* Logger

* Shared preferences

* Migration (#53)

* WolmoActivityHandler converted to kotlin (#51)

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* WolmoActivityHandler converted to kotlin

* Kotlin migration fragments (#56)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Reverting get image fragment

* changing imports

* Last migration (#58)

* FRagments migrated

* Restoring GetImage.java

* Restoring java getimage test

* To spaces

* Indentation

* Reformat

* Code reformats

* fixing tests

* Last migration

* Kotlin migration fixes - update versions (#59)

* Fixing overriding base presenter

* Presenter as val

* Fix tests

* Get presnter instead of require

* Fixing wolmo fragment inject

* DefaultModule as class

* Shared preferences string nullable

* Android core as api

* Reverting modules

* Updating version

* Updating versions

* Fixing tests

* Using implmentation

* API insteda of implementation revert

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Adding coroutine base presenter

* Coroutines and more

* updating get image fragment

* Fixing doc

* Updating get image fragment

* Rollback handler and minor changes (#61)

* Rollback handler

* Also adding some minor changes

* Another minor change

* Updating comments and using requireArgument

* Handle arguments nullable on fragment

* Fixing url

* Removing wrong comment

* Updating get image

* Moving all get image stuff to a helper

* Fixing issues

* Some fixes

* Removing wrong test

* Serializable

* Importing

* Fixing

* Reverting image provider

* Provider change

* More fixes

* Removing wrong arguments

* More navigation utils

* Updating kapt

* Removing getimagekt

* Reverting get image fragment

* Reverting get image fragment test

* Reverting spaces

* More reverts

* More reverts

* Reverting tests

* More test reverts

* Minor fixes

* More comments

* Removing log

* Single lines

* Removing imports

* Updating gradle

* More tests

* Features readme

* Reformat

* View extensions readme

* Adding tests

* Typo

* Removing wrong startactivity

Co-authored-by: igsosa92 <43349271+igsosa92@users.noreply.github.com>
Co-authored-by: patofernandez <49655621+patofernandez@users.noreply.github.com>
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.

None yet

4 participants