Skip to content

Commit ff01f53

Browse files
Optimize sample code
1 parent fa421c3 commit ff01f53

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

app/src/main/java/com/dylanc/viewbinding/sample/CustomViewFragment.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (c) 2020. Dylan Cai
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.dylanc.viewbinding.sample
218

319
import android.os.Bundle

app/src/main/java/com/dylanc/viewbinding/sample/HomeFragment.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (c) 2020. Dylan Cai
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
@file:Suppress("unused")
218

319
package com.dylanc.viewbinding.sample

app/src/main/java/com/dylanc/viewbinding/sample/base/reflection/java/BaseBindingFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public abstract class BaseBindingFragment<VB extends ViewBinding> extends Fragme
3636
@Nullable
3737
@Override
3838
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
39-
binding = ViewBindingUtil.inflateWithGeneric(this, getLayoutInflater(), container, false);
39+
binding = ViewBindingUtil.inflateWithGeneric(this, inflater, container, false);
4040
return binding.getRoot();
4141
}
4242

app/src/main/java/com/dylanc/viewbinding/sample/base/reflection/kotlin/BaseBindingFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class BaseBindingFragment<VB : ViewBinding> : Fragment() {
4343
val binding: VB get() = _binding!!
4444

4545
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
46-
_binding = ViewBindingUtil.inflateWithGeneric(this, layoutInflater, container, false)
46+
_binding = ViewBindingUtil.inflateWithGeneric(this, inflater, container, false)
4747
return binding.root
4848
}
4949

0 commit comments

Comments
 (0)