Disable profile switching when connected
This commit is contained in:
@@ -42,12 +42,15 @@ libraryDependencies ++=
|
||||
"com.google.android.gms" % "play-services-analytics" % "10.0.1" ::
|
||||
"com.google.android.gms" % "play-services-gcm" % "10.0.1" ::
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||
"dnsjava" % "dnsjava" % "2.1.7" ::
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201608240809" ::
|
||||
"me.dm7.barcodescanner" % "zxing" % "1.9" ::
|
||||
"net.glxn.qrgen" % "android" % "2.0" ::
|
||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||
"com.mikepenz" % "materialize" % "1.0.0" ::
|
||||
"com.mikepenz" % "iconics-core" % "2.8.0" ::
|
||||
"com.mikepenz" % "fastadapter" % "2.1.0" ::
|
||||
Nil
|
||||
|
||||
lazy val nativeBuild = TaskKey[Unit]("native-build", "Build native executables")
|
||||
|
||||
@@ -33,7 +33,7 @@ import android.view._
|
||||
import android.widget.{TextView, Toast}
|
||||
import com.github.shadowsocks.ShadowsocksApplication.app
|
||||
import com.github.shadowsocks.database.Profile
|
||||
import com.github.shadowsocks.utils.{Action, Parser, TrafficMonitor, Utils}
|
||||
import com.github.shadowsocks.utils._
|
||||
import com.github.shadowsocks.widget.UndoSnackbarManager
|
||||
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
@@ -92,10 +92,12 @@ final class ProfilesFragment extends ToolbarFragment with OnMenuItemClickListene
|
||||
}
|
||||
|
||||
def onClick(v: View) {
|
||||
val old = app.profileId
|
||||
app.switchProfile(item.id)
|
||||
profilesAdapter.refreshId(old)
|
||||
bind(item)
|
||||
if (getActivity.asInstanceOf[MainActivity].state == State.STOPPED) {
|
||||
val old = app.profileId
|
||||
app.switchProfile(item.id)
|
||||
profilesAdapter.refreshId(old)
|
||||
bind(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user