wxr
2022-11-24 2af932533ef851bf983385244e9912976dbd4daa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.lechange.demo.view;
 
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
 
public class RecoderSeekBar extends android.support.v7.widget.AppCompatSeekBar {
 
    private boolean canTouchAble = true;
 
    public RecoderSeekBar(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
 
    public RecoderSeekBar(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
 
    public RecoderSeekBar(Context context) {
        super(context);
    }
 
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (!canTouchAble) {
            return true;
        }
        return super.onTouchEvent(event);
    }
 
    public void setCanTouchAble(boolean canTouchAble) {
        this.canTouchAble = canTouchAble;
    }
}