Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/db/ImportOMDBHelper.kt app/src/main/java/com/navinfo/omqs/ui/activity/map/MainActivity.kt
This commit is contained in:
commit
969d687c58
@ -12,12 +12,16 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.omqs"
|
||||
minSdk 26
|
||||
targetSdk 33
|
||||
minSdk 21
|
||||
targetSdk 21
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "armeabi", "mips"
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -37,7 +41,18 @@ android {
|
||||
viewBinding true
|
||||
dataBinding true
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs = ['libs']
|
||||
}
|
||||
debug.setRoot('build-types/debug')
|
||||
release.setRoot('build-types/release')
|
||||
}
|
||||
//添加如下配置就ok了
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
abortOnError false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +61,6 @@ dependencies {
|
||||
|
||||
implementation project(':collect-library')
|
||||
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
@ -72,8 +86,8 @@ dependencies {
|
||||
kapt "androidx.room:room-ktx:2.5.1"
|
||||
|
||||
//读取excel word等文件
|
||||
implementation 'org.apache.poi:poi:5.2.3'
|
||||
implementation 'org.apache.poi:poi-ooxml:5.2.3'
|
||||
implementation 'org.apache.poi:poi:4.0.0'
|
||||
implementation 'org.apache.poi:poi-ooxml:4.0.0'
|
||||
|
||||
// 读取spatialite文件
|
||||
implementation 'com.github.sevar83:android-spatialite:2.0.1'
|
||||
|
@ -22,7 +22,15 @@ class Constant {
|
||||
/**
|
||||
* 当前用户ID
|
||||
*/
|
||||
lateinit var CURRENT_USER_ID: String
|
||||
lateinit var USER_ID: String
|
||||
|
||||
//数据版本
|
||||
lateinit var VERSION_ID: String
|
||||
|
||||
/**
|
||||
* 用户数据目录
|
||||
*/
|
||||
lateinit var USER_DATA_PATH: String
|
||||
|
||||
/**
|
||||
* 离线地图目录
|
||||
@ -46,6 +54,28 @@ class Constant {
|
||||
const val message_version_right_off = "1" //立即发送
|
||||
|
||||
const val MESSAGE_PAGE_SIZE = 30 //消息列表一页最多数量
|
||||
|
||||
lateinit var realm: Realm
|
||||
|
||||
//选择相机默认或者外设
|
||||
const val SELECT_CAMERA_STATE = "select_camera_state"
|
||||
|
||||
//是否连接
|
||||
const val CAMERA_CONNECT_STATE = "camera_connect_state"
|
||||
|
||||
//是否可以点击
|
||||
const val CAMERA_CLICK_STATE = "camera_click_state"
|
||||
|
||||
//拍照模式
|
||||
const val TAKE_CAMERA_MODE = "take_camera_mode"
|
||||
|
||||
const val TAKE_CAMERA_IP = "take_camera_ip"
|
||||
|
||||
const val TAKE_CAMERA_MAC = "take_camera_mac"
|
||||
|
||||
//选择拍照或者录像
|
||||
const val SELECT_TAKEPHOTO_OR_RECORD = "select_takephoto_or_record"
|
||||
|
||||
const val OMDB_CONFIG = "omdb.config"
|
||||
}
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
package com.navinfo.omqs
|
||||
|
||||
import android.app.Application
|
||||
import android.util.Log
|
||||
import com.navinfo.omqs.db.MyRealmModule
|
||||
import com.navinfo.omqs.tools.FileManager
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||
import com.navinfo.omqs.util.NetUtils
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
import org.videolan.vlc.Util
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
import java.io.File
|
||||
import java.security.MessageDigest
|
||||
|
||||
@HiltAndroidApp
|
||||
|
@ -2,7 +2,6 @@ package com.navinfo.omqs.bean
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.system.SystemConstant
|
||||
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
||||
import io.realm.RealmList
|
||||
import io.realm.RealmObject
|
||||
|
@ -1,42 +0,0 @@
|
||||
package com.navinfo.omqs.system;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 系统变量对象
|
||||
*/
|
||||
public class SystemConstant {
|
||||
|
||||
public static String USER_ID = "1";
|
||||
|
||||
//选择相机默认或者外设
|
||||
public static String SELECT_CAMERA_STATE = "select_camera_state";
|
||||
//是否连接
|
||||
public static String CAMERA_CONNECT_STATE = "camera_connect_state";
|
||||
//是否可以点击
|
||||
public static String CAMERA_CLICK_STATE = "camera_click_state";
|
||||
//拍照模式
|
||||
public static String TAKE_CAMERA_MODE = "take_camera_mode";
|
||||
|
||||
public static String TAKE_CAMERA_IP = "take_camera_ip";
|
||||
|
||||
public static String TAKE_CAMERA_MAC = "take_camera_mac";
|
||||
|
||||
|
||||
//选择拍照或者录像
|
||||
public static String SELECT_TAKEPHOTO_OR_RECORD = "select_takephoto_or_record";
|
||||
|
||||
/**
|
||||
* 获取uuid
|
||||
* @param isUpperCase
|
||||
* true 大写 false 小写
|
||||
*/
|
||||
public static String getUuid(boolean isUpperCase){
|
||||
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
|
||||
if(isUpperCase)
|
||||
uuid = uuid.toUpperCase();
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,204 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.navinfo.omqs.ui.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 继承了Activity,实现Android6.0的运行时权限检测
|
||||
* 需要进行运行时权限检测的Activity可以继承这个类
|
||||
*/
|
||||
public class CheckPermissionsActivity extends BaseActivity {
|
||||
//是否需要检测后台定位权限,设置为true时,如果用户没有给予后台定位权限会弹窗提示
|
||||
private boolean needCheckBackLocation = false;
|
||||
//如果设置了target > 28,需要增加这个权限,否则不会弹出"始终允许"这个选择框
|
||||
private static String BACKGROUND_LOCATION_PERMISSION = "android.permission.ACCESS_BACKGROUND_LOCATION";
|
||||
/**
|
||||
* 需要进行检测的权限数组
|
||||
*/
|
||||
protected String[] needPermissions = {
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
};
|
||||
|
||||
private static final int PERMISSON_REQUESTCODE = 0;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
if(Build.VERSION.SDK_INT > 28
|
||||
&& getApplicationContext().getApplicationInfo().targetSdkVersion > 28) {
|
||||
needPermissions = new String[] {
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
BACKGROUND_LOCATION_PERMISSION
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否需要检测,防止不停的弹框
|
||||
*/
|
||||
private boolean isNeedCheck = true;
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
if (Build.VERSION.SDK_INT >= 23
|
||||
&& getApplicationInfo().targetSdkVersion >= 23) {
|
||||
if (isNeedCheck) {
|
||||
checkPermissions(needPermissions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param permissions
|
||||
*
|
||||
*/
|
||||
private void checkPermissions(String... permissions) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 23
|
||||
&& getApplicationInfo().targetSdkVersion >= 23) {
|
||||
List<String> needRequestPermissonList = findDeniedPermissions(permissions);
|
||||
if (null != needRequestPermissonList
|
||||
&& needRequestPermissonList.size() > 0) {
|
||||
String[] array = needRequestPermissonList.toArray(new String[needRequestPermissonList.size()]);
|
||||
Method method = getClass().getMethod("requestPermissions", new Class[]{String[].class,
|
||||
int.class});
|
||||
|
||||
method.invoke(this, array, PERMISSON_REQUESTCODE);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限集中需要申请权限的列表
|
||||
*
|
||||
* @param permissions
|
||||
*
|
||||
*/
|
||||
private List<String> findDeniedPermissions(String[] permissions) {
|
||||
List<String> needRequestPermissonList = new ArrayList<String>();
|
||||
if (Build.VERSION.SDK_INT >= 23
|
||||
&& getApplicationInfo().targetSdkVersion >= 23){
|
||||
try {
|
||||
for (String perm : permissions) {
|
||||
Method checkSelfMethod = getClass().getMethod("checkSelfPermission", String.class);
|
||||
Method shouldShowRequestPermissionRationaleMethod = getClass().getMethod("shouldShowRequestPermissionRationale",
|
||||
String.class);
|
||||
if ((Integer)checkSelfMethod.invoke(this, perm) != PackageManager.PERMISSION_GRANTED
|
||||
|| (Boolean)shouldShowRequestPermissionRationaleMethod.invoke(this, perm)) {
|
||||
if(!needCheckBackLocation
|
||||
&& BACKGROUND_LOCATION_PERMISSION.equals(perm)) {
|
||||
continue;
|
||||
}
|
||||
needRequestPermissonList.add(perm);
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
||||
}
|
||||
}
|
||||
return needRequestPermissonList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否所有的权限都已经授权
|
||||
*
|
||||
*/
|
||||
private boolean verifyPermissions(int[] grantResults) {
|
||||
for (int result : grantResults) {
|
||||
if (result != PackageManager.PERMISSION_GRANTED) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@TargetApi(23)
|
||||
public void onRequestPermissionsResult(int requestCode,
|
||||
String[] permissions, int[] paramArrayOfInt) {
|
||||
if (requestCode == PERMISSON_REQUESTCODE) {
|
||||
if (!verifyPermissions(paramArrayOfInt)) {
|
||||
showMissingPermissionDialog();
|
||||
isNeedCheck = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示提示信息
|
||||
*
|
||||
*/
|
||||
private void showMissingPermissionDialog() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle("提示");
|
||||
builder.setMessage("当前应用缺少必要权限。\\n\\n请点击\\\"设置\\\"-\\\"权限\\\"-打开所需权限。");
|
||||
|
||||
// 拒绝, 退出应用
|
||||
builder.setNegativeButton("取消",
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
builder.setPositiveButton("设置",
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
startAppSettings();
|
||||
}
|
||||
});
|
||||
|
||||
builder.setCancelable(false);
|
||||
|
||||
builder.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动应用的设置
|
||||
*
|
||||
*/
|
||||
private void startAppSettings() {
|
||||
Intent intent = new Intent(
|
||||
Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if(keyCode == KeyEvent.KEYCODE_BACK){
|
||||
this.finish();
|
||||
return true;
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
}
|
@ -33,7 +33,7 @@ open abstract class PermissionsActivity : BaseActivity() {
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
|
||||
// permissionList.add(Permission.ACCESS_BACKGROUND_LOCATION)
|
||||
}
|
||||
XXPermissions.with(this)
|
||||
/* XXPermissions.with(this)
|
||||
// 申请单个权限
|
||||
.permission(permissionList)
|
||||
// 设置权限请求拦截器(局部设置)
|
||||
@ -73,7 +73,7 @@ open abstract class PermissionsActivity : BaseActivity() {
|
||||
onPermissionsDenied()
|
||||
}
|
||||
}
|
||||
})
|
||||
})*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,6 +11,7 @@ import androidx.lifecycle.Observer
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.ActivityLoginBinding
|
||||
import com.navinfo.omqs.ui.activity.CheckPermissionsActivity
|
||||
import com.navinfo.omqs.ui.activity.PermissionsActivity
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
@ -20,7 +21,7 @@ import dagger.hilt.android.AndroidEntryPoint
|
||||
*/
|
||||
|
||||
@AndroidEntryPoint
|
||||
class LoginActivity : PermissionsActivity() {
|
||||
class LoginActivity : CheckPermissionsActivity() {
|
||||
|
||||
private lateinit var binding: ActivityLoginBinding
|
||||
private val viewModel by viewModels<LoginViewModel>()
|
||||
@ -97,15 +98,6 @@ class LoginActivity : PermissionsActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
//进应用根本不调用,待查
|
||||
override fun onPermissionsGranted() {
|
||||
Log.e("jingo", "调用了吗")
|
||||
|
||||
}
|
||||
|
||||
override fun onPermissionsDenied() {
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import io.realm.Realm
|
||||
import io.realm.RealmConfiguration
|
||||
import kotlinx.coroutines.*
|
||||
import okio.IOException
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import javax.inject.Inject
|
||||
|
||||
enum class LoginStatus {
|
||||
@ -155,11 +155,12 @@ class LoginViewModel @Inject constructor(
|
||||
/**
|
||||
* 创建用户目录
|
||||
*/
|
||||
@Throws(IOException::class)
|
||||
private fun createUserFolder(context: Context, userId: String) {
|
||||
Constant.USER_ID = userId
|
||||
Constant.VERSION_ID = userId
|
||||
Constant.USER_DATA_PATH = Constant.DATA_PATH + Constant.USER_ID + "/" + Constant.VERSION_ID
|
||||
// 在SD卡创建用户目录,解压资源等
|
||||
val userFolder = File("${Constant.DATA_PATH}/${userId}")
|
||||
Constant.CURRENT_USER_ID = userId
|
||||
// 初始化Realm
|
||||
Realm.init(context.applicationContext)
|
||||
val password = "encryp".encodeToByteArray().copyInto(ByteArray(64))
|
||||
|
@ -18,8 +18,6 @@ import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
||||
import com.navinfo.omqs.http.taskdownload.TaskDownloadManager
|
||||
import com.navinfo.omqs.system.SystemConstant
|
||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||
import com.navinfo.omqs.ui.fragment.evaluationresult.EvaluationResultFragment
|
||||
import com.navinfo.omqs.ui.fragment.evaluationresult.EvaluationResultViewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import javax.inject.Inject
|
||||
|
||||
@ -50,7 +48,7 @@ class MainActivity : BaseActivity() {
|
||||
binding.mainActivityMap,
|
||||
null,
|
||||
Constant.MAP_PATH,
|
||||
Constant.DATA_PATH + SystemConstant.USER_ID + "/trace.sqlite"
|
||||
Constant.USER_DATA_PATH+"/trace.sqlite"
|
||||
)
|
||||
//关联生命周期
|
||||
binding.lifecycleOwner = this
|
||||
@ -73,8 +71,9 @@ class MainActivity : BaseActivity() {
|
||||
mapController.locationLayerHandler.startLocation()
|
||||
//启动轨迹存储
|
||||
mapController.locationLayerHandler.setNiLocationListener(NiLocationListener {
|
||||
viewModel.addSaveTrace(it)
|
||||
// binding.viewModel!!.startSaveTraceThread(this)
|
||||
ToastUtils.showLong("定位${it.longitude}")
|
||||
binding!!.viewModel!!.addSaveTrace(it)
|
||||
binding!!.viewModel!!.startSaveTraceThread(this)
|
||||
})
|
||||
//显示轨迹图层
|
||||
// mapController.layerManagerHandler.showNiLocationLayer(Constant.DATA_PATH+ SystemConstant.USER_ID+"/trace.sqlite")
|
||||
@ -108,9 +107,8 @@ class MainActivity : BaseActivity() {
|
||||
* 打开相机预览
|
||||
*/
|
||||
fun openCamera() {
|
||||
binding.viewModel!!.onClickCameraButton(this)
|
||||
//显示轨迹图层
|
||||
//binding!!.viewModel!!.onClickCameraButton(this)
|
||||
binding!!.viewModel!!.onClickCameraButton(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -16,7 +16,6 @@ import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import com.navinfo.omqs.Constant
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.system.SystemConstant
|
||||
import com.navinfo.omqs.ui.dialog.CommonDialog
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
@ -122,7 +121,7 @@ class MainViewModel @Inject constructor(
|
||||
|
||||
TraceDataBase.getDatabase(
|
||||
context,
|
||||
Constant.DATA_PATH + SystemConstant.USER_ID + "/trace.sqlite"
|
||||
Constant.USER_DATA_PATH + "/trace.sqlite"
|
||||
).niLocationDao.insert(niLocation)
|
||||
niLocationList.removeAt(0)
|
||||
Log.e("qj", "saveTrace")
|
||||
|
@ -36,11 +36,10 @@ import com.navinfo.collect.library.garminvirbxe.SensorParams;
|
||||
import com.navinfo.collect.library.garminvirbxe.HostBean;
|
||||
import com.navinfo.omqs.Constant;
|
||||
import com.navinfo.omqs.R;
|
||||
import com.navinfo.omqs.system.SystemConstant;
|
||||
import com.navinfo.omqs.system.SystemDateTime;
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity;
|
||||
import com.navinfo.omqs.ui.manager.TakePhotoManager;
|
||||
import com.navinfo.omqs.ui.other.BaseToast;
|
||||
import com.navinfo.omqs.util.DateTimeUtil;
|
||||
import com.navinfo.omqs.util.FileUtils;
|
||||
import com.navinfo.omqs.util.NetUtils;
|
||||
import com.navinfo.omqs.util.ShareUtil;
|
||||
@ -282,13 +281,13 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
Log.e("AAA", "连接中");
|
||||
connectstate = false;
|
||||
mShareUtil.setConnectstate(SystemConstant.USER_ID, connectstate);
|
||||
mShareUtil.setConnectstate(Constant.USER_ID, connectstate);
|
||||
mOneBtConnect.setText("连接中");
|
||||
updateCameraResources(2, getmDeviceNum());
|
||||
|
||||
} else {
|
||||
connectstate = false;
|
||||
mShareUtil.setConnectstate(SystemConstant.USER_ID, connectstate);
|
||||
mShareUtil.setConnectstate(Constant.USER_ID, connectstate);
|
||||
click_state = true;
|
||||
|
||||
mOneBtConnect.setEnabled(click_state);
|
||||
@ -357,11 +356,11 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
Message msg = new Message();
|
||||
|
||||
String picPath = Constant.DATA_PATH + "/" + SystemConstant.USER_ID + "/pic.jpg";
|
||||
String picPath = Constant.DATA_PATH + "/" + Constant.USER_ID + "/pic.jpg";
|
||||
|
||||
//创建目录
|
||||
if(!new File(Constant.DATA_PATH + "/" + SystemConstant.USER_ID).exists()){
|
||||
new File(Constant.DATA_PATH + "/" + SystemConstant.USER_ID).mkdirs();
|
||||
if(!new File(Constant.DATA_PATH + "/" + Constant.USER_ID).exists()){
|
||||
new File(Constant.DATA_PATH + "/" + Constant.USER_ID).mkdirs();
|
||||
}
|
||||
|
||||
//多次获取照片信息,解决概率事件无法获取有效照片问题
|
||||
@ -376,7 +375,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
Log.e("AAA", "获取单张拍照时间" + time+"次数"+i);
|
||||
if (!TextUtils.isEmpty(time)) {
|
||||
long picTime = SystemDateTime.getPicTime(time);
|
||||
long picTime = DateTimeUtil.getPicTime(time);
|
||||
|
||||
long disTime = mStartCheckTime - picTime / 1000;
|
||||
|
||||
@ -482,7 +481,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
updateCameraResources(0, getmDeviceNum());
|
||||
connectstate = true;
|
||||
mShareUtil.setConnectstate(SystemConstant.USER_ID, connectstate);
|
||||
mShareUtil.setConnectstate(Constant.USER_ID, connectstate);
|
||||
stopVideo();
|
||||
mOneBtConnect.setPressed(true);
|
||||
mOneBtConnect.setBackgroundResource(R.drawable.btn_red_disconnect_bg);
|
||||
@ -614,7 +613,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
mGpsTv.setText("相机GPS信号差,请稍等片刻,或将相机移到开发地带。");
|
||||
mGpsTv.setVisibility(View.VISIBLE);
|
||||
mStartOrEndTakePicture.setEnabled(status);
|
||||
mShareUtil.setContinusTakePhotoState(SystemConstant.USER_ID, true);
|
||||
mShareUtil.setContinusTakePhotoState(Constant.USER_ID, true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -778,7 +777,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
ImageView ivStatus = (ImageView) findViewById(resId);
|
||||
|
||||
if (ivStatus != null) {
|
||||
String time = SystemDateTime.getDateSimpleTime(SystemDateTime.getTimeInfo(SystemDateTime.getTime()) - 0/*MainActivity.disGoogleTime*/);
|
||||
String time = DateTimeUtil.getDateSimpleTime(DateTimeUtil.getTimeInfo(DateTimeUtil.getTime()) - 0/*MainActivity.disGoogleTime*/);
|
||||
|
||||
ivStatus.setImageDrawable(null);
|
||||
|
||||
@ -810,7 +809,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
if (connectstate) {
|
||||
|
||||
Log.i("chentao", "打开/结束连拍:" + arg1);
|
||||
mShareUtil.setContinusTakePhotoState(SystemConstant.USER_ID, arg1);
|
||||
mShareUtil.setContinusTakePhotoState(Constant.USER_ID, arg1);
|
||||
|
||||
if (!arg1) {
|
||||
|
||||
@ -829,7 +828,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
mStartOrEndTakePicture.setChecked(true);
|
||||
|
||||
mShareUtil.setContinusTakePhotoState(SystemConstant.USER_ID, true);
|
||||
mShareUtil.setContinusTakePhotoState(Constant.USER_ID, true);
|
||||
|
||||
BaseToast.makeText(context, "外接相机没有连接成功!不能进行连续拍照!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -845,9 +844,9 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
connectstate = false;
|
||||
|
||||
mShareUtil.setContinusTakePhotoState(SystemConstant.USER_ID, true);
|
||||
mShareUtil.setContinusTakePhotoState(Constant.USER_ID, true);
|
||||
|
||||
mShareUtil.setConnectstate(SystemConstant.USER_ID, connectstate);
|
||||
mShareUtil.setConnectstate(Constant.USER_ID, connectstate);
|
||||
|
||||
mStartOrEndTakePicture.setChecked(true);
|
||||
|
||||
@ -908,10 +907,10 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
|
||||
if (connectstate) {
|
||||
Log.i("chentao", "选择相机:" + arg1);
|
||||
mShareUtil.setSelectCameraKind(SystemConstant.USER_ID, arg1);
|
||||
mShareUtil.setSelectCameraKind(Constant.USER_ID, arg1);
|
||||
} else {
|
||||
mSelectCamera.setChecked(false);
|
||||
mShareUtil.setSelectCameraKind(SystemConstant.USER_ID, false);
|
||||
mShareUtil.setSelectCameraKind(Constant.USER_ID, false);
|
||||
BaseToast.makeText(context, "外接相机没有连接成功!只能使用系统相机,谢谢!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
@ -962,7 +961,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
}
|
||||
|
||||
//重置拍照按钮
|
||||
mShareUtil.setContinusTakePhotoState(SystemConstant.USER_ID, true);
|
||||
mShareUtil.setContinusTakePhotoState(Constant.USER_ID, true);
|
||||
}
|
||||
|
||||
//设置另外一台相机状态
|
||||
@ -980,11 +979,11 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
}
|
||||
|
||||
shareUtilOther.setSelectTakePhotoOrRecord(SystemConstant.USER_ID, !isCheck);
|
||||
shareUtilOther.setSelectTakePhotoOrRecord(Constant.USER_ID, !isCheck);
|
||||
|
||||
shareUtilOther.setContinusTakePhotoState(SystemConstant.USER_ID, true);
|
||||
shareUtilOther.setContinusTakePhotoState(Constant.USER_ID, true);
|
||||
|
||||
mShareUtil.setSelectTakePhotoOrRecord(SystemConstant.USER_ID, isCheck);
|
||||
mShareUtil.setSelectTakePhotoOrRecord(Constant.USER_ID, isCheck);
|
||||
|
||||
if (isCheck) {
|
||||
|
||||
@ -993,18 +992,18 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
takephotoManager.setCameraMode(getmDeviceNum(), SensorWorkingMode.CAMERA_VEDIO_TIMELAPSE);
|
||||
|
||||
mShareUtil.setTakeCameraMode(SystemConstant.USER_ID, 0);
|
||||
mShareUtil.setTakeCameraMode(Constant.USER_ID, 0);
|
||||
|
||||
shareUtilOther.setTakeCameraMode(SystemConstant.USER_ID, 1);
|
||||
shareUtilOther.setTakeCameraMode(Constant.USER_ID, 1);
|
||||
|
||||
} else {
|
||||
|
||||
mTakePhotoOrRecord.setText("拍照");
|
||||
setmImgViewImageDrawable(1);
|
||||
|
||||
mShareUtil.setTakeCameraMode(SystemConstant.USER_ID, 1);
|
||||
mShareUtil.setTakeCameraMode(Constant.USER_ID, 1);
|
||||
|
||||
shareUtilOther.setTakeCameraMode(SystemConstant.USER_ID, 0);
|
||||
shareUtilOther.setTakeCameraMode(Constant.USER_ID, 0);
|
||||
|
||||
takephotoManager.setCameraMode(getmDeviceNum(), SensorWorkingMode.CAMEAR_PHOTO_CONTINUOUS_PHOTO);
|
||||
|
||||
@ -1074,7 +1073,7 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
BaseToast.makeText(context, TextUtils.isEmpty(msg) ? "相机丢失连接,请检查网络是否畅通!" : msg, Toast.LENGTH_SHORT).show();
|
||||
|
||||
connectstate = false;
|
||||
mShareUtil.setConnectstate(SystemConstant.USER_ID, connectstate);
|
||||
mShareUtil.setConnectstate(Constant.USER_ID, connectstate);
|
||||
mOneBtConnect.setPressed(false);
|
||||
mOneBtConnect.setBackgroundResource(R.drawable.btn_connect_bg_enabled);
|
||||
mOneBtConnect.setText("一键连接");
|
||||
@ -1536,9 +1535,9 @@ public class CommonDialog extends Dialog implements SurfaceHolder.Callback, IVid
|
||||
|
||||
mHostBean = hostBean;
|
||||
|
||||
mShareUtil.setTakeCameraIP(SystemConstant.USER_ID, hostBean.ipAddress.toString());
|
||||
mShareUtil.setTakeCameraIP(Constant.USER_ID, hostBean.ipAddress.toString());
|
||||
|
||||
mShareUtil.setTakeCameraMac(SystemConstant.USER_ID, hostBean.hardwareAddress.toString());
|
||||
mShareUtil.setTakeCameraMac(Constant.USER_ID, hostBean.hardwareAddress.toString());
|
||||
|
||||
takephotoManager.connect(getmDeviceNum(), hostBean, params);
|
||||
}
|
||||
|
@ -120,6 +120,9 @@ class PersonalCenterFragment : BaseFragment(), FSAFActivityCallbacks {
|
||||
R.id.personal_center_menu_task_list -> {
|
||||
findNavController().navigate(R.id.TaskListFragment)
|
||||
}
|
||||
R.id.personal_center_menu_qs_record_list -> {
|
||||
findNavController().navigate(R.id.QsRecordListFragment)
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
package com.navinfo.omqs.ui.fragment.tasklist
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.Observer
|
||||
import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.bean.TaskBean
|
||||
import com.navinfo.omqs.databinding.AdapterQsRecordListBinding
|
||||
import com.navinfo.omqs.databinding.AdapterTaskListBinding
|
||||
import com.navinfo.omqs.http.taskdownload.TaskDownloadManager
|
||||
import com.navinfo.omqs.tools.FileManager.Companion.FileDownloadStatus
|
||||
import com.navinfo.omqs.ui.other.BaseRecyclerViewAdapter
|
||||
import com.navinfo.omqs.ui.other.BaseViewHolder
|
||||
|
||||
/**
|
||||
* 离线地图城市列表 RecyclerView 适配器
|
||||
*
|
||||
* 在 RecycleView 的 ViewHolder 中监听 ViewModel 的 LiveData,然后此时传递的 lifecycleOwner 是对应的 Fragment。由于 ViewHolder 的生命周期是比 Fragment 短的,所以当 ViewHolder 销毁时,由于 Fragment 的 Lifecycle 还没有结束,此时 ViewHolder 会发生内存泄露(监听的 LiveData 没有解绑)
|
||||
* 这种场景下有两种解决办法:
|
||||
*使用 LiveData 的 observeForever 然后在 ViewHolder 销毁前手动调用 removeObserver
|
||||
*使用 LifecycleRegistry 给 ViewHolder 分发生命周期(这里使用了这个)
|
||||
*/
|
||||
class QsRecordListAdapter(
|
||||
private val context: Context
|
||||
) : BaseRecyclerViewAdapter<QsRecordBean>() {
|
||||
|
||||
private var itemClickListener: IKotlinItemClickListener? = null
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseViewHolder {
|
||||
val viewBinding =
|
||||
AdapterQsRecordListBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return BaseViewHolder(viewBinding)
|
||||
}
|
||||
|
||||
override fun onViewRecycled(holder: BaseViewHolder) {
|
||||
super.onViewRecycled(holder)
|
||||
//页面滑动时会用holder重构页面,但是对进度条的监听回调会一直返回,扰乱UI,所以当当前holder去重构的时候,移除监听
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: BaseViewHolder, position: Int) {
|
||||
val binding: AdapterQsRecordListBinding =
|
||||
holder.viewBinding as AdapterQsRecordListBinding
|
||||
val qsRecordBean = data[position]
|
||||
//tag 方便onclick里拿到数据
|
||||
holder.tag = qsRecordBean.id.toString()
|
||||
// 点击事件
|
||||
holder.itemView.setOnClickListener {
|
||||
itemClickListener!!.onItemClickListener(position)
|
||||
}
|
||||
changeViews(binding, qsRecordBean)
|
||||
}
|
||||
|
||||
private fun changeViews(binding: AdapterQsRecordListBinding, qsRecordBean: QsRecordBean) {
|
||||
binding.qsRecordClassType.text = qsRecordBean.classType
|
||||
binding.qsRecordProblemType.text = qsRecordBean.problemType
|
||||
binding.qsRecordPhenomenon.text = qsRecordBean.phenomenon
|
||||
binding.qsRecordProblemLink.text = qsRecordBean.problemLink
|
||||
}
|
||||
|
||||
override fun getItemViewRes(position: Int): Int {
|
||||
return R.layout.adapter_qs_record_list
|
||||
}
|
||||
|
||||
// 提供set方法
|
||||
fun setOnKotlinItemClickListener(itemClickListener: IKotlinItemClickListener) {
|
||||
this.itemClickListener = itemClickListener
|
||||
}
|
||||
|
||||
//自定义接口
|
||||
interface IKotlinItemClickListener {
|
||||
fun onItemClickListener(position: Int)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,76 @@
|
||||
package com.navinfo.omqs.ui.fragment.qsrecordlist
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView.VERTICAL
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.databinding.FragmentQsRecordListBinding
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||
import com.navinfo.omqs.ui.fragment.BaseFragment
|
||||
import com.navinfo.omqs.ui.fragment.tasklist.QsRecordListAdapter
|
||||
import com.navinfo.omqs.ui.other.BaseToast.makeText
|
||||
import com.navinfo.omqs.ui.widget.RecycleViewDivider
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import org.apache.poi.xwpf.usermodel.VerticalAlign
|
||||
import javax.inject.Inject
|
||||
|
||||
@AndroidEntryPoint
|
||||
class QsRecordListFragment : BaseFragment(){
|
||||
private var _binding: FragmentQsRecordListBinding? = null
|
||||
private val viewModel by viewModels<QsRecordListViewModel>()
|
||||
private val binding get() = _binding!!
|
||||
private val adapter: QsRecordListAdapter by lazy {
|
||||
QsRecordListAdapter(
|
||||
requireContext()
|
||||
)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentQsRecordListBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val layoutManager = LinearLayoutManager(context)
|
||||
//// 设置 RecyclerView 的固定大小,避免在滚动时重新计算视图大小和布局,提高性能
|
||||
binding.qsRecyclerview.setHasFixedSize(true)
|
||||
binding.qsRecyclerview.layoutManager = layoutManager
|
||||
binding.qsRecyclerview.adapter = adapter
|
||||
viewModel.liveDataQSList.observe(viewLifecycleOwner) {
|
||||
adapter.refreshData(it)
|
||||
}
|
||||
val itemDecoration = DividerItemDecoration(context, DividerItemDecoration.VERTICAL)
|
||||
itemDecoration.setDrawable(resources.getDrawable(R.drawable.separator))
|
||||
binding.qsRecyclerview.addItemDecoration(itemDecoration)
|
||||
viewModel.getList(requireContext())
|
||||
// itemClick
|
||||
adapter!!.setOnKotlinItemClickListener(object : QsRecordListAdapter.IKotlinItemClickListener {
|
||||
override fun onItemClickListener(position: Int) {
|
||||
viewModel.onItemClickListener(activity as MainActivity,position)
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
viewModel.getList(requireContext())
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.navinfo.omqs.ui.fragment.qsrecordlist
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import androidx.navigation.findNavController
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.navinfo.collect.library.data.entity.QsRecordBean
|
||||
import com.navinfo.omqs.R
|
||||
import com.navinfo.omqs.ui.activity.map.MainActivity
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import io.realm.Realm
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
class QsRecordListViewModel @Inject constructor(
|
||||
) : ViewModel() {
|
||||
|
||||
val liveDataQSList = MutableLiveData<List<QsRecordBean>>()
|
||||
|
||||
fun getList(context: Context) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
val realm = Realm.getDefaultInstance()
|
||||
Log.e("jingo","realm hashCOde ${realm.hashCode()}")
|
||||
val objects = realm.where(QsRecordBean::class.java).findAll()
|
||||
liveDataQSList.postValue(realm.copyFromRealm(objects))
|
||||
}
|
||||
}
|
||||
|
||||
fun onItemClickListener(activity: MainActivity, position :Int){
|
||||
val naviController = activity.findNavController(R.id.main_activity_right_fragment)
|
||||
val bundle = Bundle()
|
||||
bundle.putString("QsId", liveDataQSList.value?.get(position)?.id)
|
||||
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||
ToastUtils.showLong(liveDataQSList.value?.get(position)?.classType)
|
||||
}
|
||||
}
|
@ -16,9 +16,9 @@ import com.navinfo.collect.library.sensor.ISensor.SensorWorkingMode;
|
||||
import com.navinfo.collect.library.sensor.ISensor.enmSensorType;
|
||||
import com.navinfo.collect.library.sensor.ISensor.enmSignalQuality;
|
||||
import com.navinfo.collect.library.sensor.SensorManager;
|
||||
import com.navinfo.omqs.system.SystemConstant;
|
||||
import com.navinfo.collect.library.utils.StringUtil;
|
||||
import com.navinfo.omqs.Constant;
|
||||
import com.navinfo.omqs.util.ShareUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -392,7 +392,7 @@ public class TakePhotoManager {
|
||||
|
||||
setCameraMode(indexClent, SensorWorkingMode.CAMERA_VEDIO_TIMELAPSE);
|
||||
|
||||
ShareUtil.getCameraMode(mCon).setContinusTakePhotoState(SystemConstant.USER_ID, false);
|
||||
ShareUtil.getCameraMode(mCon).setContinusTakePhotoState(Constant.USER_ID, false);
|
||||
|
||||
StartRecording(hostBean, indexClent);
|
||||
|
||||
@ -405,7 +405,7 @@ public class TakePhotoManager {
|
||||
if (hostBean != null) {
|
||||
CameraGarminVirbXE cameraGarminVirbXE = findCameraGarminVirbXE(hostBean, index);
|
||||
if (cameraGarminVirbXE != null) {
|
||||
cameraGarminVirbXE.snapPicture(SystemConstant.getUuid(true));
|
||||
cameraGarminVirbXE.snapPicture(StringUtil.Companion.createUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,144 @@
|
||||
package com.navinfo.omqs.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* Create by --- on 2018/12/6 0006.
|
||||
*@description:
|
||||
*/
|
||||
/**
|
||||
* 默认分割线:高度为2px,颜色为灰色
|
||||
*
|
||||
* @param context
|
||||
* @param orientation 列表方向 LinearLayoutManager.VERTICAL或LinearLayoutManager.HORIZONTAL
|
||||
*/
|
||||
class RecycleViewDivider(context: Context, private val mOrientation: Int) : RecyclerView.ItemDecoration() {
|
||||
|
||||
private var mPaint: Paint? = null
|
||||
private var mDivider: Drawable? = null
|
||||
private var mDividerHeight = 2//分割线高度,默认为1px
|
||||
|
||||
init {
|
||||
if (mOrientation != LinearLayoutManager.VERTICAL && mOrientation != LinearLayoutManager.HORIZONTAL) {
|
||||
throw IllegalArgumentException("请输入正确的参数!")
|
||||
}
|
||||
|
||||
val a = context.obtainStyledAttributes(ATTRS)
|
||||
mDivider = a.getDrawable(0)
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义分割线
|
||||
*
|
||||
* @param context
|
||||
* @param orientation 列表方向
|
||||
* @param drawableId 分割线图片
|
||||
*/
|
||||
constructor(context: Context, orientation: Int, drawableId: Int) : this(context, orientation) {
|
||||
mDivider = ContextCompat.getDrawable(context, drawableId)
|
||||
mDividerHeight = mDivider!!.intrinsicHeight
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义分割线
|
||||
*
|
||||
* @param context
|
||||
* @param orientation 列表方向
|
||||
* @param dividerHeight 分割线高度
|
||||
* @param dividerColor 分割线颜色
|
||||
*/
|
||||
constructor(context: Context, orientation: Int, dividerHeight: Int, dividerColor: Int) : this(
|
||||
context,
|
||||
orientation
|
||||
) {
|
||||
mDividerHeight = dividerHeight
|
||||
mPaint = Paint(Paint.ANTI_ALIAS_FLAG)
|
||||
mPaint!!.color = dividerColor
|
||||
mPaint!!.style = Paint.Style.FILL
|
||||
}
|
||||
|
||||
|
||||
//获取分割线尺寸
|
||||
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
if (mOrientation == LinearLayoutManager.VERTICAL) {
|
||||
outRect.set(0, 0, 0, mDividerHeight)
|
||||
} else {
|
||||
outRect.set(0, 0, mDividerHeight, 0)
|
||||
}
|
||||
}
|
||||
|
||||
//绘制分割线
|
||||
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
|
||||
super.onDraw(c, parent, state)
|
||||
if (mOrientation == LinearLayoutManager.VERTICAL) {
|
||||
drawVertical(c, parent)
|
||||
} else {
|
||||
drawHorizontal(c, parent)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制纵向列表时的分隔线 这时分隔线是横着的
|
||||
* 每次 left相同,top根据child变化,right相同,bottom也变化
|
||||
* @param canvas
|
||||
* @param parent
|
||||
*/
|
||||
private fun drawVertical(canvas: Canvas, parent: RecyclerView) {
|
||||
val left = parent.paddingLeft
|
||||
val right = parent.measuredWidth - parent.paddingRight
|
||||
val childSize = parent.childCount
|
||||
for (i in 0 until childSize) {
|
||||
val child = parent.getChildAt(i)
|
||||
val layoutParams = child.layoutParams as RecyclerView.LayoutParams
|
||||
val top = child.bottom + layoutParams.bottomMargin
|
||||
val bottom = top + mDividerHeight
|
||||
if (mDivider != null) {
|
||||
mDivider!!.setBounds(left, top, right, bottom)
|
||||
mDivider!!.draw(canvas)
|
||||
}
|
||||
if (mPaint != null) {
|
||||
canvas.drawRect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat(), mPaint!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 绘制横向列表时的分隔线 这时分隔线是竖着的
|
||||
* l、r 变化; t、b 不变
|
||||
* @param canvas
|
||||
* @param parent
|
||||
*/
|
||||
private fun drawHorizontal(canvas: Canvas, parent: RecyclerView) {
|
||||
val top = parent.paddingTop
|
||||
val bottom = parent.measuredHeight - parent.paddingBottom
|
||||
val childSize = parent.childCount
|
||||
for (i in 0 until childSize) {
|
||||
val child = parent.getChildAt(i)
|
||||
val layoutParams = child.layoutParams as RecyclerView.LayoutParams
|
||||
val left = child.right + layoutParams.rightMargin
|
||||
val right = left + mDividerHeight
|
||||
if (mDivider != null) {
|
||||
mDivider!!.setBounds(left, top, right, bottom)
|
||||
mDivider!!.draw(canvas)
|
||||
}
|
||||
if (mPaint != null) {
|
||||
canvas.drawRect(left.toFloat(), top.toFloat(), right.toFloat(), bottom.toFloat(), mPaint!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val ATTRS = intArrayOf(android.R.attr.listDivider)
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.navinfo.omqs.system;
|
||||
package com.navinfo.omqs.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.ParsePosition;
|
||||
@ -13,7 +13,7 @@ import java.util.Date;
|
||||
* @Date 2023年4月17日 下午1:56:02
|
||||
* @Description: 时间工具类
|
||||
*/
|
||||
public class SystemDateTime {
|
||||
public class DateTimeUtil {
|
||||
// 时间字符串
|
||||
private static String systemDate;
|
||||
// 全部时间信息
|
@ -3,7 +3,7 @@ package com.navinfo.omqs.util;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import com.navinfo.omqs.system.SystemConstant;
|
||||
import com.navinfo.omqs.Constant;
|
||||
|
||||
/**
|
||||
* @ClassName: ShareUtil.java
|
||||
@ -57,9 +57,9 @@ public class ShareUtil {
|
||||
return false;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
return mSharePre.getBoolean(mDeviceNum+SystemConstant.USER_ID+SELECT_CAMERA_KIND, false);
|
||||
return mSharePre.getBoolean(mDeviceNum+Constant.USER_ID+SELECT_CAMERA_KIND, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -76,7 +76,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
editor=mSharePre.edit();
|
||||
@ -98,10 +98,10 @@ public class ShareUtil {
|
||||
return true;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_TAKEPHOTO_OR_RECORD, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_TAKEPHOTO_OR_RECORD, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
return mSharePre.getBoolean(mDeviceNum+SystemConstant.USER_ID+SELECT_TAKE_PHOTO_OR_RECORD, mDeviceNum==1?true:false);
|
||||
return mSharePre.getBoolean(mDeviceNum+Constant.USER_ID+SELECT_TAKE_PHOTO_OR_RECORD, mDeviceNum==1?true:false);
|
||||
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_TAKEPHOTO_OR_RECORD, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_TAKEPHOTO_OR_RECORD, Context.MODE_PRIVATE);
|
||||
}
|
||||
editor=mSharePre.edit();
|
||||
|
||||
@ -139,9 +139,9 @@ public class ShareUtil {
|
||||
return true;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
return mSharePre.getBoolean(mDeviceNum+SystemConstant.USER_ID+CONTINUS_TAKE_PHOTO_STATE, true);
|
||||
return mSharePre.getBoolean(mDeviceNum+Constant.USER_ID+CONTINUS_TAKE_PHOTO_STATE, true);
|
||||
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.SELECT_CAMERA_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
editor=mSharePre.edit();
|
||||
|
||||
@ -178,9 +178,9 @@ public class ShareUtil {
|
||||
return false;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.CAMERA_CONNECT_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.CAMERA_CONNECT_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
return mSharePre.getBoolean(mDeviceNum+SystemConstant.USER_ID+CAMERA_CONNECT_STATE, false);
|
||||
return mSharePre.getBoolean(mDeviceNum+Constant.USER_ID+CAMERA_CONNECT_STATE, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +197,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.CAMERA_CONNECT_STATE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.CAMERA_CONNECT_STATE, Context.MODE_PRIVATE);
|
||||
}
|
||||
editor=mSharePre.edit();
|
||||
|
||||
@ -216,10 +216,10 @@ public class ShareUtil {
|
||||
return 0;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_MODE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_MODE, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
return mSharePre.getInt(mDeviceNum+SystemConstant.USER_ID+TAKE_CAMERA_MODE, mDeviceNum==1?0:1);
|
||||
return mSharePre.getInt(mDeviceNum+Constant.USER_ID+TAKE_CAMERA_MODE, mDeviceNum==1?0:1);
|
||||
|
||||
}
|
||||
|
||||
@ -238,7 +238,7 @@ public class ShareUtil {
|
||||
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_MODE, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_MODE, Context.MODE_PRIVATE);
|
||||
}
|
||||
editor=mSharePre.edit();
|
||||
|
||||
@ -257,9 +257,9 @@ public class ShareUtil {
|
||||
return "";
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_IP, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_IP, Context.MODE_PRIVATE);
|
||||
}
|
||||
String ip=mSharePre.getString(mDeviceNum+SystemConstant.USER_ID+TAKE_CAMERA_IP, "");
|
||||
String ip=mSharePre.getString(mDeviceNum+Constant.USER_ID+TAKE_CAMERA_IP, "");
|
||||
return ip;
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_IP, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_IP, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
editor=mSharePre.edit();
|
||||
@ -297,9 +297,9 @@ public class ShareUtil {
|
||||
return "";
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_MAC, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_MAC, Context.MODE_PRIVATE);
|
||||
}
|
||||
String mac=mSharePre.getString(mDeviceNum+SystemConstant.USER_ID+TAKE_CAMERA_MAC, "");
|
||||
String mac=mSharePre.getString(mDeviceNum+Constant.USER_ID+TAKE_CAMERA_MAC, "");
|
||||
return mac;
|
||||
}
|
||||
|
||||
@ -317,7 +317,7 @@ public class ShareUtil {
|
||||
return ;
|
||||
|
||||
if(mSharePre==null){
|
||||
mSharePre = mContext.getSharedPreferences(SystemConstant.TAKE_CAMERA_MAC, Context.MODE_PRIVATE);
|
||||
mSharePre = mContext.getSharedPreferences(Constant.TAKE_CAMERA_MAC, Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
editor=mSharePre.edit();
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="true" android:color="@color/blue"/>
|
||||
<item android:state_enabled="true" android:color="@color/deepskyblue"/>
|
||||
<item android:state_enabled="false" android:color="@color/text_hint_gray"/>
|
||||
</selector>
|
||||
|
9
app/src/main/res/drawable/separator.xml
Normal file
9
app/src/main/res/drawable/separator.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="line">
|
||||
<size android:height="2dp"/>
|
||||
<stroke
|
||||
android:color="@color/skyblue"
|
||||
android:dashWidth="2px"
|
||||
android:dashGap="2px"
|
||||
android:width="1dp"/>
|
||||
</shape>
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/cv_bg_color"
|
||||
android:background="@color/ivory"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingTop="5dp"
|
||||
@ -15,19 +15,18 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="省市名称"
|
||||
android:textColor="@color/white"
|
||||
style="@style/map_size_font_style"
|
||||
android:textSize="@dimen/default_font_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/offline_map_city_size"
|
||||
style="@style/map_size_font_style"
|
||||
style="@style/content_font_default_size_13sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/offline_map_city_name"
|
||||
android:drawableLeft="@mipmap/point_blue"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="文件大小"
|
||||
android:textSize="@dimen/card_title_font_3size" />
|
||||
android:text="文件大小" />
|
||||
|
||||
|
||||
<TextView
|
||||
@ -52,8 +51,7 @@
|
||||
android:clickable="true"
|
||||
android:focusable="false"
|
||||
android:shadowColor="@android:color/transparent"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/card_title_font_2size" />
|
||||
style="@style/content_font_default_size_13sp" />
|
||||
|
||||
<com.navinfo.omqs.ui.widget.MyProgressBar
|
||||
android:id="@+id/offline_map_progress"
|
||||
|
54
app/src/main/res/layout/adapter_qs_record_list.xml
Normal file
54
app/src/main/res/layout/adapter_qs_record_list.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/ivory"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
tools:context="com.navinfo.omqs.ui.fragment.qsrecordlist.QsRecordListAdapter">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qs_record_classType"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@mipmap/point_blue"
|
||||
android:text="问题分类"
|
||||
style="@style/content_font_default"
|
||||
android:textSize="@dimen/default_font_size" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qs_record_problemLink"
|
||||
style="@style/content_font_default"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/qs_record_classType"
|
||||
android:drawableLeft="@mipmap/point_blue"
|
||||
android:layout_marginLeft="@dimen/default_widget_padding"
|
||||
android:text="问题环节" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qs_record_problem_type"
|
||||
style="@style/content_font_default_size_13sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/qs_record_classType"
|
||||
android:drawableLeft="@mipmap/point_blue"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="问题类型" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/qs_record_phenomenon"
|
||||
style="@style/content_font_default_size_13sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/qs_record_problem_type"
|
||||
android:layout_below="@id/qs_record_classType"
|
||||
android:drawableLeft="@mipmap/point_blue"
|
||||
android:layout_marginLeft="@dimen/default_widget_padding"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="问题现象" />
|
||||
</RelativeLayout>
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/cv_bg_color"
|
||||
android:background="@color/ivory"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="10dp"
|
||||
|
27
app/src/main/res/layout/fragment_qs_record_list.xml
Normal file
27
app/src/main/res/layout/fragment_qs_record_list.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
tools:context=".ui.fragment.qsrecordlist.QsRecordListFragment">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/task_search"
|
||||
style="@style/input_blue_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="搜索"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/qs_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/task_search"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
tools:layout_editor_absoluteX="0dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -32,6 +32,6 @@
|
||||
android:shadowColor="#BB000000"
|
||||
android:shadowRadius="2.75"
|
||||
android:textAppearance="@android:style/TextAppearance.Small"
|
||||
android:textColor="@android:color/background_light" />
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
</LinearLayout>
|
@ -37,9 +37,9 @@
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:title="任务列表" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_offline_map3"
|
||||
android:id="@+id/personal_center_menu_qs_record_list"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
android:title="menu_home" />
|
||||
android:title="我的数据" />
|
||||
<item
|
||||
android:id="@+id/personal_center_menu_offline_map4"
|
||||
android:icon="@drawable/baseline_person_24"
|
||||
|
@ -29,4 +29,12 @@
|
||||
tools:layout="@layout/fragment_task_list">
|
||||
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/QsRecordListFragment"
|
||||
android:name="com.navinfo.omqs.ui.fragment.qsrecordlist.QsRecordListFragment"
|
||||
android:label="我的数据"
|
||||
tools:layout="@layout/fragment_qs_record_list">
|
||||
|
||||
</fragment>
|
||||
</navigation>
|
@ -1,17 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="red">#FF0000</color>
|
||||
<color name="transp">#00000000</color>
|
||||
<color name="orange">#ff8d36</color>
|
||||
<color name="blue" comment="应用主要色调">#1abbfe</color>
|
||||
<color name="line_gray" comment="轻度灰色,一般用于下划线,不可点击按钮的边框">#dadade</color>
|
||||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="white">#FFFFFF</color> <!--白色 -->
|
||||
<color name="ivory">#FFFFF0</color> <!--象牙色 -->
|
||||
<color name="lightyellow">#FFFFE0</color> <!--亮黄色 -->
|
||||
<color name="yellow">#FFFF00</color> <!--黄色 -->
|
||||
<color name="snow">#FFFAFA</color> <!--雪白色 -->
|
||||
<color name="floralwhite">#FFFAF0</color> <!--花白色 -->
|
||||
<color name="lemonchiffon">#FFFACD</color> <!--柠檬绸色 -->
|
||||
<color name="cornsilk">#FFF8DC</color> <!--米绸色 -->
|
||||
<color name="seashell">#FFF5EE</color> <!--海贝色 -->
|
||||
<color name="lavenderblush">#FFF0F5</color> <!--淡紫红 -->
|
||||
<color name="papayawhip">#FFEFD5</color> <!--番木色 -->
|
||||
<color name="blanchedalmond">#FFEBCD</color> <!--白杏色 -->
|
||||
<color name="mistyrose">#FFE4E1</color> <!--浅玫瑰色 -->
|
||||
<color name="bisque">#FFE4C4</color> <!--桔黄色 -->
|
||||
<color name="moccasin">#FFE4B5</color> <!--鹿皮色 -->
|
||||
<color name="navajowhite">#FFDEAD</color> <!--纳瓦白 -->
|
||||
<color name="peachpuff">#FFDAB9</color> <!--桃色 -->
|
||||
<color name="gold">#FFD700</color> <!--金色 -->
|
||||
<color name="pink">#FFC0CB</color> <!--粉红色 -->
|
||||
<color name="lightpink">#FFB6C1</color> <!--亮粉红色 -->
|
||||
<color name="orange">#FFA500</color> <!--橙色 -->
|
||||
<color name="lightsalmon">#FFA07A</color> <!--亮肉色 -->
|
||||
<color name="darkorange">#FF8C00</color> <!--暗桔黄色 -->
|
||||
<color name="coral">#FF7F50</color> <!--珊瑚色 -->
|
||||
<color name="hotpink">#FF69B4</color> <!--热粉红色 -->
|
||||
<color name="tomato">#FF6347</color> <!--西红柿色 -->
|
||||
<color name="orangered">#FF4500</color> <!--红橙色 -->
|
||||
<color name="deeppink">#FF1493</color> <!--深粉红色 -->
|
||||
<color name="fuchsia">#FF00FF</color> <!--紫红色 -->
|
||||
<color name="magenta">#FF00FF</color> <!--红紫色 -->
|
||||
<color name="red">#FF0000</color> <!--红色 -->
|
||||
<color name="oldlace">#FDF5E6</color> <!--老花色 -->
|
||||
<color name="lightgoldenrodyellow">#FAFAD2</color> <!--亮金黄色 -->
|
||||
<color name="linen">#FAF0E6</color> <!--亚麻色 -->
|
||||
<color name="antiquewhite">#FAEBD7</color> <!--古董白 -->
|
||||
<color name="salmon">#FA8072</color> <!--鲜肉色 -->
|
||||
<color name="ghostwhite">#F8F8FF</color> <!--幽灵白 -->
|
||||
<color name="mintcream">#F5FFFA</color> <!--薄荷色 -->
|
||||
<color name="whitesmoke">#F5F5F5</color> <!--烟白色 -->
|
||||
<color name="beige">#F5F5DC</color> <!--米色 -->
|
||||
<color name="wheat">#F5DEB3</color> <!--浅黄色 -->
|
||||
<color name="sandybrown">#F4A460</color> <!--沙褐色 -->
|
||||
<color name="azure">#F0FFFF</color> <!--天蓝色 -->
|
||||
<color name="honeydew">#F0FFF0</color> <!--蜜色 -->
|
||||
<color name="aliceblue">#F0F8FF</color> <!--艾利斯兰 -->
|
||||
<color name="khaki">#F0E68C</color> <!--黄褐色 -->
|
||||
<color name="lightcoral">#F08080</color> <!--亮珊瑚色 -->
|
||||
<color name="palegoldenrod">#EEE8AA</color> <!--苍麒麟色 -->
|
||||
<color name="violet">#EE82EE</color> <!--紫罗兰色 -->
|
||||
<color name="darksalmon">#E9967A</color> <!--暗肉色 -->
|
||||
<color name="lavender">#E6E6FA</color> <!--淡紫色 -->
|
||||
<color name="lightcyan">#E0FFFF</color> <!--亮青色 -->
|
||||
<color name="burlywood">#DEB887</color> <!--实木色 -->
|
||||
<color name="plum">#DDA0DD</color> <!--洋李色 -->
|
||||
<color name="gainsboro">#DCDCDC</color> <!--淡灰色 -->
|
||||
<color name="crimson">#DC143C</color> <!--暗深红色 -->
|
||||
<color name="palevioletred">#DB7093</color> <!--苍紫罗兰色 -->
|
||||
<color name="goldenrod">#DAA520</color> <!--金麒麟色 -->
|
||||
<color name="orchid">#DA70D6</color> <!--淡紫色 -->
|
||||
<color name="thistle">#D8BFD8</color> <!--蓟色 -->
|
||||
<color name="lightgray">#D3D3D3</color> <!--亮灰色 -->
|
||||
<color name="lightgrey">#D3D3D3</color> <!--亮灰色 -->
|
||||
<color name="tan">#D2B48C</color> <!--茶色 -->
|
||||
<color name="chocolate">#D2691E</color> <!--巧可力色 -->
|
||||
<color name="peru">#CD853F</color> <!--秘鲁色 -->
|
||||
<color name="indianred">#CD5C5C</color> <!--印第安红 -->
|
||||
<color name="mediumvioletred">#C71585</color> <!--中紫罗兰色 -->
|
||||
<color name="silver">#C0C0C0</color> <!--银色 -->
|
||||
<color name="darkkhaki">#BDB76B</color> <!--暗黄褐色-->
|
||||
<color name="rosybrown">#BC8F8F</color> <!--褐玫瑰红 -->
|
||||
<color name="mediumorchid">#BA55D3</color> <!--中粉紫色 -->
|
||||
<color name="darkgoldenrod">#B8860B</color> <!--暗金黄色 -->
|
||||
<color name="firebrick">#B22222</color> <!--火砖色 -->
|
||||
<color name="powderblue">#B0E0E6</color> <!--粉蓝色 -->
|
||||
<color name="lightsteelblue">#B0C4DE</color> <!--亮钢兰色-->
|
||||
<color name="paleturquoise">#AFEEEE</color> <!--苍宝石绿 -->
|
||||
<color name="greenyellow">#ADFF2F</color> <!--黄绿色 -->
|
||||
<color name="lightblue">#ADD8E6</color> <!--亮蓝色 -->
|
||||
<color name="darkgray">#A9A9A9</color> <!--暗灰色 -->
|
||||
<color name="darkgrey">#A9A9A9</color> <!--暗灰色 -->
|
||||
<color name="brown">#A52A2A</color> <!--褐色 -->
|
||||
<color name="sienna">#A0522D</color> <!--赭色 -->
|
||||
<color name="darkorchid">#9932CC</color> <!--暗紫色 -->
|
||||
<color name="palegreen">#98FB98</color> <!--苍绿色 -->
|
||||
<color name="darkviolet">#9400D3</color> <!--暗紫罗兰色 -->
|
||||
<color name="mediumpurple">#9370DB</color> <!--中紫色 -->
|
||||
<color name="lightgreen">#90EE90</color> <!--亮绿色 -->
|
||||
<color name="darkseagreen">#8FBC8F</color> <!--暗海兰色 -->
|
||||
<color name="saddlebrown">#8B4513</color> <!--重褐色 -->
|
||||
<color name="darkmagenta">#8B008B</color> <!--暗洋红 -->
|
||||
<color name="darkred">#8B0000</color> <!--暗红色 -->
|
||||
<color name="blueviolet">#8A2BE2</color> <!--紫罗兰蓝色 -->
|
||||
<color name="lightskyblue">#87CEFA</color> <!--亮天蓝色 -->
|
||||
<color name="skyblue">#87CEEB</color> <!--天蓝色 -->
|
||||
<color name="gray">#808080</color> <!--灰色 -->
|
||||
<color name="grey">#808080</color> <!--灰色 -->
|
||||
<color name="olive">#808000</color> <!--橄榄色 -->
|
||||
<color name="purple">#800080</color> <!--紫色 -->
|
||||
<color name="maroon">#800000</color> <!--粟色 -->
|
||||
<color name="aquamarine">#7FFFD4</color> <!--碧绿色 -->
|
||||
<color name="chartreuse">#7FFF00</color> <!--黄绿色 -->
|
||||
<color name="lawngreen">#7CFC00</color> <!--草绿色 -->
|
||||
<color name="mediumslateblue">#7B68EE</color> <!--中暗蓝色 -->
|
||||
<color name="lightslategray">#778899</color> <!--亮蓝灰 -->
|
||||
<color name="lightslategrey">#778899</color> <!--亮蓝灰 -->
|
||||
<color name="slategray">#708090</color> <!--灰石色 -->
|
||||
<color name="slategrey">#708090</color> <!--灰石色 -->
|
||||
<color name="olivedrab">#6B8E23</color> <!--深绿褐色 -->
|
||||
<color name="slateblue">#6A5ACD</color> <!--石蓝色 -->
|
||||
<color name="dimgray">#696969</color> <!--暗灰色 -->
|
||||
<color name="dimgrey">#696969</color> <!--暗灰色 -->
|
||||
<color name="mediumaquamarine">#66CDAA</color> <!--中绿色 -->
|
||||
<color name="cornflowerblue">#6495ED</color> <!--菊兰色 -->
|
||||
<color name="cadetblue">#5F9EA0</color> <!--军兰色 -->
|
||||
<color name="darkolivegreen">#556B2F</color> <!--暗橄榄绿-->
|
||||
<color name="indigo">#4B0082</color> <!--靛青色 -->
|
||||
<color name="mediumturquoise">#48D1CC</color> <!--中绿宝石 -->
|
||||
<color name="darkslateblue">#483D8B</color> <!--暗灰蓝色 -->
|
||||
<color name="steelblue">#4682B4</color> <!--钢兰色 -->
|
||||
<color name="royalblue">#4169E1</color> <!--皇家蓝 -->
|
||||
<color name="turquoise">#40E0D0</color> <!--青绿色 -->
|
||||
<color name="mediumseagreen">#3CB371</color> <!--中海蓝 -->
|
||||
<color name="limegreen">#32CD32</color> <!--橙绿色 -->
|
||||
<color name="darkslategray">#2F4F4F</color> <!--暗瓦灰色 -->
|
||||
<color name="darkslategrey">#2F4F4F</color> <!--暗瓦灰色 -->
|
||||
<color name="seagreen">#2E8B57</color> <!--海绿色 -->
|
||||
<color name="forestgreen">#228B22</color> <!--森林绿 -->
|
||||
<color name="lightseagreen">#20B2AA</color> <!--亮海蓝色 -->
|
||||
<color name="dodgerblue">#1E90FF</color> <!--闪兰色 -->
|
||||
<color name="midnightblue">#191970</color> <!--中灰兰色 -->
|
||||
<color name="aqua">#00FFFF</color> <!--浅绿色 -->
|
||||
<color name="cyan">#00FFFF</color> <!--青色 -->
|
||||
<color name="springgreen">#00FF7F</color> <!--春绿色 -->
|
||||
<color name="lime">#00FF00</color> <!--酸橙色 -->
|
||||
<color name="mediumspringgreen">#00FA9A</color> <!--中春绿色 -->
|
||||
<color name="darkturquoise">#00CED1</color> <!--暗宝石绿 -->
|
||||
<color name="deepskyblue">#00BFFF</color> <!--深天蓝色 -->
|
||||
<color name="darkcyan">#008B8B</color> <!--暗青色 -->
|
||||
<color name="teal">#008080</color> <!--水鸭色 -->
|
||||
<color name="green">#008000</color> <!--绿色 -->
|
||||
<color name="darkgreen">#006400</color> <!--暗绿色 -->
|
||||
<color name="blue">#0000FF</color> <!--蓝色 -->
|
||||
<color name="mediumblue">#0000CD</color> <!--中兰色 -->
|
||||
<color name="darkblue">#00008B</color> <!--暗蓝色 -->
|
||||
<color name="navy">#000080</color> <!--海军色 -->
|
||||
<color name="black">#000000</color> <!--黑色 -->
|
||||
|
||||
<color name="cv_gray_153">#999999</color>
|
||||
<color name="cvm_red">#FF3B30</color>
|
||||
<color name="cv_bg_color">#553C3F41</color>
|
||||
<color name="btn_blue_solid">#108ee9</color>
|
||||
<color name="background_light">#ffffffff</color>
|
||||
<!-- 一键连接对话框背景色 -->
|
||||
<color name="bg_gray2">#d1d1d1</color>
|
||||
<!-- 一键连接时间显示区域背景色 -->
|
||||
|
@ -6,7 +6,7 @@
|
||||
<dimen name="nav_header_vertical_spacing">8dp</dimen>
|
||||
<dimen name="nav_header_height">176dp</dimen>
|
||||
<dimen name="default_widget_padding">10dp</dimen>
|
||||
<dimen name="default_font_size" comment="默认字体大小,style中父最顶层">15dp</dimen>
|
||||
<dimen name="default_font_size" comment="默认字体大小,style中父最顶层">15sp</dimen>
|
||||
<dimen name="card_title_font_2size">13sp</dimen>
|
||||
<dimen name="card_title_font_3size">10sp</dimen>
|
||||
<dimen name="one">1dp</dimen>
|
||||
|
@ -17,17 +17,27 @@
|
||||
<!-- 默认字体 -->
|
||||
<style name="content_font_default">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:textSize">15dp</item>
|
||||
<item name="android:textSize">@dimen/default_font_size</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- 默认字体 -->
|
||||
<style name="content_font_default_size_13sp">
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:textSize">@dimen/card_title_font_2size</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<!-- 输入框基本样式 -->
|
||||
<style name="input_blue_type" parent="content_font_default">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:background">#FFFFFF</item>
|
||||
<item name="android:textColor">#1890ff</item>
|
||||
<item name="android:textColorHint">@color/text_hint_gray</item>
|
||||
<item name="android:padding">10dp</item>
|
||||
<item name="android:imeOptions">actionDone</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
@ -38,7 +48,7 @@
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:drawablePadding">4dp</item>
|
||||
<item name="android:textColor">@color/white</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textSize">9sp</item>
|
||||
<item name="android:focusable">false</item>
|
||||
<item name="android:clickable">false</item>
|
||||
|
@ -18,10 +18,6 @@ android {
|
||||
compileSdk 30
|
||||
|
||||
defaultConfig {
|
||||
minSdk 23
|
||||
targetSdk 30
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles "consumer-rules.pro"
|
||||
@ -32,9 +28,7 @@ android {
|
||||
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
}
|
||||
}
|
||||
ndk {
|
||||
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -64,7 +58,6 @@ dependencies {
|
||||
api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
api files('libs/BaiduLBS_Android.jar')
|
||||
|
||||
//
|
||||
api 'androidx.core:core-ktx:1.9.0'
|
||||
api 'androidx.appcompat:appcompat:1.6.1'
|
||||
api 'com.google.android.material:material:1.8.0'
|
||||
@ -132,7 +125,7 @@ dependencies {
|
||||
|
||||
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
|
||||
api 'com.tencent.wcdb:wcdb-android:1.1-19'
|
||||
|
||||
//api 'de.mrmaffen:libvlc-android:2.1.12@aar'
|
||||
// // 协程核心库
|
||||
// implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
|
||||
// // 协程Android支持库
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
collect-library/libs/dom4j-1.6.1.jar
Normal file
BIN
collect-library/libs/dom4j-1.6.1.jar
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -12,6 +12,9 @@
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="IxQi4mZGTlfv6Z9M2GRdqn4KKRbOATUU" />
|
||||
<!--<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="IxQi4mZGTlfv6Z9M2GRdqn4KKRbOATUU" />--><!--BMnHEAZ8Ypq44GOBf4UqENgvCmncfFU6-->
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:networkSecurityConfig="@xml/network_security_config">
|
||||
|
@ -75,7 +75,7 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) : Bas
|
||||
//可选,默认gcj02,设置返回的定位结果坐标系,如果配合百度地图使用,建议设置为bd09ll;
|
||||
locationOption.setCoorType("gcj02")
|
||||
//可选,默认0,即仅定位一次,设置发起连续定位请求的间隔需要大于等于1000ms才是有效的
|
||||
locationOption.setScanSpan(1000)
|
||||
locationOption.setScanSpan(1200)
|
||||
//可选,设置是否需要地址信息,默认不需要
|
||||
locationOption.setIsNeedAddress(false)
|
||||
//可选,设置是否需要地址描述
|
||||
@ -97,11 +97,11 @@ class LocationLayerHandler(context: AppCompatActivity, mapView: NIMapView) : Bas
|
||||
//可选,默认false,设置定位时是否需要海拔信息,默认不需要,除基础定位版本都可用
|
||||
locationOption.setIsNeedAltitude(true)
|
||||
//设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者,该模式下开发者无需再关心定位间隔是多少,定位SDK本身发现位置变化就会及时回调给开发者
|
||||
// locationOption.setOpenAutoNotifyMode()
|
||||
locationOption.setOpenAutoNotifyMode()
|
||||
//设置打开自动回调位置模式,该开关打开后,期间只要定位SDK检测到位置变化就会主动回调给开发者
|
||||
locationOption.setOpenAutoNotifyMode(
|
||||
1000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT
|
||||
)
|
||||
/* locationOption.setOpenAutoNotifyMode(
|
||||
5, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT
|
||||
)*/
|
||||
//需将配置好的LocationClientOption对象,通过setLocOption方法传递给LocationClient对象使用
|
||||
locationClient.locOption = locationOption
|
||||
} catch (e: Throwable) {
|
||||
|
BIN
fastmap.keystore
Normal file
BIN
fastmap.keystore
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user