Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit f37a0ba

Browse files
Fixing minor indentations
1 parent 0387d1d commit f37a0ba

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

DrawableAnimations/app/src/main/java/com/example/android/drawableanimations/ViewBindingDelegates.kt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,12 @@
1616

1717
package com.example.android.drawableanimations
1818

19-
import android.R
2019
import android.view.View
21-
import androidx.constraintlayout.widget.ConstraintLayout
2220
import androidx.fragment.app.Fragment
2321
import androidx.lifecycle.Lifecycle
2422
import androidx.lifecycle.LifecycleEventObserver
2523
import androidx.viewbinding.ViewBinding
2624

27-
2825
/**
2926
* Retrieves a view binding handle in a Fragment. The field is available only after
3027
* [Fragment.onViewCreated].
@@ -48,18 +45,12 @@ inline fun <reified BindingT : ViewBinding> Fragment.viewBindings(
4845
cached = null
4946
}
5047
}
51-
// val mConstraintLayout: ConstraintLayout = findViewById(R.id.constraintLayoutParent)
52-
// var layout: View = layoutInflater.inflate(R.layout.activity_list_item, null)
53-
// override val value: BindingT
54-
// get() = cached ?: bind(requireView()).also {
55-
// viewLifecycleOwner.lifecycle.addObserver(observer)
56-
// cached = it
57-
// }
58-
override val value: BindingT
59-
get() = cached ?: bind(requireView()).also {
60-
viewLifecycleOwner.lifecycle.addObserver(observer)
61-
cached = it
62-
}
48+
49+
override val value: BindingT
50+
get() = cached ?: bind(requireView()).also {
51+
viewLifecycleOwner.lifecycle.addObserver(observer)
52+
cached = it
53+
}
6354

6455
override fun isInitialized() = cached != null
6556
}

DrawableAnimations/app/src/main/java/com/example/android/drawableanimations/demo/animated/AnimatedFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import com.example.android.drawableanimations.databinding.AnimatedFragmentBindin
2727
import com.example.android.drawableanimations.viewBindings
2828

2929
class AnimatedFragment : Fragment(R.layout.animated_fragment) {
30+
3031
private val binding by viewBindings(AnimatedFragmentBinding::bind)
3132

3233
override fun onDestroyView() {
@@ -57,4 +58,3 @@ class AnimatedFragment : Fragment(R.layout.animated_fragment) {
5758
binding.stop.setOnClickListener { icon.stop() }
5859
}
5960
}
60-

0 commit comments

Comments
 (0)