11 changed files with 154 additions and 182 deletions
-
11app/build.gradle
-
81app/src/main/java/com/baidu/idl/face/main/finance/utils/TestPopWindow.java
-
28app/src/main/java/com/ouxuan/oxface/device/Ox485.java
-
31app/src/main/java/com/ouxuan/oxface/device/OxGpio.java
-
22datalibrary/build.gradle
-
75datalibrary/src/main/java/com/example/datalibrary/db/DBManager.java
-
13facelibrary/build.gradle
-
26financelibrary/build.gradle
-
35lib-serialport/build.gradle
-
2lib-serialport/src/main/AndroidManifest.xml
-
2settings.gradle
@ -1,81 +0,0 @@ |
|||||
package com.baidu.idl.face.main.finance.utils; |
|
||||
|
|
||||
import android.content.Context; |
|
||||
import android.util.Log; |
|
||||
import android.view.Gravity; |
|
||||
import android.view.View; |
|
||||
import android.view.ViewGroup; |
|
||||
import android.widget.PopupWindow; |
|
||||
|
|
||||
import com.baidu.idl.main.facesdk.financelibrary.R; |
|
||||
|
|
||||
public class TestPopWindow extends PopupWindow { |
|
||||
private String TAG = "TestPopWindow"; |
|
||||
private final Context gContext; |
|
||||
private View view; |
|
||||
|
|
||||
public TestPopWindow(Context context) { |
|
||||
this(context, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); |
|
||||
Log.d(TAG, "TestPopWindow: " + ViewGroup.LayoutParams.WRAP_CONTENT |
|
||||
+ "bbb:" + ViewGroup.LayoutParams.WRAP_CONTENT); |
|
||||
} |
|
||||
|
|
||||
public TestPopWindow(Context context, int width, int height) { |
|
||||
super(context); |
|
||||
this.gContext = context; |
|
||||
view = View.inflate(context, R.layout.layout_no_face_detected, null); |
|
||||
view.findViewById(R.id.retest_detectBtn).setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View view) { |
|
||||
mOnClickFinance.rester(true); |
|
||||
} |
|
||||
}); |
|
||||
view.findViewById(R.id.back_homeBtn).setOnClickListener(new View.OnClickListener() { |
|
||||
@Override |
|
||||
public void onClick(View view) { |
|
||||
mOnClickFinance.rester(false); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
setContentView(view); |
|
||||
// 设置窗口的高和宽 |
|
||||
setWidth(width); |
|
||||
setHeight(height); |
|
||||
// 设置弹窗内科点击 |
|
||||
setTouchable(true); |
|
||||
setOutsideTouchable(true); |
|
||||
setFocusable(true); |
|
||||
// TODO去除背景 |
|
||||
setBackgroundDrawable(null); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 显示popupWindow |
|
||||
*/ |
|
||||
public void showPopupWindow(View parent) { |
|
||||
if (!this.isShowing()) { |
|
||||
// 以下拉方式显示popupwindow,调整位置使其不会完全遮挡预览界面 |
|
||||
this.showAtLocation(parent, Gravity.CENTER, 0, -50); |
|
||||
} else { |
|
||||
this.dismiss(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public void closePopupWindow() { |
|
||||
if (this.isShowing()) { |
|
||||
this.dismiss(); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
public void setmOnClickFinance(OnClickFinance mOnClickFinance) { |
|
||||
this.mOnClickFinance = mOnClickFinance; |
|
||||
} |
|
||||
|
|
||||
public OnClickFinance mOnClickFinance; |
|
||||
|
|
||||
public interface OnClickFinance { |
|
||||
void rester(boolean isReTest); |
|
||||
} |
|
||||
} |
|
@ -1,33 +1,50 @@ |
|||||
apply plugin: 'com.android.library' |
apply plugin: 'com.android.library' |
||||
|
|
||||
android { |
android { |
||||
compileSdkVersion 32 |
|
||||
|
namespace 'com.kongqw.serialportlibrary' |
||||
|
compileSdk 35 |
||||
|
buildToolsVersion "35.0.0" |
||||
|
|
||||
defaultConfig { |
defaultConfig { |
||||
minSdkVersion 21 |
minSdkVersion 21 |
||||
targetSdkVersion 32 |
|
||||
|
targetSdkVersion 35 |
||||
versionCode 1 |
versionCode 1 |
||||
versionName "1.0" |
versionName "1.0" |
||||
|
|
||||
|
consumerProguardFiles "consumer-rules.pro" |
||||
|
|
||||
externalNativeBuild { |
externalNativeBuild { |
||||
cmake { |
cmake { |
||||
arguments '-DANDROID_TOOLCHAIN=clang' |
|
||||
|
cppFlags "" |
||||
|
abiFilters "armeabi-v7a", "arm64-v8a" |
||||
|
} |
||||
|
} |
||||
} |
} |
||||
|
|
||||
|
externalNativeBuild { |
||||
|
cmake { |
||||
|
path "src/main/cpp/CMakeLists.txt" |
||||
|
version "3.31.6" |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
buildTypes { |
buildTypes { |
||||
release { |
release { |
||||
minifyEnabled false |
minifyEnabled false |
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
|
||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' |
||||
} |
} |
||||
|
debug { |
||||
|
debuggable true |
||||
|
jniDebuggable true |
||||
} |
} |
||||
|
|
||||
externalNativeBuild { |
|
||||
cmake { |
|
||||
path "src/main/cpp/CMakeLists.txt" |
|
||||
} |
} |
||||
|
|
||||
|
compileOptions { |
||||
|
sourceCompatibility JavaVersion.VERSION_1_8 |
||||
|
targetCompatibility JavaVersion.VERSION_1_8 |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
dependencies { |
dependencies { |
||||
|
|
||||
|
implementation 'androidx.annotation:annotation:1.7.0' |
||||
} |
} |
@ -1,7 +1,7 @@ |
|||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
||||
package="com.kongqw.serialportlibrary"> |
package="com.kongqw.serialportlibrary"> |
||||
|
|
||||
<application android:allowBackup="true" android:label="@string/app_name" |
|
||||
|
<application android:allowBackup="false" android:label="@string/app_name" |
||||
android:supportsRtl="true"> |
android:supportsRtl="true"> |
||||
|
|
||||
</application> |
</application> |
||||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue