Eric Kok
6 years ago
23 changed files with 229 additions and 73 deletions
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
package org.transdroid.core.gui.settings; |
||||
|
||||
import android.content.Context; |
||||
import android.os.Build; |
||||
import android.preference.EditTextPreference; |
||||
import android.support.annotation.RequiresApi; |
||||
import android.util.AttributeSet; |
||||
|
||||
public class InterceptableEditTextPreference extends EditTextPreference { |
||||
|
||||
private OnPreferenceClickListener overrideClickListener = null; |
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) |
||||
public InterceptableEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { |
||||
super(context, attrs, defStyleAttr, defStyleRes); |
||||
} |
||||
|
||||
public InterceptableEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { |
||||
super(context, attrs, defStyleAttr); |
||||
} |
||||
|
||||
public InterceptableEditTextPreference(Context context, AttributeSet attrs) { |
||||
super(context, attrs); |
||||
} |
||||
|
||||
public InterceptableEditTextPreference(Context context) { |
||||
super(context); |
||||
} |
||||
|
||||
@Override |
||||
public OnPreferenceClickListener getOnPreferenceClickListener() { |
||||
return overrideClickListener; |
||||
} |
||||
|
||||
@Override |
||||
public void setOnPreferenceClickListener(OnPreferenceClickListener onPreferenceClickListener) { |
||||
this.overrideClickListener = onPreferenceClickListener; |
||||
} |
||||
|
||||
@Override |
||||
protected void onClick() { |
||||
if (overrideClickListener == null || !overrideClickListener.onPreferenceClick(this)) { |
||||
super.onClick(); |
||||
} |
||||
} |
||||
|
||||
} |
@ -1,18 +1,18 @@
@@ -1,18 +1,18 @@
|
||||
buildscript { |
||||
repositories { |
||||
google() |
||||
jcenter() |
||||
mavenCentral() |
||||
} |
||||
dependencies { |
||||
classpath 'com.android.tools.build:gradle:3.2.1' |
||||
classpath 'com.android.tools.build:gradle:3.3.2' |
||||
} |
||||
} |
||||
|
||||
allprojects { |
||||
repositories { |
||||
google() |
||||
mavenCentral() |
||||
jcenter() |
||||
mavenLocal() |
||||
maven { url "https://jitpack.io" } |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue