Merge branch 'master' of gitlab.navinfo.com:vivo/navinfovivo
Conflicts: app/src/main/java/com/navinfo/volvo/MainActivity.kt app/src/main/res/menu/bottom_nav_menu.xml app/src/main/res/navigation/mobile_navigation.xml
This commit is contained in:
commit
dc6d5424dc
2
.idea/gradle.xml
generated
2
.idea/gradle.xml
generated
@ -8,7 +8,7 @@
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleHome" value="$USER_HOME$/.gradle/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2" />
|
||||
<option name="gradleJvm" value="JDK" />
|
||||
<option name="gradleJvm" value="corretto-11" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
10
.idea/markdown.xml
generated
Normal file
10
.idea/markdown.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MarkdownSettings">
|
||||
<enabledExtensions>
|
||||
<entry key="MermaidLanguageExtension" value="true" />
|
||||
<entry key="PlantUMLLanguageExtension" value="true" />
|
||||
</enabledExtensions>
|
||||
<option name="verticalSplit" value="false" />
|
||||
</component>
|
||||
</project>
|
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@ -1,7 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<<<<<<< HEAD
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
|
||||
=======
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
||||
>>>>>>> e4f8cd19496660f3dc11140134950097331d4957
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -44,6 +44,7 @@ android {
|
||||
}
|
||||
buildFeatures {
|
||||
viewBinding true
|
||||
dataBinding true
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +53,7 @@ dependencies {
|
||||
implementation 'androidx.core:core-ktx:1.8.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.5.1'
|
||||
implementation 'com.google.android.material:material:1.7.0'
|
||||
implementation "androidx.compose.material3:material3:1.0.0-alpha04"
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
|
||||
@ -74,6 +76,10 @@ dependencies {
|
||||
// implementation "android.arch.lifecycle:extensions:1.1.1"
|
||||
// annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
|
||||
implementation 'com.tencent.wcdb:wcdb-android:1.1-19'
|
||||
// 文件选择器 https://github.com/rosuH/AndroidFilePicker/blob/master/README_CN.md
|
||||
implementation 'me.rosuh:AndroidFilePicker:0.8.2'
|
||||
// 时间选择器 https://github.com/Gredicer/datetimepicker
|
||||
implementation 'com.github.Gredicer:datetimepicker:V1.0.0'
|
||||
implementation 'com.google.code.gson:gson:2.10'
|
||||
implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
|
||||
}
|
@ -29,9 +29,7 @@ class MainActivity : AppCompatActivity() {
|
||||
// menu should be considered as top level destinations.
|
||||
val appBarConfiguration = AppBarConfiguration(
|
||||
setOf(
|
||||
R.id.navigation_home,
|
||||
R.id.navigation_dashboard,
|
||||
R.id.navigation_notifications
|
||||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications, R.id.navigation_obtain_message
|
||||
)
|
||||
)
|
||||
setupActionBarWithNavController(navController, appBarConfiguration)
|
||||
|
@ -10,6 +10,7 @@ import androidx.room.RoomDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase;
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper;
|
||||
|
||||
import com.navinfo.volvo.db.dao.entity.Message;
|
||||
import com.navinfo.volvo.db.dao.entity.Attachment;
|
||||
import com.navinfo.volvo.db.dao.entity.Message;
|
||||
import com.navinfo.volvo.db.dao.entity.User;
|
||||
|
@ -9,9 +9,15 @@ import com.navinfo.volvo.tools.GsonUtil
|
||||
@Entity(tableName = "Attachment")
|
||||
data class Attachment(
|
||||
@PrimaryKey()
|
||||
var id: String
|
||||
var id: String,
|
||||
var pathUrl: String,
|
||||
var attachmentType: AttachmentType
|
||||
)
|
||||
|
||||
enum class AttachmentType {
|
||||
PIC, AUDIO
|
||||
}
|
||||
|
||||
class AttachmentConverters() {
|
||||
@TypeConverter
|
||||
fun stringToAttachment(value: String): Attachment {
|
||||
|
@ -43,4 +43,4 @@ data class Message @JvmOverloads constructor(
|
||||
* 附件列表
|
||||
*/
|
||||
var attachment: MutableList<Attachment> = mutableListOf()
|
||||
)
|
||||
)
|
||||
|
13
app/src/main/java/com/navinfo/volvo/ui/ViewExtend.kt
Normal file
13
app/src/main/java/com/navinfo/volvo/ui/ViewExtend.kt
Normal file
@ -0,0 +1,13 @@
|
||||
package com.navinfo.volvo.ui
|
||||
|
||||
import android.graphics.Color
|
||||
import androidx.core.text.buildSpannedString
|
||||
import androidx.core.text.color
|
||||
import com.google.android.material.textfield.TextInputLayout
|
||||
|
||||
fun TextInputLayout.markRequiredInRed() {
|
||||
hint = buildSpannedString {
|
||||
append(hint)// Mind the space prefix.
|
||||
color(Color.RED) { append(" *") }
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ import com.navinfo.volvo.R
|
||||
import com.navinfo.volvo.databinding.FragmentHomeBinding
|
||||
import com.navinfo.volvo.tools.DisplayUtil
|
||||
import com.navinfo.volvo.ui.adapter.MessageAdapter
|
||||
import com.navinfo.volvo.ui.message.ObtainMessageViewModel
|
||||
import com.yanzhenjie.recyclerview.*
|
||||
import com.yanzhenjie.recyclerview.SwipeRecyclerView.LoadMoreListener
|
||||
|
||||
@ -32,10 +33,21 @@ class HomeFragment : Fragment(), OnItemClickListener, OnItemMenuClickListener {
|
||||
): View {
|
||||
val homeViewModel =
|
||||
ViewModelProvider(this).get(HomeViewModel::class.java)
|
||||
val obtainMessageViewModel = ViewModelProvider(requireActivity()).get(ObtainMessageViewModel::class.java)
|
||||
|
||||
_binding = FragmentHomeBinding.inflate(inflater, container, false)
|
||||
val root: View = binding.root
|
||||
|
||||
// val textView: TextView = binding.tvNewMessage
|
||||
// textView.setOnClickListener {
|
||||
// val message = Message(1, "新建标题", "", "", "", 0, "1", "2", mutableListOf())
|
||||
// obtainMessageViewModel.setCurrentMessage(message)
|
||||
// // 跳转到新建Message的Fragment
|
||||
// Navigation.findNavController(it).navigate(R.id.home_2_obtain_message)
|
||||
// }
|
||||
// homeViewModel.text.observe(viewLifecycleOwner) {
|
||||
//
|
||||
// }
|
||||
val recyclerview: SwipeRecyclerView = binding.homeMessageRecyclerview
|
||||
recyclerview.adapter = null //先设置null,否则会报错
|
||||
//创建菜单选项
|
||||
|
@ -0,0 +1,68 @@
|
||||
package com.navinfo.volvo.ui.message
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.gredicer.datetimepicker.DateTimePickerFragment
|
||||
import com.navinfo.volvo.databinding.FragmentObtainMessageBinding
|
||||
import com.navinfo.volvo.ui.markRequiredInRed
|
||||
|
||||
class ObtainMessageFragment: Fragment() {
|
||||
private var _binding: FragmentObtainMessageBinding? = null
|
||||
private val obtainMessageViewModel by lazy {
|
||||
ViewModelProvider(requireActivity()).get(ObtainMessageViewModel::class.java)
|
||||
}
|
||||
|
||||
// This property is only valid between onCreateView and
|
||||
// onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = FragmentObtainMessageBinding.inflate(inflater, container, false)
|
||||
val root: View = binding.root
|
||||
|
||||
obtainMessageViewModel?.getMessageLiveData()?.observe(
|
||||
viewLifecycleOwner, Observer {
|
||||
// 初始化界面显示内容
|
||||
if(it.title!=null)
|
||||
binding.tvMessageTitle?.setText(it.title)
|
||||
if (it.sendDate!=null) {
|
||||
binding.btnSendTime.setText(it.sendDate)
|
||||
}
|
||||
}
|
||||
)
|
||||
initView()
|
||||
return root
|
||||
}
|
||||
|
||||
fun initView() {
|
||||
// 设置问候信息提示的红色星号
|
||||
binding.tiLayoutTitle.markRequiredInRed()
|
||||
// 设置点击按钮选择发送时间
|
||||
binding.btnSendTime.setOnClickListener {
|
||||
val dialog = DateTimePickerFragment.newInstance().mode(0)
|
||||
dialog.listener = object : DateTimePickerFragment.OnClickListener {
|
||||
override fun onClickListener(selectTime: String) {
|
||||
obtainMessageViewModel.updateMessageSendTime(selectTime)
|
||||
}
|
||||
|
||||
}
|
||||
dialog.show(parentFragmentManager, "SelectSendTime")
|
||||
}
|
||||
|
||||
// 点击按钮选择拍照
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.navinfo.volvo.ui.message
|
||||
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.liveData
|
||||
import com.navinfo.volvo.db.dao.entity.Message
|
||||
import com.navinfo.volvo.db.dao.entity.AttachmentType
|
||||
|
||||
class ObtainMessageViewModel: ViewModel() {
|
||||
private val msgLiveData: MutableLiveData<Message> by lazy {
|
||||
MutableLiveData<Message>()
|
||||
}
|
||||
|
||||
fun setCurrentMessage(msg: Message) {
|
||||
msgLiveData.postValue(msg)
|
||||
}
|
||||
|
||||
fun getMessageLiveData(): MutableLiveData<Message> {
|
||||
return msgLiveData
|
||||
}
|
||||
|
||||
// 更新消息标题
|
||||
fun updateMessageTitle(title: String) {
|
||||
this.msgLiveData.value?.title = title
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
|
||||
// 更新消息附件中的照片文件
|
||||
fun updateMessagePic(picUrl: String) {
|
||||
for (attachment in this.msgLiveData.value!!.attachment) {
|
||||
if (attachment.attachmentType == AttachmentType.PIC) {
|
||||
attachment.pathUrl = picUrl
|
||||
}
|
||||
}
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
|
||||
// 更新消息附件中的录音文件
|
||||
fun updateMessageAudio(audioUrl: String) {
|
||||
for (attachment in this.msgLiveData.value!!.attachment) {
|
||||
if (attachment.attachmentType == AttachmentType.AUDIO) {
|
||||
attachment.pathUrl = audioUrl
|
||||
}
|
||||
}
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
|
||||
// 更新发送人
|
||||
fun updateMessageSendFrom(sendFrom: String) {
|
||||
this.msgLiveData.value?.fromId = sendFrom
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
|
||||
// 更新接收人
|
||||
fun updateMessageSendTo(sendTo: String) {
|
||||
this.msgLiveData.value?.toId = sendTo
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
|
||||
// 更新发件时间
|
||||
fun updateMessageSendTime(sendTime: String) {
|
||||
this.msgLiveData.value?.sendDate = sendTime
|
||||
this.msgLiveData.postValue(this.msgLiveData.value)
|
||||
}
|
||||
}
|
6
app/src/main/res/drawable/ic_baseline_access_time_24.xml
Normal file
6
app/src/main/res/drawable/ic_baseline_access_time_24.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_baseline_audio_file_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_audio_file_24.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M14,2H6C4.9,2 4.01,2.9 4.01,4L4,20c0,1.1 0.89,2 1.99,2H18c1.1,0 2,-0.9 2,-2V8L14,2zM16,13h-3v3.75c0,1.24 -1.01,2.25 -2.25,2.25S8.5,17.99 8.5,16.75c0,-1.24 1.01,-2.25 2.25,-2.25c0.46,0 0.89,0.14 1.25,0.38V11h4V13zM13,9V3.5L18.5,9H13z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_baseline_camera_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_camera_24.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M9.4,10.5l4.77,-8.26C13.47,2.09 12.75,2 12,2c-2.4,0 -4.6,0.85 -6.32,2.25l3.66,6.35 0.06,-0.1zM21.54,9c-0.92,-2.92 -3.15,-5.26 -6,-6.34L11.88,9h9.66zM21.8,10h-7.49l0.29,0.5 4.76,8.25C21,16.97 22,14.61 22,12c0,-0.69 -0.07,-1.35 -0.2,-2zM8.54,12l-3.9,-6.75C3.01,7.03 2,9.39 2,12c0,0.69 0.07,1.35 0.2,2h7.49l-1.15,-2zM2.46,15c0.92,2.92 3.15,5.26 6,6.34L12.12,15L2.46,15zM13.73,15l-3.9,6.76c0.7,0.15 1.42,0.24 2.17,0.24 2.4,0 4.6,-0.85 6.32,-2.25l-3.66,-6.35 -0.93,1.6z"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>
|
||||
</vector>
|
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M18,13v7L4,20L4,6h5.02c0.05,-0.71 0.22,-1.38 0.48,-2L4,4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2v-5l-2,-2zM16.5,18h-11l2.75,-3.53 1.96,2.36 2.75,-3.54zM19.3,8.89c0.44,-0.7 0.7,-1.51 0.7,-2.39C20,4.01 17.99,2 15.5,2S11,4.01 11,6.5s2.01,4.5 4.49,4.5c0.88,0 1.7,-0.26 2.39,-0.7L21,13.42 22.42,12 19.3,8.89zM15.5,9C14.12,9 13,7.88 13,6.5S14.12,4 15.5,4 18,5.12 18,6.5 16.88,9 15.5,9z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_baseline_mail_24.xml
Normal file
5
app/src/main/res/drawable/ic_baseline_mail_24.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
|
||||
</vector>
|
8
app/src/main/res/drawable/selector_bg_4_round_corner.xml
Normal file
8
app/src/main/res/drawable/selector_bg_4_round_corner.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/shape_bg_4_round_corner" android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/shape_bg_4_round_corner" android:state_selected="true"></item>
|
||||
<item android:drawable="@drawable/shape_bg_4_round_corner" android:state_pressed="true"></item>
|
||||
<item android:drawable="@drawable/shape_bg_4_round_corner" android:state_checked="true"></item>
|
||||
<item android:drawable="@drawable/shape_bg_4_round_corner_default" ></item>
|
||||
</selector>
|
21
app/src/main/res/drawable/shape_bg_4_round_corner.xml
Normal file
21
app/src/main/res/drawable/shape_bg_4_round_corner.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置圆角-->
|
||||
<!-- 按顺序分别对应:左下角的角度、右下角的角度、左上角的角度、右上角的角度-->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/default_widget_padding"
|
||||
android:bottomRightRadius="@dimen/default_widget_padding"
|
||||
android:topLeftRadius="@dimen/default_widget_padding"
|
||||
android:topRightRadius="@dimen/default_widget_padding" />
|
||||
<!--设置圆角背景色-->
|
||||
<!-- <solid android:color="@color/white" />-->
|
||||
<!-- 设置边框大小与背景色-->
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="@color/purple_200" />
|
||||
<padding android:bottom="@dimen/default_widget_padding"
|
||||
android:left="@dimen/default_widget_padding"
|
||||
android:right="@dimen/default_widget_padding"
|
||||
android:top="@dimen/default_widget_padding">
|
||||
</padding>
|
||||
</shape>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--设置圆角-->
|
||||
<!-- 按顺序分别对应:左下角的角度、右下角的角度、左上角的角度、右上角的角度-->
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/default_widget_padding"
|
||||
android:bottomRightRadius="@dimen/default_widget_padding"
|
||||
android:topLeftRadius="@dimen/default_widget_padding"
|
||||
android:topRightRadius="@dimen/default_widget_padding" />
|
||||
<!--设置圆角背景色-->
|
||||
<!-- <solid android:color="@color/white" />-->
|
||||
<!-- 设置边框大小与背景色-->
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="@color/black" />
|
||||
<padding android:bottom="@dimen/default_widget_padding"
|
||||
android:left="@dimen/default_widget_padding"
|
||||
android:right="@dimen/default_widget_padding"
|
||||
android:top="@dimen/default_widget_padding">
|
||||
</padding>
|
||||
</shape>
|
@ -6,7 +6,5 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.home.HomeFragment"
|
||||
>
|
||||
|
||||
</com.yanzhenjie.recyclerview.SwipeRecyclerView>
|
||||
tools:context=".ui.home.HomeFragment">
|
||||
</com.yanzhenjie.recyclerview.SwipeRecyclerView>
|
||||
|
272
app/src/main/res/layout/fragment_obtain_message.xml
Normal file
272
app/src/main/res/layout/fragment_obtain_message.xml
Normal file
@ -0,0 +1,272 @@
|
||||
<?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:padding="@dimen/activity_default_padding"
|
||||
tools:context=".ui.message.ObtainMessageFragment">
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/ti_layout_title"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/default_widget_padding"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="10"
|
||||
app:errorEnabled="true"
|
||||
android:hint="问候信息"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:startIconDrawable="@drawable/ic_baseline_mail_24">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/tv_message_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/label_message_subtitle"
|
||||
style="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="问候信息"
|
||||
app:layout_constraintTop_toBottomOf="@id/ti_layout_title"></com.google.android.material.textview.MaterialTextView>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/div_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="@dimen/default_widget_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/label_message_subtitle"></com.google.android.material.divider.MaterialDivider>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layer_message_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/default_widget_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/div_message">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="@color/red"></TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上传图片:"></TextView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
app:icon="@drawable/ic_baseline_camera_24"
|
||||
android:text="点击拍照"
|
||||
android:padding="@dimen/default_widget_padding"></com.google.android.material.button.MaterialButton>
|
||||
<Space
|
||||
android:layout_width="@dimen/default_widget_padding"
|
||||
android:layout_height="wrap_content"></Space>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
app:icon="@drawable/ic_baseline_image_search_24"
|
||||
android:text="相册选择"
|
||||
android:padding="@dimen/default_widget_padding"></com.google.android.material.button.MaterialButton>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="@color/red"></TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="上传音频:"></TextView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
app:icon="@drawable/ic_baseline_fiber_manual_record_24"
|
||||
android:text="长按录音"
|
||||
android:padding="@dimen/default_widget_padding"></com.google.android.material.button.MaterialButton>
|
||||
<Space
|
||||
android:layout_width="@dimen/default_widget_padding"
|
||||
android:layout_height="wrap_content"></Space>
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
app:icon="@drawable/ic_baseline_audio_file_24"
|
||||
android:text="音频选择"
|
||||
android:padding="@dimen/default_widget_padding"></com.google.android.material.button.MaterialButton>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/label_send_info"
|
||||
style="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发送信息"
|
||||
app:layout_constraintTop_toBottomOf="@id/layer_message_info"></com.google.android.material.textview.MaterialTextView>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:id="@+id/div_send_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginVertical="@dimen/default_widget_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/label_send_info"></com.google.android.material.divider.MaterialDivider>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layer_send_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/default_widget_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/div_send_info">
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="@color/red"></TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="我是谁:"></TextView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edt_send_from"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/selector_bg_4_round_corner"
|
||||
tools:ignore="TouchTargetSizeCheck,SpeakableTextPresentCheck"></androidx.appcompat.widget.AppCompatEditText>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="@color/red"></TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发给谁:"></TextView>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/edt_send_to"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/selector_bg_4_round_corner"
|
||||
tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck"></androidx.appcompat.widget.AppCompatEditText>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
style="@style/default_line"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="*"
|
||||
android:textColor="@color/red"></TextView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="发送时间:"></TextView>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/btn_send_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
app:icon="@drawable/ic_baseline_access_time_24"
|
||||
android:text="现在"
|
||||
android:padding="@dimen/default_widget_padding"></com.google.android.material.button.MaterialButton>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button.ElevatedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="取消"></com.google.android.material.button.MaterialButton>
|
||||
|
||||
<Space
|
||||
android:layout_width="@dimen/default_widget_padding"
|
||||
android:layout_height="wrap_content"></Space>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/Widget.Material3.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="确认提交"></com.google.android.material.button.MaterialButton>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -17,8 +17,14 @@
|
||||
android:id="@+id/navigation_notifications"
|
||||
android:icon="@drawable/ic_notifications_black_24dp"
|
||||
android:title="@string/title_notifications" />
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/navigation_my"-->
|
||||
<!-- android:icon="@drawable/ic_baseline_person_24"-->
|
||||
<!-- android:title="@string/my" />-->
|
||||
|
||||
<item
|
||||
android:id="@+id/navigation_my"
|
||||
android:icon="@drawable/ic_baseline_person_24"
|
||||
android:title="@string/my" />
|
||||
android:id="@+id/navigation_obtain_message"
|
||||
android:icon="@drawable/ic_baseline_mail_24"
|
||||
android:title="消息" />
|
||||
|
||||
</menu>
|
@ -10,10 +10,10 @@
|
||||
android:name="com.navinfo.volvo.ui.home.HomeFragment"
|
||||
android:label="@string/title_home"
|
||||
tools:layout="@layout/fragment_home" >
|
||||
<action
|
||||
android:id="@+id/to_fab_new_message"
|
||||
app:destination="@id/fab_new_message"
|
||||
/>
|
||||
<action android:id="@+id/home_2_obtain_message"
|
||||
app:destination="@id/navigation_obtain_message">
|
||||
|
||||
</action>
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
@ -33,4 +33,10 @@
|
||||
android:name="com.navinfo.volvo.ui.notifications.NotificationsFragment"
|
||||
android:label="@string/title_notifications"
|
||||
tools:layout="@layout/fragment_notifications" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_obtain_message"
|
||||
android:name="com.navinfo.volvo.ui.message.ObtainMessageFragment"
|
||||
android:label="问候编辑"
|
||||
tools:layout="@layout/fragment_obtain_message" />
|
||||
</navigation>
|
@ -2,4 +2,7 @@
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="activity_default_padding">12dp</dimen>
|
||||
<dimen name="default_font_size">18sp</dimen>
|
||||
<dimen name="default_widget_padding">6dp</dimen>
|
||||
</resources>
|
6
app/src/main/res/values/styles.xml
Normal file
6
app/src/main/res/values/styles.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="default_line">
|
||||
<item name="android:padding">@dimen/default_widget_padding</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.NavinfoVolvo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.NavinfoVolvo" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_500</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
@ -23,7 +23,7 @@ kotlin.code.style=official
|
||||
android.nonTransitiveRClass=true
|
||||
android.enableJetifier=true
|
||||
systemProp.http.proxyHost=127.0.0.1
|
||||
systemProp.http.proxyPort=1080
|
||||
systemProp.http.proxyPort=10080
|
||||
systemProp.https.proxyHost=127.0.0.1
|
||||
systemProp.https.proxyPort=1080
|
||||
systemProp.https.proxyPort=10080
|
||||
org.gradle.configureondemand=true
|
Loading…
x
Reference in New Issue
Block a user