diff --git a/build.sbt b/build.sbt index f4669e8e..c9da9fe8 100644 --- a/build.sbt +++ b/build.sbt @@ -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") diff --git a/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala b/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala index 9aa7c36f..fbad227f 100644 --- a/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala +++ b/src/main/scala/com/github/shadowsocks/ProfilesFragment.scala @@ -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) + } } }