Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
6ade0645
Commit
6ade0645
authored
Mar 12, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #600 from Mygod/master
Refine layout for #598
parents
14a53248
8fd8514c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
36 deletions
+26
-36
build.sbt
build.sbt
+5
-5
src/main/res/layout/layout_quick_switch.xml
src/main/res/layout/layout_quick_switch.xml
+14
-24
src/main/scala/com/github/shadowsocks/ShadowsocksQuickSwitchActivity.scala
...m/github/shadowsocks/ShadowsocksQuickSwitchActivity.scala
+4
-5
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
...in/scala/com/github/shadowsocks/ShadowsocksSettings.scala
+3
-2
No files found.
build.sbt
View file @
6ade0645
...
...
@@ -6,7 +6,7 @@ platformTarget in Android := "android-23"
name
:=
"shadowsocks"
scalaVersion
:=
"2.11.
7
"
scalaVersion
:=
"2.11.
8
"
compileOrder
in
Compile
:=
CompileOrder
.
JavaThenScala
...
...
@@ -30,15 +30,15 @@ libraryDependencies ++= Seq(
"dnsjava"
%
"dnsjava"
%
"2.1.7"
,
"com.github.kevinsawicki"
%
"http-request"
%
"6.0"
,
"commons-net"
%
"commons-net"
%
"3.4"
,
"eu.chainfire"
%
"libsuperuser"
%
"1.0.0.201602
011018
"
,
"eu.chainfire"
%
"libsuperuser"
%
"1.0.0.201602
271131
"
,
"com.google.zxing"
%
"android-integration"
%
"3.2.1"
,
"net.glxn.qrgen"
%
"android"
%
"2.0"
,
"com.google.android.gms"
%
"play-services-base"
%
"8.4.0"
,
"com.google.android.gms"
%
"play-services-ads"
%
"8.4.0"
,
"com.google.android.gms"
%
"play-services-analytics"
%
"8.4.0"
,
"com.android.support"
%
"design"
%
"23.
1
.1"
,
"com.android.support"
%
"gridlayout-v7"
%
"23.
1
.1"
,
"com.android.support"
%
"cardview-v7"
%
"23.2.
0
"
,
"com.android.support"
%
"design"
%
"23.
2
.1"
,
"com.android.support"
%
"gridlayout-v7"
%
"23.
2
.1"
,
"com.android.support"
%
"cardview-v7"
%
"23.2.
1
"
,
"com.github.jorgecastilloprz"
%
"fabprogresscircle"
%
"1.01"
,
"com.j256.ormlite"
%
"ormlite-core"
%
"4.48"
,
"com.j256.ormlite"
%
"ormlite-android"
%
"4.48"
,
...
...
src/main/res/layout/layout_quick_switch.xml
View file @
6ade0645
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:orientation=
"vertical"
android:clickable=
"true"
android:foreground=
"@android:color/transparent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<android.support.v7.widget.CardView
android:layout_height=
"260dp"
android:layout_width=
"match_parent"
<android.support.v7.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_margin=
"8dp"
android:layout_gravity=
"center_vertical"
android:clickable=
"true"
app:cardElevation=
"5dp"
app:cardBackgroundColor=
"#EEEEEE"
>
app:cardBackgroundColor=
"#EEEEEE"
>
<LinearLayout
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
>
<include
layout=
"@layout/toolbar_light_dark"
/>
<include
layout=
"@layout/toolbar_light_dark"
/>
<android.support.v7.widget.RecyclerView
<android.support.v7.widget.RecyclerView
android:id=
"@+id/profilesList"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
src/main/scala/com/github/shadowsocks/ShadowsocksQuickSwitchActivity.scala
View file @
6ade0645
...
...
@@ -27,11 +27,7 @@ class ShadowsocksQuickSwitchActivity extends AppCompatActivity {
def
bind
(
item
:
Profile
)
{
this
.
item
=
item
text
.
setText
(
item
.
name
)
if
(
item
.
id
==
ShadowsocksApplication
.
profileId
)
{
text
.
setChecked
(
true
)
}
else
{
text
.
setChecked
(
false
)
}
text
.
setChecked
(
item
.
id
==
ShadowsocksApplication
.
profileId
)
}
def
onClick
(
v
:
View
)
{
...
...
@@ -74,5 +70,8 @@ class ShadowsocksQuickSwitchActivity extends AppCompatActivity {
profilesList
.
setLayoutManager
(
lm
)
profilesList
.
setItemAnimator
(
new
DefaultItemAnimator
)
profilesList
.
setAdapter
(
profilesAdapter
)
if
(
ShadowsocksApplication
.
profileId
>=
0
)
lm
.
scrollToPosition
(
profilesAdapter
.
profiles
.
zipWithIndex
.
collectFirst
{
case
(
profile
,
i
)
if
profile
.
id
==
ShadowsocksApplication
.
profileId
=>
i
+
1
}.
getOrElse
(
0
))
}
}
src/main/scala/com/github/shadowsocks/ShadowsocksSettings.scala
View file @
6ade0645
...
...
@@ -15,7 +15,7 @@ import android.webkit.{WebView, WebViewClient}
import
com.github.shadowsocks.database.Profile
import
com.github.shadowsocks.preferences._
import
com.github.shadowsocks.utils.CloseUtils._
import
com.github.shadowsocks.utils.
Key
import
com.github.shadowsocks.utils.
{
Key
,
Utils
}
object
ShadowsocksSettings
{
// Constants
...
...
@@ -198,7 +198,8 @@ class ShadowsocksSettings extends PreferenceFragment with OnSharedPreferenceChan
this
.
enabled
=
enabled
for
(
name
<-
Key
.
isNAT
#::
PROXY_PREFS
.
toStream
#:::
FEATURE_PREFS
.
toStream
)
{
val
pref
=
findPreference
(
name
)
if
(
pref
!=
null
)
pref
.
setEnabled
(
enabled
)
if
(
pref
!=
null
)
pref
.
setEnabled
(
enabled
&&
(
name
!=
Key
.
isProxyApps
||
Utils
.
isLollipopOrAbove
||
!
ShadowsocksApplication
.
isVpnEnabled
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment