Commit 37e5d225 authored by Bartek Fabiszewski's avatar Bartek Fabiszewski
Browse files

Use SwitchCompat

parent 454325c1
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -11,14 +11,12 @@ package net.fabiszewski.ulogger;

import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Switch;

import androidx.annotation.RequiresApi;
import androidx.appcompat.widget.SwitchCompat;

public class SwipeSwitch extends Switch {
public class SwipeSwitch extends SwitchCompat {

    public SwipeSwitch(Context context) {
        super(context);
@@ -32,11 +30,6 @@ public class SwipeSwitch extends Switch {
        super(context, attrs, defStyleAttr);
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public SwipeSwitch(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @SuppressLint("ClickableViewAccessibility")
    @Override
    public boolean performClick() {
+2 −2
Original line number Diff line number Diff line
@@ -82,14 +82,14 @@
            android:checked="false"
            android:paddingTop="30dp"
            android:paddingBottom="20dp"
            android:switchMinWidth="200dp"
            android:text="@string/tracking"
            android:textAlignment="center"
            android:textAllCaps="true"
            android:textIsSelectable="false"
            android:textSize="16sp"
            android:thumb="@drawable/thumb_selector"
            android:track="@drawable/track_selector" />
            app:switchMinWidth="200dp"
            app:track="@drawable/track_selector" />

        <LinearLayout
            android:layout_width="match_parent"