Skip to content

Commit d56690e

Browse files
authored
preload (#93)
* preload * refactor * Update ktlint.gradle * Update ktlint.gradle * Update ktlint.gradle * fix gradle * update license * update * apiDump * update * update
1 parent f5aec34 commit d56690e

36 files changed

+495
-149
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
[*]
3+
indent_size=2
4+
end_of_line=lf
5+
charset=utf-8
6+
trim_trailing_whitespace=true
7+
insert_final_newline=true
8+
[*.{kt, kts}]
9+
ij_kotlin_imports_layout=*
10+
disabled_rules=filename
11+
[*.xml]
12+
indent_size=4

.idea/copyright/MIT_License.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetDropDown.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2021 Petrus Nguyễn Thái Học
3+
Copyright (c) 2020-2022 Petrus Nguyễn Thái Học
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,4 +298,4 @@ Since version `1.2.0`, `minSdkVersion` has been changed to `14`.
298298

299299
MIT License
300300

301-
Copyright (c) 2020-2021 Petrus Nguyễn Thái Học
301+
Copyright (c) 2020-2022 Petrus Nguyễn Thái Học

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package="com.hoc081098.example">
44

55
<application
6+
android:name=".MyApp"
67
android:allowBackup="true"
78
android:icon="@mipmap/ic_launcher"
89
android:label="@string/app_name"

app/src/main/java/com/hoc081098/example/DemoAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2021 Petrus Nguyễn Thái Học
4+
* Copyright (c) 2020-2022 Petrus Nguyễn Thái Học
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal

app/src/main/java/com/hoc081098/example/DemoDialogFragment.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* MIT License
33
*
4-
* Copyright (c) 2020-2021 Petrus Nguyễn Thái Học
4+
* Copyright (c) 2020-2022 Petrus Nguyễn Thái Học
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@ package com.hoc081098.example
2727
import android.app.Dialog
2828
import android.os.Bundle
2929
import android.util.Log
30+
import android.view.View
3031
import androidx.appcompat.app.AlertDialog
3132
import androidx.fragment.app.FragmentManager
3233
import com.hoc081098.example.databinding.DialogFragmentDemoBinding
@@ -52,9 +53,16 @@ class DemoDialogFragment : DefaultViewBindingDialogFragment() {
5253
.create()
5354
}
5455

56+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
57+
access()
58+
}
59+
5560
override fun onResume() {
5661
super.onResume()
62+
access()
63+
}
5764

65+
private fun access() {
5866
Log.d("###", viewBinding.toString())
5967
Log.d("###", viewBinding.textInputLayout.toString())
6068

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* MIT License
3+
*
4+
* Copyright (c) 2020-2022 Petrus Nguyễn Thái Học
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*/
24+
25+
package com.hoc081098.example
26+
27+
import android.app.Application
28+
import com.hoc081098.example.databinding.FragmentFourthBinding
29+
import com.hoc081098.example.databinding.FragmentThirdBinding
30+
import com.hoc081098.example.databinding.FragmentThirdIncludeBinding
31+
import com.hoc081098.example.databinding.ItemRecyclerBinding
32+
import com.hoc081098.viewbindingdelegate.preloadBindMethods
33+
import com.hoc081098.viewbindingdelegate.preloadInflateMethods
34+
35+
class MyApp : Application() {
36+
override fun onCreate() {
37+
super.onCreate()
38+
39+
preloadBindMethods(
40+
FragmentThirdBinding::class,
41+
FragmentThirdIncludeBinding::class,
42+
FragmentFourthBinding::class
43+
)
44+
preloadInflateMethods(
45+
ItemRecyclerBinding::class
46+
)
47+
}
48+
}

0 commit comments

Comments
 (0)