Commit d47c42ec by sikang

first commit

parents
apply plugin: 'com.android.library'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3
versionName "1.10.e"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
repositories {
flatDir {
dirs 'libs'
}
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
api(name: 'libimagecapture-release', ext: 'aar')
api(name: 'libcamera-release', ext: 'aar')
api(name: 'libidcardcaptor-release', ext: 'aar')
api(name: 'liblivenessdetector2-release', ext: 'aar')
api(name: 'liblivenessdetectionview2-release', ext: 'aar')
api(name: 'libcommon-release', ext: 'aar')
api("com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion", {
exclude module: 'support-v4'
})
api("com.android.support:percent:$rootProject.ext.supportLibraryVersion", {
exclude module: 'support-v4'
})
}
#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.
#Wed Dec 13 23:41:10 CST 2017
apiSecret=dcd5e4334ad91cd9a97d34bee217a6e878ce1b842cf2c1bae1209b8184492edc
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/jxu/Downloads/android-sdk-linux/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-keep class com.oliveapp.camerasdk.** {*;}
-keepattributes InnerClasses
-keep class **.R$* {*;}
\ No newline at end of file
package com.oliveapp.liveness.sample;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.oliveapp.liveness.sample">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application>
<activity android:name=".SampleLaunchActivity"
android:screenOrientation="portrait">
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.MAIN" />-->
<!--<category android:name="android.intent.category.LAUNCHER" />-->
<!--</intent-filter>-->
</activity>
<activity android:name=".register.SampleImageCaptureActivity"
android:screenOrientation="portrait"/>
<activity android:name=".SettingActivity"
android:screenOrientation="portrait"/>
<activity android:name=".register.SampleChooseCameraActivity"
android:screenOrientation="portrait"/>
<activity android:name=".register.SampleCameraResultActivity"
android:screenOrientation="portrait"/>
<activity
android:name="SampleStartActivity"
android:label="@string/oliveapp_app_name"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name=".liveness.SampleLivenessActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity
android:name="SampleUnusualResultActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize" />
<activity
android:name=".idcard_captor.SampleIdcardCaptorActivity"
android:screenOrientation="portrait" />
<activity
android:name=".idcard_captor.SampleIdcardResult"
android:screenOrientation="portrait" />
<activity android:name="SampleSaaSResultActivity"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation|screenSize"/>
</application>
</manifest>
\ No newline at end of file
package com.oliveapp.liveness.sample;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.liveness.sample.register.SampleChooseCameraActivity;
public class SampleLaunchActivity extends Activity {
public static final String TAG = SampleLaunchActivity.class.getSimpleName();
private Button mCameraButton;
private Button mLivenessButton;
private Button mSettingButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
// 如果有设置全局包名的需要, 在这里进行设置
// PackageNameManager.setPackageName();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_launch);
mCameraButton = (Button) findViewById(R.id.startButton);
mLivenessButton = (Button) findViewById(R.id.livenessButton);
mSettingButton = (Button) findViewById(R.id.settingButton);
mCameraButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(myself(), SampleChooseCameraActivity.class);
startActivity(i);
}
});
mLivenessButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(myself(), SampleStartActivity.class);
startActivity(i);
}
});
mSettingButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = new Intent(myself(), SettingActivity.class);
startActivity(i);
}
});
requestPermission();
}
private Activity myself() {
return this;
}
//========================================================请求权限===================================================//
private static final int PERMISSION_READ_EXTERNAL_STORAGE = 101;
private static final int PERMISSION_WRITE_EXTERNAL_STORAGE = 102;
private static final int PERMISSION_CAMERA = 103;
private boolean requestPermission() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_WRITE_EXTERNAL_STORAGE);
return false;
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_READ_EXTERNAL_STORAGE);
return false;
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, PERMISSION_CAMERA);
return false;
}
return true;
}
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
try {
switch (requestCode) {
case PERMISSION_CAMERA: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "没有摄像头权限我什么都做不了哦!", Toast.LENGTH_LONG).show();
}
break;
}
case PERMISSION_READ_EXTERNAL_STORAGE: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "请打开存储读写权限,确保APP正常运行", Toast.LENGTH_LONG).show();
}
break;
}
case PERMISSION_WRITE_EXTERNAL_STORAGE: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "请打开存储读写权限,确保APP正常运行", Toast.LENGTH_LONG).show();
}
break;
}
}
} catch (Exception e) {
LogUtil.e(TAG, "Failed to request Permission", e);
}
}
}
package com.oliveapp.liveness.sample;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.liveness.sample.R;
import com.oliveapp.liveness.sample.liveness.SampleLivenessActivity;
import com.oliveapp.liveness.sample.utils.SampleScreenDisplayHelper;
import java.util.HashMap;
import java.util.Map;
public class SampleUnusualResultActivity extends Activity implements View.OnClickListener {
public static final int PARSE_INTENT_FAIL = -1;
public static final int OPERATION_EXCEPTION = 0;
public static final int NETWORK_EXCEPTION = 1;
public static final int TIME_OUT = 2;
public static final int INIT_FAIL = 3;
public static final int PRESTART_FAIL = 4;
public static final int LIVENESS_FAIL = 5;
private final String OPERATION_EXCEPTION_DATA = "操作异常";
private final String NETWORK_EXCEPTION_DATA = "网络异常,请返回重试";
private final String TIME_OUT_DATA = "超时,请返回重试";
private final String INIT_FAIL_DATA = "初始化失败,请检查权限设置和摄像头";
private final String PRESTART_FAIL_DATA = "预检失败, 请检查设置或重试";
private final String LIVENESS_FAIL_DATA = "活检失败,请重试";
private final String PARSE_INTENT_FAIL_DATA = "解析传来的intent失败,请检查";
private Map<Integer, String> mExceptionData;
public static final String keyToGetExtra = "REASON";
public static final String TAG = SampleUnusualResultActivity.class.getSimpleName();
private TextView mOliveappResultTextView;
private Button mOliveappResultReturnBtn;
private Button mOliveappResultRetryBtn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LogUtil.e(TAG, "[JUMP] enter unusualActivity");
//设置全屏
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
//决定显示哪个页面
setContentView(decideWhichLayout());
init();
//反馈信息
int code = getIntent().getIntExtra(keyToGetExtra, PARSE_INTENT_FAIL);
mOliveappResultTextView.setText(mExceptionData.get(code));
}
//===============================初始化数据=================================//
public void init() {
mExceptionData = new HashMap<>();
mExceptionData.put(PARSE_INTENT_FAIL, PARSE_INTENT_FAIL_DATA);
mExceptionData.put(OPERATION_EXCEPTION, OPERATION_EXCEPTION_DATA);
mExceptionData.put(NETWORK_EXCEPTION, NETWORK_EXCEPTION_DATA);
mExceptionData.put(TIME_OUT, TIME_OUT_DATA);
mExceptionData.put(INIT_FAIL, INIT_FAIL_DATA);
mExceptionData.put(PRESTART_FAIL, PRESTART_FAIL_DATA);
mExceptionData.put(LIVENESS_FAIL, LIVENESS_FAIL_DATA);
mOliveappResultTextView = (TextView) findViewById(R.id.oliveappResultTextView);
mOliveappResultReturnBtn = (Button) findViewById(R.id.oliveapp_liveness_result_return);
mOliveappResultRetryBtn = (Button) findViewById(R.id.oliveapp_liveness_result_retry);
mOliveappResultRetryBtn.setOnClickListener(this);
mOliveappResultReturnBtn.setOnClickListener(this);
}
@Override
public void onClick(View view) {
/**
* 这里如果点击重试按钮,则不用做任何事情,只要finish掉就好了
*/
if (R.id.oliveapp_liveness_result_return == view.getId()) {
Intent intent = new Intent(SampleUnusualResultActivity.this, SampleLaunchActivity.class);
startActivity(intent);
}
finish();
}
//==================================选择布局=====================================//
private int decideWhichLayout() {
int layout = R.layout.oliveapp_sample_result_unusual_portrait_phone;
//选择布局文件
switch (SampleScreenDisplayHelper.getFixedOrientation(this)) {
case PORTRAIT:
if (SampleScreenDisplayHelper.ifThisIsPhone(this)) {
layout = R.layout.oliveapp_sample_result_unusual_portrait_phone;
} else {
layout = R.layout.oliveapp_sample_result_unusual_portrait_tablet;
}
break;
case LANDSCAPE:
if (!SampleScreenDisplayHelper.ifThisIsPhone(this)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
layout = R.layout.oliveapp_sample_result_unusual_landscape;
} else {
layout = R.layout.oliveapp_sample_result_unusual_portrait_phone;
}
break;
}
return layout;
}
}
package com.oliveapp.liveness.sample.idcard_captor;
import android.content.Intent;
import android.os.Bundle;
import com.oliveapp.face.idcardcaptorsdk.captor.CapturedIDCardImage;
import com.oliveapp.liveness.sample.idcard_captor.view_controller.SampleIdcardCaptorMainActivity;
/**
* SampleIdcardCaptorActivity
* 如果不想关心界面实现细节,可以直接在此Activity中实现界面跳转逻辑
*/
public class SampleIdcardCaptorActivity extends SampleIdcardCaptorMainActivity {
@Override
public void onCreate(Bundle savedInstance) {
// 如果有设置全局包名的需要, 在这里进行设置
// PackageNameManager.setPackageName();
super.onCreate(savedInstance);
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onFrameResult(int status) {
super.onFrameResult(status);
}
/**
* 捕获到最好的一张身份证照片
*/
@Override
public void onIDCardCaptured(CapturedIDCardImage data) {
super.onIDCardCaptured(data);
// 处理Activity跳转逻辑
Intent i = new Intent(SampleIdcardCaptorActivity.this, SampleIdcardResult.class);
i.putExtra("image", data.idcardImageData);
startActivity(i);
finish();
}
}
package com.oliveapp.liveness.sample.idcard_captor;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import com.oliveapp.liveness.sample.R;
public class SampleIdcardResult extends Activity {
public static final String TAG = SampleIdcardResult.class.getSimpleName();
private ImageView mOliveappLivenessImageView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.oliveapp_activity_sample_idcard_result);
mOliveappLivenessImageView = (ImageView) findViewById(R.id.oliveappLivenessImageView);
byte[] imageContent = getIntent().getByteArrayExtra("image");
Bitmap image = BitmapFactory.decodeByteArray(imageContent, 0, imageContent.length);
mOliveappLivenessImageView.setImageBitmap(image);
}
}
package com.oliveapp.liveness.sample.libsaasclient.backend;
import android.annotation.TargetApi;
import android.os.Build;
import com.oliveapp.libcommon.utility.LogUtil;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.util.Locale;
/**
* Created by zmzhang on 10/21/15.
*/
public class HashUtil {
public static class Hex {
private static final char[] toDigit = ("0123456789ABCDEF").toCharArray();
private final static String sHexStr = "0123456789ABCDEF";
public static String encode(byte[] bytes) {
char[] chars = new char[2 * bytes.length];
int j = 0;
for (int i = 0; i < bytes.length; ++i) {
byte bits = bytes[i];
chars[j++] = toDigit[((bits >>> 4) & 0xF)];
chars[j++] = toDigit[(bits & 0xF)];
}
return new String(chars);
}
public static byte[] decode(String hexStr) {
hexStr = hexStr.toString().trim().replace(" ", "").toUpperCase(Locale.US);
char[] hexs = hexStr.toCharArray();
byte[] bytes = new byte[hexStr.length() / 2];
int iTmp = 0x00;;
for (int i = 0; i < bytes.length; i++){
iTmp = sHexStr.indexOf(hexs[2 * i]) << 4;
iTmp |= sHexStr.indexOf(hexs[2 * i + 1]);
bytes[i] = (byte) (iTmp & 0xFF);
}
return bytes;
}
}
public static class MD5 {
private final static String TAG = MD5.class.getSimpleName();
public static class Md5EncodingException extends Exception
{
public Md5EncodingException() {}
public Md5EncodingException(String msg)
{
super(msg);
}
}
/**
* Generate MD5 hash code from a given string
* @param message, message to be encoded
* @return encoded MD5 hash string, 32 bytes in hex code
* @throws Md5EncodingException
*/
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static String md5(String message) throws Md5EncodingException {
try {
// Generate MD5 hash code (16 bytes)
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(message.getBytes(Charset.forName("UTF-8")));
byte messageDigest[] = digest.digest();
// Encode the 16 bytes hash code to 32 bytes hex code.
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < messageDigest.length; i++)
hexString.append(Integer.toHexString((messageDigest[i] & 0xFF) | 0x100).substring(1,3));
return hexString.toString();
} catch (Exception e) {
LogUtil.e(TAG, "md5 encoding: ", e);
throw new Md5EncodingException("Cannot generate MD5 hash string.");
}
}
}
}
package com.oliveapp.liveness.sample.libsaasclient.backend;
import android.os.Build;
import com.oliveapp.libcommon.utility.ApplicationParameters;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.libcommon.utility.Metric;
import com.oliveapp.liveness.sample.libsaasclient.datatype.AccessInfo;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.security.PublicKey;
import java.util.Iterator;
/**
* Created by jthao on 3/6/15.
*/
public class RequestWithSignatureHelper {
private final static String TAG = RequestWithSignatureHelper.class.getSimpleName();
private final static int MAX_BUFFER_SIZE = 1 * 1024 * 1024;
public final static String sDefaultAlias = "yitutest";
private final static String sPublicKeyContent = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiLegYm89cDdoDPp8SnaRY2CLe\n" +
"pviV9y1ve+zgSOz8j2aE2ous4NuxgF38OqnqCbWTzbf1B9vvWgsFTvS+givHDRbo\n" +
"2fhYkNUu36DS/4ltCkZlgZ00GXWUIks9WA1U7ACqyDvvj5MAigqS6wtONTI3wyqM\n" +
"kW0MzeWP2qc5DQUKxQIDAQAB";
public static JSONObject requestWithSignature(URL url, String method, AccessInfo accessInfo, String deviceId,
String requestMessage, int connectTimeoutMilli, int readTimeoutMilli) throws IOException, JSONException {
LogUtil.d(TAG, "request open connection to URL: " + url.toString());
URLConnection urlConn = url.openConnection();
if (urlConn == null) {
throw new IOException("cannot open url " + url.toString());
}
HttpURLConnection conn = (HttpURLConnection) urlConn;
try {
prepareConn(conn, method, accessInfo, deviceId, requestMessage,
connectTimeoutMilli, readTimeoutMilli);
} catch (Exception e) {
LogUtil.e(TAG, "failed to prepareConn", e);
}
String responseString = doRequest(conn, requestMessage);
return new JSONObject(responseString);
}
public static JSONObject requestWithSignature(URL url, String method, AccessInfo accessInfo, String deviceId,
JSONObject requestParams, int connectTimeoutMilli, int readTimeoutMilli) throws IOException, JSONException {
LogUtil.i(TAG, "url: " + url.toString());
URL finalUrl;
switch (method.toUpperCase()) {
case "GET":
// generate URL parameters
Iterator<String> iter = requestParams.keys();
String query = "";
while (iter.hasNext()) {
String key = iter.next();
if (query.length() != 0)
query += "&";
query += (key + "=" + requestParams.getString(key));
}
finalUrl = new URL(url.toString() + "?" + query);
break;
default:
finalUrl = url;
}
String requestContent;
requestContent = requestParams.toString();
return requestWithSignature(finalUrl, method, accessInfo, deviceId, requestContent, connectTimeoutMilli, readTimeoutMilli);
}
private static void prepareConn(HttpURLConnection conn, String method, AccessInfo accessInfo, String deviceId, String requestContent,
int connectTimeoutMilli, int readTimeoutMilli) throws Exception {
conn.setRequestMethod(method);
LogUtil.d(TAG, "request method: " + conn.getRequestMethod());
conn.setRequestProperty("Accept-Encoding", "");
conn.setDoOutput(true);
conn.setConnectTimeout(connectTimeoutMilli);
conn.setReadTimeout(readTimeoutMilli);
LogUtil.d(TAG, "accessId: " + accessInfo.getAccessId());
conn.setRequestProperty("x-access-id", accessInfo.getAccessId());
conn.setRequestProperty("x-device-id", deviceId);
PublicKey publicKey = SignatureUtil.RSAHelper.loadPublicKey(sPublicKeyContent);
String md5hash = SignatureUtil.generateSignature(publicKey, accessInfo.getAccessKey(), requestContent, "");
conn.setRequestProperty("x-signature", md5hash);
conn.setRequestProperty("x-device-model", Build.MODEL);
conn.setRequestProperty("x-os-version-release", Build.VERSION.RELEASE);
conn.setRequestProperty("x-os-version-sdk", Build.VERSION.SDK_INT + "");
conn.setRequestProperty("x-device-brand", Build.BRAND);
conn.setRequestProperty("x-device-manufacturer", Build.MANUFACTURER);
conn.setUseCaches(false);
}
public static String doRequest(HttpURLConnection conn, String requestContent) throws IOException, JSONException {
if (conn == null) {
throw new IOException("cannot open connection");
}
String responseString;
try {
DataOutputStream outputStream = new DataOutputStream(conn.getOutputStream());
LogUtil.d(TAG, "request content " + requestContent);
byte[] requestPaylod = requestContent.getBytes("UTF8");
outputStream.write(requestPaylod, 0, requestPaylod.length);
outputStream.flush();
outputStream.close();
Metric.addAsDouble(Metric.VERIFY_DEBUG_INFO, "Out traffic", requestPaylod.length);
BufferedReader in = null;
if (conn.getResponseCode() != 200) {
in = new BufferedReader(new InputStreamReader(
conn.getErrorStream()));
LogUtil.d(TAG, "Respond code: " + conn.getResponseCode());
} else {
in = new BufferedReader(new InputStreamReader(
conn.getInputStream()));
LogUtil.d(TAG, "Respond code: 200");
}
StringBuffer responseBuf = new StringBuffer();
String inputLine;
while ((inputLine = in.readLine()) != null) {
responseBuf.append(inputLine);
}
in.close();
Metric.addAsDouble(Metric.VERIFY_DEBUG_INFO, "In traffic", responseBuf.length());
responseString = responseBuf.toString();
LogUtil.d(TAG, "response: " + responseString);
} catch (Exception e) {
LogUtil.e(TAG, "exception: ", e);
responseString = new JSONObject().put("rtn", conn.getResponseCode()).put("message", conn.getResponseMessage()).toString();
LogUtil.e(TAG, "response: " + responseString);
throw e;
}
return responseString;
}
}
package com.oliveapp.liveness.sample.libsaasclient.backend;
import android.annotation.TargetApi;
import android.os.Build;
import android.util.Base64;
import com.oliveapp.libcommon.utility.LogUtil;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.X509EncodedKeySpec;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.CipherOutputStream;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/**
* Created by zmzhang on 10/21/15.
*/
public class SignatureUtil {
private final static String TAG = SignatureUtil.class.getSimpleName();
public static class RSAHelper {
public static class PublicKeyException extends Exception
{
public PublicKeyException() {}
public PublicKeyException(String msg)
{
super(msg);
}
}
/**
* Load public key from string
* @param publicKeyStr public key in string format
* @return PublicKey
* @throws PublicKeyException
*/
@TargetApi(Build.VERSION_CODES.FROYO)
public static PublicKey loadPublicKey(String publicKeyStr) throws PublicKeyException {
try {
byte[] buffer = Base64.decode(publicKeyStr, Base64.DEFAULT);
KeyFactory keyFactory = KeyFactory.getInstance("RSA", "BC");
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(buffer);
return (RSAPublicKey) keyFactory.generatePublic(keySpec);
} catch (Exception e) {
LogUtil.e(TAG, "Load public key str", e);
throw new PublicKeyException("Cannot load public key from string");
}
}
/**
* Load public key from InputStream
* @param in InputStream of public key
* @throws PublicKeyException
*/
public static PublicKey loadPublicKey(InputStream in) throws Exception {
try {
return loadPublicKey(readKey(in));
} catch (Exception e) {
LogUtil.e(TAG, "Load public key InputStream", e);
throw new PublicKeyException("Cannot load public key from InputStream");
}
}
/**
* Generate public key in string format from InputStream
* @param in InputStream of public key
* @return string represents the public key
* @throws IOException
*/
private static String readKey(InputStream in) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String readLine = null;
StringBuilder sb = new StringBuilder();
while ((readLine = br.readLine()) != null) {
if (readLine.charAt(0) == '-') {
continue;
} else {
sb.append(readLine);
sb.append('\r');
}
}
return sb.toString();
}
/**
* Encrypt message using public key
* @param message string before encrypt
* @param publicKey PublicKey object
* @return byte[] content of the encrypted message
* @throws PublicKeyException
*/
public static byte[] encrypt(byte[] message, PublicKey publicKey) throws PublicKeyException {
try {
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, publicKey);
byte[] enBytes = cipher.doFinal(message);
return enBytes;
} catch (Exception e) {
e.printStackTrace();
throw new PublicKeyException("Cannot encrypt message with public key");
}
}
}
public static class AESHelper {
public static String keyPart1 = "YITU.INC";
public static byte[] encrypt(byte[] message) {
try {
SecretKeySpec keySpec = new SecretKeySpec(("CopyRight " + keyPart1 + " 2015!").getBytes(), "AES");
byte[] IV = "1234567890123456".getBytes();
IvParameterSpec IVSpec = new IvParameterSpec(IV);
Cipher cipher = Cipher.getInstance("AES/CFB/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, keySpec, IVSpec);
byte[] encrypted = cipher.doFinal(message);
return encrypted;
} catch (NoSuchAlgorithmException e) {
LogUtil.e(TAG, "[AES Encrypt] NoSuchAlgorithmException...", e);
} catch (NoSuchPaddingException e) {
LogUtil.e(TAG, "[AES Encrypt] NoSuchPaddingException...", e);
} catch (InvalidAlgorithmParameterException e) {
LogUtil.e(TAG, "[AES Encrypt] InvalidAlgorithmParameterException...", e);
} catch (InvalidKeyException e) {
LogUtil.e(TAG, "[AES Encrypt] InvalidKeyException...", e);
} catch (BadPaddingException e) {
LogUtil.e(TAG, "[AES Encrypt] BadPaddingException...", e);
} catch (IllegalBlockSizeException e) {
LogUtil.e(TAG, "[AES Encrypt] IllegalBlockSizeException...", e);
}
return null;
}
}
/**
* Generate signature
* @param publicKey public key used to encrypt message
* @param accessKey access Key
* @param bodyString http body content in string format
* @param userDefinedContent user defined content, must be fewer than 41 bytes
* @return generated encrypted message
*/
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static String generateSignature(PublicKey publicKey, String accessKey, String bodyString, String userDefinedContent) throws Exception {
String result = null;
// Generate Unix timestamp
int unixTime = (int) (System.currentTimeMillis() / 1000L);
byte[] unixTimeArray = ByteBuffer.allocate(4).putInt(unixTime).array();
// Generate random number
SecureRandom sr = new SecureRandom();
byte[] rndBytes = new byte[8];
sr.nextBytes(rndBytes);
// Combine signature
byte[] signatureStr = mergeArray(accessKey.getBytes(Charset.forName("UTF-8")),HashUtil.MD5.md5(bodyString).getBytes(Charset.forName("UTF-8")));
signatureStr = mergeArray(signatureStr,unixTimeArray);
signatureStr = mergeArray(signatureStr,rndBytes);
signatureStr = mergeArray(signatureStr,userDefinedContent.getBytes(Charset.forName("UTF-8")));
// Encrypt signature
result = HashUtil.Hex.encode(RSAHelper.encrypt(signatureStr, publicKey));
return result;
}
/**
* Combine two byte arrays
* @param a
* @param b
* @return a + b
*/
public static byte[] mergeArray(byte[] a, byte[] b) {
byte[] c = new byte[a.length + b.length];
System.arraycopy(a, 0, c, 0, a.length);
System.arraycopy(b, 0, c, a.length, b.length);
return c;
}
}
package com.oliveapp.liveness.sample.libsaasclient.client;
import android.util.Base64;
import android.util.Log;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.liveness.sample.libsaasclient.backend.RequestWithSignatureHelper;
import com.oliveapp.liveness.sample.libsaasclient.datatype.UserInfo;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.concurrent.TimeoutException;
/**
* Created by jxu on 1/23/16.
*/
public class SaasClient {
public static final String TAG = SaasClient.class.getSimpleName();
private UserInfo mUserInfo;
public String mBaseURL;
public String mURLUploadUserImage;
public String mURLFacePairVerification;
public String mURLCheckUserDatabaseImageStatus;
public String mURLVerifyPairImages;
public String mURLCheckFanpai;
public String mURLTripleVerification;
public SaasClient(UserInfo userInfo) {
mUserInfo = userInfo;
mBaseURL = "http://staging.yitutech.com";
setupUrls();
}
public SaasClient(UserInfo userInfo, String baseUrl) {
mUserInfo = userInfo;
mBaseURL = baseUrl;
setupUrls();
}
private void setupUrls() {
mURLCheckFanpai = mBaseURL + "/face/basic/check_image_package";
LogUtil.e(TAG, "mURLCheckFanpai: " + mURLCheckFanpai);
}
public ArrayList<String> decodePackage(byte[] queryPackage) throws TimeoutException, IOException {
String base64EncodedPackage= Base64.encodeToString(queryPackage, Base64.NO_WRAP);
return decodePackage(base64EncodedPackage);
}
public ArrayList<String> decodePackage(String queryPackageBase64) throws TimeoutException, IOException {
JSONObject requestParams = new JSONObject();
try {
requestParams.put("query_image_package", queryPackageBase64);
requestParams.put("query_image_package_return_image_list", true);
requestParams.put("user_id", "SaasClientTester");
} catch (JSONException e) {
LogUtil.e(TAG, "JsonException in requestParams makeup in packageVerification", e);
}
JSONObject responseJson = null;
try {
responseJson = RequestWithSignatureHelper.requestWithSignature(
new URL(mURLFacePairVerification), "POST",
mUserInfo.getAccessInfo(),
"", requestParams, 2000, 15000);
} catch (JSONException e) {
LogUtil.e(TAG, e.getMessage(), e);
}
ArrayList<String> result = new ArrayList<>();
int rtn = 0;
try {
rtn = responseJson.getInt("rtn");
if (rtn != 0) {
LogUtil.w(TAG, "Request error: " + responseJson.toString());
} else {
LogUtil.i(TAG, "Response content: " + responseJson.toString());
}
} catch (JSONException e) {
LogUtil.e(TAG, "JsonException in response", e);
}
try {
JSONObject packageResult = responseJson.getJSONObject("query_image_package_result");
if (packageResult != null) {
JSONArray imageContents = packageResult.getJSONArray("query_image_contents");
for (int i = 0; i < imageContents.length(); i++) {
result.add(imageContents.getString(i));
}
}
} catch (JSONException e) {
LogUtil.w(TAG, "JsonException in response");
}
return result;
}
public JSONObject checkImagePackage(byte[] queryPackage, String threshold) throws TimeoutException, IOException {
JSONObject requestParams = new JSONObject();
try {
requestParams.put("query_image_package", Base64.encodeToString(queryPackage, Base64.NO_WRAP));
requestParams.put("query_image_package_check_anti_screen", true);
requestParams.put("query_image_package_check_same_person",true);
requestParams.put("query_image_package_check_anti_picture",true);
requestParams.put("query_image_package_check_anti_eye_blockage",true);
requestParams.put("query_image_package_check_anti_hole",true);
requestParams.put("query_image_package_return_image_list",true);
//翻拍照阈值
if (threshold != null) {
requestParams.put("query_image_package_check_anti_screen_threshold", threshold);
}
} catch (JSONException e) {
LogUtil.e(TAG, "JsonException in requestParams makeup in packageVerification", e);
}
JSONObject responseJson = null;
try {
responseJson = RequestWithSignatureHelper.requestWithSignature(
new URL(mURLCheckFanpai), "POST",
mUserInfo.getAccessInfo(),
"", requestParams, 2000, 15000);
} catch (Exception e) {
LogUtil.e(TAG, e.getMessage(), e);
}
return responseJson;
}
}
package com.oliveapp.liveness.sample.libsaasclient.datatype;
import com.oliveapp.libcommon.utility.LogUtil;
import org.json.JSONException;
import org.json.JSONObject;
/**
* AceessInfo代表调用者的身份
*/
public class AccessInfo {
private final static String TAG = "AccessInfo";
private static AccessInfo instance;
public static AccessInfo getInstance() {
if (instance == null)
instance = new AccessInfo("android_accessinfo_not_set", "empty");
return instance;
}
/**
* Setting accessId & accessKey
* @param accessId
* @param accessKey
*/
public AccessInfo setAccessInfo(String accessId, String accessKey) {
if (accessId == null ||
accessId.isEmpty()) {
throw new IllegalArgumentException("invalid accessId");
}
if (accessKey == null || accessKey.isEmpty()) {
throw new IllegalArgumentException("invalid accessKey");
}
mAccessId = accessId;
mAccessKey = accessKey;
LogUtil.w(TAG, "Setting AccessInfo, AccessId:" + accessId);
return this;
}
/**
* 构造AccessInfo
*
* @param accessId 使用者的 AccessId, 需要向依图申请
* @param accessKey 使用者的 AccessKey, 需要向依图申请
*/
private AccessInfo(String accessId, String accessKey) throws IllegalArgumentException {
if (accessId == null ||
accessId.isEmpty()) {
throw new IllegalArgumentException("invalid accessId");
}
if (accessKey == null || accessKey.isEmpty()) {
throw new IllegalArgumentException("invalid accessKey");
}
this.mAccessId = accessId;
this.mAccessKey = accessKey;
}
public static AccessInfo fromJsonString(String jsonString) throws JSONException {
JSONObject jsonObject = new JSONObject(jsonString);
return new AccessInfo(jsonObject.getString("access_id"), jsonObject.getString("access_key"));
}
@Override
public String toString() {
JSONObject object = new JSONObject();
try {
object.put("access_id", mAccessId);
object.put("access_key", mAccessKey);
} catch (JSONException e) {
LogUtil.e(TAG, "fail to transfer access info to string", e);
}
return object.toString();
}
public String getAccessId() {
return this.mAccessId;
}
public String getAccessKey() {
return this.mAccessKey;
}
private String mAccessId; // 客户标识
private String mAccessKey; // 请求密钥
}
package com.oliveapp.liveness.sample.libsaasclient.datatype;
import com.oliveapp.libcommon.utility.LogUtil;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by jqshen on 5/24/15.
*/
public class UserInfo {
/**
* 一个注册用户的信息,包含AccessInfo和用户ID
*/
public static String BUNDLE_KEY = "USER_INFO";
private static final String TAG = UserInfo.class.getSimpleName();
private static final int MAX_USER_ID_LENGTH = 80;
private static final int CITIZEN_ID_LENGTH = 18;
private static final int MAX_USER_NAME_LENGTH = 80;
/**
* 构造函数
* @param userId 最大长度: 128字节,utf-8编码
* @param citizenId 用户身份证号,最长18字节,utf-8编码,如果照片类是金融行业带水印的证件照_小, 金融行业带水印的证件照_中, 公安行业带水印的证件照_小, 公安行业带水印的证件照_中之一,则可传入null
* @param userName 最长128字节,用户姓名,如果照片类是金融行业带水印的证件照_小, 金融行业带水印的证件照_中, 公安行业带水印的证件照_小, 公安行业带水印的证件照_中之一,则可传入null
* @param accessInfo 客户标示,
* @exception IllegalArgumentException 传入的参数不符合要求
*/
public UserInfo(String userId,
String citizenId,
String userName,
AccessInfo accessInfo) throws IllegalArgumentException {
setUserId(userId);
mCitizenId = citizenId; // can be empty
mUserName = userName; // can be empty
mAccessInfo = accessInfo;
}
public UserInfo(String userId, AccessInfo accessInfo) throws IllegalArgumentException {
this(userId, "", "", accessInfo);
}
public AccessInfo getAccessInfo() {
return mAccessInfo;
}
public void setAccessInfo(AccessInfo mAccessInfo) throws IllegalArgumentException {
if (mAccessInfo == null) {
throw new IllegalArgumentException("accessInfo is null");
}
this.mAccessInfo = mAccessInfo;
}
public String getUserName() {
return mUserName;
}
public void setUserName(String userName) throws IllegalArgumentException {
if (userName == null) {
throw new IllegalArgumentException("User name is null");
} else if (userName.length() > MAX_USER_NAME_LENGTH) {
throw new IllegalArgumentException("User name exceed " + MAX_USER_NAME_LENGTH);
} else if (userName.isEmpty()) {
throw new IllegalArgumentException("User name is empty");
}
this.mUserName = userName;
}
public String getCitizenId() {
return mCitizenId;
}
public void setCitizenId(String citizenId) {
if (citizenId.length() != CITIZEN_ID_LENGTH) {
throw new IllegalArgumentException("Citizen id lenth is not " + CITIZEN_ID_LENGTH);
}
mCitizenId = citizenId;
}
public String getUserId() {
return mUserId;
}
public void setUserId(String userId) {
if (userId == null) {
throw new IllegalArgumentException("UserId is null");
} else if (userId.length() > MAX_USER_ID_LENGTH) {
throw new IllegalArgumentException("UserId length exceed " + MAX_USER_ID_LENGTH);
} else if (userId.isEmpty()) {
throw new IllegalArgumentException("UserId is empty");
}
mUserId = userId;
}
public String toString() {
JSONObject obj = new JSONObject();
try {
obj.put("user_name", mUserName);
obj.put("citizen_id", mCitizenId);
obj.put("user_id", mUserId);
obj.put("access_info", mAccessInfo.toString());
} catch (JSONException e) {
LogUtil.e(TAG, "Usre Info to string", e);
}
return obj.toString();
}
private AccessInfo mAccessInfo;
private String mUserName;
private String mCitizenId;
private String mUserId;
static public UserInfo fromString(String userBasicInfoString) {
try {
JSONObject obj = new JSONObject(userBasicInfoString);
String userName = obj.getString("user_name");
String citizenId = obj.getString("citizen_id");
String userId = obj.getString("user_id");
AccessInfo accessInfo = AccessInfo.fromJsonString(obj.getString("access_info"));
UserInfo userInfo = new UserInfo(userId, citizenId, userName, accessInfo);
return userInfo;
} catch (Exception e) {
LogUtil.e(TAG, "USER_INFO from string", e);
return null;
}
}
}
package com.oliveapp.liveness.sample.liveness;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Base64;
import android.widget.Toast;
import com.oliveapp.face.livenessdetectorsdk.livenessdetector.datatype.LivenessDetectionFrames;
import com.oliveapp.face.livenessdetectorsdk.livenessdetector.datatype.OliveappFaceInfo;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.liveness.sample.SampleUnusualResultActivity;
import com.oliveapp.liveness.sample.liveness.view_controller.LivenessDetectionMainActivity;
/**
* 样例活体检测Activity
*/
public class SampleLivenessActivity extends LivenessDetectionMainActivity {
public static final String TAG = SampleLivenessActivity.class.getSimpleName();
private ProgressDialog mProgressDialog;
public static String resultString = null;
private LivenessDetectionFrames livenessDetectionFrames;
@Override
protected void onCreate(Bundle savedInstanceState) {
// 如果有设置全局包名的需要, 在这里进行设置
// PackageNameManager.setPackageName();
super.onCreate(savedInstanceState);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
/**
* =====================启动算法===============
**/
@Override
public void onInitializeSucc() {
super.onInitializeSucc();
super.startVerification();
}
@Override
public void onInitializeFail(Throwable e) {
super.onInitializeFail(e);
LogUtil.e(TAG, "无法初始化活体检测...", e);
Toast.makeText(this, "无法初始化活体检测", Toast.LENGTH_LONG).show();
Intent i = new Intent(SampleLivenessActivity.this, SampleUnusualResultActivity.class);
i.putExtra(SampleUnusualResultActivity.keyToGetExtra, SampleUnusualResultActivity.INIT_FAIL);
startActivity(i);
finish();
}
@Override
protected void onPause() {
super.onPause();
if ((mProgressDialog != null) && mProgressDialog.isShowing()) {
mProgressDialog.dismiss();
mProgressDialog = null;
}
}
/**===================================活体检测算法的回调==================================**/
/**
* 活体检测成功的回调,同时获取大礼包
* 成功回调的接口在1.7.a_hotfix被拆成了2步,不再使用该接口
*
* @param livenessDetectionFrames 活体检测抓取的图片
* @param faceInfo 捕获到的人脸信息
*/
@Override
public void onLivenessSuccess(final LivenessDetectionFrames livenessDetectionFrames, OliveappFaceInfo faceInfo) {
super.onLivenessSuccess(livenessDetectionFrames, faceInfo);
this.livenessDetectionFrames = livenessDetectionFrames;
CheckImagePackage checkImagePackage = new CheckImagePackage();
checkImagePackage.execute();
}
/*@Override
public void onLivenessSuccess(OliveappFaceInfo oliveappFaceInfo) {
super.onLivenessSuccess(null, oliveappFaceInfo);
CheckImagePackage checkImagePackage = new CheckImagePackage();
checkImagePackage.execute();
}*/
/**
* 活检阶段失败
*/
@Override
public void onLivenessFail(int result, LivenessDetectionFrames livenessDetectionFrames) {
super.onLivenessFail(result, livenessDetectionFrames);
runOnUiThread(new Runnable() {
@Override
public void run() {
// Intent intent = new Intent();
// Bundle bundle = new Bundle();
// bundle.putString("FACE_RESULT", null);
// intent.putExtras(bundle);
setResult(Activity.RESULT_OK);
finish();
}
});
}
/**
* 获取大礼包并访问私有云的样例代码,集成时请不要使用
*/
private class CheckImagePackage extends AsyncTask<Void, Void, String> {
@Override
protected void onPreExecute() {
mProgressDialog = ProgressDialog.show(SampleLivenessActivity.this,
null, "正在比对,请稍等", true, false);
}
@Override
protected String doInBackground(Void... voids) {
// 获取大礼包,耗时操作,不可在UI线程执行
return Base64.encodeToString(livenessDetectionFrames.verificationData, Base64.NO_WRAP);
}
@Override
protected void onPostExecute(final String result) {
if (mProgressDialog != null) {
mProgressDialog.dismiss();
}
runOnUiThread(new Runnable() {
@Override
public void run() {
// Intent intent = new Intent();
// Bundle bundle = new Bundle();
// bundle.putString("FACE_RESULT", result);
// intent.putExtras(bundle);
resultString = result;
setResult(Activity.RESULT_OK);
finish();
}
});
}
}
public static class YituFaceResult{
public String resultString;
public YituFaceResult(String result){
resultString = result;
}
}
}
package com.oliveapp.liveness.sample.register;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.oliveapp.liveness.sample.R;
public class SampleCameraResultActivity extends Activity{
public static final String TAG = SampleCameraResultActivity.class.getSimpleName();
public static final String EXTRA_IMAGE_CONTENT = "image_content";
public static final String EXTRA_FACE_EXISTS = "face_exists";
public static final String EXTRA_FACE_RECT = "face_rect";
private ImageView mImageView;
private Button mRetakeButton;
private Button mBackButton;
public static final int livenessMode = 4;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_register_result);
mImageView = (ImageView) findViewById(R.id.captureImageImageView);
mRetakeButton = (Button) findViewById(R.id.retakeButton);
mBackButton = (Button) findViewById(R.id.confirmButton);
Bundle result = getIntent().getExtras();
final int mode = result.getInt(SampleImageCaptureActivity.EXTRA_CAPTURE_MODE);
byte[] imageContent = result.getByteArray(EXTRA_IMAGE_CONTENT);
boolean faceExists = result.getBoolean(EXTRA_FACE_EXISTS);
Bitmap capturedImage = BitmapFactory.decodeByteArray(imageContent, 0, imageContent.length);
if (faceExists) {
Bitmap imageWithRect = capturedImage.copy(Bitmap.Config.ARGB_8888, true);
Canvas canvas = new Canvas(imageWithRect);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setColor(Color.BLACK);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(10);
String rectString = result.getString(EXTRA_FACE_RECT);
Rect rect = Rect.unflattenFromString(rectString);
canvas.drawRect(rect, paint);
mImageView.setImageBitmap(imageWithRect);
} else {
mImageView.setImageBitmap(capturedImage);
}
//
if (livenessMode == mode) {
mRetakeButton.setVisibility(View.INVISIBLE);
}
mRetakeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(SampleCameraResultActivity.this, SampleImageCaptureActivity.class);
i.putExtra(SampleImageCaptureActivity.EXTRA_CAPTURE_MODE, mode);
startActivity(i);
finish();
}
});
mBackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
}
package com.oliveapp.liveness.sample.register;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.oliveapp.face.idcardcaptorsdk.captor.IDCardCaptor;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.libimagecapture.CaptureImageFragment;
import com.oliveapp.liveness.sample.R;
import com.oliveapp.liveness.sample.idcard_captor.SampleIdcardCaptorActivity;
public class SampleChooseCameraActivity extends Activity {
public static final String TAG = SampleChooseCameraActivity.class.getSimpleName();
private Button mIdCardButton;
private Button mSelfieButton;
private Button mIdcardFrontCaptureButton;
private Button mIdcardBackCaptureButton;
private IdcardCaptureListener mIdcardCaptureListener;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_register);
mIdCardButton = (Button) findViewById(R.id.IDcard);
mSelfieButton = (Button) findViewById(R.id.Selfie);
mIdcardFrontCaptureButton = (Button) findViewById(R.id.IdcardFrontCapture);
mIdcardBackCaptureButton = (Button) findViewById(R.id.IdcardBackCapture);
/**
* 拍摄身份证正面,反面请使用CaptureImageFragment.CAPTURE_MODE_IDCARD_BACK
*/
mIdCardButton.setOnClickListener(
new CaptureImageListener(CaptureImageFragment.CAPTURE_MODE_IDCARD_FRONT));
/**
* 拍摄类登记照
*/
mSelfieButton.setOnClickListener(
new CaptureImageListener(CaptureImageFragment.CAPTURE_MODE_SELFIE));
mIdcardCaptureListener = new IdcardCaptureListener();
mIdcardFrontCaptureButton.setOnClickListener(mIdcardCaptureListener);
mIdcardBackCaptureButton.setOnClickListener(mIdcardCaptureListener);
requestPermission();
}
private class CaptureImageListener implements View.OnClickListener {
private int mCaptureType;
public CaptureImageListener(int captureMode) {
mCaptureType = captureMode;
}
@Override
public void onClick(View v) {
if (requestPermission()) {
Intent i = new Intent(SampleChooseCameraActivity.this, SampleImageCaptureActivity.class);
i.putExtra(SampleImageCaptureActivity.EXTRA_CAPTURE_MODE, mCaptureType);
startActivity(i);
}
}
}
private class IdcardCaptureListener implements View.OnClickListener {
@Override
public void onClick(View v) {
Intent i = new Intent(SampleChooseCameraActivity.this, SampleIdcardCaptorActivity.class);
/**
* 设置身份证识别正面还是反面
*/
int i1 = v.getId();
if (i1 == R.id.IdcardFrontCapture) {
i.putExtra(SampleIdcardCaptorActivity.EXTRA_CARD_TYPE, IDCardCaptor.CARD_TYPE_FRONT);
} else if (i1 == R.id.IdcardBackCapture) {
i.putExtra(SampleIdcardCaptorActivity.EXTRA_CARD_TYPE, IDCardCaptor.CARD_TYPE_BACK);
}
/**
* 设置捕获模式,共有三种模式模式:
* 1.SampleIdcardCaptorActivity.CAPTURE_MODE_AUTO 自动捕获模式
* 2.SampleIdcardCaptorActivity.CAPTURE_MODE_MANUAL 手动拍摄模式
* 3.SampleIdcardCaptorActivity.CAPTURE_MODE_MIXED 混合模式,首先尝试自动捕获,指定时间后,采取手动拍摄
* 在本例中,使用混合捕获模式,需要设置自动捕获持续时间,单位为秒,默认10秒
*/
i.putExtra(SampleIdcardCaptorActivity.EXTRA_CAPTURE_MODE, SampleIdcardCaptorActivity.CAPTURE_MODE_MIXED);
i.putExtra(SampleIdcardCaptorActivity.EXTRA_DURATION_TIME, 10);
if (requestPermission()) {
startActivity(i);
}
}
}
/**==============================请求相机权限=========================**/
private static final int PERMISSION_READ_EXTERNAL_STORAGE = 101;
private static final int PERMISSION_WRITE_EXTERNAL_STORAGE = 102;
private static final int PERMISSION_CAMERA = 103;
private boolean requestPermission() {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_WRITE_EXTERNAL_STORAGE);
return false;
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_READ_EXTERNAL_STORAGE);
return false;
}
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_DENIED) {
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, PERMISSION_CAMERA);
return false;
}
return true;
}
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
try {
switch (requestCode) {
case PERMISSION_CAMERA: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "没有摄像头权限我什么都做不了哦!", Toast.LENGTH_LONG).show();
}
break;
}
case PERMISSION_READ_EXTERNAL_STORAGE: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "请打开存储读写权限,确保APP正常运行", Toast.LENGTH_LONG).show();
}
break;
}
case PERMISSION_WRITE_EXTERNAL_STORAGE: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
} else {
Toast.makeText(this, "请打开存储读写权限,确保APP正常运行", Toast.LENGTH_LONG).show();
}
break;
}
}
} catch (Exception e) {
LogUtil.e(TAG, "Failed to request Permission", e);
}
}
}
package com.oliveapp.liveness.sample.register;
import android.app.Activity;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.oliveapp.libcommon.utility.PackageNameManager;
import com.oliveapp.libimagecapture.CaptureImageFragment;
import com.oliveapp.libimagecapture.OnImageCapturedEventListener;
import com.oliveapp.libimagecapture.datatype.DetectedRect;
import com.oliveapp.liveness.sample.R;
public class SampleImageCaptureActivity extends Activity implements OnImageCapturedEventListener {
public static final String TAG = SampleImageCaptureActivity.class.getSimpleName();
public static final String EXTRA_CAPTURE_MODE = "capture_mode";
private CaptureImageFragment mCaptureImageFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
if (!PackageNameManager.isPackageNameSet()) {
PackageNameManager.setPackageName(getPackageName());
}
PackageNameManager.setPackageName(PackageNameManager.getPackageName());
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sample_image_capture);
attachUserImageRegistractionFragment();
}
private void attachUserImageRegistractionFragment() {
FragmentManager mFragmentManager = getFragmentManager();
CaptureImageFragment userImageRegisterFragment = (CaptureImageFragment) mFragmentManager.findFragmentByTag(CaptureImageFragment.TAG);
if (userImageRegisterFragment == null) {
int captureType = getIntent().getExtras().getInt(EXTRA_CAPTURE_MODE, CaptureImageFragment.CAPTURE_MODE_IDCARD_FRONT);
userImageRegisterFragment = CaptureImageFragment.newInstance(captureType);
FragmentTransaction ft = mFragmentManager.beginTransaction();
ft.add(R.id.imageCaptureMainLayout, userImageRegisterFragment, CaptureImageFragment.TAG);
ft.commit();
} else {
if (userImageRegisterFragment.isAdded()) {
Log.i(TAG, "user image register fragment already attached");
}
}
userImageRegisterFragment.setArgs(this, this);
mCaptureImageFragment = userImageRegisterFragment;
}
@Override
public void OnImageCaptured(byte[] imageContent, DetectedRect faceRect) {
boolean faceExists = (faceRect != null);
Intent i = new Intent(this, SampleCameraResultActivity.class);
i.putExtra(EXTRA_CAPTURE_MODE, getIntent().getExtras().getInt(EXTRA_CAPTURE_MODE, CaptureImageFragment.CAPTURE_MODE_IDCARD_FRONT));
i.putExtra(SampleCameraResultActivity.EXTRA_IMAGE_CONTENT, imageContent);
i.putExtra(SampleCameraResultActivity.EXTRA_FACE_EXISTS, faceExists);
if (faceExists) {
i.putExtra(SampleCameraResultActivity.EXTRA_FACE_RECT, faceRect.rect.flattenToString());
}
startActivity(i);
finish();
}
}
package com.oliveapp.liveness.sample.uicomponents;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.libcommon.utility.PackageNameManager;
import com.oliveapp.liveness.sample.R;
import com.oliveapp.liveness.sample.utils.SampleScreenDisplayHelper;
public class FixedAspectLayout extends FrameLayout {
private float mHWAspect = 1.0f;
private final static int FIX_HEIGHT = 1;
private final static int FIX_WIDTH = 2;
private int mFixMode = 1;
// .. alternative constructors omitted
public FixedAspectLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
@SuppressWarnings("ResourceType")
private void init(Context context, AttributeSet attrs) {
int aspectRatioId = R.attr.oliveapp_aspectRatio;
int fixModeId = R.attr.oliveapp_fixMode;
int attrArray[] = {aspectRatioId, fixModeId};
TypedArray array = context.obtainStyledAttributes(attrs, attrArray);
/**
* 改用动态获取比例来适应不同屏幕
*/
if ((SampleScreenDisplayHelper.getFixedOrientation(context) == SampleScreenDisplayHelper.OrientationType.LANDSCAPE) && !SampleScreenDisplayHelper.ifThisIsPhone(context)) {
mHWAspect = (float) (1 / SampleScreenDisplayHelper.getScreenScale(context));
} else {
mHWAspect = (float) SampleScreenDisplayHelper.getScreenScale(context);
}
mFixMode = array.getInt(1, 1); // First Parameter represents FixMode, cannot get styleableId dynamically
array.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int w = MeasureSpec.getSize(widthMeasureSpec);
int h = MeasureSpec.getSize(heightMeasureSpec);
if (w == 0) {
h = 0;
} else {
switch (mFixMode) {
case FIX_HEIGHT:
w = (int) (h / mHWAspect);
break;
case FIX_WIDTH:
h = (int) (w * mHWAspect);
break;
default:
w = (int) (h / mHWAspect);
}
}
super.onMeasure(
MeasureSpec.makeMeasureSpec(w,
MeasureSpec.getMode(widthMeasureSpec)),
MeasureSpec.makeMeasureSpec(h,
MeasureSpec.getMode(heightMeasureSpec)));
}
}
package com.oliveapp.liveness.sample.utils;
import android.content.Context;
import android.media.MediaPlayer;
import android.net.Uri;
import com.oliveapp.libcommon.utility.LogUtil;
import com.oliveapp.libcommon.utility.PackageNameManager;
import java.io.IOException;
/**
* Created by jthao on 1/13/16.
*/
public class AudioModule {
private static final String TAG = AudioModule.class.getSimpleName();
private MediaPlayer mAudioPlayer = new MediaPlayer();
public void playAudio(Context context, String audioResourceName)
{
String packageName = PackageNameManager.getPackageName();
int rawId = context.getResources().getIdentifier(audioResourceName, "raw", packageName);
Uri audioUri = Uri.parse("android.resource://" + packageName + "/" + rawId);
try {
if (mAudioPlayer != null && mAudioPlayer.isPlaying())
mAudioPlayer.stop();
mAudioPlayer.reset();
mAudioPlayer.setDataSource(context, audioUri);
mAudioPlayer.prepare();
mAudioPlayer.start();
} catch (IOException e) {
LogUtil.e(TAG, "fail to set data source for audio player", e);
} catch (NullPointerException e) {
LogUtil.e(TAG, "", e);
} catch (IllegalStateException e) {
LogUtil.e(TAG, "fail to play audio type: ", e);
}
}
public boolean isPlaying() {
if (mAudioPlayer != null) {
return mAudioPlayer.isPlaying();
}
return false;
}
public void release() {
try {
mAudioPlayer.stop();
mAudioPlayer.release();
mAudioPlayer = null;
} catch (Exception e) {
LogUtil.e(TAG, "Fail to release", e);
}
}
}
package com.oliveapp.liveness.sample.utils;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.DisplayMetrics;
/**
* Created by cli on 1/10/17.
*/
public class SampleScreenDisplayHelper {
public static String TAG = SampleScreenDisplayHelper.class.getSimpleName();
public static final double MIN_TABLET_SIZE = 7.0;
/**
* 设置设备是显示横屏还是竖屏
* OrientationType枚举中有两种选项
* PORTRAIT代表竖屏
* LANDSCAPE代表横屏
*/
public enum OrientationType {
PORTRAIT, LANDSCAPE
}
/**
* 请在这里设置决定要采用的屏幕方向
* 默认都是竖屏
* 若要自定义,请重写getFixedOrientation(Context)方法
*/
public static OrientationType getFixedOrientation(Context context) {
/**
* 手机只有竖屏,平板根据摄像头位置可以设置横屏或者竖屏
* 若要设置横屏可返回OrientationType.LANDSCAPE
* 然后在具体的Activity的decideWhichLayout()方法中返回相应的layout值;
*/
if (ifThisIsPhone(context)) {
return OrientationType.PORTRAIT;
} else {
/**
* 以下代码是为了配合设置功能,集成时可以删除
*/
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean isDebug = sharedPrefs.getBoolean("pref_debug_mode", false);
if (isDebug) {
boolean padLandscape = sharedPrefs.getBoolean("pref_pad_landscape", false);
if (padLandscape) {
return OrientationType.LANDSCAPE;
} else {
return OrientationType.PORTRAIT;
}
}
/**
* 以上代码是为了配合设置功能,集成时可以删除
*/
return OrientationType.PORTRAIT;
}
}
/**
* 判断本机是手机还是平板
* 若是手机,返回true
*/
public static boolean ifThisIsPhone(Context context) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
int widthPixels = dm.widthPixels;
int heightPixels = dm.heightPixels;
double diagonalPixels = Math.sqrt(new Double(widthPixels * widthPixels + heightPixels * heightPixels));
double dpi = dm.densityDpi;
double physicalSize = diagonalPixels / dpi;
double scale = new Double(heightPixels) / new Double(widthPixels);
double standard_16_9 = new Double(16).doubleValue() / new Double(9).doubleValue();
double standard_4_3 = new Double(4).doubleValue() / new Double(3).doubleValue();
double acceptable = 0.2;
if (physicalSize > MIN_TABLET_SIZE) {
return false;
} else {
if (Math.abs(scale - standard_16_9) < acceptable) {
return true;
}
return false;
}
}
/**
* 获取屏幕比例
* @param context
* @return
*/
public static double getScreenScale(Context context) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
int widthPixels = dm.widthPixels;
int heightPixels = dm.heightPixels;
double scale = new Double(heightPixels) / new Double(widthPixels);
return scale;
}
}
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="#ff00427d"/>
</shape>
</item>
<item android:state_selected="true">
<shape>
<solid android:color="#ff005aaa"/>
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="#80005aaa"/>
</shape>
</item>
<item>
<shape>
<solid android:color="#ff005aaa"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:useLevel="true"
android:innerRadiusRatio="2.7"
android:thickness="4dp"
android:shape="ring">
<!--<stroke android:width="1dp" android:color="#07ADD0"/>-->
<solid android:color="#02ADCF"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item>
<shape
android:useLevel="false"
android:shape="oval">
<solid android:color="#5DC6E2" />
</shape>
</item>
<item>
<shape
android:useLevel="false"
android:innerRadiusRatio="2.7"
android:thickness="4dp"
android:shape="ring">
<!--<solid android:color="#02ADCF" />-->
<solid android:color="#ffffff" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:useLevel="false"
android:innerRadiusRatio="2.7"
android:thickness="4dp"
android:shape="oval">
<stroke android:width="1dp" android:color="#5DC6E2"/>
<solid android:color="#FF4D4D4D"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="#ff00427d"/>
</shape>
</item>
<item android:state_selected="true">
<shape>
<solid android:color="#ff005aaa"/>
</shape>
</item>
<item android:state_enabled="false">
<shape>
<solid android:color="#80005aaa"/>
</shape>
</item>
<item>
<shape>
<solid android:color="#ff005aaa"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- 橙色人脸框,仅供debug用,非产品需求 -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:color="@color/navy"
android:width="2dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/oliveapp_liveness_finish_button" android:state_pressed="false"/>
<item android:drawable="@mipmap/oliveapp_liveness_finish_button_click" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/oliveapp_liveness_finish_tablet" android:state_pressed="false"/>
<item android:drawable="@mipmap/oliveapp_liveness_finish_click_tablet" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/oliveapp_liveness_finish_retry" android:state_pressed="false"/>
<item android:drawable="@mipmap/oliveapp_liveness_finish_retry_click" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@mipmap/oliveapp_liveness_finish_retry_tablet" android:state_pressed="false"/>
<item android:drawable="@mipmap/oliveapp_liveness_finish_retry_click_tablet" android:state_pressed="true"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@mipmap/oliveapp_liveness_return_click"/>
<item android:state_pressed="false" android:drawable="@mipmap/oliveapp_liveness_return"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@mipmap/oliveapp_liveness_finish_return_click_tablet"/>
<item android:state_pressed="false" android:drawable="@mipmap/oliveapp_liveness_finish_return_tablet"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="@mipmap/oliveapp_start_normal"/>
<item android:state_pressed="true" android:drawable="@mipmap/oliveapp_start_click"/>
</selector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="@mipmap/oliveapp_start_tablet"/>
<item android:state_pressed="true" android:drawable="@mipmap/oliveapp_start_click_tablet"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/checkbox_unchecked"
android:state_checked="false"
android:state_enabled="true"/>
<item
android:drawable="@drawable/checkbox_checked"
android:state_checked="true"
android:state_enabled="true"/>
<item
android:drawable="@drawable/checkbox_disable_unchecked"
android:state_checked="false"
android:state_enabled="false"/>
<item
android:drawable="@drawable/checkbox_disable_checked"
android:state_checked="true"
android:state_enabled="false"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:drawable="@color/itemdisabled" />
<item android:state_enabled="false" android:drawable="@color/itemdisabled" />
<item android:state_enabled="true" android:state_pressed="true" android:drawable="@color/itemSelectColor" />
<item android:state_focused="true" android:state_enabled="true" android:drawable="@color/itemSelectColor" />
<item android:state_enabled="true" android:state_selected="true" android:drawable="@color/itemSelectColor" />
<item android:drawable="@color/itemBgColor" />
</selector>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.oliveapp.liveness.sample.idcard_captor.SampleIdcardActivity">
</RelativeLayout>
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ImageCaptureActivity"
android:id="@+id/imageCaptureMainLayout">
</RelativeLayout>
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:background="@color/colorDefaultBackground"
tools:context=".SampleLaunchActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/titleText"
android:id="@+id/titleTextView"
android:layout_alignParentTop="true"
android:layout_marginTop="70dp"
android:layout_centerHorizontal="true"
android:textSize="40sp"
android:textColor="@color/colorWhite"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="@string/oliveapp_version"
android:textColor="@color/colorWhite"
android:textSize="20sp" />
<!--<TextView-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:textAppearance="?android:attr/textAppearanceLarge"-->
<!--android:text="@string/subtitleText"-->
<!--android:id="@+id/subtitleTextView"-->
<!--android:layout_below="@+id/titleTextView"-->
<!--android:layout_alignLeft="@+id/titleTextView"-->
<!--android:layout_alignStart="@+id/titleTextView" />-->
<Button
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="@string/hintCamera"
android:id="@+id/startButton"
android:layout_centerHorizontal="true"
android:layout_below="@+id/titleTextView"
android:layout_marginTop="100dp"
android:background="@drawable/oliveapp_button_background"
android:textColor="#ffffff"
android:textSize="20sp" />
<Button
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="@string/livenessButtonText"
android:id="@+id/livenessButton"
android:background="@drawable/oliveapp_button_background"
android:textColor="#ffffff"
android:textSize="20sp"
android:layout_below="@+id/startButton"
android:layout_marginTop="20dp"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="@string/settingButtonText"
android:id="@+id/settingButton"
android:background="@drawable/oliveapp_button_background"
android:textColor="#ffffff"
android:textSize="20sp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="60dp" />
</RelativeLayout>
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:background="@color/colorDefaultBackground"
tools:context=".register.SampleChooseCameraActivity">
<LinearLayout
android:id="@+id/chooseImageTypeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_marginTop="50dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp">
<Button
android:id="@+id/IDcard"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginBottom="30dp"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:text="@string/hintIDcard"
android:layout_gravity="center_horizontal"
android:textSize="16sp"
android:gravity="center_horizontal|center_vertical"
android:background="@drawable/oliveapp_button_background"
android:layout_marginTop="25dp"
android:textColor="#ffffff" />
<Button
android:id="@+id/Selfie"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginBottom="30dp"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:text="@string/hintFrontCamera"
android:layout_gravity="center_horizontal"
android:textSize="16sp"
android:gravity="center_horizontal|center_vertical"
android:background="@drawable/oliveapp_button_background"
android:layout_marginTop="25dp"
android:textColor="#ffffff" />
<Button
android:id="@+id/IdcardFrontCapture"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginBottom="30dp"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:text="@string/hintIdcardCapture"
android:layout_gravity="center_horizontal"
android:textSize="16sp"
android:gravity="center_horizontal|center_vertical"
android:background="@drawable/oliveapp_button_background"
android:layout_marginTop="25dp"
android:textColor="#ffffff" />
<Button
android:id="@+id/IdcardBackCapture"
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginBottom="30dp"
android:paddingLeft="50dp"
android:paddingRight="50dp"
android:text="@string/hintIdcardBackCapture"
android:layout_gravity="center_horizontal"
android:textSize="16sp"
android:gravity="center_horizontal|center_vertical"
android:background="@drawable/oliveapp_button_background"
android:layout_marginTop="25dp"
android:textColor="#ffffff" />
</LinearLayout>
</RelativeLayout>
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:background="@color/colorDefaultBackground"
tools:context=".register.SampleCameraResultActivity">
<ImageView
android:layout_width="300dp"
android:layout_height="300dp"
android:id="@+id/captureImageImageView"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
<Button
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="重新拍摄"
android:textColor="@color/colorWhite"
android:id="@+id/retakeButton"
android:layout_marginBottom="20dp"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_button_background"
android:layout_above="@+id/confirmButton" />
<Button
android:layout_width="match_parent"
android:layout_height="46dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:text="返回"
android:textColor="@color/colorWhite"
android:id="@+id/confirmButton"
android:background="@drawable/oliveapp_button_background"
android:layout_alignParentBottom="true"
android:layout_marginBottom="60dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<?xml version="1.0" encoding="UTF-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/arrow"
android:clickable="false"
android:focusable="false" />
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- 这里放上系统的id -->
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:button="@drawable/selector_checkbox"
android:clickable="false"
android:focusable="false" />
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".idcard_captor.view_controller.SampleIdcardCaptorMainActivity">
<RelativeLayout
android:id="@+id/oliveapp_face_captureLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:visibility="visible">
<RelativeLayout
android:id="@+id/oliveapp_face_previewLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true">
<view
android:id="@+id/oliveapp_face_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/oliveapp_face_captureIDCardHintLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:visibility="visible">
<ImageView
android:id="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_width="252dp"
android:layout_height="400dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_idcard_shade_skeleton_minimum3"
android:layout_centerInParent="true" />
<ImageView
android:id="@+id/oliveapp_face_scan_line"
android:layout_width="wrap_content"
android:layout_height="400dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_scan_line"/>
<ImageView
android:id="@+id/oliveapp_face_shadowLeftImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_toStartOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow" />
<ImageView
android:id="@+id/oliveapp_face_shadowRightImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="true"
android:layout_toEndOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_toRightOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow" />
<ImageView
android:id="@+id/oliveapp_face_shadowTopImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/oliveapp_face_shadowRightImageView"
android:layout_toRightOf="@+id/oliveapp_face_shadowLeftImageView"
android:adjustViewBounds="false"
android:baselineAlignBottom="false"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_above="@+id/oliveapp_face_idcardSkeletonImageView" />
<ImageView
android:id="@+id/oliveapp_face_shadowBottomImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/oliveapp_face_shadowRightImageView"
android:layout_toRightOf="@+id/oliveapp_face_shadowLeftImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_below="@+id/oliveapp_face_idcardSkeletonImageView" />
<com.oliveapp.libcommon.uicomponents.VerticalTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/oliveapp_face_hintTextView"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="@string/oliveapp_face_database_image_hint_front"
android:textColor="#ffffff"
android:layout_marginLeft="5dp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="invisible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/oliveapp_frame_rate_text"
android:text="FPS: "/>
</RelativeLayout>
<!--<RelativeLayout-->
<!--android:id="@+id/oliveapp_face_takePictureButtonLayout"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="64dp"-->
<!--android:layout_alignParentBottom="true"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentRight="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:layout_centerHorizontal="true"-->
<!--android:background="@drawable/oliveapp_face_black_shadow">-->
<ImageButton
android:id="@+id/oliveapp_face_takePictureButton"
style="?android:attr/borderlessButtonStyle"
android:layout_height="64dp"
android:layout_width="wrap_content"
android:clickable="true"
android:src="@drawable/oliveapp_camera_alt_white_48dp"
android:scaleType="fitCenter"
android:layout_alignParentBottom="true"
android:layout_centerInParent="true"
android:visibility="invisible"/>
<!--</RelativeLayout>-->
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
tools:context=".liveness.SampleUnusualResultActivity">
<ImageView
android:layout_width="400dp"
android:layout_height="200dp"
android:id="@+id/oliveappLivenessImageView"
android:scaleType="fitCenter"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp" />
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/oliveapp_face_captureLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:visibility="visible">
<RelativeLayout
android:id="@+id/oliveapp_face_previewLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerInParent="true">
<view
android:id="@+id/oliveapp_face_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/oliveapp_face_takePictureButtonLayout"
android:layout_width="fill_parent"
android:layout_height="64dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_face_black_shadow">
<ImageButton
android:id="@+id/oliveapp_face_takePictureButton"
style="?android:attr/borderlessButtonStyle"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:clickable="true"
android:src="@drawable/oliveapp_camera_alt_white_48dp"
android:scaleType="fitCenter"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_centerInParent="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/oliveapp_face_captureIDCardHintLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/oliveapp_face_takePictureButtonLayout"
android:visibility="visible">
<ImageView
android:id="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_width="280dp"
android:layout_height="448dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/oliveapp_face_idcard_shade_skeleton_minimum2"
android:layout_centerInParent="true" />
<ImageView
android:id="@+id/oliveapp_face_shadowLeftImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_toStartOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow" />
<ImageView
android:id="@+id/oliveapp_face_shadowRightImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="false"
android:layout_alignParentRight="true"
android:layout_toEndOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:layout_toRightOf="@+id/oliveapp_face_idcardSkeletonImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow" />
<ImageView
android:id="@+id/oliveapp_face_shadowTopImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/oliveapp_face_shadowRightImageView"
android:layout_toRightOf="@+id/oliveapp_face_shadowLeftImageView"
android:adjustViewBounds="false"
android:baselineAlignBottom="false"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_above="@+id/oliveapp_face_idcardSkeletonImageView" />
<ImageView
android:id="@+id/oliveapp_face_shadowBottomImageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/oliveapp_face_shadowRightImageView"
android:layout_toRightOf="@+id/oliveapp_face_shadowLeftImageView"
android:scaleType="fitXY"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_below="@+id/oliveapp_face_idcardSkeletonImageView" />
<com.oliveapp.libcommon.uicomponents.VerticalTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/oliveapp_face_hintTextView"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:text="@string/oliveapp_face_database_image_hint_front"
android:textColor="#ffffff"
android:layout_marginLeft="5dp" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/oliveapp_face_captureLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:visibility="visible">
<RelativeLayout
android:id="@+id/oliveapp_face_previewLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_centerInParent="true">
<view
android:id="@+id/oliveapp_face_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
<ImageView
android:id="@+id/oliveapp_face_previewCapturedImageView"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:scaleType="centerCrop" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/oliveapp_face_takePictureButtonLayout"
android:layout_width="fill_parent"
android:layout_height="64dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_face_black_shadow">
<ImageButton
android:id="@+id/oliveapp_face_takePictureButton"
style="?android:attr/borderlessButtonStyle"
android:layout_height="fill_parent"
android:layout_width="wrap_content"
android:clickable="true"
android:src="@drawable/oliveapp_camera_alt_white_48dp"
android:scaleType="fitCenter"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_centerInParent="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/oliveapp_face_takePictureButtonLayout"
android:id="@+id/oliveapp_face_captureSemiIDCardHintLayout">
<RelativeLayout
android:layout_width="280dp"
android:layout_height="280dp"
android:id="@+id/oliveapp_face_faceSkeletonImageLayout"
android:layout_centerHorizontal="true"
android:layout_marginTop="90dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/oliveapp_face_faceSkeletonImageView"
android:src="@drawable/oliveapp_face_skeleton_minimum2"
android:scaleType="fitCenter"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
</RelativeLayout>
<ImageView
android:layout_width="fill_parent"
android:layout_height="90dp"
android:id="@+id/oliveapp_face_faceShadeTopImageView"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_alignParentTop="true"
android:scaleType="fitXY" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/oliveapp_face_faceShadeBottomImageView"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_alignParentBottom="true"
android:scaleType="fitXY"
android:layout_below="@+id/oliveapp_face_faceSkeletonImageLayout" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/oliveapp_face_faceShadeLeftImageView"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_toLeftOf="@+id/oliveapp_face_faceSkeletonImageLayout"
android:layout_toStartOf="@+id/oliveapp_face_faceSkeletonImageLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:scaleType="fitXY"
android:layout_below="@+id/oliveapp_face_faceShadeTopImageView"
android:layout_above="@+id/oliveapp_face_faceShadeBottomImageView" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/oliveapp_face_faceShadeRightImageView"
android:src="@drawable/oliveapp_face_black_shadow"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_toRightOf="@+id/oliveapp_face_faceSkeletonImageLayout"
android:layout_toEndOf="@+id/oliveapp_face_faceSkeletonImageLayout"
android:scaleType="fitXY"
android:layout_below="@+id/oliveapp_face_faceShadeTopImageView"
android:layout_above="@+id/oliveapp_face_faceShadeBottomImageView" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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_height="match_parent">
<com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout
android:id="@+id/oliveapp_cameraPreviewLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:oliveapp_fixMode="fixWidth">
<view
android:id="@+id/oliveapp_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp" />
</com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout>
<android.support.percent.PercentRelativeLayout
android:id="@+id/oliveapp_detected_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--滤镜-->
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:src="@mipmap/oliveapp_background_filter_landscape_tablet" />
<!--人脸框-->
<ImageView
android:id="@+id/oliveapp_start_frame"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_detect_frame"
app:layout_heightPercent="60%"
app:layout_marginTopPercent="20%"
app:layout_widthPercent="40%" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_marginTopPercent="3%"
app:layout_marginLeftPercent="3%"
android:textSize="20sp"
android:textColor="#ffffff"
android:id="@+id/oliveapp_frame_rate_text"/>
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveapp_close_image_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
app:layout_marginRightPercent="7%"
app:layout_marginTopPercent="7%"
app:layout_aspectRatio="75%"
app:layout_heightPercent="5%"
android:background="@mipmap/oliveapp_close_icon"/>
<!--提示文字-->
<android.support.percent.PercentRelativeLayout
android:layout_centerHorizontal="true"
app:layout_heightPercent="10%"
app:layout_marginRightPercent="20%"
app:layout_marginTopPercent="24.6%"
app:layout_widthPercent="60%">
<TextView
android:id="@+id/oliveapp_detected_hint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/oliveapp_step_hint_focus"
android:textColor="#FFFF00"
android:textSize="40sp"
android:textStyle="bold"
app:layout_marginLeftPercent="2%"
app:layout_marginRightPercent="2%" />
<ImageView
android:id="@+id/oliveapp_detected_hint_left_border"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_left_corner"
app:layout_heightPercent="20%"
app:layout_widthPercent="2%" />
<ImageView
android:id="@+id/oliveapp_detected_hint_right_border"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_right_corner"
app:layout_heightPercent="20%"
app:layout_widthPercent="2%" />
</android.support.percent.PercentRelativeLayout>
<!--倒计时-->
<TextView
android:id="@+id/oliveapp_count_time_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="50sp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
tools:context=".liveness.view_controller.LivenessDetectionMainActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout
android:id="@+id/oliveapp_cameraPreviewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:oliveapp_fixMode="fixWidth">
<view
android:id="@+id/oliveapp_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp" />
</com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout>
<android.support.percent.PercentRelativeLayout
android:id="@+id/oliveapp_detected_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--滤镜-->
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_background_filter_portrait_phone" />
<!--人脸框-->
<ImageView
android:id="@+id/oliveapp_start_frame"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_detect_frame"
android:scaleType="centerCrop"
app:layout_heightPercent="41.3%"
app:layout_marginLeftPercent="13.2%"
app:layout_marginTopPercent="27.4%"
app:layout_widthPercent="73.5%" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_marginTopPercent="3%"
app:layout_marginLeftPercent="3%"
android:textSize="20sp"
android:textColor="#ffffff"
android:id="@+id/oliveapp_frame_rate_text"/>
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveapp_close_image_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/oliveapp_close_icon"
app:layout_heightPercent="4%"
app:layout_marginRightPercent="6.6%"
app:layout_marginTopPercent="6.8%"
app:layout_aspectRatio="100%"/>
<!--提示文字-->
<android.support.percent.PercentRelativeLayout
android:layout_centerHorizontal="true"
app:layout_heightPercent="5.2%"
app:layout_marginTopPercent="19.4%"
app:layout_widthPercent="100%">
<TextView
android:id="@+id/oliveapp_detected_hint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#FFFF00"
android:textSize="24sp"
android:text="@string/oliveapp_step_hint_focus"
app:layout_marginLeftPercent="2%"
app:layout_marginRightPercent="2%"/>
<ImageView
android:id="@+id/oliveapp_detected_hint_left_border"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_left_corner"
app:layout_heightPercent="18%"
app:layout_widthPercent="4%"/>
<ImageView
android:id="@+id/oliveapp_detected_hint_right_border"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_right_corner"
app:layout_heightPercent="18%"
app:layout_widthPercent="4%" />
</android.support.percent.PercentRelativeLayout>
<!--倒计时-->
<TextView
android:id="@+id/oliveapp_count_time_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="50sp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
/>
</android.support.percent.PercentRelativeLayout>
</FrameLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout
android:id="@+id/oliveapp_cameraPreviewLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:oliveapp_fixMode="fixWidth">
<view
android:id="@+id/oliveapp_cameraPreviewView"
class="com.oliveapp.camerasdk.ui.CameraRootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"/>
</com.oliveapp.liveness.sample.uicomponents.FixedAspectLayout>
<android.support.percent.PercentRelativeLayout
android:id="@+id/oliveapp_detected_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--滤镜-->
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
android:src="@mipmap/oliveapp_background_filter_portrait_phone" />
<!--人脸框-->
<ImageView
android:id="@+id/oliveapp_start_frame"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_detect_frame"
app:layout_marginTopPercent="25%"
app:layout_heightPercent="42.5%"
app:layout_widthPercent="73.5%"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_marginTopPercent="3%"
app:layout_marginLeftPercent="3%"
android:textSize="20sp"
android:textColor="#ffffff"
android:id="@+id/oliveapp_frame_rate_text"/>
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveapp_close_image_button"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/oliveapp_close_icon"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_heightPercent="4%"
app:layout_aspectRatio="100%"
app:layout_marginRightPercent="6.6%"
app:layout_marginTopPercent="6.8%"/>
<!--提示文字-->
<android.support.percent.PercentRelativeLayout
android:id="@+id/oliveapp_detected_hint_text_layout"
android:layout_centerHorizontal="true"
app:layout_heightPercent="5.2%"
app:layout_marginTopPercent="12%"
app:layout_widthPercent="100%">
<TextView
android:id="@+id/oliveapp_detected_hint_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="请正对屏幕"
android:textColor="#FFFF00"
android:textSize="24sp" />
<ImageView
android:id="@+id/oliveapp_detected_hint_left_border"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_left_corner"
app:layout_heightPercent="18%"
app:layout_widthPercent="4%" />
<ImageView
android:id="@+id/oliveapp_detected_hint_right_border"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/oliveapp_detected_hint_text"
android:src="@mipmap/oliveapp_detect_hint_right_corner"
app:layout_heightPercent="18%"
app:layout_widthPercent="4%" />
</android.support.percent.PercentRelativeLayout>
<!--倒计时-->
<TextView
android:id="@+id/oliveapp_count_time_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="50sp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
/>
</android.support.percent.PercentRelativeLayout>
</FrameLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_liveness_finish_fail"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginTopPercent="13.5%"
app:layout_widthPercent="36%"
app:layout_aspectRatio="462%"/>
<TextView
android:id="@+id/oliveappResultTextView"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
app:layout_widthPercent="80%"
app:layout_heightPercent="20%"
app:layout_marginTopPercent="41.6%"
android:textSize="40sp"
android:textColor="#FFFFFF"/>
<Button
android:id="@+id/oliveapp_liveness_result_retry"
android:layout_alignParentBottom="true"
android:background="@drawable/oliveapp_liveness_finish_retry_tablet_selector"
app:layout_marginBottomPercent="10.8%"
app:layout_marginLeftPercent="15%"
app:layout_widthPercent="31%"
app:layout_aspectRatio="300%"/>
<Button
android:id="@+id/oliveapp_liveness_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_tablet_selector"
app:layout_marginBottomPercent="10.8%"
app:layout_marginRightPercent="15%"
app:layout_widthPercent="31%"
app:layout_aspectRatio="300%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:background="@mipmap/oliveapp_liveness_resultpage_bg"
tools:context="SampleUnusualResultActivity">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_finish_fail"
app:layout_marginTopPercent="33.6%"
app:layout_widthPercent="49.1%"
app:layout_aspectRatio="462%"/>
<TextView
android:id="@+id/oliveappResultTextView"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
app:layout_widthPercent="80%"
app:layout_heightPercent="20%"
app:layout_marginTopPercent="41.6%"
android:textSize="30sp"
android:textColor="#FFFFFF"/>
<Button
android:id="@+id/oliveapp_liveness_result_retry"
android:layout_alignParentBottom="true"
android:background="@drawable/oliveapp_liveness_finish_retry"
app:layout_marginBottomPercent="8%"
app:layout_marginLeftPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="295%"/>
<Button
android:id="@+id/oliveapp_liveness_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_selector"
app:layout_marginBottomPercent="8%"
app:layout_marginRightPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="295%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_finish_fail"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginTopPercent="30%"
app:layout_widthPercent="49.1%"
app:layout_aspectRatio='462%'/>
<TextView
android:id="@+id/oliveappResultTextView"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
app:layout_widthPercent="80%"
app:layout_heightPercent="20%"
app:layout_marginTopPercent="41.6%"
android:textSize="40sp"
android:textColor="#FFFFFF"/>
<Button
android:id="@+id/oliveapp_liveness_result_retry"
android:layout_alignParentBottom="true"
android:background="@drawable/oliveapp_liveness_finish_retry_tablet_selector"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginBottomPercent="10.8%"
app:layout_marginLeftPercent="10%"
app:layout_widthPercent="35%"
app:layout_aspectRatio="328%"/>
<Button
android:id="@+id/oliveapp_liveness_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_tablet_selector"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginBottomPercent="10.8%"
app:layout_marginRightPercent="10%"
app:layout_widthPercent="35%"
app:layout_aspectRatio="328%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_liveness_finish_fail"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginRightPercent="25.5%"
app:layout_marginTopPercent="13.5%"
app:layout_widthPercent="36%"
app:layout_aspectRatio="462%"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentLeft="true"
app:layout_widthPercent="40%"
app:layout_heightPercent="40%"
app:layout_marginTopPercent="33.8%"
app:layout_marginLeftPercent="8.3%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<ImageView
android:layout_centerHorizontal="true"
app:layout_heightPercent="40%"
app:layout_widthPercent="2%"
app:layout_marginTopPercent="33%"
android:src="@mipmap/oliveapp_divider_tablet"/>
<android.support.percent.PercentRelativeLayout
app:layout_widthPercent="40%"
app:layout_heightPercent="40%"
app:layout_marginTopPercent="33%"
app:layout_marginRightPercent="8.2%"
android:layout_alignParentRight="true"
android:background="@mipmap/oliveapp_liveness_result_border">
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="45%"
app:layout_heightPercent="90%"
app:layout_marginTopPercent="5%"
app:layout_marginLeftPercent="2.5%"/>
<ImageView
app:layout_widthPercent="40%"
app:layout_heightPercent="80%"
app:layout_marginTopPercent="10%"
app:layout_marginLeftPercent="5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="45%"
app:layout_heightPercent="90%"
app:layout_marginTopPercent="5%"
app:layout_marginRightPercent="2.5%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="40%"
app:layout_heightPercent="80%"
app:layout_marginTopPercent="10%"
app:layout_marginRightPercent="5%"
android:layout_alignParentRight="true"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
</android.support.percent.PercentRelativeLayout>
<Button
android:id="@+id/oliveapp_liveness_saas_result_retry"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_retry_tablet_selector"
app:layout_marginBottomPercent="9%"
app:layout_marginRightPercent="28%"
app:layout_widthPercent="18%"
app:layout_aspectRatio="200%" />
<Button
android:id="@+id/oliveapp_liveness_saas_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_tablet_selector"
app:layout_marginBottomPercent="9%"
app:layout_marginRightPercent="8.3%"
app:layout_widthPercent="18%"
app:layout_aspectRatio="200%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_sample_saa_sresult"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_resultpage_bg"
tools:context="com.oliveapp.liveness.sample.SampleSaaSResultActivity">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_finish_fail"
app:layout_marginRightPercent="25.5%"
app:layout_marginTopPercent="9.7%"
app:layout_widthPercent="49.1%"
app:layout_aspectRatio="462%"/>
<ImageView
app:layout_widthPercent="87.8%"
app:layout_heightPercent="24.6%"
app:layout_marginTopPercent="20.4%"
app:layout_marginRightPercent="5.1%"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_result_border"/>
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginLeftPercent="10.49%"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="13.5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginRightPercent="10.49%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="57.6%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentBottom="true"
app:layout_widthPercent="82.7%"
app:layout_heightPercent="25.4%"
app:layout_marginBottomPercent="25.3%"
app:layout_marginLeftPercent="8.6%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_retry"
android:layout_alignParentBottom="true"
android:background="@drawable/oliveapp_liveness_finish_retry"
app:layout_marginBottomPercent="8%"
app:layout_marginLeftPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="295%"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_selector"
app:layout_marginBottomPercent="8%"
app:layout_marginRightPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="295%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_liveness_finish_fail"
app:layout_marginRightPercent="25.5%"
app:layout_marginTopPercent="9.7%"
app:layout_widthPercent="49.1%"
app:layout_heightPercent="7%"/>
<ImageView
app:layout_widthPercent="87.8%"
app:layout_heightPercent="24.6%"
app:layout_marginTopPercent="20.4%"
app:layout_marginRightPercent="5.1%"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_result_border"/>
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginLeftPercent="10.49%"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="13.5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginRightPercent="10.49%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="57.6%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentBottom="true"
app:layout_widthPercent="82.7%"
app:layout_heightPercent="25.4%"
app:layout_marginBottomPercent="25.3%"
app:layout_marginLeftPercent="8.6%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_retry"
android:layout_alignParentBottom="true"
android:background="@drawable/oliveapp_liveness_finish_retry_tablet_selector"
app:layout_marginBottomPercent="8%"
app:layout_marginLeftPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="326%"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_return"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/oliveapp_liveness_finish_return_tablet_selector"
app:layout_marginBottomPercent="8%"
app:layout_marginRightPercent="6.1%"
app:layout_widthPercent="41.7%"
app:layout_aspectRatio="326%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:id="@+id/oliveapp_liveness_result_list_layout"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/oliveapp_liveness_result_item"
android:gravity="center_vertical|left"
app:layout_widthPercent="70%"
app:layout_heightPercent="100%"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:textColor="#FFFFFF"
android:text="大礼包照片是否同一个人"/>
<ImageView
android:id="@+id/oliveapp_liveness_result_yesorno"
app:layout_widthPercent="10%"
app:layout_heightPercent="40%"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@mipmap/oliveapp_liveness_result_right"/>
<TextView
android:id="@+id/oliveapp_liveness_result_detail"
app:layout_widthPercent="20%"
app:layout_heightPercent="50%"
app:layout_marginRightPercent="3%"
android:gravity="end"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/oliveapp_liveness_result_yesorno"
android:textColor="#6DE3E7"
android:text="0.0000000"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:src="@mipmap/oliveapp_liveness_finish_pass_tablet"
android:layout_height="0dp"
android:layout_width="0dp"
app:layout_marginTopPercent="13.5%"
app:layout_widthPercent="36%"
app:layout_aspectRatio="462%"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentLeft="true"
app:layout_widthPercent="40%"
app:layout_heightPercent="40%"
app:layout_marginTopPercent="33.8%"
app:layout_marginLeftPercent="8.3%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<ImageView
android:layout_centerHorizontal="true"
app:layout_heightPercent="40%"
app:layout_widthPercent="2%"
app:layout_marginTopPercent="33%"
android:src="@mipmap/oliveapp_divider_tablet"/>
<android.support.percent.PercentRelativeLayout
app:layout_widthPercent="40%"
app:layout_heightPercent="40%"
app:layout_marginTopPercent="33%"
app:layout_marginRightPercent="8.2%"
android:layout_alignParentRight="true"
android:background="@mipmap/oliveapp_liveness_result_border">
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="45%"
app:layout_heightPercent="90%"
app:layout_marginTopPercent="5%"
app:layout_marginLeftPercent="2.5%"/>
<ImageView
app:layout_widthPercent="40%"
app:layout_heightPercent="80%"
app:layout_marginTopPercent="10%"
app:layout_marginLeftPercent="5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="45%"
app:layout_heightPercent="90%"
app:layout_marginTopPercent="5%"
app:layout_marginRightPercent="2.5%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="40%"
app:layout_heightPercent="80%"
app:layout_marginTopPercent="10%"
app:layout_marginRightPercent="5%"
android:layout_alignParentRight="true"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
</android.support.percent.PercentRelativeLayout>
<Button
android:id="@+id/oliveapp_liveness_saas_result_finish"
android:layout_alignParentRight="true"
app:layout_marginTopPercent="82%"
app:layout_marginRightPercent="8.3%"
app:layout_widthPercent="18%"
app:layout_aspectRatio="200%"
android:background="@drawable/oliveapp_liveness_finish_button_tablet_selector"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_sample_saa_sresult"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_resultpage_bg"
tools:context="com.oliveapp.liveness.sample.liveness.SampleSaaSResultActivity">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_finish_pass"
app:layout_marginTopPercent="9.7%"
app:layout_widthPercent="49.1%"
app:layout_aspectRatio="462%"/>
<ImageView
app:layout_widthPercent="87.8%"
app:layout_heightPercent="24.6%"
app:layout_marginTopPercent="20.4%"
app:layout_marginLeftPercent="6.1%"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_result_border"/>
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginLeftPercent="10.49%"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="13.5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginRightPercent="10.49%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="57.6%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentBottom="true"
app:layout_widthPercent="82.7%"
app:layout_heightPercent="25.4%"
app:layout_marginBottomPercent="25.3%"
app:layout_marginLeftPercent="8.6%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_finish"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_liveness_finish_button_selector"
app:layout_aspectRatio="618%"
app:layout_marginBottomPercent="8%"
app:layout_widthPercent="87.8%" />
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_liveness_finish_bg_landscape_tablet">
<!--检测结果-->
<ImageView
android:id="@+id/oliveapp_liveness_result_image"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_finish_pass"
app:layout_marginRightPercent="25.5%"
app:layout_marginTopPercent="9.7%"
app:layout_widthPercent="50%"
app:layout_aspectRatio="462%"/>
<ImageView
app:layout_widthPercent="87.8%"
app:layout_heightPercent="24.6%"
app:layout_marginTopPercent="20.4%"
app:layout_marginLeftPercent="6.1%"
android:layout_centerHorizontal="true"
android:background="@mipmap/oliveapp_liveness_result_border"/>
<!--两张人脸-->
<!--第一张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_close"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginLeftPercent="10.49%"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="13.5%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--第二张-->
<ImageView
android:id="@+id/oliveapp_liveness_result_open"
app:layout_widthPercent="35.12%"
app:layout_heightPercent="19.68%"
app:layout_marginTopPercent="22.86%"
app:layout_marginRightPercent="10.49%"
android:layout_alignParentRight="true"/>
<ImageView
app:layout_widthPercent="28.9%"
app:layout_heightPercent="16.3%"
app:layout_marginTopPercent="24.6%"
app:layout_marginLeftPercent="57.6%"
android:src="@mipmap/oliveapp_liveness_result_face_border"/>
<!--将下面列表使用listview表示-->
<ListView
android:id="@+id/oliveapp_liveness_saas_list"
android:layout_alignParentBottom="true"
app:layout_widthPercent="82.7%"
app:layout_heightPercent="25.4%"
app:layout_marginBottomPercent="25.3%"
app:layout_marginLeftPercent="8.6%"
android:isScrollContainer="false"
android:divider="@android:color/transparent"
android:listSelector="@android:color/transparent"/>
<Button
android:id="@+id/oliveapp_liveness_saas_result_finish"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_liveness_finish_button_selector"
app:layout_marginBottomPercent="8%"
app:layout_widthPercent="87.8%"
app:layout_aspectRatio="618%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/oliveapp_start_button_layout">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/oliveapp_homepage_bg_landscape_tablet">
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveappCloseLivenessButton"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/oliveapp_close_icon"
app:layout_aspectRatio="100%"
app:layout_heightPercent="6%"
app:layout_marginRightPercent="6.3%"
app:layout_marginTopPercent="21%"/>
<Button
android:id="@+id/oliveappStartLivenessButton"
android:background="@drawable/oliveapp_start_button_tablet_selector"
android:layout_alignParentRight="true"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginRightPercent="16%"
app:layout_marginTopPercent="60%"
app:layout_widthPercent="20%"
app:layout_aspectRatio="256%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/oliveapp_activity_vertical_margin"
android:paddingLeft="@dimen/oliveapp_activity_horizontal_margin"
android:paddingRight="@dimen/oliveapp_activity_horizontal_margin"
android:paddingTop="@dimen/oliveapp_activity_vertical_margin"
android:id="@+id/oliveapp_start_button_layout"
tools:context=".liveness.SampleStartActivity">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@mipmap/oliveapp_homepage_bg_portrait_phone"
android:scaleType="centerCrop" />
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveappCloseLivenessButton"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/oliveapp_close_icon"
app:layout_marginRightPercent="6.6%"
app:layout_marginTopPercent="6.8%"
app:layout_widthPercent="7%"
app:layout_aspectRatio="100%"/>
<Button
android:id="@+id/oliveappStartLivenessButton"
android:background="@drawable/oliveapp_start_button_selector"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
app:layout_marginBottomPercent="10%"
app:layout_widthPercent="73.5%"
app:layout_aspectRatio="513%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/oliveapp_start_button_layout"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/oliveapp_homepage_bg_portrait_phone"/>
<!--关闭按钮-->
<ImageButton
android:id="@+id/oliveappCloseLivenessButton"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@mipmap/oliveapp_close_icon"
app:layout_heightPercent="4.1%"
app:layout_aspectRatio="100%"
app:layout_marginRightPercent="6.6%"
app:layout_marginTopPercent="6.8%"/>
<Button
android:id="@+id/oliveappStartLivenessButton"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/oliveapp_start_button_selector"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_marginBottomPercent="8%"
app:layout_widthPercent="73%"
app:layout_aspectRatio="513%"/>
</android.support.percent.PercentRelativeLayout>
</RelativeLayout>
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selector_item"
android:gravity="center_vertical"
android:minHeight="50dp"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="4dp" >
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:singleLine="true"
android:text="title"
android:textColor="#4d4d4d"
android:textSize="18.0sp" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@android:id/widget_frame"
android:maxLines="2"
android:text="summary"
android:textColor="#AAAAAA"
android:textSize="16sp" />
<FrameLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="4dp"
android:gravity="center_vertical" >
</FrameLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical" >
<ImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20dp" />
<TextView
android:id="@+id/value"
android:paddingTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="value"
android:textSize="20sp"
android:textColor="#aaaaaa" />
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp" />
</LinearLayout>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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