Commit 26882168 by tangguangrui

Initial commit

parents
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
introduction.txt
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Windows thumbnail db
Thumbs.db
# OSX files
.DS_Store
# Eclipse project files
.classpath
.project
# Android Studio
*.iml
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
.gradle
build/
#NDK
obj/
*.swp
*~
/build
/debug
/release
apply plugin: 'com.android.application'
def APP_VSN = "1.0.1"//版本号
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "cn.runworld.mctower.visitor"
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "1.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
// 设置支持的SO库架构
abiFilters 'armeabi-v7a' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
signingConfigs {
debug {
storeFile file('mctower.keystore')
storePassword "mctower123321"
keyAlias "mctower"
keyPassword "mctower123321"
}
}
buildTypes {
release {
minifyEnabled false //是否混淆
shrinkResources false
debuggable false
jniDebuggable false
signingConfig signingConfigs.debug
buildConfigField("boolean", "SHOW_LOG", "false")//是否显示log信息
buildConfigField("boolean", "SAVE_LOG_TO_SDCARD", "false")//是否将log信息保存到sd卡
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "APPVsn", sprintf("\"%s\"", APP_VSN))
}
debug {
minifyEnabled false//是否混淆
shrinkResources false
debuggable true
jniDebuggable true
signingConfig signingConfigs.debug
buildConfigField("boolean", "SHOW_LOG", "true")//是否显示log信息
buildConfigField("boolean", "SAVE_LOG_TO_SDCARD", "false")//是否将log信息保存到sd卡
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField("String", "APPVsn", sprintf("\"%s\"", APP_VSN))
}
}
//android SDK 6.0以后取消了HttpClient相关jar包,如果需要使用需要添加这行代码
// useLibrary 'org.apache.http.legacy'
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
// 生成的包名信息
android.applicationVariants.all { variant ->
variant.outputs.all {
def date = new Date().format("yyyyMMddHHmmss", TimeZone.getTimeZone("GMT+08"))
outputFileName = "mctower_V" + "${variant.versionName}_${date}_" + variant.buildType.name + ".apk"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.6'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//xUtils
implementation files('libs/xUtils-2.6.14.jar')
//身份证相关库
implementation files('libs/idcard.jar')
implementation files('libs/invsusb.jar')
//KLog
implementation 'com.github.zhaokaiqiang.klog:library:1.6.0'
//权限检测库
implementation 'pub.devrel:easypermissions:1.2.0'
//gson
implementation 'com.google.code.gson:gson:2.8.5'
//网络图片加载
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
//图片加载库,后续适配androidx的时候,升级PhotoView版本
api 'com.github.LuckSiege.PictureSelector:picture_library:v2.2.9'
//七牛
implementation 'com.qiniu:qiniu-android-sdk:7.3.15'
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation 'com.tencent.bugly:nativecrashreport:latest.release'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# 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 *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-dontwarn com.tencent.bugly.**
#-keep public class com.tencent.bugly.**{*;}
\ No newline at end of file
package cn.mctower.visitor;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("cn.mctower.visitor", appContext.getPackageName());
}
}
<?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="cn.mctower.visitor">
<application
android:name=".MCTowerApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".MainActivity"
android:theme="@style/Theme.MyAppCompatTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DetailActivity"
android:theme="@style/Theme.MyAppCompatTheme"
android:windowSoftInputMode="adjustPan"/>
<service android:name="com.brilliants.idcardlib.IDCardService"/>
</application>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" />
</manifest>
\ No newline at end of file
package cn.dankal.base.activity;
import android.app.ActionBar;
import android.app.Dialog;
import cn.dankal.base.dialog.BaseLoadingDialog;
import cn.dankal.base.interfaces.INetBaseInterface;
import cn.mctower.visitor.R;
/**
* @类名: NetBaseActivity
* @功能描述: 网络基础Activity
* @创建人: Alex
*/
public class NetBaseAppCompatActivity extends BaseAppCompatActivity implements INetBaseInterface {
public static final String TAG = "NetBaseAppCompatActivity";
/**
* 操作提示Dialog
*/
protected String title = "";
protected ActionBar actionBar;
public Dialog mAlertDialog;
@Override
public Dialog createDialog() {
if (mAlertDialog == null)
mAlertDialog = new BaseLoadingDialog(this, R.style.basedDialogStyle);
return mAlertDialog;
}
@Override
protected void onDestroy() {
if (mAlertDialog != null && mAlertDialog.isShowing()) {
mAlertDialog.dismiss();
}
super.onDestroy();
}
/**
* 显示加载动画
*/
public void showLoadingDialog(){
createDialog();
mAlertDialog.show();
}
/**
* 关闭加载动画
*/
public void dismmisLoadingDialog(){
if(mAlertDialog != null && mAlertDialog.isShowing())
mAlertDialog.dismiss();
}
}
package cn.dankal.base.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import cn.dankal.base.utils.UIUtil;
import cn.mctower.visitor.R;
public class BaseLoadingDialog extends Dialog {
public BaseLoadingDialog(Context context, int theme) {
super(context, theme);
View view = LayoutInflater.from(context).inflate(
R.layout.base_dialog_circle, null);
//设定布局
this.getWindow().setGravity(Gravity.CENTER);
this.getWindow().setLayout(UIUtil.Dp2Px(context,60),UIUtil.Dp2Px(context,60));
this.getWindow().setContentView(view);
this.setCanceledOnTouchOutside(false);
}
@Override
public void onBackPressed() {
//进度条显示时不允许后退
if(this.isShowing())
return;
else
super.onBackPressed();
}
}
package cn.dankal.base.http;
import android.app.Dialog;
import android.text.TextUtils;
import org.json.JSONException;
import org.json.JSONObject;
import cn.dankal.base.activity.NetBaseAppCompatActivity;
import cn.dankal.base.interfaces.IHttpCallBack;
import cn.dankal.base.interfaces.INetBaseInterface;
import cn.dankal.base.utils.LogUtils;
public class DialogHttpCallBack implements IHttpCallBack {
/**
* 操作提示Dialog
*/
private Dialog mAlertDialog;
private INetBaseInterface activity;
public String msg = "";
public boolean showInfoWhenRequestSuccess = true;
public DialogHttpCallBack(INetBaseInterface activity) {
this.activity = activity;
this.mAlertDialog = activity.createDialog();
}
public DialogHttpCallBack(INetBaseInterface activity,boolean autoShowInfo) {
this(activity);
showInfoWhenRequestSuccess = autoShowInfo;
}
@Override
public void requestStart() {
if (mAlertDialog == null) {
mAlertDialog = activity.createDialog();
}
if(activity != null){
if(activity instanceof NetBaseAppCompatActivity){
if(((NetBaseAppCompatActivity)activity).isFinishing()){
return;
}else{
mAlertDialog.show();
}
}else
return;
}
}
/**
* 请求成功,如果服务器返回状态为1时,会对用户的基本信息进行本地保存
* @param result
*/
@Override
public void requestSuccess(String result) {
successCallBack(result);
}
/**
* 当服务器返回状态为0时调用该接口
* @param result
*/
@Override
public void requestFailure(String code, String result) {
activity.show(result);
}
@Override
public void requestOffLine() {
}
@Override
public void requestFinish() {
if (mAlertDialog != null && mAlertDialog.isShowing()) {
mAlertDialog.cancel();
}
}
/**
* 当服务器返回状态为1时调用该接口返回data属性的string内容
* @param result
*/
@Override
public void successCallBack(String result) {
}
@Override
public void downLoadSuccess(String result) {
}
@Override
public void downLoadFailure(String result) {
}
@Override
public void saveUserVarsData(String varsJson) {
}
public String getInfo(){
return msg;
}
}
package cn.dankal.base.http;
import cn.dankal.base.interfaces.IDownloadFileCallBack;
/**
* Created by Alex Tang on 2016/5/17.
*/
public class FileDownloadHttpCallBack implements IDownloadFileCallBack {
@Override
public void downloadStart() {
}
@Override
public void downloadSuccess(String result) {
}
@Override
public void downloadFailure(String result) {
}
}
package cn.dankal.base.http;
import android.text.TextUtils;
import android.widget.Toast;
import org.json.JSONException;
import org.json.JSONObject;
import cn.dankal.base.interfaces.IHttpCallBack;
import cn.dankal.base.utils.LogUtils;
import cn.mctower.visitor.MCTowerApplication;
public class HttpCallBack implements IHttpCallBack {
@Override
public void requestStart() {
}
/**
* 请求成功,如果服务器返回状态为1时,会对用户的基本信息进行本地保存
* @param result
*/
@Override
public void requestSuccess(String result) {
String msg;
try {
JSONObject obj = new JSONObject(result);
int status = obj.optInt("status", 0);
if (status == 200) {
String data = obj.optString("data");
String vars = obj.optString("vars");
if(!TextUtils.isEmpty(vars)){
saveUserVarsData(vars);
}
data = data.replace("\"page\":[]","\"page\":{}");
data = data.replace("\"page\":\"\"","\"page\":{}");
data = data.replace("\"last_time\":[]","\"last_time\":{}");
successCallBack(data);
} else {
msg = obj.optString("info", "服务器繁忙,请稍后再试!");
requestFailure(String.valueOf(status),msg);
}
} catch (JSONException e) {
msg = "服务器返回数据出错!";
requestFailure("-1",msg);//app数据解析错误
LogUtils.e("解析失败", e.getMessage());
}
}
/**
* 当服务器返回状态为0时调用该接口
* @param result
*/
@Override
public void requestFailure(String code, String result) {
Toast.makeText(MCTowerApplication.getContext(), result, Toast.LENGTH_SHORT).show();
}
@Override
public void requestOffLine() {
}
@Override
public void requestFinish() {
}
/**
* 当服务器返回状态为1时调用该接口返回data属性的string内容
* @param result
*/
@Override
public void successCallBack(String result) {
}
@Override
public void downLoadSuccess(String result) {
}
@Override
public void downLoadFailure(String result) {
}
@Override
public void saveUserVarsData(String varsJson) {
}
}
package cn.dankal.base.http;
import com.lidroid.xutils.db.annotation.Column;
import com.lidroid.xutils.db.annotation.Id;
import com.lidroid.xutils.db.annotation.Table;
/**
* 创建日期:2017/3/23 on 11:09
* 描述:
* 作者: Alex tang
*/
@Table(name = "httpLog")
public class HttpPostLogBean {
@Id
public String url;
@Column(column = "startTime")
public long startTime;
public long endTime;
public double serverGetRequestTime;
public String apiProcessTime;
public double serverSendResponseTime;
public boolean requestIsSuccess;
}
package cn.dankal.base.http;
import android.text.TextUtils;
import com.google.gson.Gson;
import org.json.JSONException;
import org.json.JSONObject;
import cn.dankal.base.interfaces.IHttpCallBack;
import cn.dankal.base.utils.LogUtils;
public class NOToastHttpCallBack implements IHttpCallBack {
public static final String TAG = NOToastHttpCallBack.class.getSimpleName();
private boolean needLoginWithLocaldata = true;
public NOToastHttpCallBack(){
}
public NOToastHttpCallBack(boolean needLoginWithLocaldata){
this.needLoginWithLocaldata = needLoginWithLocaldata;
}
@Override
public void requestStart() {
}
/**
* 请求成功,如果服务器返回状态为1时,会对用户的基本信息进行本地保存
* @param result
*/
@Override
public void requestSuccess(String result) {
successCallBack(result);
}
/**
* 当服务器返回状态为0时调用该接口
* @param result
*/
@Override
public void requestFailure(String code, String result) {
LogUtils.e("请求失败", result);
}
@Override
public void requestOffLine() {
}
@Override
public void requestFinish() {
}
/**
* 当服务器返回状态为1时调用该接口返回data属性的string内容
* @param result
*/
@Override
public void successCallBack(String result) {
}
@Override
public void downLoadSuccess(String result) {
}
@Override
public void downLoadFailure(String result) {
}
@Override
public void saveUserVarsData(String varsJson) {
LogUtils.e("AAAA","**** saveUserVarsData");
Gson gson = new Gson();
}
}
package cn.dankal.base.http;
import cn.dankal.base.interfaces.IHttpCallBack;
import cn.dankal.base.utils.LogUtils;
public class NoDataProcessNOToastHttpCallBack implements IHttpCallBack {
public static final String TAG = NoDataProcessNOToastHttpCallBack.class.getSimpleName();
@Override
public void requestStart() {
}
/**
* 请求成功,如果服务器返回状态为1时,会对用户的基本信息进行本地保存
* @param result
*/
@Override
public void requestSuccess(String result) {
}
/**
* 当服务器返回状态为0时调用该接口
* @param result
*/
@Override
public void requestFailure(String code, String result) {
LogUtils.e("请求失败", result);
}
@Override
public void requestOffLine() {
}
@Override
public void requestFinish() {
}
/**
* 当服务器返回状态为1时调用该接口返回data属性的string内容
* @param result
*/
@Override
public void successCallBack(String result) {
}
@Override
public void downLoadSuccess(String result) {
}
@Override
public void downLoadFailure(String result) {
}
@Override
public void saveUserVarsData(String varsJson) {
}
}
package cn.dankal.base.interfaces;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
/**
* @类名: IBaseInterface
* @功能描述: 界面通用接口类
* @创建人: Alex
* @创建时间: 2015-10-9 下午3:16:18
*/
public interface IBaseInterface {
/**
* 显示Toast形式的提示信息
*
* @param message
*/
public abstract void show(String message);
/**
* 显示提示
*
* @param resourceId
*/
public abstract void show(int resourceId);
/**
* 根据id获取控件
* @param id
* @return
*/
public abstract <E extends View> E getView(int id);
/**
* 跳转界面
* @param clazz
*/
public abstract void jumpActivity(Class<? extends Activity> clazz, boolean needLogin);
/**
* 跳转界面
* @param clazz
* @param flag
*/
public abstract void jumpActivity(Class<? extends Activity> clazz, int flag, boolean needLogin);
/**
* 跳转界面
* @param clazz
* @param requestCode
*/
public abstract void jumpActivityForResult(Class<? extends Activity> clazz,
int requestCode, boolean needLogin);
/**
* 跳转界面
* @param clazz
* @param data
* @param requestCode
*/
public void jumpActivityForResult(Class<? extends Activity> clazz, Bundle data,
int requestCode, boolean needLogin);
/**
* 跳转界面
* @param clazz
* @param data
*/
public abstract void jumpActivity(Class<? extends Activity> clazz,
Bundle data, boolean needLogin);
/**
* 跳转界面
* @param clazz
* @param data
* @param flag
*/
public abstract void jumpActivity(Class<? extends Activity> clazz,
Bundle data, int flag, boolean needLogin);
/**
* 跳转界面
* @param intent
*/
public abstract void jumpActivity(Intent intent, boolean needLogin);
/**
* 是否登录了
* @return
*/
boolean isLogined();
}
\ No newline at end of file
package cn.dankal.base.interfaces;
/**
* Created by Alex Tang on 2016/4/25.
*/
public interface IBottomBtnsDialogInterface {
public void onButtomClick(Object bean);
}
package cn.dankal.base.interfaces;
public interface IDownloadFileCallBack {
public void downloadStart();
public void downloadSuccess(String result);
public void downloadFailure(String result);
}
package cn.dankal.base.interfaces;
/**
* Created by Alex Tang on 2015/12/9.
*/
public interface IHomepageTagChangeInterface {
void changeTagSelectedStatus(int id);
void changeToMallRebateCuponPage();
}
package cn.dankal.base.interfaces;
import android.content.Intent;
/**
* Created by Alex Tang on 2017/1/11.
*/
public interface IHotpicJumpCallBack {
public void doJump(Intent intent);
public void doCloseCurrentPage();
public void doSendBroadcast(Intent intent);
public void postRunnable(Runnable runnable);
}
package cn.dankal.base.interfaces;
public interface IHttpCallBack {
public void requestStart();
public void requestSuccess(String result);
public void requestFailure(String code, String result);
public void requestOffLine();
public void requestFinish();
public void successCallBack(String result);
public void downLoadSuccess(String result);
public void downLoadFailure(String result);
/**
* 保存接口返回的用户基础数据
*/
public void saveUserVarsData(String varsJson);
}
package cn.dankal.base.interfaces;
public interface IHttpPostFileCallBack {
public void requestStart();
public void requestFailure(String result);
public void requestOffLine();
public void requestFinish();
public void successCallBack(String result);
public void onCancle();
public void onLoading(long total, long current);
}
package cn.dankal.base.interfaces;
import android.app.Dialog;
/**
* @类名: INetBaseInterface
* @功能描述: 有网络请求界面通用接口
* @创建人: Alex
* @创建时间: 2015-10-9 下午3:16:49
*/
public interface INetBaseInterface extends IBaseInterface {
/**
* 创建操作提示Dialog
* @return
*/
public abstract Dialog createDialog();
/**
* 显示加载动画
*/
public void showLoadingDialog();
/**
* 关闭加载动画
*/
public void dismmisLoadingDialog();
}
\ No newline at end of file
package cn.dankal.base.interfaces;
import android.widget.ImageView;
/**
* Created by Alex Tang on 2015/10/28.
*/
public interface INetPicInterface {
void display(ImageView container, String url);
void display(ImageView container, String url, INetPicLoadCallBack callback);
void displayLocalPic(ImageView container, String picPath);
}
package cn.dankal.base.interfaces;
import android.graphics.Bitmap;
import android.widget.ImageView;
/**
* Created by Alex Tang on 2015/12/4.
*/
public interface INetPicLoadCallBack {
void onLoadCompleted(ImageView imageView, String url, Bitmap bitmap);
void onLoadFailed(ImageView imageView, String url);
}
package cn.dankal.base.interfaces;
/**
* 创建日期:2019/2/22 on 3:31 PM
* 描述:
* 作者:Alex tang
*/
public interface IOnGoodsItemMenuClickedListener {
void onDelete(int position);
void onShare(int position);
}
package cn.dankal.base.interfaces;
/**
* 创建日期:2018/12/14 on 10:59 AM
* 描述:
* 作者:Alex tang
*/
public interface IPermissionCheck {
public void hasGotPermissions(int code);
}
package cn.dankal.base.interfaces;
/**
* Created by Alex Tang on 2016/2/17.
*/
public interface IPhotoGotResult {
void gotPhotoSuccess(String photoFilePath);
}
package cn.dankal.base.interfaces;
import android.view.View;
/**
* Created by Alex Tang on 2016/11/9.
*/
public interface ISuperDetailPageViewClickListener {
public static final int TYPE_SHARE_BUTTON = 1;
public static final int TYPE_QUESTION_MARK = 2;
void onViewClicked(View view, int type);
}
package cn.dankal.base.interfaces;
import android.webkit.WebView;
/**
* Created by Alex Tang on 2015/12/11.
*/
public interface IWebViewJsClassLoadInterface {
/**
* 为webview添加js交互方法类
* @param webView
*/
void addJsInteracteClass(WebView webView);
}
package cn.dankal.base.interfaces;
public interface OnCustomCalendarChangeLisenter {
public void onDaySelected(String selectedDay);
public void onDayUnselected(String unselectedDay);
public void onMonthChanged(int currentMonth);
public void onYearChanged(int currentYear);
}
package cn.dankal.base.utils;
import android.content.Context;
import android.text.TextUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import cn.mctower.visitor.Constant;
/**
* Created by Alex Tang on 2015/12/15.
*/
public class FileUtils {
public static final String TAG = FileUtils.class.getSimpleName();
protected static final String mSdcardDataDir = Constant.BaseImagesDir;
/**
* 删除文件
*
* @param path
*/
public static void deleteFile(String path) {
File file = new File(path);
if (file.exists())
file.delete();
}
/**
* 删除文件件夹
* @param pPath
*/
public static void deleteDir(final String pPath) {
File dir = new File(pPath);
deleteDirWihtFile(dir);
}
public static void deleteDirWihtFile(File dir) {
if (dir == null || !dir.exists() || !dir.isDirectory())
return;
if(dir.listFiles() == null)
return;
for (File file : dir.listFiles()) {
if (file.isFile())
file.delete(); // 删除所有文件
else if (file.isDirectory())
deleteDirWihtFile(file); // 递规的方式删除文件夹
}
dir.delete();// 删除目录本身
}
public static File copy(Context context, String fileName, String destPath) {
try {
InputStream is = context.getAssets().open(fileName);
File file = new File(destPath);
FileOutputStream fos = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int len = 0;
while ((len = is.read(buffer)) != -1) {
fos.write(buffer, 0, len);
}
fos.flush();
fos.close();
is.close();
return file;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 查找指定目录下的指定文件
* @param dir
* @param fileName
* @return
*/
public static File getFile(String dir, String fileName) {
File fileDir = new File(dir);
if (fileDir.isDirectory()) {
File[] fileArray = fileDir.listFiles();
if (null != fileArray && 0 != fileArray.length) {
for (File file : fileArray) {
if (TextUtils.equals(fileName, file.getName())) {
return file;
}
}
}
}
return null;
}
public static long getDirectorySize(File directory){
long size = 0;
LogUtils.e("aaa","directory ="+directory.getAbsolutePath());
File[] files = directory.listFiles();
for(File file : files){
if(file.isFile()){
size += file.length();
LogUtils.e("aaa","file ="+file.getAbsolutePath());
LogUtils.e("aaa","file size = "+file.length());
}else{
size = getDirectorySize(file);
}
}
return size;
}
}
package cn.dankal.base.utils;
import android.util.Log;
import com.lidroid.xutils.http.RequestParams;
import com.socks.library.KLog;
import org.apache.http.NameValuePair;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.List;
import cn.mctower.visitor.Constant;
public final class LogUtils {
private static boolean sIsLogEnabled = true;// 是否打开LOG
// private static boolean sIsLogEnabled = true;// 是否打开LOG
private static String sApplicationTag = "com.mctower";// LOG默认TAG
private static final String TAG_CONTENT_PRINT = "%s:%s.%s:%d";
private static StackTraceElement getCurrentStackTraceElement() {
return Thread.currentThread().getStackTrace()[4];
}
// 打印LOG
public static void trace() {
if (sIsLogEnabled) {
KLog.d(getContent(getCurrentStackTraceElement()));
}
}
// 获取LOG
private static String getContent(StackTraceElement trace) {
return String.format(TAG_CONTENT_PRINT, sApplicationTag,
trace.getClassName(), trace.getMethodName(),
trace.getLineNumber());
}
// 打印默认TAG的LOG
public static void traceStack() {
if (sIsLogEnabled) {
traceStack(sApplicationTag, Log.ERROR);
}
}
// 打印Log当前调用栈信�?
public static void traceStack(String tag, int priority) {
if (sIsLogEnabled) {
StackTraceElement[] stackTrace = Thread.currentThread()
.getStackTrace();
Log.println(priority, tag, stackTrace[4].toString());
StringBuilder str = new StringBuilder();
String prevClass = null;
for (int i = 5; i < stackTrace.length; i++) {
String className = stackTrace[i].getFileName();
int idx = className.indexOf(".java");
if (idx >= 0) {
className = className.substring(0, idx);
}
if (prevClass == null || !prevClass.equals(className)) {
str.append(className.substring(0, idx));
}
prevClass = className;
str.append(".").append(stackTrace[i].getMethodName())
.append(":").append(stackTrace[i].getLineNumber())
.append("->");
}
Log.println(priority, tag, str.toString());
}
}
// 指定TAG和指定内容的方法
public static void d(String tag, String msg) {
if (sIsLogEnabled) {
KLog.d(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
}
}
// 默认TAG和制定内容的方法
public static void d(String msg) {
if (sIsLogEnabled) {
KLog.d(sApplicationTag, getContent(getCurrentStackTraceElement())
+ ">" + msg);
}
}
// 下面的定义和上面方法相同,可以定义不同等级的Debugger
public static void i(String tag, String msg) {
if (sIsLogEnabled) {
KLog.i(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
}
}
public static void w(String tag, String msg) {
if (sIsLogEnabled) {
KLog.w(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
}
}
public static void v(String tag, String msg) {
if (sIsLogEnabled) {
KLog.v(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
}
}
public static void e(String tag, String msg) {
if (sIsLogEnabled) {
KLog.e(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
}
}
public static void r(String tag, String msg) {
e(tag,msg);
/*if (sIsLogEnabled) {
Log.e(tag, getContent(getCurrentStackTraceElement()) + ">" + msg);
saveToFile(tag + "-->" + getContent(getCurrentStackTraceElement()) + ">" + msg);
}*/
}
public static void json(String tag, String json){
if (sIsLogEnabled) {
KLog.json(tag, json);
}
}
public static void json(String json){
if (sIsLogEnabled) {
KLog.json(json);
}
}
}
package cn.dankal.base.utils;
import android.graphics.Bitmap;
import android.view.View;
import android.widget.ImageView;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.FailReason;
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener;
import cn.dankal.base.interfaces.INetPicInterface;
import cn.dankal.base.interfaces.INetPicLoadCallBack;
/**
* Created by Alex Tang on 2016/4/19.
*/
public class NetPicUtil implements INetPicInterface {
private DisplayImageOptions options;
public NetPicUtil(){
options = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
}
public NetPicUtil(int loadingPicResId, int emptyUrlPicResId, int loadFailPicResId){
options = new DisplayImageOptions.Builder()
.showImageOnLoading(loadingPicResId)
.showImageForEmptyUri(emptyUrlPicResId)
.showImageOnFail(loadFailPicResId)
.cacheInMemory(true)
.cacheOnDisk(true)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
}
@Override
public void display(ImageView container, String url) {
ImageLoader.getInstance().displayImage(url,container,options);
}
public void display(ImageView container, String url, final INetPicLoadCallBack callBack) {
ImageLoader.getInstance().displayImage(url, container, new ImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
if(callBack != null)
callBack.onLoadFailed((ImageView)view,imageUri);
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
if(callBack != null)
callBack.onLoadCompleted((ImageView)view,imageUri,loadedImage);
}
@Override
public void onLoadingCancelled(String imageUri, View view) {
}
});
}
@Override
public void displayLocalPic(ImageView container, String picPath) {
ImageLoader.getInstance().displayImage(picPath,container);
}
public void setOptions(DisplayImageOptions option){
options = option;
}
public void setDefaultPics(int loadingPicId,int emptyUriPicId,int loadFailurePicId){
options = new DisplayImageOptions.Builder()
.showImageOnLoading(loadingPicId)
.showImageForEmptyUri(emptyUriPicId)
.showImageOnFail(loadFailurePicId)
.cacheInMemory(true)
.cacheOnDisk(true)
.considerExifParams(true)
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
}
}
package cn.dankal.base.utils;
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
/**
* 创建日期:2019/4/1 on 11:07 AM
* 描述:
* 作者:Alex tang
*/
public class RealPathFromUriUtils {
/**
* 根据Uri获取图片的绝对路径
*
* @param context 上下文对象
* @param uri 图片的Uri
* @return 如果Uri对应的图片存在, 那么返回该图片的绝对路径, 否则返回null
*/
public static String getRealPathFromUri(Context context, Uri uri) {
int sdkVersion = Build.VERSION.SDK_INT;
if (sdkVersion >= 19) { // api >= 19
return getRealPathFromUriAboveApi19(context, uri);
} else { // api < 19
return getRealPathFromUriBelowAPI19(context, uri);
}
}
/**
* 适配api19以下(不包括api19),根据uri获取图片的绝对路径
*
* @param context 上下文对象
* @param uri 图片的Uri
* @return 如果Uri对应的图片存在, 那么返回该图片的绝对路径, 否则返回null
*/
private static String getRealPathFromUriBelowAPI19(Context context, Uri uri) {
return getDataColumn(context, uri, null, null);
}
/**
* 适配api19及以上,根据uri获取图片的绝对路径
*
* @param context 上下文对象
* @param uri 图片的Uri
* @return 如果Uri对应的图片存在, 那么返回该图片的绝对路径, 否则返回null
*/
@SuppressLint("NewApi")
private static String getRealPathFromUriAboveApi19(Context context, Uri uri) {
String filePath = null;
if (DocumentsContract.isDocumentUri(context, uri)) {
// 如果是document类型的 uri, 则通过document id来进行处理
String documentId = DocumentsContract.getDocumentId(uri);
if (isMediaDocument(uri)) { // MediaProvider
// 使用':'分割
String id = documentId.split(":")[1];
String selection = MediaStore.Images.Media._ID + "=?";
String[] selectionArgs = {id};
filePath = getDataColumn(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection, selectionArgs);
} else if (isDownloadsDocument(uri)) { // DownloadsProvider
Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(documentId));
filePath = getDataColumn(context, contentUri, null, null);
}
} else if ("content".equalsIgnoreCase(uri.getScheme())) {
// 如果是 content 类型的 Uri
filePath = getDataColumn(context, uri, null, null);
} else if ("file".equals(uri.getScheme())) {
// 如果是 file 类型的 Uri,直接获取图片对应的路径
filePath = uri.getPath();
}
return filePath;
}
/**
* 获取数据库表中的 _data 列,即返回Uri对应的文件路径
*
* @return
*/
private static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
String path = null;
String[] projection = new String[]{MediaStore.Images.Media.DATA};
Cursor cursor = null;
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
int columnIndex = cursor.getColumnIndexOrThrow(projection[0]);
path = cursor.getString(columnIndex);
}
} catch (Exception e) {
if (cursor != null) {
cursor.close();
}
}
return path;
}
/**
* @param uri the Uri to check
* @return Whether the Uri authority is MediaProvider
*/
private static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
/**
* @param uri the Uri to check
* @return Whether the Uri authority is DownloadsProvider
*/
private static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
}
package cn.dankal.base.utils;
import android.content.Context;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
/**
* 屏幕工具类--获取手机屏幕信息
*
* @author zihao
*
*/
public class ScreenUtil {
/**
* 获取屏幕的宽度
*
* @param context
* @return
*/
public static int getScreenWidth(Context context) {
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
return display.getWidth();
}
/**
* 获取屏幕的高度
*
* @param context
* @return
*/
public static int getScreenHeight(Context context) {
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();
return display.getHeight();
}
/**
* 获取屏幕中控件顶部位置的高度--即控件顶部的Y点
*
* @return
*/
public static int getScreenViewTopHeight(View view) {
return view.getTop();
}
/**
* 获取屏幕中控件底部位置的高度--即控件底部的Y点
*
* @return
*/
public static int getScreenViewBottomHeight(View view) {
return view.getBottom();
}
/**
* 获取屏幕中控件左侧的位置--即控件左侧的X点
*
* @return
*/
public static int getScreenViewLeftHeight(View view) {
return view.getLeft();
}
/**
* 获取屏幕中控件右侧的位置--即控件右侧的X点
*
* @return
*/
public static int getScreenViewRightHeight(View view) {
return view.getRight();
}
}
\ No newline at end of file
package cn.dankal.base.utils;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.StreamCorruptedException;
import cn.mctower.visitor.MCTowerApplication;
public class SharedPreferenceHelper {
public static final String TAG = SharedPreferenceHelper.class.getSimpleName();
public static void saveSharedPreferences(String key, String value) {
SharedPreferences mPre;
SharedPreferences.Editor mEditor;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
mEditor = mPre.edit();
mEditor.putString(key, value);
mEditor.commit();
}
public static void saveSharedPreferencesLong(String key, long value) {
SharedPreferences mPre;
SharedPreferences.Editor mEditor;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
mEditor = mPre.edit();
mEditor.putLong(key, value);
mEditor.commit();
}
public static void saveSharedPreferencesInt(String key, int value) {
SharedPreferences mPre;
SharedPreferences.Editor mEditor;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
mEditor = mPre.edit();
mEditor.putInt(key, value);
mEditor.commit();
}
public static void saveSharedPreferences(String key, boolean value) {
SharedPreferences mPre;
SharedPreferences.Editor mEditor;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
mEditor = mPre.edit();
mEditor.putBoolean(key, value);
mEditor.commit();
}
public static String getSharedPreferences(String key) {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
String value = mPre.getString(key, "");
return value;
}
public static String getSharedPreferences(String key, String defValue) {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
String value = mPre.getString(key, defValue);
return value;
}
public static long getSharedPreferencesLong(String key) {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
long value = mPre.getLong(key, 0);
return value;
}
public static int getSharedPreferencesInt(String key) {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
int value = mPre.getInt(key, 0);
return value;
}
public static boolean getSharedPreferencesBoolean(String key) {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
return mPre.getBoolean(key, false);
}
/**
* 将对象保存在SharedPreferences中
* @param obj
* @param key
*/
public static void saveSharedPreferencesObject(Object obj , String key){
if(obj == null){
SharedPreferenceHelper.saveSharedPreferences(key,"");
}else {
try {
// 保存对象
SharedPreferences mPre;
SharedPreferences.Editor mEditor;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
mEditor = mPre.edit();
//先将序列化结果写到byte缓存中,其实就分配一个内存空间
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream os = new ObjectOutputStream(bos);
//将对象序列化写入byte缓存
os.writeObject(obj);
//将序列化的数据转为16进制保存
String bytesToHexString = bytesToHexString(bos.toByteArray());
//保存该16进制数组
mEditor.putString(key, bytesToHexString);
mEditor.commit();
} catch (IOException e) {
e.printStackTrace();
LogUtils.e(TAG, "保存obj失败");
}
}
}
/**
* 从SharedPreferences中获取对象
* @param key
* @return
*/
public static Object getSharedPreferencesObject(String key){
try {
SharedPreferences mPre;
mPre = PreferenceManager.getDefaultSharedPreferences(MCTowerApplication
.getContext());
if (mPre.contains(key)) {
String string = mPre.getString(key, "");
if(TextUtils.isEmpty(string)){
return null;
}else{
//将16进制的数据转为数组,准备反序列化
byte[] stringToBytes = stringToBytes(string);
ByteArrayInputStream bis=new ByteArrayInputStream(stringToBytes);
ObjectInputStream is=new ObjectInputStream(bis);
//返回反序列化得到的对象
Object readObject = is.readObject();
return readObject;
}
}
} catch (StreamCorruptedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
//所有异常返回null
return null;
}
/*public static void setUserSharedPreferencesFile(Context context,String uid){
File file = null;
if(!TextUtils.isEmpty(uid)){
file = new File(File.separator+"data"+File.separator+"data"+File.separator+context.getPackageName() +
"shared_prefs"+File.separator+"com.geihui_preferences.xml");
}else{
file = new File(File.separator+"data"+File.separator+"data"+File.separator+context.getPackageName() +
"shared_prefs"+File.separator+"uid_"+uid+".xml");
}
if(file.exists()){
LogUtils.e("aaaaaaa", "fille exists");
}
}*/
/**
* desc:将数组转为16进制
* @param bArray
* @return
* modified:
*/
public static String bytesToHexString(byte[] bArray) {
if(bArray == null){
return null;
}
if(bArray.length == 0){
return "";
}
StringBuffer sb = new StringBuffer(bArray.length);
String sTemp;
for (int i = 0; i < bArray.length; i++) {
sTemp = Integer.toHexString(0xFF & bArray[i]);
if (sTemp.length() < 2)
sb.append(0);
sb.append(sTemp.toUpperCase());
}
return sb.toString();
}
/**
* desc:将16进制的数据转为数组
* <p>创建人:聂旭阳 , 2014-5-25 上午11:08:33</p>
* @param data
* @return
* modified:
*/
public static byte[] stringToBytes(String data){
String hexString=data.toUpperCase().trim();
if (hexString.length()%2!=0) {
return null;
}
byte[] retData=new byte[hexString.length()/2];
for(int i=0;i<hexString.length();i++)
{
int int_ch; // 两位16进制数转化后的10进制数
char hex_char1 = hexString.charAt(i); ////两位16进制数中的第一位(高位*16)
int int_ch1;
if(hex_char1 >= '0' && hex_char1 <='9')
int_ch1 = (hex_char1-48)*16; //// 0 的Ascll - 48
else if(hex_char1 >= 'A' && hex_char1 <='F')
int_ch1 = (hex_char1-55)*16; //// A 的Ascll - 65
else
return null;
i++;
char hex_char2 = hexString.charAt(i); ///两位16进制数中的第二位(低位)
int int_ch2;
if(hex_char2 >= '0' && hex_char2 <='9')
int_ch2 = (hex_char2-48); //// 0 的Ascll - 48
else if(hex_char2 >= 'A' && hex_char2 <='F')
int_ch2 = hex_char2-55; //// A 的Ascll - 65
else
return null;
int_ch = int_ch1+int_ch2;
retData[i/2]=(byte) int_ch;//将转化后的数放入Byte里
}
return retData;
}
}
package cn.dankal.base.utils;
import android.text.TextUtils;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class StringUtils {
/**
* 将每三个数字加上逗号处理(通常使用金额方面的编辑)
*
* @param str
* 无逗号的数字
* @return 加上逗号的数字
*/
public static String addComma(String str) {
// 将传进数字反转
String reverseStr = new StringBuilder(str).reverse().toString();
String strTemp = "";
for (int i = 0; i < reverseStr.length(); i++) {
if (i * 3 + 3 > reverseStr.length()) {
strTemp += reverseStr.substring(i * 3, reverseStr.length());
break;
}
strTemp += reverseStr.substring(i * 3, i * 3 + 3) + ",";
}
// 将 【789,456,】 中最后一个【,】去除
if (strTemp.endsWith(",")) {
strTemp = strTemp.substring(0, strTemp.length() - 1);
}
// 将数字重新反转
String resultStr = new StringBuilder(strTemp).reverse().toString();
return resultStr;
}
/**
* 将带有分隔符的string装换为List<String>
*
* @param str
* @param regularExpression
* @return
*/
public static List<String> string2List(String str, String regularExpression) {
List<String> result = null;
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(regularExpression)) {
String[] temp = str.split(regularExpression);
if (temp != null) {
result = new ArrayList<String>();
for (String obj : temp) {
result.add(obj);
}
}
}
return result;
}
/**
* 将List<String> 转换为已regularExpression为分隔符的String
*
* @param regularExpression
* @return
*/
public static String list2String(List<String> data, String regularExpression) {
String result = null;
if (data != null && !TextUtils.isEmpty(regularExpression)) {
StringBuffer buffer = new StringBuffer("");
for (String temp : data) {
if (buffer.toString().equals(""))
buffer.append(temp);
else
buffer.append(regularExpression + temp);
}
result = buffer.toString();
}
return result;
}
public static String intToIp(int i) {
return (i & 0xFF) + "." + ((i >> 8) & 0xFF) + "." + ((i >> 16) & 0xFF)
+ "." + (i >> 24 & 0xFF);
}
/**
* 解析出url请求的路径,包括页面
*
* @param strURL
* url地址
* @return url路径
*/
public static String UrlPage(String strURL) {
String strPage = null;
String[] arrSplit = null;
strURL = strURL.trim();
arrSplit = strURL.split("[?]");
if (strURL.length() > 0) {
if (arrSplit.length > 1) {
if (arrSplit[0] != null) {
strPage = arrSplit[0];
}
}
}
return strPage;
}
/**
* 去掉url中的路径,留下请求参数部分
*
* @param strURL url地址
* @return url请求参数部分
*/
private static String TruncateUrlPage(String strURL) {
String strAllParam = null;
String[] arrSplit = null;
strURL = strURL.trim();
arrSplit = strURL.split("[?]");
if (strURL.length() > 1) {
if (arrSplit.length > 1) {
if (arrSplit[1] != null) {
strAllParam = arrSplit[1];
}
}
}
return strAllParam;
}
/**
* 解析出url参数中的键值对 如 "index.jsp?Action=del&id=123",解析出Action:del,id:123存入map中
*
* @param url url地址
* @return url请求参数部分
*/
public static Map<String, String> URLRequest(String url) {
Map<String, String> mapRequest = new HashMap<String, String>();
String[] arrSplit = null;
String strUrlParam = TruncateUrlPage(url);
if (strUrlParam == null) {
return mapRequest;
}
// 每个键值为一组 www.2cto.com
arrSplit = strUrlParam.split("[&]");
for (String strSplit : arrSplit) {
String[] arrSplitEqual = null;
arrSplitEqual = strSplit.split("[=]");
// 解析出键值
if (arrSplitEqual.length > 1) {
// 正确解析
mapRequest.put(arrSplitEqual[0], arrSplitEqual[1]);
} else {
if (arrSplitEqual[0] != "") {
// 只有参数没有值,不加入
mapRequest.put(arrSplitEqual[0], "");
}
}
}
return mapRequest;
}
/**
* 生成随机字符串
* @param length
* @return
*/
public static String getRandomString(int length) { //length表示生成字符串的长度
String base = "abcdefghijklmnopqrstuvwxyz0123456789";
Random random = new Random();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; i++) {
int number = random.nextInt(base.length());
sb.append(base.charAt(number));
}
return sb.toString();
}
public static String getLimitString(String string , int length){
if(string != null){
if(string.length() <= length){
return string;
}else{
return string.substring(0,15)+"....";
}
}else
return null;
}
/**
* 将long转换为日期
* @param fromat
* @param millSec
* @return
*/
public static String longToData(String fromat, long millSec){
SimpleDateFormat formatter = new SimpleDateFormat(fromat);
Date date= new Date(millSec);
return formatter.format(date);
}
/**
* double 转换为金额
* @param num
* @return
*/
public static String doubleToMoney(double num){
// DecimalFormat df = new DecimalFormat("#.00");
return String.format("%.2f", num);
}
public static HashMap<String, String> longToCountDownTime(long leftTimeSecond){
HashMap<String, String> result = new HashMap<>();
String second = String.valueOf(leftTimeSecond % 60);
if(second.length() == 1){
second = "0"+second;
}
result.put("second",second);
String minute = String.valueOf(( leftTimeSecond/60 ) % 60);
if(minute.length() == 1){
minute = "0"+minute;
}
result.put("minute",minute);
String hour = String.valueOf(leftTimeSecond / (60 * 60));
if(hour.length() ==1){
hour = "0"+hour;
}
result.put("hour",hour);
return result;
}
}
package cn.dankal.base.utils;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import cn.mctower.visitor.MCTowerApplication;
import cn.mctower.visitor.R;
/**
* Created by Alex Tang on 2016/12/29.
*/
public class ToastUtils {
private static Toast mToast;
public static void show(String message) {
if(!TextUtils.isEmpty(message)) {
mToast = new Toast(MCTowerApplication.getContext());
LayoutInflater inflater = LayoutInflater.from(MCTowerApplication.getContext());
View layout = inflater.inflate(R.layout.custom_toast, null);
TextView msg = (TextView) layout.findViewById(R.id.msg);
msg.setText(message);
mToast = new Toast(MCTowerApplication.getContext());
mToast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, UIUtil.Dp2Px(MCTowerApplication.getContext(), 60));
mToast.setDuration(Toast.LENGTH_SHORT);
mToast.setView(layout);
mToast.show();
}
}
public static void cancelToast() {
if (mToast != null) {
mToast.cancel();
}
}
public static void show(int resourceId) {
show(MCTowerApplication.getContext().getResources().getString(resourceId));
}
}
package cn.dankal.base.utils;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.os.Environment;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Calendar;
public class UIUtil {
/**
* 获取屏幕真实大小(像素)
* @param ctx
* @return
*/
public static DisplayMetrics getScreenPhysicalSize(Context ctx) {
DisplayMetrics dm = new DisplayMetrics();
WindowManager wm = (WindowManager) ctx
.getSystemService(Context.WINDOW_SERVICE);
wm.getDefaultDisplay().getMetrics(dm);
return dm;
}
/**
* dp转像素
* @param context
* @param dp
* @return
*/
public static int Dp2Px(Context context, float dp) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dp * scale + 0.5f);
}
/**
* 像素转dp
* @param context
* @param px
* @return
*/
public static int Px2Dp(Context context, float px) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (px / scale + 0.5f);
}
public static Bitmap saveViewAsImage(View view , String path){
Bitmap bitmap = null;
if(view != null && !TextUtils.isEmpty(path)){
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
bitmap = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
if(bitmap != null){
System.out.println("bitmap got!");
try{
File dir = new File(path.substring(0,path.lastIndexOf("/")));
if(!dir.exists())
dir.mkdirs();
FileOutputStream out = new FileOutputStream(path);
bitmap.compress(Bitmap.CompressFormat.PNG,70, out);
System.out.println("file" + path + "output done.");
}catch(Exception e) {
e.printStackTrace();
}
}else{
System.out.println("bitmap is NULL!");
}
}
return bitmap;
}
public static Bitmap convertViewToBitmap(View view){
Bitmap bitmap = null;
if(view != null){
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
bitmap = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
}
return bitmap;
}
/**
* 将px值转换为sp值,保证文字大小不变
*
* @param context
* @param pxValue
* (DisplayMetrics类中属性scaledDensity)
* @return
*/
public static int px2sp(Context context, float pxValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (int) (pxValue / fontScale + 0.5f);
}
/**
* 将sp值转换为px值,保证文字大小不变
*
* @param spValue
* (DisplayMetrics类中属性scaledDensity)
* @return
*/
public static int sp2px(Context context, float spValue) {
final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
return (int) (spValue * fontScale + 0.5f);
}
/**
* 以defaultWidth作为基准和手机屏幕宽度做比较,计算出value对应的手机频幕应显示的像素值
* @param context
* @param defaulWidth 基准像素
* @param value 需要转换的值
* @return
*/
public static int getRealPx(Context context, int defaulWidth, int value){
int screenWidth = getScreenPhysicalSize(context).widthPixels;
return screenWidth * value / defaulWidth;
}
/**
* 以720像素作为基准和手机屏幕宽度做比较,计算出value对应的手机频幕应显示的像素值
* @param context
* @param value
* @return
*/
public static int getRealPx(Context context, int value){
return getRealPx(context,720,value);
}
/**
* 获取控件的高度
*/
public static int getViewMeasuredHeight(View view) {
calculateViewMeasure(view);
return view.getMeasuredHeight();
}
/**
* 获取控件的宽度
*/
public static int getViewMeasuredWidth(View view) {
calculateViewMeasure(view);
return view.getMeasuredWidth();
}
/**
* 测量控件的尺寸
*/
private static void calculateViewMeasure(View view) {
int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
view.measure(w, h);
}
public static String viewSaveToImage(View view) {
view.setDrawingCacheEnabled(true);
view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
view.setDrawingCacheBackgroundColor(Color.WHITE);
// 把一个View转换成图片
Bitmap cachebmp = loadBitmapFromView(view);
FileOutputStream fos;
String imagePath = "";
try {
// 判断手机设备是否有SD卡
boolean isHasSDCard = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
if (isHasSDCard) {
// SD卡根目录
File sdRoot = Environment.getExternalStorageDirectory();
File file = new File(sdRoot, Calendar.getInstance().getTimeInMillis()+".png");
fos = new FileOutputStream(file);
imagePath = file.getAbsolutePath();
} else
throw new Exception("创建文件失败!");
cachebmp.compress(Bitmap.CompressFormat.PNG, 90, fos);
fos.flush();
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
LogUtils.e("","imagePath="+imagePath);
view.destroyDrawingCache();
return imagePath;
}
private static Bitmap loadBitmapFromView(View v) {
int w = v.getWidth();
int h = v.getHeight();
Bitmap bmp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bmp);
c.drawColor(Color.WHITE);
/** 如果不设置canvas画布为白色,则生成透明 */
v.layout(0, 0, w, h);
v.draw(c);
return bmp;
}
public static void showSoftInputFromWindow(Activity activity, EditText editText) {
editText.setFocusable(true);
editText.setFocusableInTouchMode(true);
editText.requestFocus();
//显示软键盘
// activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
//如果上面的代码没有弹出软键盘 可以使用下面另一种方式
InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, 0);
}
public static int getStatusBarHeight(Context context) {
Resources resources = context.getResources();
int resourceId = resources.getIdentifier("status_bar_height", "dimen", "android");
int height = resources.getDimensionPixelSize(resourceId);
return height;
}
}
package cn.mctower.visitor;
import cn.dankal.base.utils.Utils;
/**
* Author:Alex tang
* Date:2020-07-20
* Time:12:47
* Description:
*/
public class Constant {
public static String BaseImagesDir = Utils.getRootFilePath() + "/image/";
// public static String Host = "https://api-mircrosoft-building.dankal.cn/v1/";
public static String Host = "https://api.mctower.dankal.cn/v1/";
public static final String API_VISIT_RECORD_LIST = Host + "mini/visit/users";
public static final String API_VISIT_DETAIL = Host + "mini/visit/user/detail/";
public static final String API_GET_QINIU_TOKEN = Host + "cms/property/common/ignore/qiniu";
public static final String API_SAVE_USER_INFO = Host + "mini/visit/user/binding";
public static final String API_SAVE_USER_INFO_OTHER = Host + "mini/visit/user/binding/other";
public static final String API_SAVE_NOTE = Host + "mini/visit/user/remark";
}
package cn.mctower.visitor;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import com.brilliants.idcardlib.IDCard;
import com.brilliants.idcardlib.IDCardCallBack;
import com.invs.invsIdCard;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
import com.tencent.bugly.Bugly;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import cn.dankal.base.activity.NetBaseAppCompatActivity;
/**
* Author:Alex tang
* Date:2020-07-20
* Time:11:41
* Description:
*/
public class MCTowerApplication extends Application {
private static Context context;
private static IDCard idCard;
private Activity currentActivity;
@Override
public void onCreate() {
super.onCreate();
this.context = this;
//初始化imageloader
ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(context);
config.threadPriority(Thread.NORM_PRIORITY - 2);
config.denyCacheImageMultipleSizesInMemory();
config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
config.diskCacheSize(300 * 1024 * 1024); // 300 MiB
config.tasksProcessingOrder(QueueProcessingType.LIFO);
ImageLoader.getInstance().init(config.build());
Bugly.init(getApplicationContext(), "2c5f751c8c", true);
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) {
currentActivity = activity;
}
@Override
public void onActivityStarted(@NonNull Activity activity) {
currentActivity = activity;
}
@Override
public void onActivityResumed(@NonNull Activity activity) {
currentActivity = activity;
}
@Override
public void onActivityPaused(@NonNull Activity activity) {
}
@Override
public void onActivityStopped(@NonNull Activity activity) {
}
@Override
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {
}
@Override
public void onActivityDestroyed(@NonNull Activity activity) {
}
});
idCard = new IDCard(this, new IDCardCallBack() {
@Override
public void idCardDeviceComment() {
}
@Override
public void idCardDeviceUnComment() {
}
@Override
public void readIDCardDataFail() {
if(currentActivity != null){
if(currentActivity instanceof MainActivity){
((MainActivity)currentActivity).readIdCardFailure();
}else if(currentActivity instanceof DetailActivity){
((DetailActivity)currentActivity).readIdCardFailure();
}
}
}
@Override
public void readIDCardData(invsIdCard invsIdCard, boolean b) {
if(currentActivity != null){
if(currentActivity instanceof MainActivity){
((MainActivity)currentActivity).setIdCardInfo(invsIdCard);
}else if(currentActivity instanceof DetailActivity){
((DetailActivity)currentActivity).setIdCardInfo(invsIdCard);
}
}
}
});
}
@Override
public void onTerminate() {
super.onTerminate();
if(idCard != null)
idCard.unInit();
}
public static Context getContext(){
return context;
}
}
package cn.mctower.visitor.model;
import java.util.ArrayList;
/**
* Author:Alex tang
* Date:2020-07-21
* Time:15:10
* Description:
*/
public class DetailPageBean {
public UserInfoBean user;
public ArrayList<VisitRecordBean> visitList;
public static class UserInfoBean{
public String uuid; //4855f420006b4e0097bdfa6874729edd",
public String wxName; //F",
public String wxImg; //https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJfaKrsAASnzvgPU5F7DBs1meONalvLMDxnv3ic6pPIuI0Vyicyicp9zFpSu6iaZiaAjNmLFsn5icuuTTQA/132",
public String userName; //F",
public String sex; //null,
public String identityCard; //null,
public String identityImg; //null
public int isBindingId;
public String faceImg;
public String remark;
public String certificatesImg;
}
}
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-07-23
* Time:10:26
* Description:
*/
public class QiNiuTokenBean {
public String token;
public String url;
}
package cn.mctower.visitor.model;
import com.google.gson.Gson;
import androidx.annotation.NonNull;
/**
* Author:Alex tang
* Date:2020-08-03
* Time:10:23
* Description:
*/
public class RemarkBean {
public String remark;
public String userUuid;
@NonNull
@Override
public String toString() {
return new Gson().toJson(this);
}
}
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-07-21
* Time:13:29
* Description:
*/
public class VisitRecordBean {
public String clientName; // 客户名字",
public String companyName; // 公司名字",
public String staffName;
public String companyUuid; // uuid",
public String phone; // 客户名字",
public String userUuid; // 客户名字",
public String uuid; // 访客申请uuid",
public String visitorTime; // 公司名字"
}
package cn.mctower.visitor.model;
import java.util.ArrayList;
/**
* Author:Alex tang
* Date:2020-07-21
* Time:13:30
* Description:
*/
public class VisitRecordPageBean {
public ArrayList<VisitRecordBean> data;
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="#66000000" />
<corners android:radius="10dp" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#ffffff"
android:endColor="#ffffff"
android:angle="0"
/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topRightRadius="0dp"
android:topLeftRadius="0dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:endColor="#00000000"
android:startColor="#55cccccc"
android:angle="90"
/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<solid android:color="@color/blackTransparentColor" />
<corners android:radius="4dp" />
<padding
android:bottom="10dp"
android:left="20dp"
android:right="20dp"
android:top="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#AADBFF"
android:endColor="#0998FF"
android:angle="0"
/>
<corners android:radius="50dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#F7F8FA"
android:endColor="#F7F8FA"
android:angle="0"
/>
<corners android:radius="50dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#ffffff"
android:endColor="#ffffff"
android:angle="0"
/>
<corners android:radius="50dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#ffffff"
android:endColor="#ffffff"
android:angle="0"
/>
<corners android:radius="10dip" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#2D506B"
android:endColor="#2D506B"
android:angle="0"
/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="0dp"
android:topRightRadius="10dp"
android:topLeftRadius="0dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#F7F8FA"
android:endColor="#F7F8FA"
android:angle="0"
/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topRightRadius="10dp"
android:topLeftRadius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#ffffff"
android:endColor="#ffffff"
android:angle="0"
/>
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topRightRadius="10dp"
android:topLeftRadius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<gradient
android:startColor="#ffeef1f7"
android:endColor="#ffeef1f7"
android:angle="0"
/>
<corners
android:bottomRightRadius="0dp"
android:bottomLeftRadius="0dp"
android:topRightRadius="10dp"
android:topLeftRadius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false" >
<solid android:color="@android:color/white" />
<size
android:height="12dp"
android:width="12dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
tools:context=".MainActivity"
android:background="@color/pageBg"
android:orientation="vertical">
<include layout="@layout/sub_layout_titlebar"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 访客布局 -->
<LinearLayout
android:id="@+id/visitorFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerInParent="true"
android:gravity="center"
android:visibility="visible">
<ImageView
android:layout_width="91dp"
android:layout_height="107dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_empty"/>
<TextView
android:id="@+id/visitorBtn"
android:layout_width="240dp"
android:layout_height="49dp"
android:layout_marginTop="95dp"
android:textColor="@android:color/white"
android:textSize="17sp"
android:textStyle="bold"
android:gravity="center"
android:background="@drawable/left_right_ring_lightblue_to_blue_bg"
android:text="访客"/>
</LinearLayout>
<!-- 搜索布局 -->
<LinearLayout
android:id="@+id/searchPageFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone">
<RelativeLayout
android:id="@+id/searchFrame"
android:layout_width="match_parent"
android:layout_height="52dp"
android:paddingLeft="17dp"
android:paddingRight="21dp"
android:paddingStart="17dp"
android:paddingEnd="21dp"
android:background="@android:color/white">
<TextView
android:id="@+id/searchBtn"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:text="搜索"
android:textSize="15sp"
android:textColor="#28A5FF"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/searchBtn"
android:layout_marginRight="15dp"
android:layout_height="32dp"
android:background="@drawable/left_right_ring_lightgray_bg">
<LinearLayout
android:id="@+id/inputTipFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_centerInParent="true"
android:orientation="horizontal">
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:src="@mipmap/ic_search"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ABB2B7"
android:textSize="13sp"
android:layout_marginLeft="5dp"
android:text="请输入关键词搜索"/>
</LinearLayout>
<ImageView
android:id="@+id/clearBtn"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:background="@mipmap/ic_search_delete"
android:visibility="gone"/>
<EditText
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|left"
android:layout_toLeftOf="@id/clearBtn"
android:layout_marginRight="10dp"
android:layout_marginLeft="15dp"
android:textSize="13dp"
android:singleLine="true"
android:imeOptions="actionSearch"
android:textColor="#2D506B"
android:background="@null"/>
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#ABB2B7"
android:textSize="14dp"
android:gravity="center"
android:layout_marginTop="15dp"
android:text="输入姓名、手机号或者读取身份证进行搜索"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ 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="60dp"
android:layout_height="60dp"
android:background="@drawable/base_loading_circle_background"
android:padding="20dp" >
<!--<ImageView
android:id="@+id/circle_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:contentDescription=""
android:scaleType="fitXY" />-->
<ProgressBar
android:id="@+id/loadProgressBar"
android:layout_width="20dp"
android:layout_height="20dp"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/circle_trans_black_bg"
android:gravity="center_vertical">
<TextView
android:id="@+id/msg"
style="@style/colorffffffdp14"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="5dp"
/>
</LinearLayout>
\ 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:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/left_right_roundrectangle_white_bg"
android:layout_marginLeft="22dp"
android:layout_marginRight="22dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="14dp"
android:translationZ="20dp">
<TextView
android:id="@+id/tag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="13sp"
android:textColor="#FFFFFF"
android:text="访\n客"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:background="@drawable/left_ring_blue_bg"
android:layout_centerVertical="true"/>
<TextView
android:id="@+id/nameTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tag"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginTop="12dp"
android:text="姓名"
/>
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginTop="12dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:text="xxxxxx"/>
<TextView
android:id="@+id/staffNameTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tag"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="邀请人"
android:layout_below="@id/nameTitle"
/>
<TextView
android:id="@+id/staffName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="15dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_below="@id/name"
android:text="xxxxxx"/>
<TextView
android:id="@+id/mobileTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tag"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginBottom="8dp"
android:text="手机号码"
android:layout_below="@id/staffNameTitle"
/>
<TextView
android:id="@+id/mobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="8dp"
android:layout_marginRight="15dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_below="@id/staffName"
android:text="xxxxxx"/>
<TextView
android:id="@+id/comTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tag"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginBottom="12dp"
android:layout_below="@id/mobileTitle"
android:text="拜访企业"
/>
<TextView
android:id="@+id/company"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:layout_marginBottom="12dp"
android:textSize="14sp"
android:layout_below="@id/mobile"
android:textColor="#2D506B"
android:text="xxxxxx"/>
</RelativeLayout>
\ 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:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/mainFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/left_right_roundrectangle_white_bg"
android:layout_marginLeft="22dp"
android:layout_marginRight="22dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="10dp"
android:translationZ="8dp">
<TextView
android:id="@+id/nameTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginTop="30dp"
android:text="到访企业"
/>
<TextView
android:id="@+id/companyName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:layout_marginTop="30dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:text="xxxxxx"/>
<TextView
android:id="@+id/invatePersonTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:text="邀请人"
android:layout_below="@id/nameTitle"
/>
<TextView
android:id="@+id/invatePerson"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="30dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_below="@id/companyName"
android:text="xxxxxx"/>
<TextView
android:id="@+id/mobileTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginBottom="8dp"
android:text="手机号码"
android:layout_below="@id/invatePersonTitle"
/>
<TextView
android:id="@+id/mobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="8dp"
android:layout_marginRight="30dp"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_below="@id/invatePerson"
android:text="xxxxxx"/>
<TextView
android:id="@+id/comTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:textColor="#ABB2B7"
android:textSize="14sp"
android:layout_marginBottom="30dp"
android:layout_below="@id/mobileTitle"
android:text="到访时间"
/>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:layout_marginBottom="30dp"
android:textSize="14sp"
android:layout_below="@id/mobile"
android:textColor="#2D506B"
android:text="xxxxxx"/>
</RelativeLayout>
<TextView
android:id="@+id/topDot1"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginTop="13dp"
android:layout_marginLeft="70dp"
android:background="@drawable/white_dot"
android:translationZ="10dp"/>
<TextView
android:id="@+id/topLine1"
android:layout_width="2dp"
android:layout_height="18dp"
android:layout_marginLeft="75dp"
android:background="#D8D8D8"
android:translationZ="9dp"/>
<TextView
android:id="@+id/topDot2"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginTop="13dp"
android:layout_marginRight="70dp"
android:layout_alignParentRight="true"
android:background="@drawable/white_dot"
android:translationZ="10dp"/>
<TextView
android:id="@+id/topLine2"
android:layout_width="2dp"
android:layout_height="18dp"
android:layout_marginRight="75dp"
android:layout_alignParentRight="true"
android:background="#D8D8D8"
android:translationZ="9dp"/>
<TextView
android:id="@+id/bottomDot1"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginLeft="70dp"
android:layout_alignBottom="@id/mainFrame"
android:background="@drawable/white_dot"
android:layout_marginBottom="3dp"
android:translationZ="10dp"/>
<TextView
android:id="@+id/bottomLine1"
android:layout_width="2dp"
android:layout_height="18dp"
android:layout_marginLeft="75dp"
android:layout_below="@id/bottomDot1"
android:layout_marginTop="-3dp"
android:background="#D8D8D8"
android:translationZ="9dp"/>
<TextView
android:id="@+id/bottomDot2"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginRight="70dp"
android:layout_alignParentRight="true"
android:layout_alignBottom="@id/mainFrame"
android:background="@drawable/white_dot"
android:layout_marginBottom="3dp"
android:translationZ="10dp"/>
<TextView
android:id="@+id/bottomLine2"
android:layout_width="2dp"
android:layout_height="18dp"
android:layout_marginRight="75dp"
android:layout_below="@id/bottomDot2"
android:layout_alignParentRight="true"
android:layout_marginTop="-3dp"
android:background="#D8D8D8"
android:translationZ="9dp"/>
</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="wrap_content"
android:layout_margin="20dp"
android:background="@drawable/roundrectangle_white_bg"
android:padding="20dp">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textSize="18sp"
android:textColor="#2D506B"
android:text="提示"/>
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/title"
android:layout_marginTop="28dp"
android:textSize="16sp"
android:textColor="#2D506B"
android:text="请读取身份证"/>
<TextView
android:id="@+id/btn"
android:layout_width="match_parent"
android:layout_height="49dp"
android:layout_marginTop="48dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="21dp"
android:gravity="center"
android:textSize="17sp"
android:textColor="@android:color/white"
android:textStyle="bold"
android:translationZ="5dp"
android:layout_below="@id/msg"
android:text="确定"
android:background="@drawable/left_right_ring_lightblue_to_blue_bg"/>
</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="wrap_content"
android:layout_margin="20dp"
android:background="@drawable/roundrectangle_white_bg">
<RelativeLayout
android:id="@+id/infoFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/idPic"
android:layout_width="71dp"
android:layout_height="86dp"
android:src="@mipmap/ic_the"
android:layout_marginTop="19dp"
android:layout_marginLeft="19dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="22dp"
android:scaleType="centerCrop"/>
<RelativeLayout
android:id="@+id/titleFrame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignTop="@id/idPic"
android:layout_alignBottom="@id/idPic"
android:layout_toRightOf="@id/idPic">
<TextView
android:textSize="14sp"
android:textColor="#ABB2B7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="姓名"/>
<TextView
android:textSize="14sp"
android:textColor="#ABB2B7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="性别"/>
<TextView
android:textSize="14sp"
android:textColor="#ABB2B7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_alignParentBottom="true"
android:text="身份证"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_alignTop="@id/idPic"
android:layout_alignBottom="@id/idPic"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp">
<TextView
android:id="@+id/name"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/gender"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true" />
<TextView
android:id="@+id/idCode"
android:textSize="14sp"
android:textColor="#2D506B"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" />
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/cancelBtn"
android:layout_width="130dp"
android:layout_height="39dp"
android:textColor="#2D506B"
android:textSize="17sp"
android:gravity="center"
android:layout_below="@id/infoFrame"
android:layout_marginTop="10dp"
android:layout_marginLeft="15dp"
android:layout_marginBottom="27dp"
android:translationZ="5dp"
android:background="@drawable/left_right_ring_white_bg"
android:text="取消"/>
<TextView
android:id="@+id/bindBtn"
android:layout_width="130dp"
android:layout_height="39dp"
android:textColor="#ffffff"
android:textSize="17sp"
android:gravity="center"
android:layout_below="@id/infoFrame"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="27dp"
android:translationZ="5dp"
android:background="@drawable/left_right_ring_lightblue_to_blue_bg"
android:layout_alignParentRight="true"
android:text="绑定"/>
</RelativeLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="48dp"
tools:context=".MainActivity"
android:background="@android:color/white">
<TextView
android:id="@+id/titleTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="XX"
android:textSize="18sp"
android:textColor="#000000"
android:textStyle="bold"/>
<ImageView
android:id="@+id/backBtn"
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="5dp"
android:layout_centerVertical="true"
android:src="@mipmap/ic_return"
android:layout_marginLeft="10dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#E0E0E0"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
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