Commit f45ee8d1 authored by Max Lv's avatar Max Lv

fix #46

parent 5f1b0e60
...@@ -13,7 +13,7 @@ libraryDependencies ++= Seq( ...@@ -13,7 +13,7 @@ libraryDependencies ++= Seq(
) )
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"de.keyboardsurfer.android.widget" % "crouton" % "1.7", "de.keyboardsurfer.android.widget" % "crouton" % "1.8.1",
"com.nostra13.universalimageloader" % "universal-image-loader" % "1.8.4", "com.nostra13.universalimageloader" % "universal-image-loader" % "1.8.4",
"com.j256.ormlite" % "ormlite-core" % "4.47", "com.j256.ormlite" % "ormlite-core" % "4.47",
"com.j256.ormlite" % "ormlite-android" % "4.47" "com.j256.ormlite" % "ormlite-android" % "4.47"
......
...@@ -48,8 +48,7 @@ import android.util.Log ...@@ -48,8 +48,7 @@ import android.util.Log
import android.view._ import android.view._
import android.widget._ import android.widget._
import com.google.analytics.tracking.android.{MapBuilder, EasyTracker} import com.google.analytics.tracking.android.{MapBuilder, EasyTracker}
import de.keyboardsurfer.android.widget.crouton.Crouton import de.keyboardsurfer.android.widget.crouton.{Crouton, Style, Configuration}
import de.keyboardsurfer.android.widget.crouton.Style
import java.io._ import java.io._
import java.util.Hashtable import java.util.Hashtable
import net.saik0.android.unifiedpreference.UnifiedPreferenceFragment import net.saik0.android.unifiedpreference.UnifiedPreferenceFragment
...@@ -714,10 +713,14 @@ class Shadowsocks ...@@ -714,10 +713,14 @@ class Shadowsocks
if (ShadowVpnService.isServiceStarted(this)) { if (ShadowVpnService.isServiceStarted(this)) {
val style = new Style.Builder() val style = new Style.Builder()
.setBackgroundColorValue(Style.holoBlueLight) .setBackgroundColorValue(Style.holoBlueLight)
.setDuration(Style.DURATION_INFINITE) .build()
val config = new Configuration.Builder()
.setDuration(Configuration.DURATION_LONG)
.build() .build()
switchButton.setEnabled(false) switchButton.setEnabled(false)
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).show() Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style)
.setConfiguration(config)
.show()
} }
setPreferenceEnabled(enabled = false) setPreferenceEnabled(enabled = false)
onStateChanged(State.CONNECTED, null) onStateChanged(State.CONNECTED, null)
...@@ -878,9 +881,13 @@ class Shadowsocks ...@@ -878,9 +881,13 @@ class Shadowsocks
startService(intent) startService(intent)
val style = new Style.Builder() val style = new Style.Builder()
.setBackgroundColorValue(Style.holoBlueLight) .setBackgroundColorValue(Style.holoBlueLight)
.setDuration(Style.DURATION_INFINITE)
.build() .build()
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style).show() val config = new Configuration.Builder()
.setDuration(Configuration.DURATION_LONG)
.build()
Crouton.makeText(Shadowsocks.this, R.string.vpn_status, style)
.setConfiguration(config)
.show()
switchButton.setEnabled(false) switchButton.setEnabled(false)
} else { } else {
if (ShadowsocksService.isServiceStarted(this)) return false if (ShadowsocksService.isServiceStarted(this)) return false
...@@ -972,10 +979,13 @@ class Shadowsocks ...@@ -972,10 +979,13 @@ class Shadowsocks
Crouton.cancelAllCroutons() Crouton.cancelAllCroutons()
val style = new Style.Builder() val style = new Style.Builder()
.setBackgroundColorValue(Style.holoRedLight) .setBackgroundColorValue(Style.holoRedLight)
.setDuration(Style.DURATION_INFINITE) .build()
val config = new Configuration.Builder()
.setDuration(Configuration.DURATION_LONG)
.build() .build()
Crouton Crouton
.makeText(Shadowsocks.this, getString(R.string.vpn_error).format(m), style) .makeText(Shadowsocks.this, getString(R.string.vpn_error).format(m), style)
.setConfiguration(config)
.show() .show()
} }
setPreferenceEnabled(enabled = true) setPreferenceEnabled(enabled = true)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment