Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
component
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王涛55
component
Commits
85eff6e4
Commit
85eff6e4
authored
Sep 20, 2019
by
王涛55
Committed by
wangtao
Sep 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data
parent
4c19be06
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
109 additions
and
85 deletions
+109
-85
ModuleProject/app/build.gradle
+1
-0
ModuleProject/app/src/main/AndroidManifest.xml
+2
-2
ModuleProject/app/src/main/java/com/hikcreate/ui/testActivity.java
+14
-8
ModuleProject/app/src/main/res/layout/app_test.xml
+1
-1
ModuleProject/app_login/src/main/AndroidManifest.xml
+1
-1
ModuleProject/app_login/src/main/java/com/hikcreate/login/testLoginActivity.java
+4
-3
ModuleProject/app_login/src/main/module/AndroidManifest.xml
+1
-1
ModuleProject/app_passport/src/main/java/com/hikcreate/passport/TestFragment.java
+2
-3
ModuleProject/app_passport/src/main/module/AndroidManifest.xml
+1
-1
ModuleProject/config/app_config.gradle
+2
-0
ModuleProject/lib_app_common/build.gradle
+10
-0
ModuleProject/lib_baidu_facedect/build.gradle
+5
-3
ModuleProject/lib_baidu_facedect/src/main/java/com/hikcreate/baidufacedect/ui/BaseDetectFragment.java
+8
-10
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_activity_face_detect_v3100.xml
+3
-3
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_activity_face_liveness_v3100.xml
+3
-2
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_fragment_face_detect_version_v3100.xml
+24
-31
ModuleProject/lib_baidu_textdect/build.gradle
+3
-1
ModuleProject/lib_baidu_textdect/libs/astudio-v2.1.160401.jar
+0
-0
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/util/TextDecTools.java
+12
-3
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_confirm_result.xml
+4
-4
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_crop.xml
+4
-4
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_take_picture.xml
+4
-4
No files found.
ModuleProject/app/build.gradle
View file @
85eff6e4
...
@@ -96,6 +96,7 @@ dependencies {
...
@@ -96,6 +96,7 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
if
(
build_module
==
build_module_app
)
{
if
(
build_module
==
build_module_app
)
{
api
project
(
':lib_app_common'
)
api
project
(
':lib_app_common'
)
api
project
(
':app_common'
)
api
project
(
':app_login'
)
api
project
(
':app_login'
)
api
project
(
':app_passport'
)
api
project
(
':app_passport'
)
}
}
...
...
ModuleProject/app/src/main/AndroidManifest.xml
View file @
85eff6e4
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
<application
<application
android:roundIcon=
"@mipmap/ic_launcher"
android:roundIcon=
"@mipmap/ic_launcher"
android:allowBackup=
"false"
android:allowBackup=
"false"
android:theme=
"@
android:style/Theme.NoTitle
Bar"
android:theme=
"@
style/Theme.AppCompat.Light.NoAction
Bar"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
tools:ignore=
"GoogleAppIndexingWarning,HardcodedDebugMode"
tools:ignore=
"GoogleAppIndexingWarning,HardcodedDebugMode"
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
<activity
android:name=
"com.
passport
.testActivity"
>
<activity
android:name=
"com.
hikcreate.ui
.testActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
...
ModuleProject/app/src/main/java/com/
passport
/testActivity.java
→
ModuleProject/app/src/main/java/com/
hikcreate/ui
/testActivity.java
View file @
85eff6e4
package
com
.
passport
;
package
com
.
hikcreate
.
ui
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v7.app.AppCompatActivity
;
import
com.hikcreate.login.testLoginActivity
;
import
com.module.hikcreate.R
;
import
com.module.hikcreate.R
;
/**
/**
* 类说明
* 类说明
*
*
...
@@ -12,20 +16,22 @@ import com.module.hikcreate.R;
...
@@ -12,20 +16,22 @@ import com.module.hikcreate.R;
* @date 2019/9/18
* @date 2019/9/18
* @mail wangtao55@hikcreate.com
* @mail wangtao55@hikcreate.com
*/
*/
public
class
testActivity
extends
Activity
{
public
class
testActivity
extends
A
ppCompatA
ctivity
{
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
app_test
);
setContentView
(
R
.
layout
.
app_test
);
findViewById
(
R
.
id
.
mBtnLogin
).
setOnClickListener
(
v
->
{
findViewById
(
R
.
id
.
mBtnLogin
).
setOnClickListener
(
v
->
{
// Intent mIntent = new Intent(testActivity.this,
testLoginActivity.class);
Intent
mIntent
=
new
Intent
(
testActivity
.
this
,
testLoginActivity
.
class
);
//
startActivity(mIntent);
startActivity
(
mIntent
);
});
});
findViewById
(
R
.
id
.
mBtnPassport
).
setOnClickListener
(
v
->
{
findViewById
(
R
.
id
.
mBtnPassport
).
setOnClickListener
(
v
->
{
//
Intent mIntent = new Intent(testActivity.this,testLoginActivity.class);
Intent
mIntent
=
new
Intent
(
testActivity
.
this
,
testLoginActivity
.
class
);
//
startActivity(mIntent);
startActivity
(
mIntent
);
});
});
// getFragmentManager().beginTransaction().add(R.id.test_passport,);
FragmentTransaction
transaction
=
getSupportFragmentManager
().
beginTransaction
();
transaction
.
add
(
R
.
id
.
test_passport
,
new
TestFragment
());
transaction
.
commit
();
}
}
}
}
ModuleProject/app/src/main/res/layout/app_test.xml
View file @
85eff6e4
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<FrameLayout
<FrameLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:id=
"@+id/test_passport"
android:id=
"@+id/test_passport"
android:layout_height=
"
3
00dp"
/>
android:layout_height=
"
6
00dp"
/>
...
...
ModuleProject/app_login/src/main/AndroidManifest.xml
View file @
85eff6e4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<application>
<application>
<activity
<activity
android:name=
"com.
passport
.testLoginActivity"
android:name=
"com.
hikcreate.login
.testLoginActivity"
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
/>
...
...
ModuleProject/app_login/src/main/java/com/
passport
/testLoginActivity.java
→
ModuleProject/app_login/src/main/java/com/
hikcreate/login
/testLoginActivity.java
View file @
85eff6e4
package
com
.
passport
;
package
com
.
hikcreate
.
login
;
import
android.app.Activity
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v7.app.AppCompatActivity
;
import
com.app.login.R
;
import
com.app.login.R
;
/**
/**
...
@@ -11,7 +12,7 @@ import com.app.login.R;
...
@@ -11,7 +12,7 @@ import com.app.login.R;
* @date 2019/9/18
* @date 2019/9/18
* @mail wangtao55@hikcreate.com
* @mail wangtao55@hikcreate.com
*/
*/
public
class
testLoginActivity
extends
Activity
{
public
class
testLoginActivity
extends
A
ppCompatA
ctivity
{
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
ModuleProject/app_login/src/main/module/AndroidManifest.xml
View file @
85eff6e4
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
tools:ignore=
"GoogleAppIndexingWarning"
tools:ignore=
"GoogleAppIndexingWarning"
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
<activity
android:name=
"com.
passport
.testLoginActivity"
>
<activity
android:name=
"com.
hikcreate.login
.testLoginActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
...
ModuleProject/app_passport/src/main/java/com/passport/TestFragment.java
→
ModuleProject/app_passport/src/main/java/com/
hikcreate/
passport/TestFragment.java
View file @
85eff6e4
package
com
.
passport
;
package
com
.
hikcreate
.
passport
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
...
@@ -25,8 +25,7 @@ public class TestFragment extends Fragment {
...
@@ -25,8 +25,7 @@ public class TestFragment extends Fragment {
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
//通过参数中的布局填充获取对应布局
//通过参数中的布局填充获取对应布局
View
view
=
inflater
.
inflate
(
R
.
layout
.
passport_test_fragment
,
container
,
false
);
return
inflater
.
inflate
(
R
.
layout
.
passport_test_fragment
,
container
,
false
);
return
view
;
}
}
@Override
@Override
...
...
ModuleProject/app_passport/src/main/module/AndroidManifest.xml
View file @
85eff6e4
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
tools:ignore=
"GoogleAppIndexingWarning"
tools:ignore=
"GoogleAppIndexingWarning"
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
tools:replace=
"android:icon,android:roundIcon,android:theme,android:label,android:allowBackup"
>
<activity
android:name=
"com.
passport
.testLoginActivity"
>
<activity
android:name=
"com.
hikcreate,login
.testLoginActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
...
ModuleProject/config/app_config.gradle
View file @
85eff6e4
...
@@ -62,6 +62,7 @@ versions.bugly_crashreport ='1.3.8'
...
@@ -62,6 +62,7 @@ versions.bugly_crashreport ='1.3.8'
versions
.
bugly_native_crashreport
=
'latest.release'
versions
.
bugly_native_crashreport
=
'latest.release'
versions
.
meituanWalle
=
'1.1.3'
versions
.
meituanWalle
=
'1.1.3'
versions
.
eventbus
=
"3.1.1"
versions
.
eventbus
=
"3.1.1"
versions
.
gson
=
"2.8.0"
ext
.
versions
=
versions
ext
.
versions
=
versions
//deps依赖库
//deps依赖库
...
@@ -92,5 +93,6 @@ deps.glide_compiler = "com.github.bumptech.glide:compiler:$versions.gliderVersio
...
@@ -92,5 +93,6 @@ deps.glide_compiler = "com.github.bumptech.glide:compiler:$versions.gliderVersio
deps
.
jsbridge
=
"com.github.lzyzsd:jsbridge:$versions.jsbridge"
//JsBridge
deps
.
jsbridge
=
"com.github.lzyzsd:jsbridge:$versions.jsbridge"
//JsBridge
deps
.
otto
=
'com.squareup:otto:1.3.5'
//otto消息总线
deps
.
otto
=
'com.squareup:otto:1.3.5'
//otto消息总线
deps
.
eventbus
=
"org.greenrobot:eventbus:$versions.eventbus"
deps
.
eventbus
=
"org.greenrobot:eventbus:$versions.eventbus"
deps
.
gson
=
"com.google.code.gson:gson:$versions.gson"
ext
.
deps
=
deps
ext
.
deps
=
deps
ModuleProject/lib_app_common/build.gradle
View file @
85eff6e4
...
@@ -29,6 +29,15 @@ android {
...
@@ -29,6 +29,15 @@ android {
dependencies
{
dependencies
{
api
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
api
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
api
project
(
':lib_baidu_audiodect'
)
api
project
(
':lib_baidu_facedect'
)
api
project
(
':lib_baidu_textdect'
)
api
project
(
':lib_common_ui'
)
api
project
(
':lib_data_drive'
)
api
project
(
':lib_network'
)
// App's support dependencies
// App's support dependencies
api
([
api
([
deps
.
appcompat
,
deps
.
appcompat
,
...
@@ -49,6 +58,7 @@ dependencies {
...
@@ -49,6 +58,7 @@ dependencies {
deps
.
rxandroid2
deps
.
rxandroid2
])
])
api
deps
.
gson
api
deps
.
androidsvg_aar
api
deps
.
androidsvg_aar
api
deps
.
constraint_layout
api
deps
.
constraint_layout
api
deps
.
glide
api
deps
.
glide
...
...
ModuleProject/lib_baidu_facedect/build.gradle
View file @
85eff6e4
...
@@ -6,8 +6,8 @@ android {
...
@@ -6,8 +6,8 @@ android {
minSdkVersion
build_config
.
min_sdk
minSdkVersion
build_config
.
min_sdk
targetSdkVersion
build_config
.
target_sdk
targetSdkVersion
build_config
.
target_sdk
resourcePrefix
build_modele_baidu_resourcePrefix
resourcePrefix
build_modele_baidu_resourcePrefix
versionCode
1
versionCode
build_config
.
version_code
versionName
"1.0"
versionName
build_config
.
version_name
}
}
buildTypes
{
buildTypes
{
...
@@ -25,15 +25,17 @@ android {
...
@@ -25,15 +25,17 @@ android {
dataBinding
{
dataBinding
{
enabled
=
true
enabled
=
true
}
}
repositories
{
repositories
{
flatDir
{
flatDir
{
dirs
'libs'
,
'aars'
dirs
'libs'
,
'aars'
}
}
}
}
}
}
dependencies
{
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
deps
.
support_v4
implementation
deps
.
support_v4
api
deps
.
constraint_layout
implementation
deps
.
constraint_layout
}
}
ModuleProject/lib_baidu_facedect/src/main/java/com/hikcreate/baidufacedect/ui/BaseDetectFragment.java
View file @
85eff6e4
...
@@ -2,7 +2,6 @@ package com.hikcreate.baidufacedect.ui;
...
@@ -2,7 +2,6 @@ package com.hikcreate.baidufacedect.ui;
import
android.content.BroadcastReceiver
;
import
android.content.BroadcastReceiver
;
import
android.content.Context
;
import
android.content.Context
;
import
android.databinding.DataBindingUtil
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.BitmapFactory
;
import
android.graphics.PixelFormat
;
import
android.graphics.PixelFormat
;
...
@@ -29,7 +28,6 @@ import android.view.WindowManager;
...
@@ -29,7 +28,6 @@ import android.view.WindowManager;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
com.baidu.idl.face.platform.FaceConfig
;
import
com.baidu.idl.face.platform.FaceConfig
;
import
com.baidu.idl.face.platform.FaceSDKManager
;
import
com.baidu.idl.face.platform.FaceSDKManager
;
import
com.baidu.idl.face.platform.FaceStatusEnum
;
import
com.baidu.idl.face.platform.FaceStatusEnum
;
...
@@ -40,7 +38,6 @@ import com.baidu.idl.face.platform.utils.APIUtils;
...
@@ -40,7 +38,6 @@ import com.baidu.idl.face.platform.utils.APIUtils;
import
com.baidu.idl.face.platform.utils.Base64Utils
;
import
com.baidu.idl.face.platform.utils.Base64Utils
;
import
com.baidu.idl.face.platform.utils.CameraPreviewUtils
;
import
com.baidu.idl.face.platform.utils.CameraPreviewUtils
;
import
com.hikcreate.baidufacedect.R
;
import
com.hikcreate.baidufacedect.R
;
import
com.hikcreate.baidufacedect.databinding.FragmentFaceDetectV3100Binding
;
import
com.hikcreate.baidufacedect.ui.widget.FaceDetectRoundView
;
import
com.hikcreate.baidufacedect.ui.widget.FaceDetectRoundView
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -62,7 +59,6 @@ public abstract class BaseDetectFragment extends Fragment implements
...
@@ -62,7 +59,6 @@ public abstract class BaseDetectFragment extends Fragment implements
public
static
final
String
TAG
=
BaseDetectFragment
.
class
.
getSimpleName
();
public
static
final
String
TAG
=
BaseDetectFragment
.
class
.
getSimpleName
();
// View
// View
protected
FragmentFaceDetectV3100Binding
mBinding
;
protected
View
mRootView
;
protected
View
mRootView
;
protected
FrameLayout
mFrameLayout
;
protected
FrameLayout
mFrameLayout
;
protected
SurfaceView
mSurfaceView
;
protected
SurfaceView
mSurfaceView
;
...
@@ -92,6 +88,7 @@ public abstract class BaseDetectFragment extends Fragment implements
...
@@ -92,6 +88,7 @@ public abstract class BaseDetectFragment extends Fragment implements
protected
int
mPreviewWidth
;
protected
int
mPreviewWidth
;
protected
int
mPreviewHight
;
protected
int
mPreviewHight
;
protected
int
mPreviewDegree
;
protected
int
mPreviewDegree
;
private
ViewGroup
contentView
;
// 监听系统音量广播
// 监听系统音量广播
protected
BroadcastReceiver
mVolumeReceiver
;
protected
BroadcastReceiver
mVolumeReceiver
;
protected
IFaceDetectTipCallback
mDetectTipCallback
;
protected
IFaceDetectTipCallback
mDetectTipCallback
;
...
@@ -100,8 +97,9 @@ public abstract class BaseDetectFragment extends Fragment implements
...
@@ -100,8 +97,9 @@ public abstract class BaseDetectFragment extends Fragment implements
@Nullable
@Nullable
@Override
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
mBinding
=
DataBindingUtil
.
inflate
(
LayoutInflater
.
from
(
getActivity
()),
R
.
layout
.
baidu_fragment_face_detect_v3100
,
null
,
false
);
return
mBinding
.
getRoot
();
contentView
=
(
ViewGroup
)
inflater
.
inflate
(
R
.
layout
.
baidu_fragment_face_detect_version_v3100
,
container
,
false
);
return
contentView
;
}
}
@Override
@Override
...
@@ -121,8 +119,8 @@ public abstract class BaseDetectFragment extends Fragment implements
...
@@ -121,8 +119,8 @@ public abstract class BaseDetectFragment extends Fragment implements
int
vol
=
am
.
getStreamVolume
(
AudioManager
.
STREAM_MUSIC
);
int
vol
=
am
.
getStreamVolume
(
AudioManager
.
STREAM_MUSIC
);
mIsEnableSound
=
vol
>
0
?
mFaceConfig
.
isSound
:
false
;
mIsEnableSound
=
vol
>
0
?
mFaceConfig
.
isSound
:
false
;
mRootView
=
mBinding
.
getRoot
()
;
mRootView
=
contentView
;
mFrameLayout
=
mBinding
.
detectSurfaceLayout
;
mFrameLayout
=
contentView
.
findViewById
(
R
.
id
.
detect_surface_layout
)
;
mSurfaceView
=
new
SurfaceView
(
getContext
());
mSurfaceView
=
new
SurfaceView
(
getContext
());
mSurfaceHolder
=
mSurfaceView
.
getHolder
();
mSurfaceHolder
=
mSurfaceView
.
getHolder
();
...
@@ -140,8 +138,8 @@ public abstract class BaseDetectFragment extends Fragment implements
...
@@ -140,8 +138,8 @@ public abstract class BaseDetectFragment extends Fragment implements
mSurfaceView
.
setLayoutParams
(
cameraFL
);
mSurfaceView
.
setLayoutParams
(
cameraFL
);
mFrameLayout
.
addView
(
mSurfaceView
);
mFrameLayout
.
addView
(
mSurfaceView
);
mFaceDetectRoundView
=
mBinding
.
detectFaceRound
;
mFaceDetectRoundView
=
contentView
.
findViewById
(
R
.
id
.
detect_face_round
)
;
mImageLayout
=
mBinding
.
detectResultImageLayout
;
mImageLayout
=
contentView
.
findViewById
(
R
.
id
.
detect_result_image_layout
)
;
if
(
mBase64ImageMap
!=
null
)
{
if
(
mBase64ImageMap
!=
null
)
{
mBase64ImageMap
.
clear
();
mBase64ImageMap
.
clear
();
}
}
...
...
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_activity_face_detect_v3100.xml
View file @
85eff6e4
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/detect_root_layout"
android:id=
"@+id/detect_root_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
...
@@ -8,7 +7,7 @@
...
@@ -8,7 +7,7 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/detect_surface_layout"
android:id=
"@+id/detect_surface_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
></FrameLayout
>
android:layout_height=
"match_parent"
/
>
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
android:id=
"@+id/detect_face_round"
android:id=
"@+id/detect_face_round"
...
@@ -89,6 +88,6 @@
...
@@ -89,6 +88,6 @@
android:id=
"@+id/detect_result_image_layout"
android:id=
"@+id/detect_result_image_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
></LinearLayout
>
android:orientation=
"horizontal"
/
>
</HorizontalScrollView>
</HorizontalScrollView>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_activity_face_liveness_v3100.xml
View file @
85eff6e4
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<FrameLayout
<FrameLayout
android:id=
"@+id/liveness_surface_layout"
android:id=
"@+id/liveness_surface_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
></FrameLayout
>
android:layout_height=
"match_parent"
/
>
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
android:id=
"@+id/liveness_face_round"
android:id=
"@+id/liveness_face_round"
...
@@ -89,6 +89,6 @@
...
@@ -89,6 +89,6 @@
android:id=
"@+id/liveness_result_image_layout"
android:id=
"@+id/liveness_result_image_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
></LinearLayout
>
android:orientation=
"horizontal"
/
>
</HorizontalScrollView>
</HorizontalScrollView>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_fragment_face_detect_v3100.xml
→
ModuleProject/lib_baidu_facedect/src/main/res/layout/baidu_fragment_face_detect_v
ersion_v
3100.xml
View file @
85eff6e4
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/detect_root_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<data>
<FrameLayout
android:id=
"@+id/detect_surface_layout"
</data>
<android.support.constraint.ConstraintLayout
android:id=
"@+id/detect_root_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
/
>
<FrameLayout
<com.hikcreate.baidufacedect.ui.widget.FaceDetectRoundView
android:id=
"@+id/detect_surface_layout
"
android:id=
"@+id/detect_face_round
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<com.hikcreate.baidufacedect.ui.widget.FaceDetectRoundView
<HorizontalScrollView
android:id=
"@+id/detect_face_round"
android:id=
"@+id/detect_image_list"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
>
<
HorizontalScrollView
<
LinearLayout
android:id=
"@+id/detect_
image_lis
t"
android:id=
"@+id/detect_
result_image_layou
t"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
app:layout_constraintBottom_toBottomOf=
"parent"
>
android:orientation=
"horizontal"
/>
</HorizontalScrollView>
<LinearLayout
</android.support.constraint.ConstraintLayout>
android:id=
"@+id/detect_result_image_layout"
\ No newline at end of file
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
></LinearLayout>
</HorizontalScrollView>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
ModuleProject/lib_baidu_textdect/build.gradle
View file @
85eff6e4
...
@@ -29,9 +29,11 @@ android {
...
@@ -29,9 +29,11 @@ android {
}
}
dependencies
{
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
files
(
'libs/ocr-sdk.jar'
)
implementation
files
(
'libs/ocr-sdk.jar'
)
implementation
files
(
'libs/license.jar'
)
implementation
files
(
'libs/license.jar'
)
implementation
deps
.
appcompat
implementation
deps
.
appcompat
// implementation deps.retrofit2_converter_gson
implementation
deps
.
rxandroid2
implementation
deps
.
gson
}
}
ModuleProject/lib_baidu_textdect/libs/astudio-v2.1.160401.jar
0 → 100644
View file @
85eff6e4
File added
ModuleProject/lib_baidu_textdect/src/main/java/com/hikcreate/baidutextdect/util/TextDecTools.java
View file @
85eff6e4
package
com
.
hikcreate
.
baidutextdect
.
util
;
package
com
.
hikcreate
.
baidutextdect
.
util
;
import
android.annotation.SuppressLint
;
import
android.studio.plugins.GsonUtils
;
import
android.studio.plugins.GsonUtils
;
import
android.view.ViewTreeObserver
;
import
android.view.ViewTreeObserver
;
import
android.webkit.URLUtil
;
import
android.webkit.URLUtil
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.baidu.ocr.sdk.utils.LogUtil
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonSyntaxException
;
import
com.google.gson.JsonSyntaxException
;
import
com.hikcreate.library.plugin.netbase.scheduler.SchedulerProvider
;
import
java.io.File
;
import
java.io.File
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
io.reactivex.ObservableOnSubscribe
;
import
io.reactivex.ObservableOnSubscribe
;
import
io.reactivex.ObservableTransformer
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
io.reactivex.schedulers.Schedulers
;
/**
/**
* 常用工具方法
* 常用工具方法
*
*
...
@@ -67,7 +70,7 @@ public class TextDecTools {
...
@@ -67,7 +70,7 @@ public class TextDecTools {
//这个回调会调用多次,获取完行数记得注销监听
//这个回调会调用多次,获取完行数记得注销监听
textView
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
textView
.
getViewTreeObserver
().
removeOnPreDrawListener
(
this
);
int
lines
=
textView
.
getLineCount
();
int
lines
=
textView
.
getLineCount
();
Log
Cat
.
e
(
"xwm"
,
textView
.
getText
()
+
"--"
+
lines
);
Log
Util
.
e
(
"xwm"
,
textView
.
getText
()
+
"--"
+
lines
);
if
(
lines
>
maxLines
)
{
if
(
lines
>
maxLines
)
{
callBack
.
overFlowed
(
true
);
callBack
.
overFlowed
(
true
);
}
else
{
}
else
{
...
@@ -116,6 +119,7 @@ public class TextDecTools {
...
@@ -116,6 +119,7 @@ public class TextDecTools {
* @param obj2
* @param obj2
* @return
* @return
*/
*/
@SuppressLint
(
"CheckResult"
)
public
static
void
objectEquals
(
Object
obj1
,
Object
obj2
,
ObjectEqualsCallBack
callBack
)
{
public
static
void
objectEquals
(
Object
obj1
,
Object
obj2
,
ObjectEqualsCallBack
callBack
)
{
Observable
.
create
((
ObservableOnSubscribe
<
Boolean
>)
e
->
{
Observable
.
create
((
ObservableOnSubscribe
<
Boolean
>)
e
->
{
if
(
obj1
==
obj2
)
{
if
(
obj1
==
obj2
)
{
...
@@ -125,7 +129,7 @@ public class TextDecTools {
...
@@ -125,7 +129,7 @@ public class TextDecTools {
String
json2
=
GsonUtils
.
jsonSerializer
(
obj2
);
String
json2
=
GsonUtils
.
jsonSerializer
(
obj2
);
e
.
onNext
(
json1
.
equals
(
json2
));
e
.
onNext
(
json1
.
equals
(
json2
));
}
}
}).
compose
(
SchedulerProvider
.
applySchedulers
())
}).
compose
(
applySchedulers
())
.
subscribe
(
equals
->
{
.
subscribe
(
equals
->
{
if
(
callBack
!=
null
)
{
if
(
callBack
!=
null
)
{
callBack
.
result
(
equals
);
callBack
.
result
(
equals
);
...
@@ -137,6 +141,11 @@ public class TextDecTools {
...
@@ -137,6 +141,11 @@ public class TextDecTools {
});
});
}
}
private
static
<
T
>
ObservableTransformer
<
T
,
T
>
applySchedulers
()
{
return
observable
->
observable
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
());
}
public
interface
ObjectEqualsCallBack
{
public
interface
ObjectEqualsCallBack
{
void
result
(
boolean
equals
);
void
result
(
boolean
equals
);
}
}
...
...
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_confirm_result.xml
View file @
85eff6e4
...
@@ -5,16 +5,16 @@
...
@@ -5,16 +5,16 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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"
app:contentView=
"@+id/display_image_view"
app:
baidu_
contentView=
"@+id/display_image_view"
app:leftDownView=
"@+id/cancel_button"
app:
baidu_
leftDownView=
"@+id/cancel_button"
app:rightUpView=
"@+id/confirm_button"
>
app:
baidu_
rightUpView=
"@+id/confirm_button"
>
<ImageView
<ImageView
android:id=
"@+id/display_image_view"
android:id=
"@+id/display_image_view"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
app:srcCompat=
"@drawable/bd_ocr_id_card_locator_front"
/>
app:srcCompat=
"@drawable/b
aidu_b
d_ocr_id_card_locator_front"
/>
<ImageView
<ImageView
android:id=
"@+id/cancel_button"
android:id=
"@+id/cancel_button"
...
...
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_crop.xml
View file @
85eff6e4
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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"
app:centerView=
"@+id/rotate_button"
app:
baidu_
centerView=
"@+id/rotate_button"
app:contentView=
"@+id/crop_view_container"
app:
baidu_
contentView=
"@+id/crop_view_container"
app:leftDownView=
"@+id/cancel_button"
app:
baidu_
leftDownView=
"@+id/cancel_button"
app:rightUpView=
"@+id/confirm_button"
>
app:
baidu_
rightUpView=
"@+id/confirm_button"
>
<com.baidu.ocr.ui.camera.OCRFrameLayout
<com.baidu.ocr.ui.camera.OCRFrameLayout
android:id=
"@+id/crop_view_container"
android:id=
"@+id/crop_view_container"
...
...
ModuleProject/lib_baidu_textdect/src/main/res/layout/baidu_bd_ocr_take_picture.xml
View file @
85eff6e4
...
@@ -5,10 +5,10 @@
...
@@ -5,10 +5,10 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
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"
app:centerView=
"@+id/take_photo_button"
app:
baidu_
centerView=
"@+id/take_photo_button"
app:contentView=
"@+id/camera_view"
app:
baidu_
contentView=
"@+id/camera_view"
app:leftDownView=
"@+id/album_button"
app:
baidu_
leftDownView=
"@+id/album_button"
app:rightUpView=
"@+id/light_button"
>
app:
baidu_
rightUpView=
"@+id/light_button"
>
<com.baidu.ocr.ui.camera.CameraView
<com.baidu.ocr.ui.camera.CameraView
android:id=
"@+id/camera_view"
android:id=
"@+id/camera_view"
...
...
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