Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
android-mvp-flytour-kotlin
提交
caf06550
A
android-mvp-flytour-kotlin
项目概览
门心叼龙
/
android-mvp-flytour-kotlin
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
android-mvp-flytour-kotlin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
caf06550
编写于
3月 02, 2020
作者:
门心叼龙
浏览文件
操作
浏览文件
下载
差异文件
update test
上级
6dfc6d71
b05ec5ba
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
183 addition
and
2 deletion
+183
-2
.idea/codeStyles/Project.xml
.idea/codeStyles/Project.xml
+3
-0
.idea/misc.xml
.idea/misc.xml
+1
-1
module_test/build.gradle
module_test/build.gradle
+7
-0
module_test/src/main/AndroidManifest.xml
module_test/src/main/AndroidManifest.xml
+2
-1
module_test/src/main/java/com/fly/tour/test/MainActivity.kt
module_test/src/main/java/com/fly/tour/test/MainActivity.kt
+42
-0
module_test/src/main/java/com/fly/tour/test/MyApplication.kt
module_test/src/main/java/com/fly/tour/test/MyApplication.kt
+16
-0
module_test/src/main/java/com/fly/tour/test/dsl/MyTextWatcher.kt
...test/src/main/java/com/fly/tour/test/dsl/MyTextWatcher.kt
+23
-0
module_test/src/main/java/com/fly/tour/test/dsl/MyUtils.kt
module_test/src/main/java/com/fly/tour/test/dsl/MyUtils.kt
+39
-0
module_test/src/main/java/com/fly/tour/test/dsl/TextChangeListenerDsl.kt
.../main/java/com/fly/tour/test/dsl/TextChangeListenerDsl.kt
+42
-0
module_test/src/main/res/layout/activity_main.xml
module_test/src/main/res/layout/activity_main.xml
+8
-0
未找到文件。
.idea/codeStyles/Project.xml
浏览文件 @
caf06550
...
...
@@ -6,6 +6,9 @@
<JetCodeStyleSettings>
<option
name=
"CODE_STYLE_DEFAULTS"
value=
"KOTLIN_OFFICIAL"
/>
</JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option
name=
"RIGHT_MARGIN"
value=
"72"
/>
</MarkdownNavigatorCodeStyleSettings>
<codeStyleSettings
language=
"XML"
>
<indentOptions>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
...
...
.idea/misc.xml
浏览文件 @
caf06550
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
project-jdk-name=
"
JDK
"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_7"
project-jdk-name=
"
1.8
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
</project>
\ No newline at end of file
module_test/build.gradle
浏览文件 @
caf06550
...
...
@@ -13,6 +13,8 @@ android {
versionCode
1
versionName
"1.0"
//multiDexEnabled true
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
...
...
@@ -34,6 +36,11 @@ dependencies {
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
<<<<<<<
HEAD
implementation
'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
=======
//implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
//implementation 'com.android.support:multidex:1.0.3'
>>>>>>>
b05ec5ba2cfc1b8b505b985998da925f5f6b8f5f
implementation
project
(
':lib_common'
)
}
module_test/src/main/AndroidManifest.xml
浏览文件 @
caf06550
...
...
@@ -8,7 +8,8 @@
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".MainActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
module_test/src/main/java/com/fly/tour/test/MainActivity.kt
浏览文件 @
caf06550
...
...
@@ -5,6 +5,11 @@ import android.os.Bundle
import
android.util.Log
import
android.view.View
import
com.fly.tour.common.util.ToastUtil
<<<<<<<
HEAD
=======
import
com.fly.tour.test.dsl.addTextChangeListenerClosure
import
com.fly.tour.test.dsl.addTextChangeListenerDsl
>>>>>>>
b05ec5ba2cfc1b8b505b985998da925f5f6b8f5f
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.coroutines.GlobalScope
import
kotlinx.coroutines.delay
...
...
@@ -12,11 +17,18 @@ import kotlinx.coroutines.launch
import
kotlinx.coroutines.runBlocking
class
MainActivity
:
AppCompatActivity
()
{
<<<<<<<
HEAD
val
TAG
=
"MYTAG"
=======
//var TAG = MainActivity::class.simpleName
var
TAG
=
"MYTAG"
>>>>>>>
b05ec5ba2cfc1b8b505b985998da925f5f6b8f5f
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
<<<<<<<
HEAD
//testOnClick()
//testThread()
//test1
...
...
@@ -41,6 +53,8 @@ class MainActivity : AppCompatActivity() {
}
private
fun
testOnClick
()
{
=======
>>>>>>>
b05ec5ba2cfc1b8b505b985998da925f5f6b8f5f
btn
.
setOnClickListener
{
v
->
ToastUtil
.
showToast
(
"ok"
)
}
btn
.
setOnClickListener
()
{
v
->
ToastUtil
.
showToast
(
"ok"
)
}
btn
.
setOnClickListener
({
v
->
ToastUtil
.
showToast
(
"ok"
)
})
...
...
@@ -51,6 +65,34 @@ class MainActivity : AppCompatActivity() {
}
})
// txtContent.addTextChangedListener(object : TextWatcher {
// override fun afterTextChanged(s: Editable?) {
// Log.v(TAG,"afterTextChanged ${s.toString()}")
// }
//
// override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
// Log.v(TAG, "beforeTextChanged s: $s, start: $start, count: $count, after: $after")
// }
//
// override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
// Log.v(TAG, "onTextChanged s: $s, start: $start, before: $before, count: $count")
// }
//
// })
// txtContent.addTextChangedListener(object: MyTextWatcher() {
// override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
// Log.v(TAG,"$s:$before:$count")
// }
// })
// txtContent.addTextChangeListenerClosure(onTextChanged = { s, start, before, count ->
// Log.v(TAG,"s:$s")
// })
txtContent
.
addTextChangeListenerDsl
{
onTextChanged
{
s
,
start
,
before
,
count
->
Log
.
v
(
TAG
,
"s value:$s"
)
}
}
}
}
module_test/src/main/java/com/fly/tour/test/MyApplication.kt
0 → 100644
浏览文件 @
caf06550
package
com.fly.tour.test
import
android.app.Application
/**
* Description: <MyApplication><br>
* Author: mxdl<br>
* Date: 2020/2/28<br>
* Version: V1.0.0<br>
* Update: <br>
*/
class
MyApplication
:
Application
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
}
}
\ No newline at end of file
module_test/src/main/java/com/fly/tour/test/dsl/MyTextWatcher.kt
0 → 100644
浏览文件 @
caf06550
package
com.fly.tour.test.dsl
import
android.text.Editable
import
android.text.TextWatcher
/**
* Description: <MyTextWatcher><br>
* Author: mxdl<br>
* Date: 2020/2/28<br>
* Version: V1.0.0<br>
* Update: <br>
*/
open
class
MyTextWatcher
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
}
}
\ No newline at end of file
module_test/src/main/java/com/fly/tour/test/dsl/MyUtils.kt
0 → 100644
浏览文件 @
caf06550
package
com.fly.tour.test.dsl
import
android.text.Editable
import
android.text.TextWatcher
import
android.widget.TextView
/**
* Description: <MyUtils><br>
* Author: mxdl<br>
* Date: 2020/2/28<br>
* Version: V1.0.0<br>
* Update: <br>
*/
inline
fun
TextView
.
addTextChangeListenerClosure
(
crossinline
afterTextChanged
:
(
Editable
?)
->
Unit
=
{},
crossinline
beforeTextChanged
:(
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
=
{
s
,
start
,
count
,
after
->},
crossinline
onTextChanged
:(
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
=
{
s
,
start
,
before
,
count
->}){
var
listener
=
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
afterTextChanged
.
invoke
(
s
)
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
beforeTextChanged
.
invoke
(
s
,
start
,
count
,
after
)
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
onTextChanged
.
invoke
(
s
,
start
,
before
,
count
)
}
}
this
.
addTextChangedListener
(
listener
)
}
fun
TextView
.
addTextChangeListenerDsl
(
listener
:
TextChangeListenerDsl
.()->
Unit
){
var
mListener
=
TextChangeListenerDsl
()
//mListener.listener()
mListener
.
apply
(
listener
)
this
.
addTextChangedListener
(
mListener
)
}
\ No newline at end of file
module_test/src/main/java/com/fly/tour/test/dsl/TextChangeListenerDsl.kt
0 → 100644
浏览文件 @
caf06550
package
com.fly.tour.test.dsl
import
android.text.Editable
import
android.text.TextWatcher
/**
* Description: <TextChangeListenerDsl><br>
* Author: mxdl<br>
* Date: 2020/2/28<br>
* Version: V1.0.0<br>
* Update: <br>
*/
class
TextChangeListenerDsl
:
TextWatcher
{
var
afterTextChanged
:
((
Editable
?)
->
Unit
)?
=
null
var
beforeTextChanged
:
((
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
)?
=
null
var
onTextChanged
:
((
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
)?
=
null
fun
afterTextChanged
(
method
:
(
Editable
?)
->
Unit
)
{
afterTextChanged
=
method
}
fun
beforeTextChanged
(
method
:
(
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
)
{
beforeTextChanged
=
method
}
fun
onTextChanged
(
method
:
(
CharSequence
?,
Int
,
Int
,
Int
)
->
Unit
)
{
beforeTextChanged
=
method
}
override
fun
afterTextChanged
(
s
:
Editable
?)
{
afterTextChanged
?.
invoke
(
s
)
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
beforeTextChanged
?.
invoke
(
s
,
start
,
count
,
after
)
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
onTextChanged
?.
invoke
(
s
,
start
,
before
,
count
)
}
}
\ No newline at end of file
module_test/src/main/res/layout/activity_main.xml
浏览文件 @
caf06550
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<EditText
android:id=
"@+id/txtContent"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
/>
<Button
android:id=
"@+id/btn"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录