Skip to content

kotlin/navigation#90

Open
saifer2505 wants to merge 8 commits intofeature/kotlinfrom
kotlin/navigation
Open

kotlin/navigation#90
saifer2505 wants to merge 8 commits intofeature/kotlinfrom
kotlin/navigation

Conversation

@saifer2505
Copy link
Copy Markdown
Contributor

navigation: Java => Kotlin

.build())
}

private class CrashlyticsLogProcessor(private val crashlytics: Crashlytics) : LogProcessor(LcLevel.INFO) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

В отдельный класс

override fun onCreate() {
super.onCreate()
JodaTimeAndroid.init(this)
if (BuildConfig.DEBUG) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

В отдельный метод

Lc.initialize(CrashlyticsLogProcessor(crashlytics), false)
} catch (error: NoClassDefFoundError) {
Lc.initialize(ConsoleLogProcessor(LcLevel.INFO), false)
Lc.e("Crashlytics initialization error! Did you forget to add\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Можно в const

Copy link
Copy Markdown
Contributor

@maxbach maxbach left a comment

Choose a reason for hiding this comment

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

статик

.permitDiskReads()
.permitDiskWrites()
.penaltyLog()
.build())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Добавь пустую строку


fun onBackPressed(): Boolean

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Пустая строка в конце

}
private val keyboardHideListener = object : OnBackPressedListener {

override fun onBackPressed(): Boolean =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Совмести 30 и 31

throwable: Throwable?
) {
when {
group === LcGroup.UI_LIFECYCLE -> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

В одну строку

private fun reduceStackTrace(throwable: Throwable) {
val stackTrace = throwable.stackTrace
val reducedStackTraceList = arrayListOf<StackTraceElement>()
for (i in stackTrace.indices.reversed()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

write in kotlin style without for

val reducedStackTraceList = arrayListOf<StackTraceElement>()
for (i in stackTrace.indices.reversed()) {
val stackTraceElement = stackTrace[i]
if (stackTraceElement.className.contains(javaClass.simpleName)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Условие внутри if в отдельный метод

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