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
63e6e604
Unverified
Commit
63e6e604
authored
Jun 26, 2020
by
Max Lv
Committed by
GitHub
Jun 26, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2551 from Mygod/mlkit
Migrate to ML kit for scanning QR code
parents
73fa7c97
0828a7e0
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
80 deletions
+99
-80
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/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+2
-0
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
...e/src/main/java/com/github/shadowsocks/ScannerActivity.kt
+86
-70
mobile/src/main/java/com/github/shadowsocks/widget/WindowInsetsListeners.kt
...va/com/github/shadowsocks/widget/WindowInsetsListeners.kt
+1
-1
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 @
63e6e604
...
@@ -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 @
63e6e604
...
@@ -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 @
63e6e604
...
@@ -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/AndroidManifest.xml
View file @
63e6e604
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
android:name=
".ScannerActivity"
android:name=
".ScannerActivity"
android:label=
"@string/add_profile_methods_scan_qr_code"
android:label=
"@string/add_profile_methods_scan_qr_code"
android:parentActivityName=
".MainActivity"
android:parentActivityName=
".MainActivity"
android:theme=
"@style/Theme.Shadowsocks.Immersive"
android:screenOrientation=
"locked"
android:excludeFromRecents=
"true"
/>
android:excludeFromRecents=
"true"
/>
<activity
android:name=
".tasker.ConfigActivity"
<activity
android:name=
".tasker.ConfigActivity"
...
...
mobile/src/main/java/com/github/shadowsocks/ScannerActivity.kt
View file @
63e6e604
This diff is collapsed.
Click to expand it.
mobile/src/main/java/com/github/shadowsocks/widget/WindowInsetsListeners.kt
View file @
63e6e604
...
@@ -33,7 +33,7 @@ object ListHolderListener : View.OnApplyWindowInsetsListener {
...
@@ -33,7 +33,7 @@ object ListHolderListener : View.OnApplyWindowInsetsListener {
return
insets
.
replaceSystemWindowInsets
(
0
,
0
,
0
,
insets
.
systemWindowInsetBottom
)
return
insets
.
replaceSystemWindowInsets
(
0
,
0
,
0
,
insets
.
systemWindowInsetBottom
)
}
}
fun
setup
(
activity
:
AppCompatActivity
)
=
activity
.
findViewById
<
View
>(
android
.
R
.
id
.
content
).
apply
{
fun
setup
(
activity
:
AppCompatActivity
)
=
activity
.
findViewById
<
View
>(
android
.
R
.
id
.
content
).
run
{
setOnApplyWindowInsetsListener
(
ListHolderListener
)
setOnApplyWindowInsetsListener
(
ListHolderListener
)
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
systemUiVisibility
=
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
or
View
.
SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
}
}
...
...
mobile/src/main/res/layout/layout_scanner.xml
View file @
63e6e604
<?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