Commit 6b43e04f by tangguangrui

提交第二个版本代码

parent 669f46a2
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "cn.runworld.mctower.visitor" applicationId "cn.runworld.mctower.visitor"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 2 versionCode 3
versionName "1.0.1" versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk { ndk {
// 设置支持的SO库架构 // 设置支持的SO库架构
......
...@@ -14,26 +14,36 @@ ...@@ -14,26 +14,36 @@
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<activity <activity android:name=".HomePageActivity"
android:name=".MainActivity" android:theme="@style/Theme.MyAppCompatTheme"
android:theme="@style/Theme.MyAppCompatTheme"> android:windowSoftInputMode="adjustPan" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".PassThroughDetailActivity"
android:theme="@style/Theme.MyAppCompatTheme"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".PassThroughQueryActivity"
android:theme="@style/Theme.MyAppCompatTheme"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".MainActivity"
android:theme="@style/Theme.MyAppCompatTheme"
android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".DetailActivity" android:name=".DetailActivity"
android:theme="@style/Theme.MyAppCompatTheme" android:theme="@style/Theme.MyAppCompatTheme"
android:windowSoftInputMode="adjustPan"/> android:windowSoftInputMode="adjustPan" />
<service android:name="com.brilliants.idcardlib.IDCardService"/>
<service android:name="com.brilliants.idcardlib.IDCardService" />
</application> </application>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
...@@ -42,6 +52,7 @@ ...@@ -42,6 +52,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_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.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_LOGS" /> <uses-permission android:name="android.permission.READ_LOGS" />
</manifest> </manifest>
\ No newline at end of file
...@@ -10,6 +10,8 @@ import cn.dankal.base.utils.Utils; ...@@ -10,6 +10,8 @@ import cn.dankal.base.utils.Utils;
*/ */
public class Constant { public class Constant {
//接口文档地址 https://api-mircrosoft-building.dankal.cn/v1/swagger-ui.html#/
public static String BaseImagesDir = Utils.getRootFilePath() + "/image/"; public static String BaseImagesDir = Utils.getRootFilePath() + "/image/";
// public static String Host = "https://api-mircrosoft-building.dankal.cn/v1/"; //测试 // public static String Host = "https://api-mircrosoft-building.dankal.cn/v1/"; //测试
...@@ -20,6 +22,9 @@ public class Constant { ...@@ -20,6 +22,9 @@ public class Constant {
public static final String API_SAVE_USER_INFO = Host + "mini/visit/user/binding"; 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_USER_INFO_OTHER = Host + "mini/visit/user/binding/other";
public static final String API_SAVE_NOTE = Host + "mini/visit/user/remark"; public static final String API_SAVE_NOTE = Host + "mini/visit/user/remark";
public static final String API_PASS_USER_LIST = Host + "mini/pass/users";
public static final String API_PASS_USER_DETAIL = Host + "mini/pass/user/detail/";
public static final String API_PASS_USER_BIND = Host + "mini/pass/user/binding";
} }
package cn.mctower.visitor;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import androidx.annotation.MainThread;
import cn.dankal.base.activity.NetBaseAppCompatActivity;
public class HomePageActivity extends NetBaseAppCompatActivity {
@ViewInject(R.id.titleTv)
TextView titleTv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_page);
setAndroidNativeLightStatusBar(this,true);
setStatusBarColor(this,android.R.color.white);
ViewUtils.inject(this);
titleTv.setText("首页");
}
@OnClick({R.id.backBtn,R.id.passCode, R.id.visitor})
public void click(View view){
switch (view.getId()){
case R.id.backBtn:
onBackPressed();
break;
case R.id.passCode:
jumpActivity(PassThroughQueryActivity.class,false);
break;
case R.id.visitor:
jumpActivity(MainActivity.class,false);
break;
}
}
}
...@@ -102,6 +102,8 @@ public class MCTowerApplication extends Application { ...@@ -102,6 +102,8 @@ public class MCTowerApplication extends Application {
((MainActivity)currentActivity).readIdCardFailure(); ((MainActivity)currentActivity).readIdCardFailure();
}else if(currentActivity instanceof DetailActivity){ }else if(currentActivity instanceof DetailActivity){
((DetailActivity)currentActivity).readIdCardFailure(); ((DetailActivity)currentActivity).readIdCardFailure();
}else if(currentActivity instanceof PassThroughDetailActivity){
((PassThroughDetailActivity)currentActivity).readIdCardFailure();
} }
} }
} }
...@@ -113,6 +115,8 @@ public class MCTowerApplication extends Application { ...@@ -113,6 +115,8 @@ public class MCTowerApplication extends Application {
((MainActivity)currentActivity).setIdCardInfo(invsIdCard); ((MainActivity)currentActivity).setIdCardInfo(invsIdCard);
}else if(currentActivity instanceof DetailActivity){ }else if(currentActivity instanceof DetailActivity){
((DetailActivity)currentActivity).setIdCardInfo(invsIdCard); ((DetailActivity)currentActivity).setIdCardInfo(invsIdCard);
}else if(currentActivity instanceof PassThroughDetailActivity){
((PassThroughDetailActivity)currentActivity).setIdCardInfo(invsIdCard);
} }
} }
} }
......
...@@ -75,6 +75,9 @@ public class MainActivity extends NetBaseAppCompatActivity { ...@@ -75,6 +75,9 @@ public class MainActivity extends NetBaseAppCompatActivity {
setStatusBarColor(this,android.R.color.white); setStatusBarColor(this,android.R.color.white);
ViewUtils.inject(this); ViewUtils.inject(this);
visitorFrame.setVisibility(View.GONE);
searchPageFrame.setVisibility(View.VISIBLE);
titleTv.setText("信息"); titleTv.setText("信息");
input.setOnFocusChangeListener(new View.OnFocusChangeListener() { input.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override @Override
...@@ -150,7 +153,7 @@ public class MainActivity extends NetBaseAppCompatActivity { ...@@ -150,7 +153,7 @@ public class MainActivity extends NetBaseAppCompatActivity {
} }
} }
@Override /*@Override
public void onBackPressed() { public void onBackPressed() {
if(searchPageFrame.getVisibility() == View.VISIBLE){ if(searchPageFrame.getVisibility() == View.VISIBLE){
visitorFrame.setVisibility(View.VISIBLE); visitorFrame.setVisibility(View.VISIBLE);
...@@ -159,7 +162,7 @@ public class MainActivity extends NetBaseAppCompatActivity { ...@@ -159,7 +162,7 @@ public class MainActivity extends NetBaseAppCompatActivity {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
}else }else
super.onBackPressed(); super.onBackPressed();
} }*/
private void doSearch(){ private void doSearch(){
String key = input.getText().toString().trim(); String key = input.getText().toString().trim();
......
package cn.mctower.visitor;
import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.google.gson.Gson;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import java.util.ArrayList;
import java.util.HashMap;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cn.dankal.base.activity.NetBaseAppCompatActivity;
import cn.dankal.base.http.DialogHttpCallBack;
import cn.dankal.base.http.HttpPostHelper;
import cn.dankal.base.interfaces.IPermissionCheck;
import cn.dankal.base.utils.ToastUtils;
import cn.mctower.visitor.model.PassThroughRecordBean;
import cn.mctower.visitor.model.PassThroughRecordPageBean;
import cn.mctower.visitor.model.VisitRecordBean;
import cn.mctower.visitor.model.VisitRecordPageBean;
public class PassThroughQueryActivity extends NetBaseAppCompatActivity {
@ViewInject(R.id.titleTv)
TextView titleTv;
@ViewInject(R.id.visitorFrame)
LinearLayout visitorFrame;
@ViewInject(R.id.visitorBtn)
TextView visitorBtn;
@ViewInject(R.id.searchPageFrame)
LinearLayout searchPageFrame;
@ViewInject(R.id.input)
EditText input;
@ViewInject(R.id.inputMobile)
EditText inputMobile;
@ViewInject(R.id.searchBtn)
TextView searchBtn;
@ViewInject(R.id.listView)
RecyclerView listView;
private ArrayList<PassThroughRecordBean> data = new ArrayList<>();
private MyAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pass_through_query);
setAndroidNativeLightStatusBar(this,true);
setStatusBarColor(this,android.R.color.white);
ViewUtils.inject(this);
titleTv.setText("通行查询");
input.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_SEARCH || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
click(searchBtn);
return true;
}
return false;
});
inputMobile.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_SEARCH || (event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
click(searchBtn);
return true;
}
return false;
});
LinearLayoutManager lm = new LinearLayoutManager(this);
lm.setOrientation(LinearLayoutManager.VERTICAL);
listView.setLayoutManager(lm);
adapter = new MyAdapter();
listView.setAdapter(adapter);
String[] permission = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE};
requestPermissions(permission, 12122, "需要存储权限", new IPermissionCheck() {
@Override
public void hasGotPermissions(int code) {
}
});
}
@OnClick({R.id.backBtn,R.id.visitorBtn,R.id.searchBtn})
public void click(View view){
switch (view.getId()){
case R.id.backBtn:
onBackPressed();
break;
case R.id.visitorBtn:
if(!TextUtils.isEmpty(inputMobile.getText().toString().trim())){
doSearch(inputMobile.getText().toString().trim());
}
visitorFrame.setVisibility(View.GONE);
searchPageFrame.setVisibility(View.VISIBLE);
break;
case R.id.searchBtn:
if(!TextUtils.isEmpty(input.getText().toString().trim())){
doSearch(input.getText().toString().trim());
}
break;
}
}
private void doSearch(String key){
HashMap<String,String> param = new HashMap<>();
if(!TextUtils.isEmpty(key)) {
param.put("search", key);
param.put("pageIndex", "1");
param.put("pageSize", "10000");
HttpPostHelper.httpGet(this, Constant.API_PASS_USER_LIST, new DialogHttpCallBack(this) {
@Override
public void requestStart() {
super.requestStart();
data.clear();
}
@Override
public void successCallBack(String result) {
super.successCallBack(result);
PassThroughRecordPageBean bean = new Gson().fromJson(result, PassThroughRecordPageBean.class);
if (bean != null && bean.data != null) {
data.addAll(bean.data);
adapter.notifyDataSetChanged();
}
}
@Override
public void requestFinish() {
super.requestFinish();
titleTv.setText("查询结果");
}
}, param);
}else
ToastUtils.show("请输入手机号后再进行搜索");
}
class MyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
private LayoutInflater layoutInflater = LayoutInflater.from(PassThroughQueryActivity.this);
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = layoutInflater.inflate(R.layout.itme_pass_record, parent, false);
return new CustomViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
PassThroughRecordBean bean = data.get(position);
CustomViewHolder viewHolder = (CustomViewHolder) holder;
viewHolder.name.setText(bean.getName());
viewHolder.mobile.setText(bean.getPhone());
viewHolder.company.setText(bean.getCompanyName());
viewHolder.item.setOnClickListener(view -> {
if(!TextUtils.isEmpty(bean.getUuid())) {
Intent intent = new Intent(PassThroughQueryActivity.this, PassThroughDetailActivity.class);
intent.putExtra("id", bean.getUuid());
startActivity(intent);
}else
ToastUtils.show("本条邀请还未分享给访客");
});
}
@Override
public int getItemCount() {
return data.size();
}
}
class CustomViewHolder extends RecyclerView.ViewHolder{
private RelativeLayout item;
private TextView name;
private TextView mobile;
private TextView company;
public CustomViewHolder(@NonNull View itemView) {
super(itemView);
item = itemView.findViewById(R.id.item);
name = itemView.findViewById(R.id.name);
mobile = itemView.findViewById(R.id.mobile);
company = itemView.findViewById(R.id.company);
}
}
}
package cn.mctower.visitor;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
public class RoundLayout extends RelativeLayout {
private float roundLayoutRadius = 14f;
private int borderColor = Color.WHITE;
private int borderWidth = 0;
private Path roundPath;
private RectF rectF;
private RectF rectFBorder;
private Paint paint;
public RoundLayout(Context context) {
this(context, null);
}
public RoundLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
private void init() {
setWillNotDraw(false);//如果你继承的是ViewGroup,注意此行,否则draw方法是不会回调的;
roundPath = new Path();
rectF = new RectF();
paint = new Paint();
paint.setColor(Color.WHITE);
paint.setAntiAlias(true);
}
private void setRoundPath() {
//添加一个圆角矩形到path中, 如果要实现任意形状的View, 只需要手动添加path就行
roundPath.addRoundRect(rectF, roundLayoutRadius, roundLayoutRadius, Path.Direction.CW);
}
public void setRoundLayoutRadius(float roundLayoutRadius) {
this.roundLayoutRadius = roundLayoutRadius;
setRoundPath();
postInvalidate();
}
public void setRoundLayoutBorder(int borderColor,int borderWidth) {
this.borderColor = borderColor;
this.borderWidth = borderWidth;
this.paint.setColor(borderColor);
this.paint.setStrokeWidth(borderWidth *2);
postInvalidate();
}
public void setBorderInfo(BorderInfo borderInfo){
if(borderInfo != null){
if(borderInfo.radius > 0f)
setRoundLayoutRadius(borderInfo.radius);
if(borderInfo.borderWidth > 0) {
setRoundLayoutBorder(borderInfo.borderColor, borderInfo.borderWidth);
}
}
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
rectF.set(0f, 0f, getMeasuredWidth(), getMeasuredHeight());
setRoundPath();
}
@Override
public void draw(Canvas canvas) {
if (roundLayoutRadius > 0f) {
try {
canvas.clipPath(roundPath);
}catch (Exception e){
e.printStackTrace();
}
}
super.draw(canvas);
if(borderWidth > 0){
if(rectFBorder == null) {
paint.setStyle(Paint.Style.STROKE);;
rectFBorder = new RectF();
rectFBorder.set(0, 0, getMeasuredWidth(), getMeasuredHeight());
}
canvas.drawRoundRect(rectFBorder,roundLayoutRadius,roundLayoutRadius,paint);
}
}
public class BorderInfo {
public float radius;
public int borderColor;
public int borderWidth;
}
}
\ No newline at end of file
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-11-07
* Time:09:21
* Description:
*/
public class PassRecordBean {
public String id;
public String name;
public String company;
public String mobile;
public String idNum;
public String idCardUrl;
public String remark;
public String isBind;
}
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-11-09
* Time:09:13
* Description:
*/
public class PassThroughDetailBean {
/**
* uuid : c6a3a892630240f4aac7d4c8fc27302b
* userUuid : a73c59ee04f34d3abf7cfc5c18ce1618
* name : 韩艳秋
* phone : 13923713519
* isBindingId : 0
* companyName : 科通集团
* identityImg :
* identityCard :
* remark :
*/
private String uuid;
private String userUuid;
private String name;
private String phone;
private int isBindingId;
private String companyName;
private String identityImg;
private String identityCard;
private String remark;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getUserUuid() {
return userUuid;
}
public void setUserUuid(String userUuid) {
this.userUuid = userUuid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public int getIsBindingId() {
return isBindingId;
}
public void setIsBindingId(int isBindingId) {
this.isBindingId = isBindingId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getIdentityImg() {
return identityImg;
}
public void setIdentityImg(String identityImg) {
this.identityImg = identityImg;
}
public String getIdentityCard() {
return identityCard;
}
public void setIdentityCard(String identityCard) {
this.identityCard = identityCard;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-11-09
* Time:09:02
* Description:
*/
public class PassThroughRecordBean {
/**
* uuid : b9f342f65781435ab7e0e9fde1b7f66c
* userUuid : 6069badb7b8241fab3abf8f628b2c689
* name : 罗铖
* phone : 13510503290
* isBindingId : 0
* companyName : 科通集团
*/
private String uuid;
private String userUuid;
private String name;
private String phone;
private int isBindingId;
private String companyName;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getUserUuid() {
return userUuid;
}
public void setUserUuid(String userUuid) {
this.userUuid = userUuid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public int getIsBindingId() {
return isBindingId;
}
public void setIsBindingId(int isBindingId) {
this.isBindingId = isBindingId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
package cn.mctower.visitor.model;
import java.util.ArrayList;
/**
* Author:Alex tang
* Date:2020-07-21
* Time:13:30
* Description:
*/
public class PassThroughRecordPageBean {
public ArrayList<PassThroughRecordBean> data;
}
package cn.mctower.visitor.model;
/**
* Author:Alex tang
* Date:2020-11-09
* Time:09:37
* Description:
*/
public class PassThroughSaveBean {
/**
* identityCard : 4113*****
* identityImg : img
* remark : string
* sex : 男女
* userName : wjz
* userUuid : uuid
*/
public String identityCard;
public String identityImg;
public String remark;
public String sex;
public String userName;
public String userUuid;
}
<?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"
/>
<stroke android:color="#999999"
android:width="1px"/>
<corners
android:radius="6dp"/>
</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=".HomePageActivity"
android:background="@color/pageBg"
android:orientation="vertical">
<include layout="@layout/sub_layout_titlebar"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginTop="130dp">
<LinearLayout
android:id="@+id/passCode"
android:layout_width="100dp"
android:layout_height="100dp"
android:orientation="vertical"
android:gravity="center"
android:background="#ffffff">
<ImageView
android:layout_width="33dp"
android:layout_height="33dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_passcode"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333333"
android:layout_marginTop="12dp"
android:textSize="12sp"
android:text="通行码"/>
</LinearLayout>
<LinearLayout
android:id="@+id/visitor"
android:layout_width="100dp"
android:layout_height="100dp"
android:orientation="vertical"
android:gravity="center"
android:background="#ffffff"
android:layout_marginLeft="25dp">
<ImageView
android:layout_width="33dp"
android:layout_height="33dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_visitors"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#333333"
android:layout_marginTop="12dp"
android:textSize="12sp"
android:text="访客"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<?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=".PassThroughQueryActivity"
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="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@drawable/roundrectangle_white_bg_gray_order"
android:layout_marginLeft="22dp"
android:layout_marginRight="22dp"
android:layout_marginTop="60dp"
android:gravity="center_vertical">
<ImageView
android:layout_width="16dp"
android:layout_height="22dp"
android:src="@mipmap/ic_phone"
android:layout_marginLeft="15dp"/>
<EditText
android:id="@+id/inputMobile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:layout_marginLeft="10dp"
android:textSize="17sp"
android:textColor="#333333"
android:singleLine="true"
android:inputType="number"
android:lines="1"
android:paddingStart="10dp"
android:background="@null"
android:hint="请输入手机号"
android:textColorHint="#CCCCCC"/>
</LinearLayout>
<TextView
android:id="@+id/visitorBtn"
android:layout_width="120dp"
android:layout_height="49dp"
android:layout_marginTop="32dp"
android:textColor="@android:color/white"
android:textSize="19sp"
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="60dp"
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="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:textStyle="bold"
android:gravity="center"
android:background="@drawable/left_right_ring_lightblue_to_blue_bg"
android:text="搜索"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/roundrectangle_white_bg_gray_order"
android:layout_marginRight="15dp"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_toLeftOf="@id/searchBtn">
<ImageView
android:layout_width="11dp"
android:layout_height="16dp"
android:src="@mipmap/ic_phone"
android:layout_marginLeft="15dp"/>
<EditText
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="15dp"
android:layout_marginLeft="10dp"
android:textSize="12sp"
android:textColor="#333333"
android:background="@null"
android:singleLine="true"
android:lines="1"
android:inputType="number"
android:paddingStart="10dp"
android:gravity="center_vertical"
android:hint="请输入手机号"
android:textColorHint="#CCCCCC"/>
</LinearLayout>
</RelativeLayout>
<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"
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/nameTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="16sp"
android:layout_marginBottom="8dp"
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="16sp"
android:textColor="#2D506B"
android:layout_marginBottom="8dp"
android:text="xxxxxx"/>
<TextView
android:id="@+id/mobileTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="16sp"
android:layout_marginBottom="8dp"
android:text="手机号码"
android:layout_below="@id/nameTitle"
/>
<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="16sp"
android:textColor="#2D506B"
android:layout_below="@id/name"
android:text="xxxxxx"/>
<TextView
android:id="@+id/comTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:textColor="#ABB2B7"
android:textSize="16sp"
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="16sp"
android:layout_below="@id/mobile"
android:layout_toRightOf="@id/comTitle"
android:layout_marginLeft="10dp"
android:lines="1"
android:ellipsize="end"
android:singleLine="true"
android:textColor="#2D506B"
android:gravity="right"
android:text="xxxxxx"/>
</RelativeLayout>
\ No newline at end of file
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