update styles
|
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 125 B |
|
After Width: | Height: | Size: 113 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 461 B |
|
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 107 B |
|
Before Width: | Height: | Size: 100 B After Width: | Height: | Size: 100 B |
|
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
|
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
|
Before Width: | Height: | Size: 105 B After Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 134 B |
|
After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 817 B After Width: | Height: | Size: 822 B |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
|
Before Width: | Height: | Size: 97 B After Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 260 B After Width: | Height: | Size: 259 B |
|
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
|
Before Width: | Height: | Size: 125 B After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 677 B After Width: | Height: | Size: 603 B |
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
|
After Width: | Height: | Size: 357 B |
|
After Width: | Height: | Size: 351 B |
|
After Width: | Height: | Size: 350 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 352 B |
|
After Width: | Height: | Size: 140 B |
|
After Width: | Height: | Size: 131 B |
|
After Width: | Height: | Size: 148 B |
|
After Width: | Height: | Size: 372 B |
|
After Width: | Height: | Size: 360 B |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 137 B |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 156 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 157 B |
|
After Width: | Height: | Size: 480 B |
|
After Width: | Height: | Size: 481 B |
|
After Width: | Height: | Size: 805 B |
|
After Width: | Height: | Size: 744 B |
|
After Width: | Height: | Size: 116 B |
|
After Width: | Height: | Size: 116 B |
|
After Width: | Height: | Size: 110 B |
|
After Width: | Height: | Size: 102 B |
|
After Width: | Height: | Size: 102 B |
|
After Width: | Height: | Size: 110 B |
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- File created by the Android Action Bar Style Generator
|
||||
|
||||
Copyright (C) 2011 The Android Open Source Project
|
||||
Copyright (C) 2012 readyState Software Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/pressed_shadow" />
|
||||
</shape>
|
||||
@@ -20,6 +20,6 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:exitFadeDuration="@android:integer/config_mediumAnimTime" >
|
||||
<item android:state_pressed="false" android:state_focused="true" android:drawable="@drawable/list_focused_shadow" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/pressed_background_shadow" />
|
||||
<item android:state_pressed="true" android:drawable="@drawable/list_pressed_shadow" />
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
||||
@@ -21,7 +21,7 @@
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<org.jraf.android.backport.switchwidget.Switch
|
||||
<Switch
|
||||
android:id="@+id/bypassSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"/>
|
||||
|
||||
<org.jraf.android.backport.switchwidget.Switch
|
||||
<Switch
|
||||
android:id="@+id/switchButton"
|
||||
android:switchTextAppearance="@android:style/TextAppearance.Small.Inverse"
|
||||
android:enabled="false"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -16,45 +16,60 @@
|
||||
|
||||
<resources>
|
||||
|
||||
<!-- Variation on the Light theme that turns off the title -->
|
||||
<style name="Theme.Shadowsocks" parent="@style/Theme.Shadow">
|
||||
<item name="menuDrawerStyle">@style/MenuDrawerStyle</item>
|
||||
</style>
|
||||
<style name="Theme.AppManager" parent="@style/Theme.Shadow">
|
||||
</style>
|
||||
|
||||
<style name="MenuDrawer"/>
|
||||
<style name="PopupTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
|
||||
<item name="android:windowSoftInputMode">stateAlwaysHidden</item>
|
||||
<item name="android:windowActionModeOverlay">true</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDrawer.Widget"/>
|
||||
<!-- Variation on the Light theme that turns off the title -->
|
||||
<style name="Theme.Shadowsocks" parent="@style/Theme.Shadow">
|
||||
<item name="menuDrawerStyle">@style/MenuDrawerStyle</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDrawer.Widget.Category">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">?android:attr/textColorSecondaryInverse</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
<style name="MenuDrawer"/>
|
||||
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:background">@drawable/md__category_background</item>
|
||||
<style name="MenuDrawer.Widget"/>
|
||||
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
</style>
|
||||
<style name="MenuDrawer.Widget.Category">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">?android:attr/textColorSecondaryInverse</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textAllCaps">true</item>
|
||||
|
||||
<style name="MenuDrawer.Widget.Title">
|
||||
<item name="android:background">@drawable/md__list_selector_holo_dark</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearance</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingRight">32dp</item>
|
||||
<item name="android:paddingTop">8dp</item>
|
||||
<item name="android:paddingBottom">8dp</item>
|
||||
<item name="android:drawablePadding">16dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:background">@drawable/md__category_background</item>
|
||||
|
||||
<style name="MenuDrawerStyle" parent="Widget.MenuDrawer">
|
||||
<item name="mdActiveIndicator">@drawable/menu_arrow</item>
|
||||
<item name="mdMenuSize">250dp</item>
|
||||
</style>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDrawer.Widget.Title">
|
||||
<item name="android:background">@drawable/md__list_selector_holo_dark</item>
|
||||
<item name="android:textAppearance">?android:attr/textAppearance</item>
|
||||
<item name="android:textColor">?android:attr/textColorPrimaryInverse</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingRight">32dp</item>
|
||||
<item name="android:paddingTop">8dp</item>
|
||||
<item name="android:paddingBottom">8dp</item>
|
||||
<item name="android:drawablePadding">16dp</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
</style>
|
||||
|
||||
<style name="MenuDrawerStyle" parent="Widget.MenuDrawer">
|
||||
<item name="mdActiveIndicator">@drawable/menu_arrow</item>
|
||||
<item name="mdMenuSize">250dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
package com.github.shadowsocks
|
||||
|
||||
import android.app.ProgressDialog
|
||||
import android.app.{Activity, ProgressDialog}
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.pm.PackageManager
|
||||
@@ -53,22 +53,13 @@ import android.view.View.OnClickListener
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams
|
||||
import android.view.WindowManager
|
||||
import android.widget.AbsListView
|
||||
import android.widget._
|
||||
import android.widget.AbsListView.OnScrollListener
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.CheckBox
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.CompoundButton.OnCheckedChangeListener
|
||||
import android.widget.ImageView
|
||||
import android.widget.ListAdapter
|
||||
import android.widget.ListView
|
||||
import android.widget.TextView
|
||||
import com.actionbarsherlock.app.SherlockActivity
|
||||
import com.nostra13.universalimageloader.core.download.BaseImageDownloader
|
||||
import java.io.{ByteArrayOutputStream, ByteArrayInputStream, InputStream}
|
||||
import com.nostra13.universalimageloader.core.{DisplayImageOptions, ImageLoader, ImageLoaderConfiguration}
|
||||
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer
|
||||
import org.jraf.android.backport.switchwidget.Switch
|
||||
import com.github.shadowsocks.utils.{Utils, Scheme, Key}
|
||||
|
||||
case class ProxiedApp(uid: Int, name: String, var proxied: Boolean)
|
||||
@@ -105,7 +96,7 @@ object AppManager {
|
||||
}
|
||||
}
|
||||
|
||||
class AppManager extends SherlockActivity with OnCheckedChangeListener with OnClickListener {
|
||||
class AppManager extends Activity with OnCheckedChangeListener with OnClickListener {
|
||||
|
||||
val MSG_LOAD_START = 1
|
||||
val MSG_LOAD_FINISH = 2
|
||||
@@ -217,7 +208,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
|
||||
|
||||
protected override def onCreate(savedInstanceState: Bundle) {
|
||||
super.onCreate(savedInstanceState)
|
||||
getSupportActionBar.setTitle(R.string.proxied_help)
|
||||
getActionBar.setTitle(R.string.proxied_help)
|
||||
this.setContentView(R.layout.layout_apps)
|
||||
this.overlay = View.inflate(this, R.layout.overlay, null).asInstanceOf[TextView]
|
||||
getWindowManager.addView(overlay, new
|
||||
@@ -232,7 +223,7 @@ class AppManager extends SherlockActivity with OnCheckedChangeListener with OnCl
|
||||
.build()
|
||||
ImageLoader.getInstance().init(config)
|
||||
|
||||
val bypassSwitch: Switch = findViewById(R.id.bypassSwitch).asInstanceOf[Switch]
|
||||
val bypassSwitch = findViewById(R.id.bypassSwitch).asInstanceOf[Switch]
|
||||
val prefs: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(getBaseContext)
|
||||
bypassSwitch.setOnCheckedChangeListener(new OnCheckedChangeListener {
|
||||
def onCheckedChanged(button: CompoundButton, checked: Boolean) {
|
||||
|
||||
@@ -225,18 +225,19 @@ class Shadowsocks
|
||||
}
|
||||
}
|
||||
|
||||
lazy val settings = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
lazy val status = getSharedPreferences(Key.status, Context.MODE_PRIVATE)
|
||||
lazy val preferenceReceiver = new PreferenceBroadcastReceiver
|
||||
lazy val drawer = MenuDrawer.attach(this)
|
||||
lazy val menuAdapter = new MenuAdapter(this, getMenuList)
|
||||
lazy val listView = new ListView(this)
|
||||
lazy val profileManager =
|
||||
private lazy val settings = PreferenceManager.getDefaultSharedPreferences(this)
|
||||
private lazy val status = getSharedPreferences(Key.status, Context.MODE_PRIVATE)
|
||||
private lazy val preferenceReceiver = new PreferenceBroadcastReceiver
|
||||
private lazy val drawer = MenuDrawer.attach(this)
|
||||
private lazy val menuAdapter = new MenuAdapter(this, getMenuList)
|
||||
private lazy val listView = new ListView(this)
|
||||
private lazy val profileManager =
|
||||
new ProfileManager(settings, getApplication.asInstanceOf[ShadowsocksApplication].dbHelper)
|
||||
|
||||
private lazy val handler = new Handler()
|
||||
private lazy val application = getApplication.asInstanceOf[ShadowsocksApplication]
|
||||
|
||||
val handler = new Handler()
|
||||
|
||||
def isSinglePane: Boolean = {
|
||||
if (singlePane == -1) {
|
||||
val metrics = new DisplayMetrics()
|
||||
@@ -518,8 +519,8 @@ class Shadowsocks
|
||||
case ignored: RemoteException => // Nothing
|
||||
}
|
||||
bgService = null
|
||||
unbindService(connection)
|
||||
}
|
||||
unbindService(connection)
|
||||
}
|
||||
|
||||
override def onRestoreInstanceState(inState: Bundle) {
|
||||
|
||||
@@ -39,19 +39,16 @@
|
||||
|
||||
package com.github.shadowsocks
|
||||
|
||||
import java.util
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
import android.app.Application
|
||||
import com.github.shadowsocks.database.DBHelper
|
||||
import com.google.android.gms.analytics.{GoogleAnalytics, Tracker}
|
||||
import com.github.shadowsocks.utils.Utils
|
||||
import com.google.android.gms.analytics.GoogleAnalytics
|
||||
import com.google.android.gms.common.api.ResultCallback
|
||||
import com.google.android.gms.tagmanager.Container.FunctionCallMacroCallback
|
||||
import com.google.android.gms.tagmanager.{ContainerHolder, TagManager, Container}
|
||||
import com.google.tagmanager.{Container, ContainerOpener, TagManager}
|
||||
import com.google.tagmanager.ContainerOpener.{Notifier, OpenType}
|
||||
import com.google.tagmanager.Container.FunctionCallMacroHandler
|
||||
import java.util
|
||||
import com.github.shadowsocks.utils.Utils
|
||||
import com.google.android.gms.tagmanager.{ContainerHolder, TagManager}
|
||||
|
||||
class ShadowsocksApplication extends Application {
|
||||
lazy val dbHelper = new DBHelper(this)
|
||||
@@ -64,7 +61,7 @@ class ShadowsocksApplication extends Application {
|
||||
val pending = tm.loadContainerPreferNonDefault("GTM-NT8WS8", R.raw.gtm_default_container)
|
||||
val callback = new ResultCallback[ContainerHolder] {
|
||||
override def onResult(holder: ContainerHolder): Unit = {
|
||||
if (!containerHolder.getStatus.isSuccess) {
|
||||
if (!holder.getStatus.isSuccess) {
|
||||
return
|
||||
}
|
||||
containerHolder = holder
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
|
||||
package com.github.shadowsocks
|
||||
|
||||
import android.app.backup.{FileBackupHelper, SharedPreferencesBackupHelper, BackupAgentHelper}
|
||||
import android.content.Context
|
||||
import android.app.backup.{BackupAgentHelper, FileBackupHelper, SharedPreferencesBackupHelper}
|
||||
import com.github.shadowsocks.database.DBHelper
|
||||
|
||||
class ShadowsocksBackupAgent extends BackupAgentHelper {
|
||||
|
||||
@@ -39,30 +39,26 @@
|
||||
|
||||
package com.github.shadowsocks
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.app.Service
|
||||
import java.io.File
|
||||
import java.lang.reflect.{InvocationTargetException, Method}
|
||||
import java.util.{Timer, TimerTask}
|
||||
|
||||
import android.app.{Notification, NotificationManager, PendingIntent, Service}
|
||||
import android.content._
|
||||
import android.content.pm.PackageInfo
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.pm.{PackageInfo, PackageManager}
|
||||
import android.graphics.Color
|
||||
import android.net.TrafficStats
|
||||
import android.os._
|
||||
import android.support.v4.app.NotificationCompat
|
||||
import android.util.Log
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.lang.reflect.Method
|
||||
import com.github.shadowsocks.aidl.Config
|
||||
import com.github.shadowsocks.utils._
|
||||
import com.google.android.gms.analytics.HitBuilders
|
||||
import org.apache.http.conn.util.InetAddressUtils
|
||||
|
||||
import scala.collection._
|
||||
import java.util.{TimerTask, Timer}
|
||||
import android.net.TrafficStats
|
||||
import scala.concurrent.ops._
|
||||
import com.github.shadowsocks.utils._
|
||||
import scala.Some
|
||||
import android.graphics.Color
|
||||
import com.github.shadowsocks.aidl.Config
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
import java.io.File
|
||||
import scala.concurrent.ops._
|
||||
|
||||
case class TrafficStat(tx: Long, rx: Long, timestamp: Long)
|
||||
|
||||
@@ -275,6 +271,7 @@ class ShadowsocksNatService extends Service with BaseService {
|
||||
}
|
||||
|
||||
def onBind(intent: Intent): IBinder = {
|
||||
Log.d(TAG, "onBind")
|
||||
if (Action.SERVICE == intent.getAction) {
|
||||
binder
|
||||
} else {
|
||||
|
||||