Commit 85eff6e4 by 王涛55 Committed by wangtao

data

parent 4c19be06
......@@ -96,6 +96,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
if (build_module == build_module_app) {
api project(':lib_app_common')
api project(':app_common')
api project(':app_login')
api project(':app_passport')
}
......
......@@ -5,13 +5,13 @@
<application
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="false"
android:theme="@android:style/Theme.NoTitleBar"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
tools:ignore="GoogleAppIndexingWarning,HardcodedDebugMode"
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>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
......
package com.passport;
package com.hikcreate.ui;
import android.app.Activity;
import android.content.Intent;
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;
/**
* 类说明
*
......@@ -12,20 +16,22 @@ import com.module.hikcreate.R;
* @date 2019/9/18
* @mail wangtao55@hikcreate.com
*/
public class testActivity extends Activity {
public class testActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_test);
findViewById(R.id.mBtnLogin).setOnClickListener(v -> {
// Intent mIntent = new Intent(testActivity.this,testLoginActivity.class);
// startActivity(mIntent);
Intent mIntent = new Intent(testActivity.this, testLoginActivity.class);
startActivity(mIntent);
});
findViewById(R.id.mBtnPassport).setOnClickListener(v -> {
// Intent mIntent = new Intent(testActivity.this,testLoginActivity.class);
// startActivity(mIntent);
Intent mIntent = new Intent(testActivity.this,testLoginActivity.class);
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 @@
<FrameLayout
android:layout_width="match_parent"
android:id="@+id/test_passport"
android:layout_height="300dp"/>
android:layout_height="600dp"/>
......
......@@ -4,7 +4,7 @@
<application>
<activity
android:name="com.passport.testLoginActivity"
android:name="com.hikcreate.login.testLoginActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait" />
......
package com.passport;
package com.hikcreate.login;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.app.login.R;
/**
......@@ -11,7 +12,7 @@ import com.app.login.R;
* @date 2019/9/18
* @mail wangtao55@hikcreate.com
*/
public class testLoginActivity extends Activity {
public class testLoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
......
......@@ -12,7 +12,7 @@
tools:ignore="GoogleAppIndexingWarning"
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>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
......
package com.passport;
package com.hikcreate.passport;
import android.os.Bundle;
import android.support.v4.app.Fragment;
......@@ -25,8 +25,7 @@ public class TestFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//通过参数中的布局填充获取对应布局
View view =inflater.inflate(R.layout.passport_test_fragment,container,false);
return view;
return inflater.inflate(R.layout.passport_test_fragment,container,false);
}
@Override
......
......@@ -12,7 +12,7 @@
tools:ignore="GoogleAppIndexingWarning"
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>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
......
......@@ -62,6 +62,7 @@ versions.bugly_crashreport ='1.3.8'
versions.bugly_native_crashreport ='latest.release'
versions.meituanWalle = '1.1.3'
versions.eventbus = "3.1.1"
versions.gson = "2.8.0"
ext.versions = versions
//deps依赖库
......@@ -92,5 +93,6 @@ deps.glide_compiler = "com.github.bumptech.glide:compiler:$versions.gliderVersio
deps.jsbridge = "com.github.lzyzsd:jsbridge:$versions.jsbridge"//JsBridge
deps.otto = 'com.squareup:otto:1.3.5'//otto消息总线
deps.eventbus = "org.greenrobot:eventbus:$versions.eventbus"
deps.gson = "com.google.code.gson:gson:$versions.gson"
ext.deps = deps
......@@ -29,6 +29,15 @@ android {
dependencies {
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
api ([
deps.appcompat,
......@@ -49,6 +58,7 @@ dependencies {
deps.rxandroid2
])
api deps.gson
api deps.androidsvg_aar
api deps.constraint_layout
api deps.glide
......
......@@ -6,8 +6,8 @@ android {
minSdkVersion build_config.min_sdk
targetSdkVersion build_config.target_sdk
resourcePrefix build_modele_baidu_resourcePrefix
versionCode 1
versionName "1.0"
versionCode build_config.version_code
versionName build_config.version_name
}
buildTypes {
......@@ -25,15 +25,17 @@ android {
dataBinding {
enabled = true
}
repositories {
flatDir {
dirs 'libs', 'aars'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation deps.support_v4
api deps.constraint_layout
implementation deps.constraint_layout
}
......@@ -2,7 +2,6 @@ package com.hikcreate.baidufacedect.ui;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PixelFormat;
......@@ -29,7 +28,6 @@ import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.baidu.idl.face.platform.FaceConfig;
import com.baidu.idl.face.platform.FaceSDKManager;
import com.baidu.idl.face.platform.FaceStatusEnum;
......@@ -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.CameraPreviewUtils;
import com.hikcreate.baidufacedect.R;
import com.hikcreate.baidufacedect.databinding.FragmentFaceDetectV3100Binding;
import com.hikcreate.baidufacedect.ui.widget.FaceDetectRoundView;
import java.util.HashMap;
......@@ -62,7 +59,6 @@ public abstract class BaseDetectFragment extends Fragment implements
public static final String TAG = BaseDetectFragment.class.getSimpleName();
// View
protected FragmentFaceDetectV3100Binding mBinding;
protected View mRootView;
protected FrameLayout mFrameLayout;
protected SurfaceView mSurfaceView;
......@@ -92,6 +88,7 @@ public abstract class BaseDetectFragment extends Fragment implements
protected int mPreviewWidth;
protected int mPreviewHight;
protected int mPreviewDegree;
private ViewGroup contentView;
// 监听系统音量广播
protected BroadcastReceiver mVolumeReceiver;
protected IFaceDetectTipCallback mDetectTipCallback;
......@@ -100,8 +97,9 @@ public abstract class BaseDetectFragment extends Fragment implements
@Nullable
@Override
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
......@@ -121,8 +119,8 @@ public abstract class BaseDetectFragment extends Fragment implements
int vol = am.getStreamVolume(AudioManager.STREAM_MUSIC);
mIsEnableSound = vol > 0 ? mFaceConfig.isSound : false;
mRootView = mBinding.getRoot();
mFrameLayout = mBinding.detectSurfaceLayout;
mRootView = contentView;
mFrameLayout = contentView.findViewById(R.id.detect_surface_layout);
mSurfaceView = new SurfaceView(getContext());
mSurfaceHolder = mSurfaceView.getHolder();
......@@ -140,8 +138,8 @@ public abstract class BaseDetectFragment extends Fragment implements
mSurfaceView.setLayoutParams(cameraFL);
mFrameLayout.addView(mSurfaceView);
mFaceDetectRoundView = mBinding.detectFaceRound;
mImageLayout = mBinding.detectResultImageLayout;
mFaceDetectRoundView = contentView.findViewById(R.id.detect_face_round);
mImageLayout = contentView.findViewById(R.id.detect_result_image_layout);
if (mBase64ImageMap != null) {
mBase64ImageMap.clear();
}
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/detect_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
......@@ -8,7 +7,7 @@
<FrameLayout
android:id="@+id/detect_surface_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
android:layout_height="match_parent"/>
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
android:id="@+id/detect_face_round"
......@@ -89,6 +88,6 @@
android:id="@+id/detect_result_image_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"></LinearLayout>
android:orientation="horizontal"/>
</HorizontalScrollView>
</RelativeLayout>
\ No newline at end of file
......@@ -8,7 +8,7 @@
<FrameLayout
android:id="@+id/liveness_surface_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
android:layout_height="match_parent"/>
<com.baidu.idl.face.platform.ui.widget.FaceDetectRoundView
android:id="@+id/liveness_face_round"
......@@ -89,6 +89,6 @@
android:id="@+id/liveness_result_image_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"></LinearLayout>
android:orientation="horizontal"/>
</HorizontalScrollView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
</data>
<android.support.constraint.ConstraintLayout
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
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">
......@@ -31,7 +25,6 @@
android:id="@+id/detect_result_image_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"></LinearLayout>
android:orientation="horizontal" />
</HorizontalScrollView>
</android.support.constraint.ConstraintLayout>
</layout>
\ No newline at end of file
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
......@@ -29,9 +29,11 @@ android {
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation files('libs/ocr-sdk.jar')
implementation files('libs/license.jar')
implementation deps.appcompat
// implementation deps.retrofit2_converter_gson
implementation deps.rxandroid2
implementation deps.gson
}
package com.hikcreate.baidutextdect.util;
import android.annotation.SuppressLint;
import android.studio.plugins.GsonUtils;
import android.view.ViewTreeObserver;
import android.webkit.URLUtil;
import android.widget.TextView;
import com.baidu.ocr.sdk.utils.LogUtil;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.hikcreate.library.plugin.netbase.scheduler.SchedulerProvider;
import java.io.File;
import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 常用工具方法
*
......@@ -67,7 +70,7 @@ public class TextDecTools {
//这个回调会调用多次,获取完行数记得注销监听
textView.getViewTreeObserver().removeOnPreDrawListener(this);
int lines = textView.getLineCount();
LogCat.e("xwm", textView.getText() + "--" + lines);
LogUtil.e("xwm", textView.getText() + "--" + lines);
if (lines > maxLines) {
callBack.overFlowed(true);
} else {
......@@ -116,6 +119,7 @@ public class TextDecTools {
* @param obj2
* @return
*/
@SuppressLint("CheckResult")
public static void objectEquals(Object obj1, Object obj2, ObjectEqualsCallBack callBack) {
Observable.create((ObservableOnSubscribe<Boolean>) e -> {
if (obj1 == obj2) {
......@@ -125,7 +129,7 @@ public class TextDecTools {
String json2 = GsonUtils.jsonSerializer(obj2);
e.onNext(json1.equals(json2));
}
}).compose(SchedulerProvider.applySchedulers())
}).compose(applySchedulers())
.subscribe(equals -> {
if (callBack != null) {
callBack.result(equals);
......@@ -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 {
void result(boolean equals);
}
......
......@@ -5,16 +5,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentView="@+id/display_image_view"
app:leftDownView="@+id/cancel_button"
app:rightUpView="@+id/confirm_button">
app:baidu_contentView="@+id/display_image_view"
app:baidu_leftDownView="@+id/cancel_button"
app:baidu_rightUpView="@+id/confirm_button">
<ImageView
android:id="@+id/display_image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:srcCompat="@drawable/bd_ocr_id_card_locator_front" />
app:srcCompat="@drawable/baidu_bd_ocr_id_card_locator_front" />
<ImageView
android:id="@+id/cancel_button"
......
......@@ -5,10 +5,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:centerView="@+id/rotate_button"
app:contentView="@+id/crop_view_container"
app:leftDownView="@+id/cancel_button"
app:rightUpView="@+id/confirm_button">
app:baidu_centerView="@+id/rotate_button"
app:baidu_contentView="@+id/crop_view_container"
app:baidu_leftDownView="@+id/cancel_button"
app:baidu_rightUpView="@+id/confirm_button">
<com.baidu.ocr.ui.camera.OCRFrameLayout
android:id="@+id/crop_view_container"
......
......@@ -5,10 +5,10 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:centerView="@+id/take_photo_button"
app:contentView="@+id/camera_view"
app:leftDownView="@+id/album_button"
app:rightUpView="@+id/light_button">
app:baidu_centerView="@+id/take_photo_button"
app:baidu_contentView="@+id/camera_view"
app:baidu_leftDownView="@+id/album_button"
app:baidu_rightUpView="@+id/light_button">
<com.baidu.ocr.ui.camera.CameraView
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