Skip to content

Commit

Permalink
feat: 增加 ktx
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Jul 17, 2021
1 parent b389b21 commit ad17e95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ext.libs = [
activity : 'androidx.activity:activity:1.2.3',
appcompat : 'androidx.appcompat:appcompat:1.3.0',
android_core_ktx : "androidx.core:core-ktx:1.6.0",
fragment_ktx : "androidx.fragment:fragment-ktx:1.3.4",
fragment_ktx : "androidx.fragment:fragment-ktx:1.3.5",
recyclerview : "androidx.recyclerview:recyclerview:1.2.0",
rxandroid : "io.reactivex.rxjava2:rxandroid:2.1.1",
rxjava : "io.reactivex.rxjava2:rxjava:2.2.20",
Expand Down
6 changes: 5 additions & 1 deletion lib-ktx/src/main/java/com/xiaojinzi/support/ktx/Commons.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xiaojinzi.support.ktx

import android.app.Application
import android.view.View
import com.xiaojinzi.support.init.AppInstance
import java.util.*

Expand All @@ -13,4 +14,7 @@ val app: Application
/**
* 创建一个 UUID
*/
fun newUUid() = UUID.randomUUID().toString()
fun newUUid() = UUID.randomUUID().toString()

inline fun Boolean.toVisible(isGone: Boolean = false) =
if (this) View.VISIBLE else (if (isGone) View.GONE else View.INVISIBLE)

0 comments on commit ad17e95

Please sign in to comment.