Skip to content

Commit 3f83ef8

Browse files
david-allisonlukstbit
authored andcommitted
refactor: use LayoutInflater.from(context)
1 parent fb3fadb commit 3f83ef8

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

AnkiDroid/src/main/java/com/ichi2/ui/AxisSelector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class AxisSelector : LinearLayout {
6060
private var onExtremitySelectedListener: ((Binding.AxisButtonBinding) -> Unit)? = null
6161

6262
init {
63-
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
63+
val inflater = LayoutInflater.from(context)
6464
inflater.inflate(R.layout.axis_display, this, true)
6565
name = findViewById(R.id.axis_name)
6666
minButton = findViewById(R.id.select_min_extremity)

AnkiDroid/src/main/java/com/ichi2/ui/GestureDisplay.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class GestureDisplay
7474
private var swipeView: ImageView
7575

7676
init {
77-
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
77+
val inflater = LayoutInflater.from(context)
7878
inflater.inflate(R.layout.gesture_display, this)
7979

8080
val listener = OnGestureListener.createInstance(this, this::setGesture)

AnkiDroid/src/main/java/com/ichi2/ui/GesturePicker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class GesturePicker(
5252
private var onGestureListener: GestureListener? = null
5353

5454
init {
55-
val inflater = ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
55+
val inflater = LayoutInflater.from(ctx)
5656
inflater.inflate(R.layout.gesture_picker, this)
5757
gestureDisplay = findViewById(R.id.gestureDisplay)
5858
gestureSpinner = findViewById(R.id.spinner_gesture)

0 commit comments

Comments
 (0)