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
bbc635b1
Commit
bbc635b1
authored
Jun 26, 2020
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate to ML kit for scanning QR code
Fixes #2548.
parent
9d2bc2d6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
79 deletions
+94
-79
core/build.gradle.kts
core/build.gradle.kts
+1
-1
core/src/main/java/com/github/shadowsocks/utils/Utils.kt
core/src/main/java/com/github/shadowsocks/utils/Utils.kt
+1
-1
mobile/build.gradle.kts
mobile/build.gradle.kts
+6
-2
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
...e/src/main/java/com/github/shadowsocks/ScannerActivity.kt
+84
-70
mobile/src/main/res/layout/layout_scanner.xml
mobile/src/main/res/layout/layout_scanner.xml
+2
-5
No files found.
core/build.gradle.kts
View file @
bbc635b1
...
@@ -71,7 +71,7 @@ dependencies {
...
@@ -71,7 +71,7 @@ dependencies {
val
workVersion
=
"2.4.0-rc01"
val
workVersion
=
"2.4.0-rc01"
api
(
project
(
":plugin"
))
api
(
project
(
":plugin"
))
api
(
"androidx.fragment:fragment-ktx:1.
2.5
"
)
api
(
"androidx.fragment:fragment-ktx:1.
3.0-alpha06
"
)
api
(
"androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
)
api
(
"androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion"
)
api
(
"androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycleVersion"
)
api
(
"androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycleVersion"
)
api
(
"androidx.preference:preference:1.1.1"
)
api
(
"androidx.preference:preference:1.1.1"
)
...
...
core/src/main/java/com/github/shadowsocks/utils/Utils.kt
View file @
bbc635b1
...
@@ -44,7 +44,7 @@ import java.net.InetAddress
...
@@ -44,7 +44,7 @@ import java.net.InetAddress
import
kotlin.coroutines.resume
import
kotlin.coroutines.resume
import
kotlin.coroutines.resumeWithException
import
kotlin.coroutines.resumeWithException
fun
<
T
>
Iterable
<
T
>.
forEachTry
(
action
:
(
T
)
->
Unit
)
{
inline
fun
<
T
>
Iterable
<
T
>.
forEachTry
(
action
:
(
T
)
->
Unit
)
{
var
result
:
Exception
?
=
null
var
result
:
Exception
?
=
null
for
(
element
in
this
)
try
{
for
(
element
in
this
)
try
{
action
(
element
)
action
(
element
)
...
...
mobile/build.gradle.kts
View file @
bbc635b1
...
@@ -12,14 +12,18 @@ setupApp()
...
@@ -12,14 +12,18 @@ setupApp()
android
.
defaultConfig
.
applicationId
=
"com.github.shadowsocks"
android
.
defaultConfig
.
applicationId
=
"com.github.shadowsocks"
dependencies
{
dependencies
{
val
cameraxVersion
=
"1.0.0-beta06"
implementation
(
"androidx.browser:browser:1.2.0"
)
implementation
(
"androidx.browser:browser:1.2.0"
)
implementation
(
"androidx.camera:camera-camera2:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-lifecycle:$cameraxVersion"
)
implementation
(
"androidx.camera:camera-view:1.0.0-alpha13"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.0.0-beta7"
)
implementation
(
"androidx.constraintlayout:constraintlayout:2.0.0-beta7"
)
implementation
(
"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
)
implementation
(
"androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
)
implementation
(
"com.google.android.gms:play-services-vision:20.1.0"
)
implementation
(
"com.google.firebase:firebase-ads:19.2.0"
)
implementation
(
"com.google.firebase:firebase-ads:19.2.0"
)
implementation
(
"com.google.mlkit:barcode-scanning:16.0.0"
)
implementation
(
"com.google.zxing:core:3.4.0"
)
implementation
(
"com.google.zxing:core:3.4.0"
)
implementation
(
"com.takisoft.preferencex:preferencex-simplemenu:1.1.0"
)
implementation
(
"com.takisoft.preferencex:preferencex-simplemenu:1.1.0"
)
implementation
(
"com.twofortyfouram:android-plugin-api-for-locale:1.0.4"
)
implementation
(
"com.twofortyfouram:android-plugin-api-for-locale:1.0.4"
)
implementation
(
"me.zhanghai.android.fastscroll:library:1.1.4"
)
implementation
(
"me.zhanghai.android.fastscroll:library:1.1.4"
)
implementation
(
"xyz.belvi.mobilevision:barcodescanner:2.0.3"
)
}
}
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
View file @
bbc635b1
This diff is collapsed.
Click to expand it.
mobile/src/main/res/layout/layout_scanner.xml
View file @
bbc635b1
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<include
layout=
"@layout/toolbar_light_dark"
/>
<include
layout=
"@layout/toolbar_light_dark"
/>
<
fragment
<
androidx.camera.view.PreviewView
android:id=
"@+id/barcode"
android:id=
"@+id/barcode"
android:name=
"com.google.android.gms.samples.vision.barcodereader.BarcodeCapture"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
/>
app:gvb_auto_focus=
"true"
/>
</LinearLayout>
</LinearLayout>
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