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
c4583bea
Commit
c4583bea
authored
Dec 25, 2015
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a friendly dialog
parent
0d582f23
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
src/main/res/values-zh/strings.xml
src/main/res/values-zh/strings.xml
+4
-0
src/main/res/values/strings.xml
src/main/res/values/strings.xml
+4
-0
src/main/scala/com/github/shadowsocks/ProfileManagerActivity.scala
...scala/com/github/shadowsocks/ProfileManagerActivity.scala
+13
-1
No files found.
src/main/res/values-zh/strings.xml
View file @
c4583bea
...
...
@@ -85,6 +85,10 @@
<string
name=
"connection_test_error_status_code"
>
状态码无效。(#%d)
</string>
<!-- profile -->
<string
name=
"profile_manager_dialog"
>
配置文件
</string>
<string
name=
"profile_manager_dialog_content"
>
•
点击选择配置文件;\n
•
滑动删除;\n
•
长按拖动改变顺序。
</string>
<string
name=
"gotcha"
>
好的
</string>
<string
name=
"add_profile_dialog"
>
为影梭添加此配置文件?
</string>
<string
name=
"add_profile_methods_scan_qr_code"
>
扫描二维码
</string>
<string
name=
"add_profile_methods_manual_settings"
>
手动设置
</string>
...
...
src/main/res/values/strings.xml
View file @
c4583bea
...
...
@@ -103,6 +103,10 @@
<string
name=
"action_import_err"
>
Failed to import.
</string>
<!-- profile -->
<string
name=
"profile_manager_dialog"
>
Profiles
</string>
<string
name=
"profile_manager_dialog_content"
>
•
Tap to select a profile;\n
•
Swipe to remove;\n
•
Long press to reorder profiles.
</string>
<string
name=
"gotcha"
>
Gotcha!
</string>
<string
name=
"add_profile_dialog"
>
Add this Shadowsocks Profile?
</string>
<string
name=
"add_profile_methods_scan_qr_code"
>
Scan QR code
</string>
<string
name=
"add_profile_methods_manual_settings"
>
Manual Settings
</string>
...
...
src/main/scala/com/github/shadowsocks/ProfileManagerActivity.scala
View file @
c4583bea
package
com.github.shadowsocks
import
android.content.Intent
import
android.os.
{
Handler
,
Bundle
}
import
android.os.
{
Bundle
,
Handler
}
import
android.support.design.widget.Snackbar
import
android.support.v7.app.
{
AlertDialog
,
AppCompatActivity
}
import
android.support.v7.widget.RecyclerView.ViewHolder
...
...
@@ -25,7 +25,13 @@ import scala.collection.mutable.ArrayBuffer
/**
* @author Mygod
*/
object
ProfileManagerActivity
{
private
final
val
profileTip
=
"profileTip"
}
class
ProfileManagerActivity
extends
AppCompatActivity
with
OnMenuItemClickListener
with
ServiceBoundContext
{
import
ProfileManagerActivity._
private
class
ProfileViewHolder
(
val
view
:
View
)
extends
RecyclerView
.
ViewHolder
(
view
)
with
View
.
OnClickListener
{
private
var
item
:
Profile
=
_
private
val
text
=
itemView
.
findViewById
(
android
.
R
.
id
.
text1
).
asInstanceOf
[
CheckedTextView
]
...
...
@@ -204,6 +210,12 @@ class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClickListe
def
trafficUpdated
(
txRate
:
String
,
rxRate
:
String
,
txTotal
:
String
,
rxTotal
:
String
)
=
if
(
selectedItem
!=
null
)
selectedItem
.
updateText
(
true
)
})
if
(
ShadowsocksApplication
.
settings
.
getBoolean
(
profileTip
,
true
))
{
ShadowsocksApplication
.
settings
.
edit
.
putBoolean
(
profileTip
,
false
).
commit
new
AlertDialog
.
Builder
(
this
).
setTitle
(
R
.
string
.
profile_manager_dialog
)
.
setMessage
(
R
.
string
.
profile_manager_dialog_content
).
setPositiveButton
(
R
.
string
.
gotcha
,
null
).
create
.
show
}
}
override
def
onDestroy
{
...
...
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