Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS
Conflicts: app/src/main/java/com/navinfo/omqs/db/ImportOMDBHelper.kt
This commit is contained in:
commit
fbff312f41
@ -2,6 +2,7 @@ package com.navinfo.omqs.db
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.database.Cursor.*
|
import android.database.Cursor.*
|
||||||
|
import android.util.Log
|
||||||
import androidx.core.database.getBlobOrNull
|
import androidx.core.database.getBlobOrNull
|
||||||
import androidx.core.database.getFloatOrNull
|
import androidx.core.database.getFloatOrNull
|
||||||
import androidx.core.database.getIntOrNull
|
import androidx.core.database.getIntOrNull
|
||||||
@ -129,7 +130,8 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
// 开始解压zip文件
|
// 开始解压zip文件
|
||||||
val unZipFiles = ZipUtils.unzipFile(omdbZipFile, unZipFolder)
|
val unZipFiles = ZipUtils.unzipFile(omdbZipFile, unZipFolder)
|
||||||
// 将listResult数据插入到Realm数据库中
|
// 将listResult数据插入到Realm数据库中
|
||||||
val realm = Realm.getDefaultInstance()
|
try {
|
||||||
|
Realm.getDefaultInstance().beginTransaction()
|
||||||
// 遍历解压后的文件,读取该数据返回
|
// 遍历解压后的文件,读取该数据返回
|
||||||
for ((index, currentConfig) in importConfig.tables.withIndex()) {
|
for ((index, currentConfig) in importConfig.tables.withIndex()) {
|
||||||
val txtFile = unZipFiles.find {
|
val txtFile = unZipFiles.find {
|
||||||
@ -139,9 +141,11 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
val listResult = mutableListOf<Map<String, Any>>()
|
val listResult = mutableListOf<Map<String, Any>>()
|
||||||
currentConfig?.let {
|
currentConfig?.let {
|
||||||
val list = FileIOUtils.readFile2List(txtFile, "UTF-8")
|
val list = FileIOUtils.readFile2List(txtFile, "UTF-8")
|
||||||
|
Log.d("ImportOMDBHelper", "开始解析:${txtFile?.name}")
|
||||||
if (list != null) {
|
if (list != null) {
|
||||||
// 将list数据转换为map
|
// 将list数据转换为map
|
||||||
for (line in list) {
|
for ((index, line) in list.withIndex()) {
|
||||||
|
Log.d("ImportOMDBHelper", "解析第:${index+1}行")
|
||||||
val map = gson.fromJson<Map<String, Any>>(line, object:TypeToken<Map<String, Any>>(){}.getType())
|
val map = gson.fromJson<Map<String, Any>>(line, object:TypeToken<Map<String, Any>>(){}.getType())
|
||||||
.toMutableMap()
|
.toMutableMap()
|
||||||
map["qi_table"] = currentConfig.table
|
map["qi_table"] = currentConfig.table
|
||||||
@ -174,6 +178,10 @@ class ImportOMDBHelper @AssistedInject constructor(
|
|||||||
emit("${index + 1}/${importConfig.tables.size}")
|
emit("${index + 1}/${importConfig.tables.size}")
|
||||||
}
|
}
|
||||||
Realm.getDefaultInstance().commitTransaction()
|
Realm.getDefaultInstance().commitTransaction()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Realm.getDefaultInstance().cancelTransaction()
|
||||||
|
throw e
|
||||||
|
}
|
||||||
emit("finish")
|
emit("finish")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,10 @@ class QsRecordListFragment : BaseFragment(){
|
|||||||
findNavController().popBackStack()
|
findNavController().popBackStack()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
binding.recordBack.setOnClickListener{
|
||||||
|
findNavController().navigateUp()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
5
app/src/main/res/drawable/ic_baseline_search_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_search_24.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<vector android:height="24dp" android:tint="#2C2C2C"
|
||||||
|
android:viewportHeight="24" android:viewportWidth="24"
|
||||||
|
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||||
|
</vector>
|
@ -3,6 +3,6 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="rectangle">
|
android:shape="rectangle">
|
||||||
<solid android:color="@color/colorSurface"></solid>
|
<solid android:color="@color/colorSurface"></solid>
|
||||||
<stroke android:color="@color/gray_121" android:width="0.1dp"></stroke>
|
<stroke android:color="@color/cv_gray_153" android:width="0.1dp"></stroke>
|
||||||
<corners android:radius="30dp" />
|
<corners android:radius="30dp" />
|
||||||
</shape>
|
</shape>
|
@ -26,6 +26,7 @@
|
|||||||
android:layout_below="@id/offline_map_city_name"
|
android:layout_below="@id/offline_map_city_name"
|
||||||
android:drawableLeft="@mipmap/point_blue"
|
android:drawableLeft="@mipmap/point_blue"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:textColor="@color/gray_121"
|
||||||
android:text="文件大小" />
|
android:text="文件大小" />
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingVertical="@dimen/default_widget_padding"
|
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
android:id="@+id/offline_map_tab_layout"
|
android:id="@+id/offline_map_tab_layout"
|
||||||
|
@ -4,23 +4,41 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:padding="@dimen/default_widget_padding"
|
||||||
tools:context=".ui.fragment.offlinemap.OfflineMapCityListFragment">
|
tools:context=".ui.fragment.offlinemap.OfflineMapCityListFragment">
|
||||||
|
|
||||||
<EditText
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/offline_map_search_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:startIconDrawable="@drawable/ic_baseline_search_24"
|
||||||
|
app:startIconTint="@color/gray_121"
|
||||||
|
app:endIconMode="clear_text"
|
||||||
|
android:layout_marginHorizontal="@dimen/default_widget_padding"
|
||||||
|
app:endIconDrawable="@drawable/baseline_delete_forever_24"
|
||||||
|
app:endIconTint="@color/gray_121"
|
||||||
|
android:scrollbarAlwaysDrawHorizontalTrack="true"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/offline_map_search"
|
android:id="@+id/offline_map_search"
|
||||||
style="@style/input_blue_type"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="搜索"
|
android:hint="搜索"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:lines="1"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
android:background="@drawable/login_inputlayout_bg"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/offline_map_city_list_recyclerview"
|
android:id="@+id/offline_map_city_list_recyclerview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="@dimen/default_widget_padding"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/offline_map_search"
|
app:layout_constraintTop_toBottomOf="@id/offline_map_search_layout"
|
||||||
app:layout_constraintVertical_bias="0.0"
|
app:layout_constraintVertical_bias="0.0"
|
||||||
tools:layout_editor_absoluteX="0dp" />
|
tools:layout_editor_absoluteX="0dp" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,24 +4,82 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white"
|
android:background="@color/bg_left_pannel"
|
||||||
tools:context=".ui.fragment.qsrecordlist.QsRecordListFragment">
|
tools:context=".ui.fragment.qsrecordlist.QsRecordListFragment">
|
||||||
|
|
||||||
<EditText
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/task_search"
|
android:id="@+id/title_layout"
|
||||||
style="@style/input_blue_type"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="搜索"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
style="@style/left_pannel_title_layout">
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/record_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:background="@drawable/selector_bg_round_button"
|
||||||
|
android:foreground="@drawable/ripple_btn_press"
|
||||||
|
style="@style/btn_round"
|
||||||
|
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"></androidx.appcompat.widget.AppCompatImageView>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/record_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/left_pannel_title_font"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="我的数据"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"></androidx.appcompat.widget.AppCompatTextView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
style="@style/default_card_view">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/task_search_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:startIconDrawable="@drawable/ic_baseline_search_24"
|
||||||
|
app:startIconTint="@color/gray_121"
|
||||||
|
app:endIconMode="clear_text"
|
||||||
|
android:layout_marginHorizontal="@dimen/default_widget_padding"
|
||||||
|
app:endIconDrawable="@drawable/baseline_delete_forever_24"
|
||||||
|
app:endIconTint="@color/gray_121"
|
||||||
|
android:scrollbarAlwaysDrawHorizontalTrack="true"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout"
|
||||||
|
app:layout_constraintVertical_bias="0.4">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/task_search"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="输入LinkPid"
|
||||||
|
android:lines="1"
|
||||||
|
android:background="@drawable/login_inputlayout_bg"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/qs_recyclerview"
|
android:id="@+id/qs_recyclerview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/task_search"
|
app:layout_constraintTop_toBottomOf="@id/task_search_layout" />
|
||||||
app:layout_constraintVertical_bias="0.0"
|
</LinearLayout>
|
||||||
tools:layout_editor_absoluteX="0dp" />
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -4,46 +4,83 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white"
|
android:background="@color/bg_left_pannel"
|
||||||
tools:context=".ui.fragment.tasklist.TaskListFragment">
|
tools:context=".ui.fragment.tasklist.TaskListFragment">
|
||||||
|
|
||||||
<TextView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/task_title"
|
android:id="@+id/title_layout"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:text="任务列表"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textSize="18sp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:background="@color/default_blue"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/task_back"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:src="@drawable/btn_back_xml"
|
|
||||||
android:paddingLeft="15dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
app:layout_constraintLeft_toLeftOf="@id/task_title"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/task_title"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/task_title"
|
|
||||||
/>
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/task_search"
|
|
||||||
style="@style/input_blue_type"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:hint="搜索"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
style="@style/left_pannel_title_layout">
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/task_back"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/task_title" />
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
android:background="@drawable/selector_bg_round_button"
|
||||||
|
android:foreground="@drawable/ripple_btn_press"
|
||||||
|
style="@style/btn_round"
|
||||||
|
android:src="@drawable/ic_baseline_keyboard_arrow_left_24"></androidx.appcompat.widget.AppCompatImageView>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/task_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/left_pannel_title_font"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="任务列表"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"></androidx.appcompat.widget.AppCompatTextView>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
style="@style/default_card_view">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:id="@+id/task_search_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:startIconDrawable="@drawable/ic_baseline_search_24"
|
||||||
|
app:startIconTint="@color/gray_121"
|
||||||
|
app:endIconMode="clear_text"
|
||||||
|
android:layout_marginHorizontal="@dimen/default_widget_padding"
|
||||||
|
app:endIconDrawable="@drawable/baseline_delete_forever_24"
|
||||||
|
app:endIconTint="@color/gray_121"
|
||||||
|
android:scrollbarAlwaysDrawHorizontalTrack="true"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout"
|
||||||
|
app:layout_constraintVertical_bias="0.4">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:id="@+id/task_search"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="输入LinkPid"
|
||||||
|
android:lines="1"
|
||||||
|
android:background="@drawable/login_inputlayout_bg"
|
||||||
|
tools:ignore="TouchTargetSizeCheck" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/task_recyclerview"
|
android:id="@+id/task_recyclerview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="match_parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/task_search"
|
app:layout_constraintTop_toBottomOf="@id/task_search_layout" />
|
||||||
app:layout_constraintVertical_bias="0.0"
|
</LinearLayout>
|
||||||
tools:layout_editor_absoluteX="0dp" />
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -160,5 +160,6 @@
|
|||||||
<item name="background">@drawable/shape_card_bg_default</item>
|
<item name="background">@drawable/shape_card_bg_default</item>
|
||||||
<item name="android:layout_margin">@dimen/default_widget_padding</item>
|
<item name="android:layout_margin">@dimen/default_widget_padding</item>
|
||||||
<item name="cardCornerRadius">@dimen/default_widget_padding</item>
|
<item name="cardCornerRadius">@dimen/default_widget_padding</item>
|
||||||
|
<item name="android:padding">@dimen/default_widget_padding</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user