VersionPreference -> kt
This commit is contained in:
parent
e93f98cb02
commit
b210bea490
|
@ -1,30 +0,0 @@
|
|||
package info.nightscout.androidaps.interaction.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.Toast;
|
||||
|
||||
import info.nightscout.androidaps.BuildConfig;
|
||||
import preference.WearListPreference;
|
||||
|
||||
/**
|
||||
* Created by adrian on 07/08/17.
|
||||
*/
|
||||
|
||||
public class VersionPreference extends WearListPreference {
|
||||
public VersionPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
entries = new CharSequence[]{BuildConfig.BUILDVERSION};
|
||||
entryValues = new CharSequence[]{BuildConfig.BUILDVERSION};
|
||||
}
|
||||
|
||||
@Override public CharSequence getSummary(@NonNull final Context context) {
|
||||
return BuildConfig.BUILDVERSION;
|
||||
}
|
||||
@Override
|
||||
public void onPreferenceClick(@NonNull Context context) {
|
||||
Toast.makeText(context, "Build version:" + BuildConfig.BUILDVERSION, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package info.nightscout.androidaps.interaction.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import preference.WearListPreference
|
||||
import android.widget.Toast
|
||||
import info.nightscout.androidaps.BuildConfig
|
||||
|
||||
/**
|
||||
* Created by adrian on 07/08/17.
|
||||
*/
|
||||
class VersionPreference(context: Context?, attrs: AttributeSet?) : WearListPreference(context, attrs) {
|
||||
|
||||
override fun getSummary(context: Context): CharSequence {
|
||||
return BuildConfig.BUILDVERSION
|
||||
}
|
||||
|
||||
override fun onPreferenceClick(context: Context) {
|
||||
Toast.makeText(context, "Build version:" + BuildConfig.BUILDVERSION, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
init {
|
||||
entries = arrayOf<CharSequence>(BuildConfig.BUILDVERSION)
|
||||
entryValues = arrayOf<CharSequence>(BuildConfig.BUILDVERSION)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue