diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/DataBindingAdapters.kt b/mobile/src/main/java/be/mygod/vpnhotspot/DataBindingAdapters.kt deleted file mode 100644 index ce51fc92..00000000 --- a/mobile/src/main/java/be/mygod/vpnhotspot/DataBindingAdapters.kt +++ /dev/null @@ -1,11 +0,0 @@ -package be.mygod.vpnhotspot - -import android.databinding.BindingAdapter -import android.support.annotation.DrawableRes -import android.widget.ImageView - -object DataBindingAdapters { - @JvmStatic - @BindingAdapter("android:src") - fun setImageResource(imageView: ImageView, @DrawableRes resource: Int) = imageView.setImageResource(resource) -} diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/Utils.kt b/mobile/src/main/java/be/mygod/vpnhotspot/Utils.kt index adf89761..ca339191 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/Utils.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/Utils.kt @@ -4,7 +4,10 @@ import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.content.IntentFilter +import android.databinding.BindingAdapter +import android.support.annotation.DrawableRes import android.util.Log +import android.widget.ImageView import java.io.IOException import java.io.InputStream @@ -22,6 +25,9 @@ fun intentFilter(vararg actions: String): IntentFilter { return result } +@BindingAdapter("android:src") +fun setImageResource(imageView: ImageView, @DrawableRes resource: Int) = imageView.setImageResource(resource) + private const val NOISYSU_TAG = "NoisySU" private const val NOISYSU_SUFFIX = "SUCCESS\n" fun loggerSuStream(command: String): InputStream {