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
e7d2dec9
Commit
e7d2dec9
authored
Dec 18, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't navigate up if scanning was cancelled
parent
cd25dcdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
src/main/AndroidManifest.xml
src/main/AndroidManifest.xml
+1
-1
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
+6
-11
No files found.
src/main/AndroidManifest.xml
View file @
e7d2dec9
...
...
@@ -74,7 +74,7 @@
android:name=
".ShadowsocksRunnerActivity"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
android:excludeFromRecents=
"true"
android:taskAffinity=
""
android:taskAffinity=
""
android:launchMode=
"singleTask"
/>
<activity
...
...
src/main/scala/com/github/shadowsocks/ScannerActivity.scala
View file @
e7d2dec9
...
...
@@ -58,20 +58,13 @@ class ScannerActivity extends AppCompatActivity with ZXingScannerView.ResultHand
}
}
def
navigateUp
()
{
val
intent
=
getParentActivityIntent
if
(
shouldUpRecreateTask
(
intent
)
||
isTaskRoot
)
TaskStackBuilder
.
create
(
this
).
addNextIntentWithParentStack
(
intent
).
startActivities
()
else
finish
()
}
override
def
onCreate
(
state
:
Bundle
)
{
super
.
onCreate
(
state
)
setContentView
(
R
.
layout
.
layout_scanner
)
val
toolbar
=
findViewById
(
R
.
id
.
toolbar
).
asInstanceOf
[
Toolbar
]
toolbar
.
setTitle
(
getTitle
)
toolbar
.
setNavigationIcon
(
R
.
drawable
.
abc_ic_ab_back_material
)
toolbar
.
setNavigationOnClickListener
(
_
=>
navigateUp
())
toolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_navigation_close
)
toolbar
.
setNavigationOnClickListener
(
_
=>
finish
())
scannerView
=
findViewById
(
R
.
id
.
scanner
).
asInstanceOf
[
ZXingScannerView
]
if
(
Build
.
VERSION
.
SDK_INT
>=
25
)
getSystemService
(
classOf
[
ShortcutManager
]).
reportShortcutUsed
(
"scan"
)
}
...
...
@@ -98,7 +91,9 @@ class ScannerActivity extends AppCompatActivity with ZXingScannerView.ResultHand
val
uri
=
rawResult
.
getText
if
(!
TextUtils
.
isEmpty
(
uri
))
Parser
.
findAll
(
uri
).
foreach
(
app
.
profileManager
.
createProfile
)
navigateUp
()
val
intent
=
getParentActivityIntent
if
(
shouldUpRecreateTask
(
intent
)
||
isTaskRoot
)
TaskStackBuilder
.
create
(
this
).
addNextIntentWithParentStack
(
intent
).
startActivities
()
else
finish
()
}
}
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