Commit 483bb067 by 王涛55

data

parent 4c19be06
...@@ -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')
} }
......
...@@ -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.NoTitleBar" android:theme="@style/Theme.AppCompat.Light.NoActionBar"
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.main.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" />
......
package com.passport; package com.main;
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.module.hikcreate.R; import com.module.hikcreate.R;
import com.passport.TestFragment;
/** /**
* 类说明 * 类说明
...@@ -12,20 +14,22 @@ import com.module.hikcreate.R; ...@@ -12,20 +14,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 AppCompatActivity {
@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();
} }
} }
...@@ -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="300dp"/> android:layout_height="600dp"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<application> <application>
<activity <activity
android:name="com.passport.testLoginActivity" android:name="com.main.testLoginActivity"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
......
package com.passport; package com.main;
import android.app.Activity; 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 +13,7 @@ import com.app.login.R; ...@@ -11,7 +13,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 AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
......
...@@ -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.main.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" />
......
...@@ -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
......
...@@ -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.main.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" />
......
...@@ -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
...@@ -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
......
...@@ -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
} }
...@@ -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();
} }
......
<?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
...@@ -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
<?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_list" android:id="@+id/detect_result_image_layout"
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
...@@ -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
} }
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();
LogCat.e("xwm", textView.getText() + "--" + lines); LogUtil.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);
} }
......
...@@ -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/baidu_bd_ocr_id_card_locator_front" />
<ImageView <ImageView
android:id="@+id/cancel_button" android:id="@+id/cancel_button"
......
...@@ -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"
......
...@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment