添加通讯录
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
@ -10,8 +10,8 @@
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 9,
|
||||
"versionName": "1.0.8",
|
||||
"versionCode": 4,
|
||||
"versionName": "1.0.4",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
|
@ -1,7 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
package="com.tenlionsoft.oasystem">
|
||||
|
||||
<application
|
||||
@ -17,8 +15,7 @@
|
||||
android:roundIcon="@drawable/app_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
>
|
||||
android:usesCleartextTraffic="true">
|
||||
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 43 KiB |
@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">oasystem</string>
|
||||
<string name="app_name">综合办公系统</string>
|
||||
</resources>
|
@ -131,6 +131,11 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_DOC = "/oamodule/fragment/document";//文档
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_EMAIL = "/oamodule/fragment/email";//邮件
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_MINE = "/oamodule/fragment/mine";//我的
|
||||
|
||||
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_ADDRESS_LIST = "/oamodule/activity/addresslist";//通讯录
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_ADDRESS_USER_DETAIL = "/oamodule/activity/addresslistUserDetail";//通讯录用户详情
|
||||
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_SEL_DEPT = "/oamodule/activity/chooseDept";//部门选择
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_SEL_PERSON = "/oamodule/activity/choosePerson";//选择人员
|
||||
public static final String PATH_MODULE_OA_ACTIVITY_SEL_DRIVER = "/oamodule/activity/chooseDriver";//选择驾驶员
|
||||
|
@ -2,35 +2,13 @@ package com.tenlionsoft.baselib.core.db;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodCanteenBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodFoodBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodPublishBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodPublishFoodBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodSubscribeBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.FoodSubscribeFoodBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.LocalMediaBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.UserAccountBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.UserAccountItemBean;
|
||||
import com.tenlionsoft.baselib.core.db.beans.UserChargeBean;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodCanteenDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodFoodDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodPublishDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodPublishFoodDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodSubscribeDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.FoodSubscribeFoodDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.LocalMediaDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.UserAccountDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.UserAccountItemDao;
|
||||
import com.tenlionsoft.baselib.core.db.daos.UserChargeDao;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.OftenContactBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.Database;
|
||||
import androidx.room.Room;
|
||||
import androidx.room.RoomDatabase;
|
||||
import androidx.room.migration.Migration;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
@ -39,37 +17,17 @@ import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
* 描述:
|
||||
*/
|
||||
@Database(entities = {
|
||||
FoodCanteenBean.class,
|
||||
FoodFoodBean.class,
|
||||
FoodPublishBean.class,
|
||||
FoodPublishFoodBean.class,
|
||||
FoodSubscribeBean.class,
|
||||
FoodSubscribeFoodBean.class,
|
||||
UserAccountBean.class,
|
||||
UserAccountItemBean.class,
|
||||
UserChargeBean.class,
|
||||
LocalMediaBean.class}, version = 2)
|
||||
DeptDatabaseBean.class,
|
||||
UserDatabaseBean.class,
|
||||
OftenContactBean.class}, version = 1)
|
||||
public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public abstract FoodCanteenDao getFoodCanteenDao();//食堂信息
|
||||
|
||||
public abstract FoodFoodDao getFoodFoodDao();//菜品
|
||||
public abstract DeptDao getDeptDao();
|
||||
|
||||
public abstract FoodPublishDao getFoodPublishDao();//菜单
|
||||
public abstract UserDao getUserDao();
|
||||
|
||||
public abstract FoodPublishFoodDao getFoodPublishFoodDao();//菜单菜品
|
||||
|
||||
public abstract FoodSubscribeDao getFoodSubscribeDao();//订单
|
||||
|
||||
public abstract FoodSubscribeFoodDao getFoodSubscribeFoodDao();//订单关联菜品
|
||||
|
||||
public abstract UserAccountDao getUserAccountDao();//账户
|
||||
|
||||
public abstract UserAccountItemDao getUserAccountItemDao();//账户流水
|
||||
|
||||
public abstract UserChargeDao getUserChargeDao();//账户充值记录
|
||||
|
||||
public abstract LocalMediaDao getLocalMediaDao();//本地下载的媒体记录
|
||||
public abstract OftenContactDao getOftenContactDao();
|
||||
|
||||
private static AppDatabase mInstance;
|
||||
|
||||
@ -77,7 +35,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
if (mInstance == null) {
|
||||
synchronized (AppDatabase.class) {
|
||||
if (mInstance == null) {
|
||||
mInstance = Room.databaseBuilder(ctx, AppDatabase.class, "sys_police_food.db")
|
||||
mInstance = Room.databaseBuilder(ctx, AppDatabase.class, "sys_msg.db")
|
||||
.allowMainThreadQueries()
|
||||
.build();
|
||||
}
|
||||
@ -85,12 +43,4 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
static final Migration MIGRATION_1_2 = new Migration(1, 2) {
|
||||
@Override
|
||||
public void migrate(@NonNull @NotNull SupportSQLiteDatabase database) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
@ -59,16 +59,16 @@ public class DataCenter {
|
||||
private void initDataCenter() {
|
||||
Observable.create(emitter -> {
|
||||
try {
|
||||
mFoodCanteenDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodCanteenDao();
|
||||
mFoodFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodFoodDao();
|
||||
mFoodPublishDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodPublishDao();
|
||||
mFoodPublishFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodPublishFoodDao();
|
||||
mFoodSubscribeDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodSubscribeDao();
|
||||
mFoodSubscribeFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodSubscribeFoodDao();
|
||||
mUserAccountDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserAccountDao();
|
||||
mUserAccountItemDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserAccountItemDao();
|
||||
mUserChargeDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserChargeDao();
|
||||
mLocalMediaDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getLocalMediaDao();
|
||||
// mFoodCanteenDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodCanteenDao();
|
||||
// mFoodFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodFoodDao();
|
||||
// mFoodPublishDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodPublishDao();
|
||||
// mFoodPublishFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodPublishFoodDao();
|
||||
// mFoodSubscribeDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodSubscribeDao();
|
||||
// mFoodSubscribeFoodDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getFoodSubscribeFoodDao();
|
||||
// mUserAccountDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserAccountDao();
|
||||
// mUserAccountItemDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserAccountItemDao();
|
||||
// mUserChargeDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getUserChargeDao();
|
||||
// mLocalMediaDao = AppDatabase.getInstance(BaseAppContext.getInstance()).getLocalMediaDao();
|
||||
emitter.onNext("");
|
||||
} catch (Exception e) {
|
||||
emitter.onError(e);
|
||||
|
@ -0,0 +1,35 @@
|
||||
package com.tenlionsoft.baselib.core.db;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 9:15 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 部门表
|
||||
*/
|
||||
@Dao
|
||||
public interface DeptDao {
|
||||
|
||||
@Insert
|
||||
void insertAll(List<DeptDatabaseBean> beans);
|
||||
|
||||
@Query("DELETE FROM db_dept")
|
||||
void deleteAll();
|
||||
|
||||
|
||||
@Query("SELECT * FROM db_dept WHERE `departmentParentId` = (:pid)")
|
||||
List<DeptDatabaseBean> queryByPid(String pid);
|
||||
|
||||
@Query("SELECT * FROM db_dept WHERE `departmentParentId`=(:pid) AND departmentName LIKE '%' || :keyword || '%' OR departmentTel LIKE '%' || :keyword || '%'")
|
||||
List<DeptDatabaseBean> queryByPidAndKeyWord(String pid, String keyword);
|
||||
|
||||
@Query("SELECT * FROM db_dept WHERE departmentId = (:id)")
|
||||
DeptDatabaseBean getDeptById(String id);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.tenlionsoft.baselib.core.db;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.OftenContactBean;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 10:49 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
@Dao
|
||||
public interface OftenContactDao {
|
||||
|
||||
@Insert
|
||||
void insertUser(OftenContactBean bean);
|
||||
|
||||
@Query("SELECT * FROM db_often_contact WHERE userId=(:userid)")
|
||||
OftenContactBean getOftenContactByUserId(String userid);
|
||||
|
||||
@Delete
|
||||
void deleteUser(OftenContactBean bean);
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
package com.tenlionsoft.baselib.core.db;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.Query;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 9:16 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 用户表
|
||||
*/
|
||||
@Dao
|
||||
public interface UserDao {
|
||||
|
||||
|
||||
@Insert
|
||||
void insertAll(List<UserDatabaseBean> beans);
|
||||
|
||||
@Query("DELETE FROM db_user")
|
||||
void deleteAll();
|
||||
|
||||
@Query("SELECT * FROM db_user")
|
||||
List<UserDatabaseBean> getAllUser();
|
||||
|
||||
/**
|
||||
* 除了自己其他所有联系人
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE userId != (:id)")
|
||||
List<UserDatabaseBean> getExceptMineUsers(String id);
|
||||
|
||||
/**
|
||||
* 获取联系人数量
|
||||
*/
|
||||
@Query("SELECT COUNT(*) FROM db_user")
|
||||
int getCount();
|
||||
|
||||
/**
|
||||
* 分页获取联系人
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE userId != (:id) LIMIT (:page),(:rows)")
|
||||
List<UserDatabaseBean> getExceptMineUserByPage(String id, int page, int rows);
|
||||
|
||||
/**
|
||||
* 在一定范围内的user
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE userId in (:ids)")
|
||||
List<UserDatabaseBean> getUsersByIds(String ids);
|
||||
|
||||
/**
|
||||
* 根据UserId获取详情
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE userId=(:id)")
|
||||
UserDatabaseBean getUserByUserId(String id);
|
||||
|
||||
/**
|
||||
* 获取全部常用联系人
|
||||
*/
|
||||
@Query("SELECT * FROM db_user INNER JOIN db_often_contact ON db_often_contact.userId= db_user.userId")
|
||||
List<UserDatabaseBean> getAllOftenContact();
|
||||
|
||||
/**
|
||||
* 根据关键字查询联系人
|
||||
*/
|
||||
@Query("SELECT * FROM (SELECT * FROM db_user INNER JOIN db_often_contact ON db_often_contact.userId= db_user.userId) WHERE userName LIKE '%' || :keyword || '%' OR userPhone LIKE '%' || :keyword || '%'")
|
||||
List<UserDatabaseBean> getOftenContactByKeyword(String keyword);
|
||||
|
||||
// /**
|
||||
// * Rxjava方式获取全部常用联系人
|
||||
// */
|
||||
// @Query("SELECT * FROM db_user INNER JOIN db_often_contact ON db_often_contact.userId= db_user.userId")
|
||||
// Flowable<List<UserDatabaseBean>> getRxAllOftenContact();
|
||||
|
||||
/**
|
||||
* 根据部门Id获取部门下所有人员
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE departmentId = (:deptId)")
|
||||
List<UserDatabaseBean> getUsersByDeptId(String deptId);
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
*/
|
||||
@Query("SELECT * FROM db_user WHERE `departmentId`=(:deptId) AND userName LIKE '%' || :keyword || '%' OR userPhone LIKE '%' || :keyword || '%'")
|
||||
List<UserDatabaseBean> queryByDeptIdAndKeyWord(String deptId, String keyword);
|
||||
|
||||
@Query("SELECT * FROM db_user WHERE userName LIKE (:name)")
|
||||
List<UserDatabaseBean> getUsersLikeName(String name);
|
||||
|
||||
|
||||
@Query("SELECT * FROM db_user WHERE userName LIKE '%' || :name || '%'")
|
||||
List<UserDatabaseBean> getUsersLikeNameSync(String name);
|
||||
}
|
@ -0,0 +1,427 @@
|
||||
package com.tenlionsoft.baselib.core.db.beans;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 9:12 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 部门表
|
||||
*/
|
||||
@Entity(tableName = "db_dept")
|
||||
public class DeptDatabaseBean {
|
||||
@NonNull
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "departmentAddress")
|
||||
private String departmentAddress;
|
||||
@ColumnInfo(name = "departmentArea1Code")
|
||||
private String departmentArea1Code;
|
||||
@ColumnInfo(name = "departmentArea1Id")
|
||||
private String departmentArea1Id;
|
||||
@ColumnInfo(name = "departmentArea1Name")
|
||||
private String departmentArea1Name;
|
||||
@ColumnInfo(name = "departmentArea2Code")
|
||||
private String departmentArea2Code;
|
||||
@ColumnInfo(name = "departmentArea2Id")
|
||||
private String departmentArea2Id;
|
||||
@ColumnInfo(name = "departmentArea2Name")
|
||||
private String departmentArea2Name;
|
||||
@ColumnInfo(name = "departmentArea3Code")
|
||||
private String departmentArea3Code;
|
||||
@ColumnInfo(name = "departmentArea3Id")
|
||||
private String departmentArea3Id;
|
||||
@ColumnInfo(name = "departmentArea3Name")
|
||||
private String departmentArea3Name;
|
||||
@ColumnInfo(name = "departmentArea4Code")
|
||||
private String departmentArea4Code;
|
||||
@ColumnInfo(name = "departmentArea4Id")
|
||||
private String departmentArea4Id;
|
||||
@ColumnInfo(name = "departmentArea4Name")
|
||||
private String departmentArea4Name;
|
||||
@ColumnInfo(name = "departmentArea5Code")
|
||||
private String departmentArea5Code;
|
||||
@ColumnInfo(name = "departmentArea5Id")
|
||||
private String departmentArea5Id;
|
||||
@ColumnInfo(name = "departmentArea5Name")
|
||||
private String departmentArea5Name;
|
||||
@ColumnInfo(name = "departmentCode")
|
||||
private String departmentCode;
|
||||
@ColumnInfo(name = "departmentDuty")
|
||||
private String departmentDuty;
|
||||
@ColumnInfo(name = "departmentFax")
|
||||
private String departmentFax;
|
||||
@ColumnInfo(name = "departmentId")
|
||||
private String departmentId;
|
||||
@ColumnInfo(name = "departmentIntId")
|
||||
private int departmentIntId;
|
||||
@ColumnInfo(name = "departmentLatitude")
|
||||
private String departmentLatitude;
|
||||
@ColumnInfo(name = "departmentLogo")
|
||||
private int departmentLogo;
|
||||
@ColumnInfo(name = "departmentLogoHover")
|
||||
private int departmentLogoHover;
|
||||
@ColumnInfo(name = "departmentLongitude")
|
||||
private String departmentLongitude;
|
||||
@ColumnInfo(name = "departmentMaster")
|
||||
private String departmentMaster;
|
||||
@ColumnInfo(name = "departmentMasterName")
|
||||
private String departmentMasterName;
|
||||
@ColumnInfo(name = "departmentName")
|
||||
private String departmentName;
|
||||
@ColumnInfo(name = "departmentNameEn")
|
||||
private String departmentNameEn;
|
||||
@ColumnInfo(name = "departmentNameOther")
|
||||
private String departmentNameOther;
|
||||
@ColumnInfo(name = "departmentNo")
|
||||
private String departmentNo;
|
||||
@ColumnInfo(name = "departmentOrder")
|
||||
private String departmentOrder;
|
||||
@ColumnInfo(name = "departmentParentId")
|
||||
private String departmentParentId;
|
||||
@ColumnInfo(name = "departmentParentName")
|
||||
private String departmentParentName;
|
||||
@ColumnInfo(name = "departmentState")
|
||||
private int departmentState;
|
||||
@ColumnInfo(name = "departmentSummary")
|
||||
private String departmentSummary;
|
||||
@ColumnInfo(name = "departmentTel")
|
||||
private String departmentTel;
|
||||
@ColumnInfo(name = "departmentType")
|
||||
private int departmentType;
|
||||
|
||||
|
||||
@Ignore
|
||||
private List<DeptDatabaseBean> subDepartments;
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getDepartmentAddress() {
|
||||
return departmentAddress;
|
||||
}
|
||||
|
||||
public void setDepartmentAddress(String departmentAddress) {
|
||||
this.departmentAddress = departmentAddress;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Code() {
|
||||
return departmentArea1Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Code(String departmentArea1Code) {
|
||||
this.departmentArea1Code = departmentArea1Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Id() {
|
||||
return departmentArea1Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Id(String departmentArea1Id) {
|
||||
this.departmentArea1Id = departmentArea1Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea1Name() {
|
||||
return departmentArea1Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea1Name(String departmentArea1Name) {
|
||||
this.departmentArea1Name = departmentArea1Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Code() {
|
||||
return departmentArea2Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Code(String departmentArea2Code) {
|
||||
this.departmentArea2Code = departmentArea2Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Id() {
|
||||
return departmentArea2Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Id(String departmentArea2Id) {
|
||||
this.departmentArea2Id = departmentArea2Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea2Name() {
|
||||
return departmentArea2Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea2Name(String departmentArea2Name) {
|
||||
this.departmentArea2Name = departmentArea2Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Code() {
|
||||
return departmentArea3Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Code(String departmentArea3Code) {
|
||||
this.departmentArea3Code = departmentArea3Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Id() {
|
||||
return departmentArea3Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Id(String departmentArea3Id) {
|
||||
this.departmentArea3Id = departmentArea3Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea3Name() {
|
||||
return departmentArea3Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea3Name(String departmentArea3Name) {
|
||||
this.departmentArea3Name = departmentArea3Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Code() {
|
||||
return departmentArea4Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Code(String departmentArea4Code) {
|
||||
this.departmentArea4Code = departmentArea4Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Id() {
|
||||
return departmentArea4Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Id(String departmentArea4Id) {
|
||||
this.departmentArea4Id = departmentArea4Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea4Name() {
|
||||
return departmentArea4Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea4Name(String departmentArea4Name) {
|
||||
this.departmentArea4Name = departmentArea4Name;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Code() {
|
||||
return departmentArea5Code;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Code(String departmentArea5Code) {
|
||||
this.departmentArea5Code = departmentArea5Code;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Id() {
|
||||
return departmentArea5Id;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Id(String departmentArea5Id) {
|
||||
this.departmentArea5Id = departmentArea5Id;
|
||||
}
|
||||
|
||||
public String getDepartmentArea5Name() {
|
||||
return departmentArea5Name;
|
||||
}
|
||||
|
||||
public void setDepartmentArea5Name(String departmentArea5Name) {
|
||||
this.departmentArea5Name = departmentArea5Name;
|
||||
}
|
||||
|
||||
public String getDepartmentCode() {
|
||||
return departmentCode;
|
||||
}
|
||||
|
||||
public void setDepartmentCode(String departmentCode) {
|
||||
this.departmentCode = departmentCode;
|
||||
}
|
||||
|
||||
public String getDepartmentDuty() {
|
||||
return departmentDuty;
|
||||
}
|
||||
|
||||
public void setDepartmentDuty(String departmentDuty) {
|
||||
this.departmentDuty = departmentDuty;
|
||||
}
|
||||
|
||||
public String getDepartmentFax() {
|
||||
return departmentFax;
|
||||
}
|
||||
|
||||
public void setDepartmentFax(String departmentFax) {
|
||||
this.departmentFax = departmentFax;
|
||||
}
|
||||
|
||||
public String getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(String departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public int getDepartmentIntId() {
|
||||
return departmentIntId;
|
||||
}
|
||||
|
||||
public void setDepartmentIntId(int departmentIntId) {
|
||||
this.departmentIntId = departmentIntId;
|
||||
}
|
||||
|
||||
public String getDepartmentLatitude() {
|
||||
return departmentLatitude;
|
||||
}
|
||||
|
||||
public void setDepartmentLatitude(String departmentLatitude) {
|
||||
this.departmentLatitude = departmentLatitude;
|
||||
}
|
||||
|
||||
public int getDepartmentLogo() {
|
||||
return departmentLogo;
|
||||
}
|
||||
|
||||
public void setDepartmentLogo(int departmentLogo) {
|
||||
this.departmentLogo = departmentLogo;
|
||||
}
|
||||
|
||||
public int getDepartmentLogoHover() {
|
||||
return departmentLogoHover;
|
||||
}
|
||||
|
||||
public void setDepartmentLogoHover(int departmentLogoHover) {
|
||||
this.departmentLogoHover = departmentLogoHover;
|
||||
}
|
||||
|
||||
public String getDepartmentLongitude() {
|
||||
return departmentLongitude;
|
||||
}
|
||||
|
||||
public void setDepartmentLongitude(String departmentLongitude) {
|
||||
this.departmentLongitude = departmentLongitude;
|
||||
}
|
||||
|
||||
public String getDepartmentMaster() {
|
||||
return departmentMaster;
|
||||
}
|
||||
|
||||
public void setDepartmentMaster(String departmentMaster) {
|
||||
this.departmentMaster = departmentMaster;
|
||||
}
|
||||
|
||||
public String getDepartmentMasterName() {
|
||||
return departmentMasterName;
|
||||
}
|
||||
|
||||
public void setDepartmentMasterName(String departmentMasterName) {
|
||||
this.departmentMasterName = departmentMasterName;
|
||||
}
|
||||
|
||||
public String getDepartmentName() {
|
||||
return departmentName;
|
||||
}
|
||||
|
||||
public void setDepartmentName(String departmentName) {
|
||||
this.departmentName = departmentName;
|
||||
}
|
||||
|
||||
public String getDepartmentNameEn() {
|
||||
return departmentNameEn;
|
||||
}
|
||||
|
||||
public void setDepartmentNameEn(String departmentNameEn) {
|
||||
this.departmentNameEn = departmentNameEn;
|
||||
}
|
||||
|
||||
public String getDepartmentNameOther() {
|
||||
return departmentNameOther;
|
||||
}
|
||||
|
||||
public void setDepartmentNameOther(String departmentNameOther) {
|
||||
this.departmentNameOther = departmentNameOther;
|
||||
}
|
||||
|
||||
public String getDepartmentNo() {
|
||||
return departmentNo;
|
||||
}
|
||||
|
||||
public void setDepartmentNo(String departmentNo) {
|
||||
this.departmentNo = departmentNo;
|
||||
}
|
||||
|
||||
public String getDepartmentOrder() {
|
||||
return departmentOrder;
|
||||
}
|
||||
|
||||
public void setDepartmentOrder(String departmentOrder) {
|
||||
this.departmentOrder = departmentOrder;
|
||||
}
|
||||
|
||||
public String getDepartmentParentId() {
|
||||
return departmentParentId;
|
||||
}
|
||||
|
||||
public void setDepartmentParentId(String departmentParentId) {
|
||||
this.departmentParentId = departmentParentId;
|
||||
}
|
||||
|
||||
public String getDepartmentParentName() {
|
||||
return departmentParentName;
|
||||
}
|
||||
|
||||
public void setDepartmentParentName(String departmentParentName) {
|
||||
this.departmentParentName = departmentParentName;
|
||||
}
|
||||
|
||||
public int getDepartmentState() {
|
||||
return departmentState;
|
||||
}
|
||||
|
||||
public void setDepartmentState(int departmentState) {
|
||||
this.departmentState = departmentState;
|
||||
}
|
||||
|
||||
public String getDepartmentSummary() {
|
||||
return departmentSummary;
|
||||
}
|
||||
|
||||
public void setDepartmentSummary(String departmentSummary) {
|
||||
this.departmentSummary = departmentSummary;
|
||||
}
|
||||
|
||||
public String getDepartmentTel() {
|
||||
return departmentTel;
|
||||
}
|
||||
|
||||
public void setDepartmentTel(String departmentTel) {
|
||||
this.departmentTel = departmentTel;
|
||||
}
|
||||
|
||||
public int getDepartmentType() {
|
||||
return departmentType;
|
||||
}
|
||||
|
||||
public void setDepartmentType(int departmentType) {
|
||||
this.departmentType = departmentType;
|
||||
}
|
||||
|
||||
public List<DeptDatabaseBean> getSubDepartments() {
|
||||
return subDepartments;
|
||||
}
|
||||
|
||||
public void setSubDepartments(List<DeptDatabaseBean> subDepartments) {
|
||||
this.subDepartments = subDepartments;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.tenlionsoft.baselib.core.db.beans;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 5:20 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
@Entity(tableName = "db_often_contact")
|
||||
public class OftenContactBean {
|
||||
@NonNull
|
||||
@PrimaryKey(autoGenerate = true)
|
||||
private int id;
|
||||
|
||||
@ColumnInfo(name = "userId")
|
||||
private String userId;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
package com.tenlionsoft.baselib.core.db.daos;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.MessageBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 1/18/21 - 5:36 PM
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: tableName=message
|
||||
*/
|
||||
@Dao
|
||||
public interface MessageDao {
|
||||
/**
|
||||
* 获取全部信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg")
|
||||
List<MessageBean> getAllMsg();
|
||||
|
||||
/**
|
||||
* 根据ID获取消息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg WHERE id =(:id) ")
|
||||
List<MessageBean> getMsgById(String id);
|
||||
|
||||
/**
|
||||
* 根据信息来源查询消息
|
||||
*
|
||||
* @param from
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg WHERE `from`=(:from)")
|
||||
List<MessageBean> getMsgByFrom(String from);
|
||||
|
||||
/**
|
||||
* 根据发送给谁进行查询
|
||||
*
|
||||
* @param to
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg WHERE `to` =(:to)")
|
||||
List<MessageBean> getMsgByTo(String to);
|
||||
|
||||
|
||||
/**
|
||||
* 根据哪里
|
||||
*
|
||||
* @param form
|
||||
* @param pageSize
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg WHERE `from`=(:form) ORDER BY timestamp LIMIT (((:page)-1)*(:pageSize)),(:pageSize)")
|
||||
List<MessageBean> getMsgByPage(String form, int pageSize, int page);
|
||||
|
||||
/**
|
||||
* 查询与单人的聊天记录
|
||||
*/
|
||||
@Query("SELECT * FROM db_msg t1 WHERE t1.id IN (SELECT id FROM db_msg WHERE `from`=(:form) AND `to`=(:to) OR `from`=(:to) AND `to`=(:form) ORDER BY timestamp DESC LIMIT (((:page)-1)*(:pageSize)),(:pageSize)) ORDER by t1.timestamp ASC")
|
||||
List<MessageBean> getMsgByFromOrToPage(String form, String to, int pageSize, int page);
|
||||
|
||||
/**
|
||||
* 清空与某个人的聊天记录
|
||||
*/
|
||||
@Query("DELETE FROM db_msg WHERE `from`=(:from) AND `to`=(:to) OR `from`=(:to) AND `to`=(:from)")
|
||||
void delChatHistory(String from, String to);
|
||||
|
||||
/**
|
||||
* 添加消息多个
|
||||
*
|
||||
* @param beans
|
||||
*/
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(MessageBean... beans);
|
||||
|
||||
/**
|
||||
* 批量添加
|
||||
*/
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertAll(List<MessageBean> beans);
|
||||
|
||||
/**
|
||||
* 添加消息-单个
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
void insertMsg(MessageBean bean);
|
||||
|
||||
/**
|
||||
* 清除全部聊天记录
|
||||
*/
|
||||
@Query("DELETE FROM db_msg")
|
||||
void delAllMsg();
|
||||
}
|
@ -7,8 +7,9 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
||||
*/
|
||||
public class BaseUrlApi {
|
||||
|
||||
public static final String IP = "http://192.168.0.120:8080/";/* 测试IP */
|
||||
// public static final String IP = "http://192.168.0.103:7008/";/* 测试IP */
|
||||
// public static final String IP = "http://192.168.0.120:8080/";/* 测试IP */
|
||||
// /systemoa/
|
||||
public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
||||
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||
public static final String SYS_USERCENTER = "usercenter/";
|
||||
public static final String SYS_POPULATION = "population/";/*人口系统*/
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.6 KiB |
BIN
baselib/src/main/res/drawable-xhdpi/ic_add_contact_icon.png
Normal file
After Width: | Height: | Size: 823 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_address_icon_16.png
Normal file
After Width: | Height: | Size: 570 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_dept_contact_icon.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
baselib/src/main/res/drawable-xhdpi/ic_dept_icon_16.png
Normal file
After Width: | Height: | Size: 461 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_email_icon.png
Normal file
After Width: | Height: | Size: 468 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_location_blue.png
Executable file
After Width: | Height: | Size: 609 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_phone_icon.png
Normal file
After Width: | Height: | Size: 368 B |
BIN
baselib/src/main/res/drawable-xhdpi/ic_send_msg_icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
baselib/src/main/res/drawable-xhdpi/ic_user_contact_icon.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
baselib/src/main/res/drawable-xhdpi/ic_voice_call_icon.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
@ -49,7 +49,7 @@
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_close_no_cir" />
|
||||
|
||||
<TextView
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_show"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -59,8 +59,8 @@ ext {
|
||||
gCompileSdkVersion = 30
|
||||
gMinSdkVersion = 19
|
||||
gTargetSdkVersion = 30
|
||||
gVersionCode = 9
|
||||
gVersionName = '1.0.8'
|
||||
gVersionCode = 4
|
||||
gVersionName = '1.0.4'
|
||||
gBuildToolsVersion = "29.0.2"
|
||||
// gVersionCode=26
|
||||
// gVersionName='1.3.0'
|
||||
|
@ -17,7 +17,6 @@ import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@ -26,12 +25,14 @@ import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tengshisoft.mainmodule.R;
|
||||
import com.tengshisoft.mainmodule.R2;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.GlobalProvider;
|
||||
import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AppTokenUser;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.LoginUser;
|
||||
import com.tenlionsoft.baselib.core.db.AppDatabase;
|
||||
import com.tenlionsoft.baselib.core.network.update.CheckUpdateUtils;
|
||||
import com.tenlionsoft.baselib.core.network.update.service.DownloadService;
|
||||
import com.tenlionsoft.baselib.core.network.update.utils.Constants;
|
||||
@ -183,6 +184,19 @@ public class LoginActivity extends BaseActivity {
|
||||
setTouchDelegate(mIvExit, 30);
|
||||
mIvExit.setOnClickListener(v -> showConfirmDialog());
|
||||
isPad();
|
||||
initDatabase();
|
||||
}
|
||||
|
||||
private void initDatabase() {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
super.run();
|
||||
AppDatabase.getInstance(BaseAppContext.getInstance()).getUserDao();
|
||||
AppDatabase.getInstance(BaseAppContext.getInstance()).getDeptDao();
|
||||
AppDatabase.getInstance(BaseAppContext.getInstance()).getOftenContactDao();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
private void showConfirmDialog() {
|
||||
|
@ -170,7 +170,7 @@
|
||||
android:focusable="true"
|
||||
android:text="忘记密码"
|
||||
android:textSize="15sp"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
@ -3,18 +3,56 @@
|
||||
package="com.tenlionsoft.oamodule">
|
||||
|
||||
<application>
|
||||
<activity android:name=".activity.oaflow.OaFlowCenterActivity"></activity>
|
||||
<activity
|
||||
android:name=".activity.addresslist.AddressUserDetailActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.addresslist.AddressListActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.OaFlowCenterActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.OaFlowApproveActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity android:name=".activity.common.WebDemoActivity" />
|
||||
<activity android:name=".activity.oaflow.ApplyOaFlowActivity" />
|
||||
<activity android:name=".activity.oaflow.MineUnreadActivity" />
|
||||
<activity android:name=".activity.oaflow.MineReadActivity" />
|
||||
<activity android:name=".activity.oaflow.MineTodoActivity" />
|
||||
<activity android:name=".activity.oaflow.MineDoneActivity" />
|
||||
<activity
|
||||
android:name=".activity.common.WebDemoActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.ApplyOaFlowActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineUnreadActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineReadActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineTodoActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.oaflow.MineDoneActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateVisible|adjustResize" />
|
||||
<activity
|
||||
android:name=".activity.common.WebViewActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
|
@ -0,0 +1,632 @@
|
||||
package com.tenlionsoft.oamodule.activity.addresslist;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.db.AppDatabase;
|
||||
import com.tenlionsoft.baselib.core.db.DeptDao;
|
||||
import com.tenlionsoft.baselib.core.db.UserDao;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceEditText;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.DeptChooseAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.DeptOrUserAdapter;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2022年06月13日16:39:08
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 通讯录
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_ADDRESS_LIST)
|
||||
public class AddressListActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.iv_back)
|
||||
ImageView mIvBack;
|
||||
@BindView(R2.id.rg_type)
|
||||
RadioGroup mRgType;
|
||||
@BindView(R2.id.rl_content_title)
|
||||
RelativeLayout mRlContentTitle;
|
||||
@BindView(R2.id.et_base_search_cancel)
|
||||
TypeFaceEditText mEtBaseSearchCancel;
|
||||
@BindView(R2.id.tv_base_search_cancel)
|
||||
TypeFaceTextView mTvBaseSearchCancel;
|
||||
@BindView(R2.id.ll_base_search_cancel)
|
||||
LinearLayout mLlBaseSearchCancel;
|
||||
@BindView(R2.id.rlv_users)
|
||||
RecyclerView mRlvUsers;
|
||||
@BindView(R2.id.rlv_sel_dept)
|
||||
RecyclerView mRlvSelDept;
|
||||
@BindView(R2.id.rlv_dept)
|
||||
RecyclerView mRlvDept;
|
||||
@BindView(R2.id.csv_state)
|
||||
CustomStateView mCsvState;
|
||||
@BindView(R2.id.ll_dept)
|
||||
LinearLayout mLlDept;
|
||||
@BindView(R2.id.v_line)
|
||||
View mVLine;
|
||||
@BindView(R2.id.rb_dept)
|
||||
RadioButton mRbDept;
|
||||
@BindView(R2.id.rb_often)
|
||||
RadioButton mRbOften;
|
||||
private AppDatabase mDatabase;
|
||||
private UserDao mUserDao;
|
||||
private DeptDao mDeptDao;
|
||||
private int mCount;
|
||||
private List<UserDatabaseBean> mUserDatabaseBeanList;
|
||||
private ProgressDialog mDialog;
|
||||
private List<DeptDatabaseBean> mDatabaseBeanList;
|
||||
private List<Object> mDatas;
|
||||
private String mSelDeptId = "0";
|
||||
private DeptOrUserAdapter mAdapter;
|
||||
private List<DeptDatabaseBean> mBeans;
|
||||
private List<DeptDatabaseBean> mSelDatas;
|
||||
private DeptChooseAdapter mSelAdapter;
|
||||
private List<Object> mUserDatas = new ArrayList<>();
|
||||
private List<Object> mSearchData = new ArrayList<>();
|
||||
private String mKeyword;
|
||||
private int mCurrentDeptIndex = 0;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_address_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
ButterKnife.bind(this);
|
||||
mRlTitleBar.setVisibility(View.GONE);
|
||||
ImmersionBar.with(this)
|
||||
.statusBarDarkFont(true)
|
||||
.statusBarColor(R.color.gray_bg)
|
||||
.titleBar(mRlContentTitle)
|
||||
.init();
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
boolean isSync = UserLgUtils.getIsSync();
|
||||
if (isSync) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
initViews();
|
||||
} else {
|
||||
showSyncDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化视图
|
||||
*/
|
||||
private void initViews() {
|
||||
mIvBack.setOnClickListener(v -> finish());
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
mDatas = new ArrayList<>();
|
||||
DeptDatabaseBean bean1 = new DeptDatabaseBean();
|
||||
bean1.setDepartmentName("组织部门");
|
||||
bean1.setDepartmentId("0");
|
||||
mSelDatas = new ArrayList<>();
|
||||
mSelDatas.add(bean1);
|
||||
mSelAdapter = new DeptChooseAdapter(mActivity, mSelDatas);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(mActivity);
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
mRlvSelDept.setLayoutManager(linearLayoutManager);
|
||||
mRlvSelDept.setAdapter(mSelAdapter);
|
||||
mAdapter = new DeptOrUserAdapter(mActivity, mDatas);
|
||||
mRlvDept.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvDept.setAdapter(mAdapter);
|
||||
|
||||
mRlvUsers.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvUsers.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(o -> {
|
||||
if (o instanceof UserDatabaseBean) {
|
||||
//用户
|
||||
UserDatabaseBean bean = (UserDatabaseBean) o;
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_ADDRESS_USER_DETAIL)
|
||||
.withString("id", bean.getUserId())
|
||||
.withString("deptId", bean.getDepartmentId())
|
||||
.navigation();
|
||||
} else {
|
||||
//部门
|
||||
DeptDatabaseBean bean = (DeptDatabaseBean) o;
|
||||
//添加到当前选中的集合中
|
||||
mSelDatas.add(bean);
|
||||
mSelAdapter.setData(mSelDatas);
|
||||
//获取当前选中的下一级
|
||||
mRlvSelDept.scrollToPosition(mSelDatas.size() - 1);
|
||||
mSelDeptId = bean.getDepartmentId();
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
queryDept();
|
||||
}
|
||||
});
|
||||
|
||||
mSelAdapter.setOnItemChoose((bean12, pos) -> {
|
||||
mSelDatas = mSelDatas.subList(0, pos + 1);
|
||||
mSelAdapter.setData(mSelDatas);
|
||||
mRlvSelDept.scrollToPosition(mSelDatas.size() - 1);
|
||||
mSelDeptId = bean12.getDepartmentId();
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
if (pos < mCurrentDeptIndex) {
|
||||
mKeyword = "";
|
||||
mEtBaseSearchCancel.setText("");
|
||||
mCurrentDeptIndex = 0;
|
||||
}
|
||||
//判断是否在搜索
|
||||
if (!TextUtils.isEmpty(mKeyword) && mCurrentDeptIndex == pos) {
|
||||
queryDeptByKeyword();
|
||||
} else {
|
||||
queryDept();
|
||||
}
|
||||
});
|
||||
queryDept();
|
||||
mRgType.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
mKeyword = "";
|
||||
mEtBaseSearchCancel.setText("");
|
||||
mCurrentDeptIndex = 0;
|
||||
if (checkedId == R.id.rb_dept) {
|
||||
//部门
|
||||
mLlDept.setVisibility(View.VISIBLE);
|
||||
mRlvUsers.setVisibility(View.GONE);
|
||||
queryDept();
|
||||
} else if (checkedId == R.id.rb_often) {
|
||||
//常用联系人
|
||||
mLlDept.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
getUserList();
|
||||
}
|
||||
});
|
||||
|
||||
mEtBaseSearchCancel.setOnEditorActionListener((v, actionId, event) -> {
|
||||
LogUtils.e("搜索==" + actionId);
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
hideSoftKeyboard();
|
||||
mCurrentDeptIndex = mSelDatas.size() - 1;
|
||||
mEtBaseSearchCancel.clearFocus();
|
||||
mKeyword = v.getText().toString();
|
||||
if (mRbOften.isChecked()) {
|
||||
//常用联系人
|
||||
getUserListByKeyword();
|
||||
} else {
|
||||
//部门
|
||||
queryDeptByKeyword();
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
mTvBaseSearchCancel.setOnClickListener(v -> {
|
||||
mKeyword = "";
|
||||
mCurrentDeptIndex = 0;
|
||||
mEtBaseSearchCancel.setText("");
|
||||
mEtBaseSearchCancel.clearFocus();
|
||||
mSearchData.clear();
|
||||
if (mRbOften.isChecked()) {
|
||||
getUserList();
|
||||
} else {
|
||||
queryDept();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询部门
|
||||
*/
|
||||
private void queryDept() {
|
||||
mDatas.clear();
|
||||
Observable.create((ObservableOnSubscribe<Integer>) emitter -> {
|
||||
try {
|
||||
if (mDatabase == null) {
|
||||
mDatabase = AppDatabase.getInstance(mActivity.getApplication());
|
||||
mDeptDao = mDatabase.getDeptDao();
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
}
|
||||
List<DeptDatabaseBean> beans = mDeptDao.queryByPid(mSelDeptId);
|
||||
List<UserDatabaseBean> deptId = mUserDao.getUsersByDeptId(mSelDeptId);
|
||||
if (beans.size() > 0 || deptId.size() > 0) {
|
||||
mDatas.addAll(beans);
|
||||
mDatas.addAll(deptId);
|
||||
emitter.onNext(1);
|
||||
} else {
|
||||
emitter.onNext(2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Exception("加载失败"));
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Integer>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Integer o) {
|
||||
if (o == 1) {
|
||||
//有数据
|
||||
mRlvDept.setVisibility(View.VISIBLE);
|
||||
mAdapter.setData(mDatas);
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
//没有数据
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
// 加载失败
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据关键字查询部门
|
||||
*/
|
||||
private void queryDeptByKeyword() {
|
||||
mDatas.clear();
|
||||
Observable.create((ObservableOnSubscribe<Integer>) emitter -> {
|
||||
try {
|
||||
if (mDatabase == null) {
|
||||
mDatabase = AppDatabase.getInstance(mActivity.getApplication());
|
||||
mDeptDao = mDatabase.getDeptDao();
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
}
|
||||
List<DeptDatabaseBean> beans = mDeptDao.queryByPidAndKeyWord(mSelDeptId, mKeyword);
|
||||
List<UserDatabaseBean> deptId = mUserDao.queryByDeptIdAndKeyWord(mSelDeptId, mKeyword);
|
||||
if (beans.size() > 0 || deptId.size() > 0) {
|
||||
mDatas.addAll(beans);
|
||||
mDatas.addAll(deptId);
|
||||
emitter.onNext(1);
|
||||
} else {
|
||||
emitter.onNext(2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Exception("加载失败"));
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Integer>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Integer o) {
|
||||
if (o == 1) {
|
||||
//有数据
|
||||
mRlvDept.setVisibility(View.VISIBLE);
|
||||
mAdapter.setData(mDatas);
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
//没有数据
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
// 加载失败
|
||||
mRlvDept.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 提示需要同步dialog
|
||||
*/
|
||||
private void showSyncDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
|
||||
builder.setTitle("提示")
|
||||
.setMessage("您还未同步通讯录,现在要同步吗?")
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
dialog.dismiss();
|
||||
doSyncContact();
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
dialog.dismiss();
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步通讯录
|
||||
*/
|
||||
private void doSyncContact() {
|
||||
mDatabase = AppDatabase.getInstance(mActivity);
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
mDeptDao = mDatabase.getDeptDao();
|
||||
mDialog = UIUtil.initDialog(mActivity, "同步中...");
|
||||
mDialog.show();
|
||||
mCount = 0;
|
||||
doSyncDept();
|
||||
doSyncUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步用户
|
||||
*/
|
||||
private void doSyncUser() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getAllUserList()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<UserDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<UserDatabaseBean> userDatabaseBeans) {
|
||||
mUserDatabaseBeanList = userDatabaseBeans;
|
||||
++mCount;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
mDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步组织
|
||||
*/
|
||||
private void doSyncDept() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getAllDeptList()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<DeptDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull List<DeptDatabaseBean> deptDatabaseBeans) {
|
||||
++mCount;
|
||||
mDatabaseBeanList = deptDatabaseBeans;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始同步
|
||||
*/
|
||||
private void insertAll() {
|
||||
try {
|
||||
mDatabase.runInTransaction(() -> {
|
||||
mDeptDao.deleteAll();
|
||||
mUserDao.deleteAll();
|
||||
mUserDao.insertAll(mUserDatabaseBeanList);
|
||||
mDeptDao.insertAll(mDatabaseBeanList);
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
initViews();
|
||||
ToastUtils.show("同步完成");
|
||||
UserLgUtils.setIsSync(true);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常用联系人
|
||||
*/
|
||||
private void getUserList() {
|
||||
mUserDatas.clear();
|
||||
Observable.create(emitter -> {
|
||||
if (mDatabase == null) {
|
||||
mDatabase = AppDatabase.getInstance(mActivity.getApplication());
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
}
|
||||
mUserDatas.addAll(mUserDao.getAllOftenContact());
|
||||
emitter.onNext("");
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Object>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Object o) {
|
||||
if (mUserDatas.size() > 0) {
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
mRlvUsers.setVisibility(View.VISIBLE);
|
||||
mAdapter.setData(mUserDatas);
|
||||
} else {
|
||||
mRlvUsers.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
mRlvUsers.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 搜索常用联系人
|
||||
*/
|
||||
private void getUserListByKeyword() {
|
||||
mUserDatas.clear();
|
||||
Observable.create(emitter -> {
|
||||
if (mDatabase == null) {
|
||||
mDatabase = AppDatabase.getInstance(mActivity.getApplication());
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
}
|
||||
mUserDatas.addAll(mUserDao.getOftenContactByKeyword(mKeyword));
|
||||
emitter.onNext("");
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Object>() {
|
||||
@Override
|
||||
public void onSubscribe(@io.reactivex.rxjava3.annotations.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@io.reactivex.rxjava3.annotations.NonNull Object o) {
|
||||
if (mUserDatas.size() > 0) {
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
mRlvUsers.setVisibility(View.VISIBLE);
|
||||
mAdapter.setData(mUserDatas);
|
||||
} else {
|
||||
mRlvUsers.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@io.reactivex.rxjava3.annotations.NonNull Throwable e) {
|
||||
e.printStackTrace();
|
||||
mRlvUsers.setVisibility(View.GONE);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (mRbOften.isChecked()) {
|
||||
if (!TextUtils.isEmpty(mKeyword)) {
|
||||
getUserListByKeyword();
|
||||
} else {
|
||||
getUserList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,391 @@
|
||||
package com.tenlionsoft.oamodule.activity.addresslist;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.tenlionsoft.baselib.app.BaseAppContext;
|
||||
import com.tenlionsoft.baselib.constant.Constant;
|
||||
import com.tenlionsoft.baselib.constant.ConstantsV2;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.MessageBean;
|
||||
import com.tenlionsoft.baselib.core.beans.OftenContactBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.db.AppDatabase;
|
||||
import com.tenlionsoft.baselib.core.db.DeptDao;
|
||||
import com.tenlionsoft.baselib.core.db.OftenContactDao;
|
||||
import com.tenlionsoft.baselib.core.db.UserDao;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||
import com.tenlionsoft.baselib.utils.AppUtils;
|
||||
import com.tenlionsoft.baselib.utils.EncryptedSPTool;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableOnSubscribe;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 作者: Adam
|
||||
* 日期: 2021年10月29日10:12:55
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 通讯录用户详情
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_ACTIVITY_ADDRESS_USER_DETAIL)
|
||||
public class AddressUserDetailActivity extends BaseActivity {
|
||||
|
||||
@BindView(R2.id.iv_user_icon)
|
||||
ImageView mIvUserIcon;
|
||||
@BindView(R2.id.tv_user_name)
|
||||
TextView mTvUserName;
|
||||
@BindView(R2.id.tv_dept)
|
||||
TextView mTvDept;
|
||||
@BindView(R2.id.tv_email)
|
||||
TextView mTvEmail;
|
||||
@BindView(R2.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R2.id.tv_dept_dept)
|
||||
TextView mTvDeptDept;
|
||||
@BindView(R2.id.tv_dept_phone)
|
||||
TextView mTvDeptPhone;
|
||||
@BindView(R2.id.tv_dept_address)
|
||||
TextView mTvDeptAddress;
|
||||
@BindView(R2.id.ll_msg)
|
||||
LinearLayout mLlMsg;
|
||||
@BindView(R2.id.ll_call)
|
||||
LinearLayout mLlCall;
|
||||
@BindView(R2.id.ll_add_contact)
|
||||
LinearLayout mLlAddContact;
|
||||
@BindView(R2.id.tv_add_contact)
|
||||
TextView mTvAddContact;
|
||||
private Unbinder mBind;
|
||||
private AppDatabase mDatabase;
|
||||
private String mId;
|
||||
private OftenContactDao mOftenContactDao;
|
||||
private UserDao mUserDao;
|
||||
private DeptDao mDeptDao;
|
||||
private OftenContactBean mOftenContactByUserId;
|
||||
private UserDatabaseBean mUserByUserId;
|
||||
private String mDeptId;
|
||||
private DeptDatabaseBean mDeptById;
|
||||
|
||||
|
||||
private MsgHandler mMsgHandler;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_address_user_detail;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("联系人详情");
|
||||
mId = getIntent().getStringExtra("id");
|
||||
mDeptId = getIntent().getStringExtra("deptId");
|
||||
Observable.create((ObservableOnSubscribe<Integer>) emitter -> {
|
||||
try {
|
||||
mDatabase = AppDatabase.getInstance(mActivity);
|
||||
mDeptDao = mDatabase.getDeptDao();
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
mOftenContactDao = mDatabase.getOftenContactDao();
|
||||
mUserByUserId = mUserDao.getUserByUserId(mId);
|
||||
mDeptById = mDeptDao.getDeptById(mDeptId);
|
||||
mOftenContactByUserId = mOftenContactDao.getOftenContactByUserId(mId);
|
||||
emitter.onNext(1);
|
||||
} catch (Exception e) {
|
||||
emitter.onError(new Exception("load err"));
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<Integer>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull Integer integer) {
|
||||
if (mUserByUserId != null) {
|
||||
setDataToView();
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
mLlAddContact.setOnClickListener(v -> {
|
||||
if (mOftenContactByUserId == null) {
|
||||
OftenContactBean b = new OftenContactBean();
|
||||
b.setUserId(mUserByUserId.getUserId());
|
||||
mOftenContactDao.insertUser(b);
|
||||
mOftenContactByUserId = mOftenContactDao.getOftenContactByUserId(mUserByUserId.getUserId());
|
||||
mTvAddContact.setText("移除好友");
|
||||
ToastUtils.show("添加成功");
|
||||
} else {
|
||||
//移除常用联系人
|
||||
mOftenContactDao.deleteUser(mOftenContactByUserId);
|
||||
setResult(13);
|
||||
mOftenContactByUserId = null;
|
||||
ToastUtils.show("移除成功");
|
||||
mTvAddContact.setText("添加好友");
|
||||
}
|
||||
});
|
||||
mLlCall.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(mUserByUserId.getUserPhone())) {
|
||||
ToastUtils.show("该联系人未录入联系电话");
|
||||
} else {
|
||||
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||
Uri data = Uri.parse("tel:" + mUserByUserId.getUserPhone());
|
||||
intent.setData(data);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
// mLlMsg.setOnClickListener(v -> ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_CHAT_CHAT)
|
||||
// .withString("to", mUserByUserId.getUserId())
|
||||
// .withString("toName", mUserByUserId.getUserName())
|
||||
// .navigation());
|
||||
initViews();
|
||||
}
|
||||
|
||||
|
||||
private void initViews() {
|
||||
mMsgHandler = new MsgHandler();
|
||||
//语音通话
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送让对方登录的消息
|
||||
*/
|
||||
private void sendNotifyLogin() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构建
|
||||
*/
|
||||
private MessageBean buildMsgBean(String id, String toId, String formId, String formName, int msgType, String msg, int type) {
|
||||
// MessageBean bean = new MessageBean();
|
||||
// String uuid = "";
|
||||
// if (!TextUtils.isEmpty(id)) {
|
||||
// uuid = id;
|
||||
// } else {
|
||||
// uuid = UUID.randomUUID().toString();
|
||||
// }
|
||||
// bean.setMsgWhat(System.currentTimeMillis());
|
||||
// bean.setId(uuid);
|
||||
// bean.setTo(toId);
|
||||
// bean.setFrom(formId);
|
||||
// bean.setSystem(false);
|
||||
// bean.setTimestamp(System.currentTimeMillis());
|
||||
// bean.setFromName(formName);
|
||||
// bean.setSendState(MsgTypeStateEnum.MSG_SEND_ING);//发送状态
|
||||
// bean.setBody(msg);
|
||||
// bean.setMsgType(msgType);
|
||||
// bean.setType(type);
|
||||
return null;
|
||||
}
|
||||
|
||||
private void setDataToView() {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
if (mOftenContactByUserId == null) {
|
||||
//不是常用联系人
|
||||
mTvAddContact.setText("添加好友");
|
||||
} else {
|
||||
//是常用联系人
|
||||
mTvAddContact.setText("移除好友");
|
||||
}
|
||||
mTvUserName.setText(mUserByUserId.getUserName());
|
||||
mTvPhone.setText("联系电话:" + mUserByUserId.getUserPhone());
|
||||
mTvEmail.setText("邮箱:" + (TextUtils.isEmpty(mUserByUserId.getUserEmail()) ? "未录入" : mUserByUserId.getUserEmail()));
|
||||
if (mDeptById != null) {
|
||||
mTvDeptDept.setText("部门:" + (TextUtils.isEmpty(mDeptById.getDepartmentName()) ? "未录入" : mDeptById.getDepartmentName()));
|
||||
mTvDept.setText((TextUtils.isEmpty(mDeptById.getDepartmentName()) ? "未录入" : mDeptById.getDepartmentName()));
|
||||
mTvDeptPhone.setText("部门电话:" + (TextUtils.isEmpty(mDeptById.getDepartmentTel()) ? "未录入" : mDeptById.getDepartmentTel()));
|
||||
mTvDeptAddress.setText("部门地址:" + (TextUtils.isEmpty(mDeptById.getDepartmentAddress()) ? "未录入" : mDeptById.getDepartmentAddress()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 注册广播
|
||||
// */
|
||||
// private void registerRec() {
|
||||
// sendBroadcast(new Intent(PathConfig.ACTION_UNREGISTER_BROAD));
|
||||
// IntentFilter filter = new IntentFilter();
|
||||
// mMsgReceiver = new MsgReceiver();
|
||||
// filter.addAction(PathConfig.ACTION_MSG_CHAT_REFRESH);//刷新信息状态
|
||||
// filter.addAction(PathConfig.ACTION_MSG_SOCKET_FAIL);//socket连接失败
|
||||
// filter.addAction(PathConfig.ACTION_NOTIFY_CONTACT_LOGIN_SUCCESS);//对方登录成功
|
||||
// filter.addAction(PathConfig.ACTION_NOTIFY_CONTACT_LOGIN_FAIL);//对方登录不成功
|
||||
// filter.addAction(PathConfig.ACTION_CALL_OTHER_NO_SUPPORT);//对方手机不支持通话
|
||||
// filter.addAction(PathConfig.ACTION_USER_OFFLINE);//用户不在线
|
||||
// registerReceiver(mMsgReceiver, filter);
|
||||
// LocalBroadcast.getInstance().registerBroadcast(this, mActions);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 注销广播
|
||||
*/
|
||||
// private void unRegister() {
|
||||
// sendBroadcast(new Intent(PathConfig.ACTION_REGISTER_BROAD));
|
||||
// if (mMsgReceiver != null) {
|
||||
// unregisterReceiver(mMsgReceiver);
|
||||
// }
|
||||
// LocalBroadcast.getInstance().unRegisterBroadcast(this, mActions);
|
||||
// }
|
||||
|
||||
|
||||
public class MsgHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(@androidx.annotation.NonNull Message msg) {
|
||||
// int what = msg.what;
|
||||
// if (10086 == what) {
|
||||
// //语音视频通话消息 3秒钟对方为返回登录成功消息 定义为登录失败
|
||||
// //TODO 对方登录失败
|
||||
// ToastUtils.show("对方不在线");
|
||||
// if (mDialog != null && mDialog.isShowing()) {
|
||||
// mDialog.dismiss();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private class MsgReceiver extends BroadcastReceiver {
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// String action = intent.getAction();
|
||||
// if (!TextUtils.isEmpty(action)) {
|
||||
// switch (action) {
|
||||
// case PathConfig.ACTION_USER_OFFLINE:
|
||||
// ToastUtils.show("对方不在线,无法通话");
|
||||
// int logout = LoginMangerV2.getInstance().logout();
|
||||
// LogUtils.e("退出登录" + logout);
|
||||
// if (mDialog != null && mDialog.isShowing()) {
|
||||
// mDialog.dismiss();
|
||||
// }
|
||||
// mMsgHandler.removeMessages(10086);
|
||||
// break;
|
||||
// case PathConfig.ACTION_NOTIFY_CONTACT_LOGIN_SUCCESS:
|
||||
// //TODO 对方登录成功,获取返回的号码, 进行拨打电话
|
||||
// LogUtils.e("对方登录成功" + System.currentTimeMillis());
|
||||
// mToUserPhoneNumber = intent.getStringExtra("number");
|
||||
// doCall();
|
||||
// break;
|
||||
// case PathConfig.ACTION_NOTIFY_CONTACT_LOGIN_FAIL://通话时对方登录失败
|
||||
// ToastUtils.show("对方不在线,请稍后重试");
|
||||
// LoginMangerV2.getInstance().logout();
|
||||
// if (mDialog != null && mDialog.isShowing()) {
|
||||
// mDialog.dismiss();
|
||||
// }
|
||||
// mMsgHandler.removeMessages(10086);
|
||||
// break;
|
||||
// case PathConfig.ACTION_CALL_OTHER_NO_SUPPORT://对方手机不支持通话
|
||||
// ToastUtils.show("对方手机不支持通话");
|
||||
// LoginMangerV2.getInstance().logout();
|
||||
// if (mDialog != null && mDialog.isShowing()) {
|
||||
// mDialog.dismiss();
|
||||
// }
|
||||
// mMsgHandler.removeMessages(10086);
|
||||
// break;
|
||||
// case PathConfig.ACTION_MSG_SOCKET_FAIL://Socket连接失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void dealNoDuration() {
|
||||
Observable.timer(ConstantsV2.DELAY_MILLIS_600, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(aLong -> {
|
||||
// TODO Intent it = new Intent(BaseMvpActivityV2.this, NoDurationActivityV2.class);
|
||||
// it.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
// startActivity(it);
|
||||
EncryptedSPTool.putBoolean(Constant.IS_NO_STREAM_DURATION, false);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void clearSearch() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doSearchByTitle() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断socket是否在运行
|
||||
*/
|
||||
private boolean isRunning() {
|
||||
return AppUtils.isRunningService(getApplicationContext(), getPackageName() + ":local");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
if (mMsgHandler != null) {
|
||||
mMsgHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
BaseAppContext.getInstance().setUsername("");
|
||||
BaseAppContext.getInstance().setOtherUserId("");
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
@ -181,6 +181,7 @@ public class NoticeDetailActivity extends BaseActivity {
|
||||
super.onPageFinished(view, url);
|
||||
view.getSettings().setBlockNetworkImage(false);//开启页面图片加载
|
||||
doSaveReadState();
|
||||
imgReset();
|
||||
runOnUiThread(() -> mNswWeb.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)));
|
||||
}
|
||||
|
||||
@ -206,6 +207,20 @@ public class NoticeDetailActivity extends BaseActivity {
|
||||
setFiles(bean.getFileList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 对图片进行重置大小,宽度就是手机屏幕宽度,高度根据宽度比便自动缩放
|
||||
**/
|
||||
private void imgReset() {
|
||||
mNswWeb.loadUrl("javascript:(function(){" +
|
||||
"var objs = document.getElementsByTagName('img'); " +
|
||||
"for(var i=0;i<objs.length;i++) " +
|
||||
"{"
|
||||
+ "var img = objs[i]; " +
|
||||
" img.style.maxWidth = '100%'; img.style.height = 'auto'; " +
|
||||
"}" +
|
||||
"})()");
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存已读
|
||||
*/
|
||||
|
@ -139,6 +139,8 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
LinearLayout mLlControl;
|
||||
@BindView(R2.id.nsv_scroll)
|
||||
NestedScrollView mNsvScroll;
|
||||
@BindView(R2.id.csv_web)
|
||||
CustomStateView mCsvWeb;
|
||||
private String mUrl;
|
||||
private String mProcessId;
|
||||
private String mTaskId;
|
||||
@ -487,6 +489,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
private void nextCounterSigned() {
|
||||
//获取当前会签框实体
|
||||
//设置数据
|
||||
LogUtils.e(mFieldsList.size());
|
||||
++mCurrentSigned;
|
||||
if (mCurrentSigned > (mFieldsList.size() - 1)) {
|
||||
mCurrentSigned = mFieldsList.size() - 1;
|
||||
@ -833,6 +836,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
*/
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private void initWebView() {
|
||||
mCsvWeb.setState(CustomStateView.STATE_LOAD);
|
||||
mWebChromeClient = new WebChromeClient() {
|
||||
@Override
|
||||
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
|
||||
@ -870,6 +874,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
super.onPageFinished(view, url);
|
||||
mCsvWeb.setState(CustomStateView.STATE_SUCCESS);
|
||||
LogUtils.e("加载完成");
|
||||
runOnUiThread(() -> {
|
||||
WebView webView = mWebView.getWebCreator().getWebView();
|
||||
|
@ -0,0 +1,58 @@
|
||||
package com.tenlionsoft.oamodule.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.holder.DeptChooseHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 1:56 下午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 选择部门
|
||||
*/
|
||||
public class DeptChooseAdapter extends BaseRecyclerAdapter<DeptDatabaseBean, DeptChooseHolder> {
|
||||
|
||||
public DeptChooseAdapter(Context ctx, List<DeptDatabaseBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeptChooseHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_choose_dept_layout, parent, false);
|
||||
return new DeptChooseHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(DeptChooseHolder holder, int i) {
|
||||
DeptDatabaseBean bean = mData.get(i);
|
||||
holder.mTvName.setText(bean.getDepartmentName());
|
||||
if (i == (mData.size() - 1)) {
|
||||
holder.mIvArrow.setVisibility(View.GONE);
|
||||
holder.mTvName.setTextColor(Color.parseColor("#1189FF"));
|
||||
} else {
|
||||
holder.mIvArrow.setVisibility(View.VISIBLE);
|
||||
holder.mTvName.setTextColor(Color.BLACK);
|
||||
}
|
||||
if (mOnItemChoose != null) {
|
||||
holder.itemView.setOnClickListener(v -> mOnItemChoose.onItemChoose(bean, i));
|
||||
}
|
||||
}
|
||||
|
||||
private OnItemChoose mOnItemChoose;
|
||||
|
||||
public void setOnItemChoose(OnItemChoose onItemChoose) {
|
||||
this.mOnItemChoose = onItemChoose;
|
||||
}
|
||||
|
||||
public interface OnItemChoose {
|
||||
void onItemChoose(DeptDatabaseBean bean, int pos);
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.tenlionsoft.oamodule.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.holder.DeptContactHolder;
|
||||
import com.tenlionsoft.oamodule.holder.UserContactHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 11:22 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 联系人或部门列表
|
||||
*/
|
||||
public class DeptOrUserAdapter extends BaseRecyclerAdapter<Object, RecyclerView.ViewHolder> {
|
||||
|
||||
public DeptOrUserAdapter(Context ctx, List<Object> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView.ViewHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View view;
|
||||
if (viewType == 1) {
|
||||
//联系人
|
||||
view = LayoutInflater.from(mContext).inflate(R.layout.item_contact_user_layout, parent, false);
|
||||
return new UserContactHolder(view);
|
||||
} else {
|
||||
//部门
|
||||
view = LayoutInflater.from(mContext).inflate(R.layout.item_contact_dept_layout, parent, false);
|
||||
return new DeptContactHolder(view);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(RecyclerView.ViewHolder viewHolder, int i) {
|
||||
if (viewHolder instanceof UserContactHolder) {
|
||||
//联系人
|
||||
UserDatabaseBean bean = (UserDatabaseBean) mData.get(i);
|
||||
UserContactHolder holder = (UserContactHolder) viewHolder;
|
||||
holder.mTvName.setText(bean.getUserName());
|
||||
holder.mTvPhone.setText("联系电话:" + bean.getUserPhone());
|
||||
holder.mTvEmail.setText("邮箱:" + bean.getUserEmail());
|
||||
} else {
|
||||
//部门
|
||||
DeptDatabaseBean bean = (DeptDatabaseBean) mData.get(i);
|
||||
DeptContactHolder holder = (DeptContactHolder) viewHolder;
|
||||
holder.mTvName.setText(bean.getDepartmentName());
|
||||
holder.mTvDeptPhone.setText("部门电话:" + bean.getDepartmentTel());
|
||||
holder.mTvAddress.setText(bean.getDepartmentAddress());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
Object bean = mData.get(position);
|
||||
if (bean instanceof UserDatabaseBean) {
|
||||
return 1;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
@ -28,8 +28,13 @@ import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.AppTokenUser;
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.ChangeUserInfoBean;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.LoginUser;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserInfoBean;
|
||||
import com.tenlionsoft.baselib.core.db.AppDatabase;
|
||||
import com.tenlionsoft.baselib.core.db.DeptDao;
|
||||
import com.tenlionsoft.baselib.core.db.UserDao;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||
@ -51,6 +56,7 @@ import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
@ -108,6 +114,10 @@ public class MineFragment extends BaseFragment {
|
||||
LinearLayout mLlLoginOut;
|
||||
private Unbinder mBind;
|
||||
private String mPicPath;
|
||||
private AppDatabase mDatabase;
|
||||
private UserDao mUserDao;
|
||||
private DeptDao mDeptDao;
|
||||
private int mCount;
|
||||
private ActivityResultLauncher<Intent> mLauncher = registerForActivityResult(
|
||||
new ActivityResultContracts.StartActivityForResult(),
|
||||
result -> {
|
||||
@ -158,6 +168,10 @@ public class MineFragment extends BaseFragment {
|
||||
.navigation());//日常工作
|
||||
mIvUserIcon.setOnClickListener(v -> changeUserIcon());
|
||||
|
||||
mDatabase = AppDatabase.getInstance(mActivity.getApplication());
|
||||
mDeptDao = mDatabase.getDeptDao();
|
||||
mUserDao = mDatabase.getUserDao();
|
||||
mLlMineDept.setOnClickListener(v -> doSyncContact());
|
||||
}
|
||||
|
||||
private void doLoginOut() {
|
||||
@ -187,10 +201,124 @@ public class MineFragment extends BaseFragment {
|
||||
getShowNum();
|
||||
}
|
||||
|
||||
private List<UserDatabaseBean> mUserDatabaseBeanList;
|
||||
private ProgressDialog mDialog;
|
||||
private List<DeptDatabaseBean> mDatabaseBeanList;
|
||||
|
||||
/**
|
||||
* 同步通讯录
|
||||
*/
|
||||
private void doSyncContact() {
|
||||
mDialog = UIUtil.initDialog(mActivity, "同步中...");
|
||||
mDialog.show();
|
||||
mCount = 0;
|
||||
doSyncDept();
|
||||
doSyncUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步用户
|
||||
*/
|
||||
private void doSyncUser() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getAllUserList()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<UserDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<UserDatabaseBean> userDatabaseBeans) {
|
||||
mUserDatabaseBeanList = userDatabaseBeans;
|
||||
++mCount;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@androidx.annotation.NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步组织
|
||||
*/
|
||||
private void doSyncDept() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getAllDeptList()
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<List<DeptDatabaseBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(@androidx.annotation.NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@androidx.annotation.NonNull List<DeptDatabaseBean> deptDatabaseBeans) {
|
||||
++mCount;
|
||||
mDatabaseBeanList = deptDatabaseBeans;
|
||||
if (mCount == 2) {
|
||||
insertAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@androidx.annotation.NonNull Throwable e) {
|
||||
mCount = 0;
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始同步
|
||||
*/
|
||||
private void insertAll() {
|
||||
try {
|
||||
mDatabase.runInTransaction(() -> {
|
||||
mDeptDao.deleteAll();
|
||||
mUserDao.deleteAll();
|
||||
mUserDao.insertAll(mUserDatabaseBeanList);
|
||||
mDeptDao.insertAll(mDatabaseBeanList);
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步完成");
|
||||
UserLgUtils.setIsSync(true);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (mDialog != null && mDialog.isShowing()) {
|
||||
mDialog.dismiss();
|
||||
ToastUtils.show("同步失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getShowNum() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getMineJoinMeetingList("","","", "1")
|
||||
.getMineJoinMeetingList("", "", "", "1")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<MineJoinMeetingListBean>() {
|
||||
@Override
|
||||
|
@ -1,13 +1,9 @@
|
||||
package com.tenlionsoft.oamodule.fragments;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
@ -26,6 +22,7 @@ import com.bumptech.glide.request.transition.Transition;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.king.zxing.CaptureActivity;
|
||||
import com.king.zxing.Intents;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
@ -41,7 +38,6 @@ import com.tenlionsoft.baselib.core.widget.base.FunctionTitleNumAdapter;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.baselib.utils.ProvderUtils;
|
||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
@ -55,7 +51,6 @@ import com.tenlionsoft.oamodule.net.OAApi;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -63,7 +58,6 @@ import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@ -202,53 +196,18 @@ public class OaMainFragment extends BaseFragment {
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_NOTICE)
|
||||
.navigation());//通知公告更多
|
||||
mIvScan.setOnClickListener(v -> {
|
||||
|
||||
// PrintManager printManager = (PrintManager) mActivity.getSystemService(Context.PRINT_SERVICE);
|
||||
// PrintAttributes.Builder builder = new PrintAttributes.Builder();
|
||||
//
|
||||
// String filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/2222.pdf";
|
||||
// PrintJob jobName = printManager.print("jobName", new MyPrintDocumentAdapter(mActivity, filePath), null);
|
||||
String s = Environment.getExternalStorageDirectory().getAbsolutePath() + "/create_src.pdf";
|
||||
File file = new File(s);
|
||||
ComponentName comp = new ComponentName("org.cups.android", "org.cups.android.AddPrinterActivity");
|
||||
Uri uri;
|
||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
|
||||
uri = Uri.fromFile(file);
|
||||
} else {
|
||||
uri = FileProvider.getUriForFile(mActivity, ProvderUtils.getFileProviderName(mActivity), file);
|
||||
}
|
||||
String host = "printer.add";
|
||||
String scheme = "printer://";
|
||||
LogUtils.e(uri);
|
||||
String path = scheme + host;
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(path));
|
||||
// intent.setComponent(comp);
|
||||
// intent.putExtra(Intent.EXTRA_STREAM, uri);
|
||||
// intent.putExtra(Intent.EXTRA_SUBJECT, file.getName());
|
||||
// intent.setType("application/pdf");
|
||||
intent.setDataAndType(uri, "application/pdf");
|
||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
startActivity(intent);
|
||||
// Intent intent = new Intent(mActivity, CaptureActivity.class);
|
||||
// mLauncher.launch(intent);
|
||||
});
|
||||
Intent intent = new Intent(mActivity, CaptureActivity.class);
|
||||
mLauncher.launch(intent);
|
||||
});//扫码
|
||||
mRlTodo.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_TODO)
|
||||
.navigation());//我的待办
|
||||
// mRlTodo.setOnClickListener(v -> ARouter.getInstance()
|
||||
// .build(PathConfig.PATH_MODULE_OA_ACTIVITY_WEB_DEMO)
|
||||
// .navigation());//我的待办
|
||||
mRlToRead.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_MINE_READ)
|
||||
.navigation());//我的待阅
|
||||
mRlSupervise.setOnClickListener(v -> ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_OAFLOW_APPLY_FLOW)
|
||||
.build(PathConfig.PATH_MODULE_OA_ACTIVITY_SUPERVISE)
|
||||
.navigation());//我的督办
|
||||
|
||||
// PrintHelper helper= new PrintHelper(mActivity);
|
||||
// helper.setScaleMode(PrintHelper.SCALE_MODE_FIT);
|
||||
// helper.print
|
||||
}
|
||||
|
||||
private void doRefresh() {
|
||||
|
@ -0,0 +1,31 @@
|
||||
package com.tenlionsoft.oamodule.holder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 11:18 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 部门列表
|
||||
*/
|
||||
public class DeptChooseHolder extends RecyclerView.ViewHolder {
|
||||
public TextView mTvName;
|
||||
public ImageView mIvArrow;
|
||||
|
||||
public DeptChooseHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
mTvName = itemView.findViewById(R.id.tv_name);
|
||||
mIvArrow = itemView.findViewById(R.id.iv_arrow);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.tenlionsoft.oamodule.holder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 11:18 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 部门列表
|
||||
*/
|
||||
public class DeptContactHolder extends RecyclerView.ViewHolder {
|
||||
public ImageView mIvDeptImg;
|
||||
public TextView mTvName;
|
||||
public TextView mTvDeptPhone;
|
||||
public TextView mTvAddress;
|
||||
|
||||
public DeptContactHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
mIvDeptImg = itemView.findViewById(R.id.iv_dept_img);
|
||||
mTvName = itemView.findViewById(R.id.tv_name);
|
||||
mTvDeptPhone = itemView.findViewById(R.id.tv_dept_phone);
|
||||
mTvAddress = itemView.findViewById(R.id.tv_address);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.tenlionsoft.oamodule.holder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2021/10/28 - 11:19 上午
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 联系人列表
|
||||
*/
|
||||
public class UserContactHolder extends RecyclerView.ViewHolder {
|
||||
public ImageView mIvUserImg;
|
||||
public TextView mTvName;
|
||||
public TextView mTvPhone;
|
||||
public TextView mTvEmail;
|
||||
|
||||
|
||||
public UserContactHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
mIvUserImg = itemView.findViewById(R.id.iv_user_img);
|
||||
mTvName = itemView.findViewById(R.id.tv_name);
|
||||
mTvPhone = itemView.findViewById(R.id.tv_phone);
|
||||
mTvEmail = itemView.findViewById(R.id.tv_email);
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
package com.tenlionsoft.oamodule.net;
|
||||
|
||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||
import com.tenlionsoft.baselib.core.beans.DeptDatabaseBean;
|
||||
import com.tenlionsoft.baselib.core.beans.FuncBean;
|
||||
import com.tenlionsoft.baselib.core.beans.UserDatabaseBean;
|
||||
import com.tenlionsoft.oamodule.beans.ByCarRecordBean;
|
||||
import com.tenlionsoft.oamodule.beans.ByCarRecordListBean;
|
||||
import com.tenlionsoft.oamodule.beans.BySuperviseListBean;
|
||||
@ -886,4 +888,19 @@ public interface OAApi {
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oa/count-unread-of-mine")
|
||||
Observable<UnReadCountBean> getMineUnReadCount();
|
||||
|
||||
|
||||
/**
|
||||
* 获取系统组织部门
|
||||
*/
|
||||
@Headers({"Content-Type: application/json", "need_token:true", "Accept: application/json"})
|
||||
@GET("app/department/list")
|
||||
Observable<List<DeptDatabaseBean>> getAllDeptList();
|
||||
|
||||
/**
|
||||
* 获取通讯录用户
|
||||
*/
|
||||
@Headers({"Content-Type: application/json", "need_token:true", "Accept: application/json"})
|
||||
@GET("app/department/user/list-with-user")
|
||||
Observable<List<UserDatabaseBean>> getAllUserList();
|
||||
}
|
||||
|
141
oamodule/src/main/res/layout/activity_address_list.xml
Normal file
@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_content_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="@drawable/ic_back_black"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:maxLength="8"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
android:visibility="visible"
|
||||
tools:text=""
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rg_type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_dept"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/switch_custom_gray_white_left"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:gravity="center"
|
||||
android:minWidth="80dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="按部门"
|
||||
android:textColor="@color/col_gray_black" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rb_often"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/switch_custom_gray_white_right"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:text="常用联系人"
|
||||
android:textColor="@color/col_gray_black" />
|
||||
</RadioGroup>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/layout_base_search_cancel" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_users"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_sel_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="5dp"
|
||||
tools:itemCount="1"
|
||||
tools:listitem="@layout/item_dept_sel_layout" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@color/gray_bb12" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.CustomStateView
|
||||
android:id="@+id/csv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
308
oamodule/src/main/res/layout/activity_address_user_detail.xml
Normal file
@ -0,0 +1,308 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="70dp"
|
||||
android:background="@color/gray_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/shp_rectangle_white_5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_icon"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/ic_user_default" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/iv_user_icon"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="王丽霞" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="@color/text_blue"
|
||||
android:textSize="14sp"
|
||||
tools:text="部门:123241234" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/shp_rectangle_white_5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="个人信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:drawableLeft="@drawable/ic_email_icon"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="邮箱:123241234" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_phone_icon"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="联系电话:123241234" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:background="@drawable/shp_rectangle_white_5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="组织信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept_dept"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:drawableLeft="@drawable/ic_dept_icon_16"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="部门:123241234" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:drawableLeft="@drawable/ic_dept_icon_16"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="部门联系方式:123241234" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@color/gray_bg" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:drawableLeft="@drawable/ic_address_icon_16"
|
||||
android:drawablePadding="5dp"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/black"
|
||||
tools:text="部门地址:123241234" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/white"
|
||||
android:clipChildren="true"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_msg"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_circle_blue"
|
||||
android:gravity="center"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_send_msg_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="发消息"
|
||||
android:textColor="@color/main_theme"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_call"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_circle_blue"
|
||||
android:gravity="center"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_voice_call_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="拨打电话"
|
||||
android:textColor="@color/main_theme"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_add_contact"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shp_circle_blue"
|
||||
android:gravity="center"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/ic_add_contact_icon" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_add_contact"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="添加好友"
|
||||
android:textColor="@color/main_theme"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -16,18 +16,33 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_content"
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:minHeight="250dp">
|
||||
|
||||
</FrameLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.CustomStateView
|
||||
android:id="@+id/csv_web"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical"
|
||||
android:padding="17dp"
|
||||
@ -98,7 +113,7 @@
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/shp_rectangle_white_5"
|
||||
android:orientation="vertical"
|
||||
android:padding="17dp">
|
||||
@ -144,8 +159,8 @@
|
||||
android:id="@+id/ll_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp"
|
||||
android:visibility="gone">
|
||||
|
@ -233,7 +233,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="我的部门"
|
||||
android:text="同步通讯录"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_14" />
|
||||
|
||||
|
@ -127,7 +127,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="以发送"
|
||||
android:text="已发送"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_14" />
|
||||
|
||||
|
@ -138,7 +138,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:text="以发送"
|
||||
android:text="已发送"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_14" />
|
||||
|
||||
|
28
oamodule/src/main/res/layout/item_choose_dept_layout.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_rectangle_white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="2dp">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:textColor="#ff353535"
|
||||
android:textSize="16sp"
|
||||
tools:text="部门名称" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_arrow"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:src="@drawable/ic_arrow_cir" />
|
||||
</LinearLayout>
|
78
oamodule/src/main/res/layout/item_contact_dept_layout.xml
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/shape_rectangle_white"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_dept_img"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/ic_dept_contact_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ff353535"
|
||||
android:textSize="18sp"
|
||||
tools:text="部门名称" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_dept_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="联系电话" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_arrow_cir" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_line_dotted"
|
||||
android:layerType="software" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:drawableLeft="@drawable/ic_location_blue"
|
||||
android:drawablePadding="5dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="#ff1189ff"
|
||||
android:textSize="12sp"
|
||||
tools:text="地址" />
|
||||
|
||||
|
||||
</LinearLayout>
|
72
oamodule/src/main/res/layout/item_contact_user_layout.xml
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/shape_rectangle_white"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_user_img"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:background="@drawable/ic_user_contact_icon" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#ff353535"
|
||||
android:textSize="18sp"
|
||||
tools:text="姓名" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_phone_icon"
|
||||
android:drawablePadding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="联系电话" />
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_email_icon"
|
||||
android:drawablePadding="5dp"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="12sp"
|
||||
tools:text="邮箱" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_marginLeft="32dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/shp_line_dotted"
|
||||
android:layerType="software" />
|
||||
|
||||
</LinearLayout>
|