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
90b5780d
Commit
90b5780d
authored
Nov 19, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #982
parent
d1890448
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
src/main/scala/com/github/shadowsocks/ProfileManagerActivity.scala
...scala/com/github/shadowsocks/ProfileManagerActivity.scala
+1
-9
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
+6
-3
No files found.
src/main/scala/com/github/shadowsocks/ProfileManagerActivity.scala
View file @
90b5780d
...
...
@@ -295,7 +295,7 @@ final class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClic
case
R
.
id
.
fab_qrcode_add
=>
menu
.
toggle
(
false
)
val
intent
=
new
Intent
(
this
,
classOf
[
ScannerActivity
])
startActivity
ForResult
(
intent
,
REQUEST_QRCODE
)
startActivity
(
intent
)
case
R
.
id
.
fab_nfc_add
=>
menu
.
toggle
(
true
)
val
dialog
=
new
AlertDialog
.
Builder
(
ProfileManagerActivity
.
this
)
...
...
@@ -385,14 +385,6 @@ final class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClic
super
.
onDestroy
}
override
def
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
)
{
if
(
requestCode
==
REQUEST_QRCODE
&&
resultCode
==
Activity
.
RESULT_OK
)
{
val
contents
=
data
.
getStringExtra
(
"uri"
)
if
(!
TextUtils
.
isEmpty
(
contents
))
Parser
.
findAll
(
contents
).
foreach
(
app
.
profileManager
.
createProfile
)
}
}
override
def
onBackPressed
()
{
if
(
menu
.
isOpened
)
menu
.
close
(
true
)
else
super
.
onBackPressed
()
}
...
...
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
View file @
90b5780d
...
...
@@ -8,8 +8,11 @@ import android.support.v4.app.ActivityCompat
import
android.support.v4.content.ContextCompat
import
android.support.v7.app.AppCompatActivity
import
android.support.v7.widget.Toolbar
import
android.text.TextUtils
import
android.widget.Toast
import
com.google.zxing.Result
import
com.github.shadowsocks.ShadowsocksApplication.app
import
com.github.shadowsocks.utils.Parser
import
me.dm7.barcodescanner.zxing.ZXingScannerView
object
ScannerActivity
{
...
...
@@ -73,9 +76,9 @@ class ScannerActivity extends AppCompatActivity with ZXingScannerView.ResultHand
}
override
def
handleResult
(
rawResult
:
Result
)
=
{
val
intent
=
new
Intent
()
i
ntent
.
putExtra
(
"uri"
,
rawResult
.
getText
)
setResult
(
Activity
.
RESULT_OK
,
intent
)
val
uri
=
rawResult
.
getText
i
f
(!
TextUtils
.
isEmpty
(
uri
)
)
Parser
.
findAll
(
uri
).
foreach
(
app
.
profileManager
.
createProfile
)
navigateUp
()
}
}
...
...
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