add: 首页药物管理展示,添加和更新
This commit is contained in:
1 parent
c3c6c7c135
commit
f90a5aba91
20 files changed
+470
-41
No files matched your search
@@ -74,6 +74,12 @@ dependencies {
|
||||
// EventBus
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor "androidx.room:room-compiler:$room_version" // For Kotlin use kapt instead of annotationProcessor
|
||||
|
||||
// optional - Kotlin Extensions and Coroutines support for Room
|
||||
implementation "androidx.room:room-ktx:$room_version"
|
||||
|
||||
// MINSocket相关
|
||||
// https://mvnrepository.com/artifact/com.lmax/disruptor
|
||||
implementation group: 'com.lmax', name: 'disruptor', version: '3.4.2'
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity android:name=".activity.add_medical_record.AddMedicalRecordActivity"></activity>
|
||||
<activity android:name=".activity.setting.SettingActivity" />
|
||||
<activity android:name=".activity.register.RegisterActivity" />
|
||||
<activity android:name=".activity.welcome.WelcomeActivity">
|
||||
@@ -35,5 +36,4 @@
|
||||
android:launchMode="singleTask" />
|
||||
</application>
|
||||
|
||||
|
||||
</manifest>
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package cn.tsr.personal_drug_management.activity.add_medical_record
|
||||
|
||||
import android.os.Bundle
|
||||
import cn.qjm253.quick_android_easy_bar.EasyBar
|
||||
import cn.qjm253.quick_android_easy_bar.init
|
||||
import cn.tsr.personal_drug_management.R
|
||||
import cn.tsr.personal_drug_management.activity.base.MINVpnBaseActivity
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
import cn.tsr.personal_drug_management.model.event.AddOrUpdateMedicalRecordEvent
|
||||
import cn.tsr.personal_drug_management.model.event.EditMedicalRecordEvent
|
||||
import kotlinx.android.synthetic.main.activity_medical_record.*
|
||||
import kotlinx.android.synthetic.main.bar_item.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
class AddMedicalRecordActivity : MINVpnBaseActivity<AddMedicalRecordActivityPresenter>(),
|
||||
AddMedicalRecordActivityContract.View {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_medical_record)
|
||||
|
||||
initView()
|
||||
}
|
||||
|
||||
private var mode = 0
|
||||
private lateinit var medicalRecord: MedicalRecord
|
||||
private var position = 0
|
||||
private fun initView() {
|
||||
easyBar.init(EasyBar.Mode.ICON_, titleRes = R.string.add_medical_record, leftCallback = {
|
||||
onBackPressed()
|
||||
})
|
||||
|
||||
btnSave.setBackgroundResource(R.drawable.button_shape_default)
|
||||
btnSave.setOnClickListener {
|
||||
btnSave.startAnimation()
|
||||
val medicalName = etMedicalName.text.toString()
|
||||
val medicalMount = etMedicalMount.text.toString()
|
||||
val medicalEatTimes: Int = etEatMedicalTimes.text.toString().toInt()
|
||||
if (mode == 0) {
|
||||
medicalRecord = MedicalRecord(medicalName, medicalMount, medicalEatTimes)
|
||||
} else {
|
||||
medicalRecord.medicalName = medicalName
|
||||
medicalRecord.medicalEatMethod = medicalMount
|
||||
medicalRecord.medicalEatTimes = medicalEatTimes
|
||||
}
|
||||
btnSave.postDelayed({
|
||||
EventBus.getDefault().postSticky(
|
||||
AddOrUpdateMedicalRecordEvent(mode, position, medicalRecord)
|
||||
)
|
||||
onBackPressed()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onCreatePresenter(): AddMedicalRecordActivityPresenter =
|
||||
AddMedicalRecordActivityPresenter(this)
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||
fun onReceiveMedicalRecord(editMedicalRecordEvent: EditMedicalRecordEvent) {
|
||||
EventBus.getDefault().removeStickyEvent(editMedicalRecordEvent)
|
||||
mode = 1
|
||||
position = editMedicalRecordEvent.position
|
||||
medicalRecord = editMedicalRecordEvent.medicalRecord
|
||||
println(medicalRecord)
|
||||
etMedicalName.setText(medicalRecord.medicalName)
|
||||
etMedicalMount.setText(medicalRecord.medicalEatMethod)
|
||||
etEatMedicalTimes.setText("${medicalRecord.medicalEatTimes}")
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package cn.tsr.personal_drug_management.activity.add_medical_record
|
||||
|
||||
import cn.qjm253.quick_android_mvp.base.mvp.BaseModel
|
||||
import cn.qjm253.quick_android_mvp.base.mvp.BasePresenter
|
||||
import cn.tsr.personal_drug_management.activity.base.mvp.MINVpnBaseView
|
||||
|
||||
interface AddMedicalRecordActivityContract {
|
||||
interface View : MINVpnBaseView {
|
||||
|
||||
}
|
||||
|
||||
interface Model : BaseModel {
|
||||
|
||||
}
|
||||
|
||||
abstract class Presenter : BasePresenter<View, Model>() {
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package cn.tsr.personal_drug_management.activity.add_medical_record
|
||||
|
||||
class AddMedicalRecordActivityModel(val mPresenter: AddMedicalRecordActivityPresenter) :
|
||||
AddMedicalRecordActivityContract.Model
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.tsr.personal_drug_management.activity.add_medical_record
|
||||
|
||||
class AddMedicalRecordActivityPresenter(addMedicalRecordActivity: AddMedicalRecordActivity) :
|
||||
AddMedicalRecordActivityContract.Presenter() {
|
||||
init {
|
||||
mView = addMedicalRecordActivity
|
||||
mModel = AddMedicalRecordActivityModel(this)
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,9 @@ import cn.qjm253.quick_android_base.extensions.toast
|
||||
import cn.qjm253.quick_android_mvp.base.fragment.BaseQuickAndroidMVPFragment
|
||||
import cn.qjm253.quick_android_mvp.base.mvp.BasePresenter
|
||||
import cn.tsr.personal_drug_management.activity.base.mvp.MINVpnBaseView
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
abstract class MINVpnBaseFragment<P : BasePresenter<*, *>> : BaseQuickAndroidMVPFragment<P>(),
|
||||
MINVpnBaseView {
|
||||
@@ -21,4 +24,19 @@ abstract class MINVpnBaseFragment<P : BasePresenter<*, *>> : BaseQuickAndroidMVP
|
||||
}
|
||||
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onReceiveTest(test: Int) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package cn.tsr.personal_drug_management.activity.main.medical_records
|
||||
|
||||
import cn.tsr.personal_drug_management.R
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
|
||||
class MedicalRecordAdapter(mList: MutableList<MedicalRecord>) :
|
||||
BaseQuickAdapter<MedicalRecord, BaseViewHolder>(
|
||||
R.layout.item_medical_record, mList
|
||||
) {
|
||||
override fun convert(helper: BaseViewHolder, item: MedicalRecord?) {
|
||||
item?.let {
|
||||
helper.setText(R.id.tvMedicalName, it.medicalName)
|
||||
helper.setText(R.id.tvMedicalEdaMethod, "服用方式及剂量:${it.medicalEatMethod}")
|
||||
helper.setText(R.id.tvMedicalEatTime, "服用次数:${it.medicalEatTimes}")
|
||||
}
|
||||
}
|
||||
}
|
||||
+69
@@ -1,8 +1,22 @@
|
||||
package cn.tsr.personal_drug_management.activity.main.medical_records
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import cn.qjm253.quick_android_base.extensions.jumpForResult
|
||||
import cn.qjm253.quick_android_base.extensions.jumpTo
|
||||
import cn.qjm253.quick_android_base.params.IntentParam
|
||||
import cn.qjm253.quick_android_easy_bar.EasyBar
|
||||
import cn.qjm253.quick_android_easy_bar.init
|
||||
import cn.tsr.personal_drug_management.R
|
||||
import cn.tsr.personal_drug_management.activity.add_medical_record.AddMedicalRecordActivity
|
||||
import cn.tsr.personal_drug_management.activity.base.MINVpnBaseFragment
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
import cn.tsr.personal_drug_management.model.event.AddOrUpdateMedicalRecordEvent
|
||||
import cn.tsr.personal_drug_management.model.event.EditMedicalRecordEvent
|
||||
import kotlinx.android.synthetic.main.bar_item.*
|
||||
import kotlinx.android.synthetic.main.fragment_medical_records.*
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
class MedicalRecordsFragment : MINVpnBaseFragment<MedicalRecordsFragmentPresenter>(),
|
||||
MedicalRecordsFragmentContract.View {
|
||||
@@ -15,7 +29,46 @@ class MedicalRecordsFragment : MINVpnBaseFragment<MedicalRecordsFragmentPresente
|
||||
|
||||
override fun getRes(): Int = R.layout.fragment_medical_records
|
||||
|
||||
private lateinit var adapter: MedicalRecordAdapter
|
||||
override fun initView() {
|
||||
easyBar.init(
|
||||
mode = EasyBar.Mode._ICON,
|
||||
titleRes = R.string.medical_records,
|
||||
rightRes = R.drawable.input,
|
||||
tinColor = R.color.white,
|
||||
rightCallback = {
|
||||
// 跳转到添加服药信息
|
||||
activity?.jumpTo(AddMedicalRecordActivity::class.java)
|
||||
})
|
||||
|
||||
refreshLayout.setOnRefreshListener {
|
||||
// 刷新操作
|
||||
|
||||
refreshLayout.postDelayed({
|
||||
refreshLayout.finishRefresh()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
adapter = MedicalRecordAdapter(
|
||||
mutableListOf(
|
||||
MedicalRecord("999感冒灵", "一日三次,一次一包", 5),
|
||||
MedicalRecord("清喉利咽颗粒", "一日一次,一次一包", 15)
|
||||
)
|
||||
)
|
||||
recyclerview.layoutManager = LinearLayoutManager(activity)
|
||||
adapter.bindToRecyclerView(recyclerview)
|
||||
|
||||
adapter.setOnItemClickListener { adapter, view, position ->
|
||||
adapter as MedicalRecordAdapter
|
||||
activity?.jumpTo(AddMedicalRecordActivity::class.java)
|
||||
EventBus.getDefault()
|
||||
.postSticky(adapter.getItem(position)?.let {
|
||||
EditMedicalRecordEvent(
|
||||
position,
|
||||
it
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
override fun initialLoadData() {
|
||||
@@ -24,4 +77,20 @@ class MedicalRecordsFragment : MINVpnBaseFragment<MedicalRecordsFragmentPresente
|
||||
override fun onCreatePresenter(): MedicalRecordsFragmentPresenter =
|
||||
MedicalRecordsFragmentPresenter(this)
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||
fun onReceiveMedicalRecordEvent(addOrUpdateMedicalRecordEvent: AddOrUpdateMedicalRecordEvent) {
|
||||
EventBus.getDefault().removeStickyEvent(addOrUpdateMedicalRecordEvent)
|
||||
when (addOrUpdateMedicalRecordEvent.mode) {
|
||||
0 -> { // 添加
|
||||
adapter.addData(addOrUpdateMedicalRecordEvent.medicalRecord)
|
||||
}
|
||||
1 -> {
|
||||
adapter.data[addOrUpdateMedicalRecordEvent.position] =
|
||||
addOrUpdateMedicalRecordEvent.medicalRecord
|
||||
adapter.notifyItemChanged(addOrUpdateMedicalRecordEvent.position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+25
-25
@@ -26,31 +26,31 @@ class SettingActivity : MINVpnBaseActivity<SettingActivityPresenter>(),
|
||||
|
||||
btnSaveSetting.setBackgroundResource(R.drawable.button_shape_default)
|
||||
|
||||
// 获取本地的设置填充
|
||||
etIpAddress.setText(MINVpnAPI.getMirIpAddress())
|
||||
etPort.setText("${MINVpnAPI.getMirPort()}")
|
||||
etServicePrefix.setText(MINVpnAPI.getServicePrefix())
|
||||
etBlockChainIp.setText(MINVpnAPI.getBlockChainIpAddress())
|
||||
etBlockChainPort.setText("${MINVpnAPI.getBlockChainPort()}")
|
||||
|
||||
btnSaveSetting.setOnClickListener {
|
||||
btnSaveSetting.startAnimation()
|
||||
val mirIpAddress = etIpAddress.text.toString()
|
||||
val mirPort = etPort.text.toString().toInt()
|
||||
val blockChainIpAddress = etBlockChainIp.text.toString()
|
||||
val blockChainPort = etBlockChainPort.text.toString().toInt()
|
||||
val servicePrefix = etServicePrefix.text.toString()
|
||||
|
||||
MINVpnAPI.updateBlockChainIpAddress(blockChainIpAddress)
|
||||
MINVpnAPI.updateBlockChainPort(blockChainPort)
|
||||
MINVpnAPI.updateMirIpAddress(mirIpAddress)
|
||||
MINVpnAPI.updateMirPort(mirPort)
|
||||
MINVpnAPI.updateServicePrefix(servicePrefix)
|
||||
btnSaveSetting.postDelayed({
|
||||
btnSaveSetting.revertAnimation()
|
||||
toast("保存成功")
|
||||
}, 1000)
|
||||
}
|
||||
// // 获取本地的设置填充
|
||||
// etIpAddress.setText(MINVpnAPI.getMirIpAddress())
|
||||
// etPort.setText("${MINVpnAPI.getMirPort()}")
|
||||
// etServicePrefix.setText(MINVpnAPI.getServicePrefix())
|
||||
// etBlockChainIp.setText(MINVpnAPI.getBlockChainIpAddress())
|
||||
// etBlockChainPort.setText("${MINVpnAPI.getBlockChainPort()}")
|
||||
//
|
||||
// btnSaveSetting.setOnClickListener {
|
||||
// btnSaveSetting.startAnimation()
|
||||
// val mirIpAddress = etIpAddress.text.toString()
|
||||
// val mirPort = etPort.text.toString().toInt()
|
||||
// val blockChainIpAddress = etBlockChainIp.text.toString()
|
||||
// val blockChainPort = etBlockChainPort.text.toString().toInt()
|
||||
// val servicePrefix = etServicePrefix.text.toString()
|
||||
//
|
||||
// MINVpnAPI.updateBlockChainIpAddress(blockChainIpAddress)
|
||||
// MINVpnAPI.updateBlockChainPort(blockChainPort)
|
||||
// MINVpnAPI.updateMirIpAddress(mirIpAddress)
|
||||
// MINVpnAPI.updateMirPort(mirPort)
|
||||
// MINVpnAPI.updateServicePrefix(servicePrefix)
|
||||
// btnSaveSetting.postDelayed({
|
||||
// btnSaveSetting.revertAnimation()
|
||||
// toast("保存成功")
|
||||
// }, 1000)
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package cn.tsr.personal_drug_management.model
|
||||
|
||||
import androidx.room.Database
|
||||
import androidx.room.RoomDatabase
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
|
||||
@Database(entities = [MedicalRecord::class], version = 1)
|
||||
abstract class AppDataBase : RoomDatabase() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package cn.tsr.personal_drug_management.model.entity
|
||||
|
||||
import androidx.room.DatabaseConfiguration
|
||||
import androidx.room.InvalidationTracker
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.sqlite.db.SupportSQLiteOpenHelper
|
||||
|
||||
|
||||
data class MedicalRecord(
|
||||
var medicalName: String,
|
||||
var medicalEatMethod: String,
|
||||
var medicalEatTimes: Int
|
||||
) {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package cn.tsr.personal_drug_management.model.event
|
||||
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
|
||||
class AddOrUpdateMedicalRecordEvent(
|
||||
val mode: Int, // 0 -> add, 1 -> update
|
||||
val position: Int, // if update, indicate the origin position of record
|
||||
val medicalRecord: MedicalRecord
|
||||
)
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package cn.tsr.personal_drug_management.model.event
|
||||
|
||||
import cn.tsr.personal_drug_management.model.entity.MedicalRecord
|
||||
|
||||
class EditMedicalRecordEvent(
|
||||
val position: Int,
|
||||
val medicalRecord: MedicalRecord
|
||||
)
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.add_medical_record.AddMedicalRecordActivity">
|
||||
|
||||
<include layout="@layout/bar_item" />
|
||||
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDecoration1"
|
||||
style="@style/setting_title_decoration"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingTvTitle1"
|
||||
style="@style/setting_title"
|
||||
android:text="@string/medical_name"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvDecoration1"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDecoration1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration1" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etMedicalName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/medical_name_example"
|
||||
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle1"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDecoration1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDecoration2"
|
||||
style="@style/setting_title_decoration"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etMedicalName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingTvTitle2"
|
||||
style="@style/setting_title"
|
||||
android:text="@string/medical_mount"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvDecoration2"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDecoration2"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration2" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etMedicalMount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/medical_mount_example"
|
||||
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle2"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDecoration2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDecoration3"
|
||||
style="@style/setting_title_decoration"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/etMedicalMount" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingTvTitle3"
|
||||
style="@style/setting_title"
|
||||
android:text="@string/eat_medical_times"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvDecoration3"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDecoration3"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration3" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etEatMedicalTimes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:hint="@string/eat_medical_times_example"
|
||||
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle3"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvDecoration3" />
|
||||
|
||||
|
||||
<br.com.simplepass.loadingbutton.customViews.CircularProgressButton
|
||||
android:id="@+id/btnSave"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:background="@drawable/button_shape_default"
|
||||
android:text="@string/save"
|
||||
android:textColor="@color/white"
|
||||
app:finalCornerAngle="40dp"
|
||||
app:initialCornerAngle="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/etEatMedicalTimes"
|
||||
app:spinning_bar_color="#FFFFFF"
|
||||
app:spinning_bar_padding="4dp"
|
||||
app:spinning_bar_width="3dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -29,7 +29,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration1" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etIpAddress"
|
||||
android:id="@+id/etMedicalName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setting_ip_address_example"
|
||||
@@ -52,7 +52,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration2" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etPort"
|
||||
android:id="@+id/etMedicalMount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setting_port_example"
|
||||
@@ -76,7 +76,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration3" />
|
||||
|
||||
<cn.qjm253.quick_android_custom_view.other.ClearAbleEditText
|
||||
android:id="@+id/etServicePrefix"
|
||||
android:id="@+id/etEatMedicalTimes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setting_service_prefix_example"
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="就医记录"
|
||||
tools:layout_editor_absoluteX="266dp"
|
||||
tools:layout_editor_absoluteY="223dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<include layout="@layout/bar_item" />
|
||||
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDecoration1"
|
||||
style="@style/setting_title_decoration"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMedicalName"
|
||||
style="@style/setting_title"
|
||||
android:text="@string/medical_name"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvDecoration1"
|
||||
app:layout_constraintStart_toEndOf="@+id/tvDecoration1"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvDecoration1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMedicalEdaMethod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="服用方式及剂量:一日三次,每日一包"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvMedicalName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMedicalName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvMedicalEatTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="服用次数:1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tvMedicalEdaMethod"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvMedicalEdaMethod" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -30,4 +30,12 @@
|
||||
<string name="setting_title_block_chain_port">区块链端口</string>
|
||||
<string name="setting_block_chain_port_example">例如:9749</string>
|
||||
<string name="save_config">保存配置</string>
|
||||
<string name="add_medical_record">添加服药记录</string>
|
||||
<string name="medical_name">药物名称</string>
|
||||
<string name="medical_name_example">例如:999感冒灵</string>
|
||||
<string name="medical_mount">服药方式及剂量</string>
|
||||
<string name="medical_mount_example">例如:一日三次,每次一包</string>
|
||||
<string name="eat_medical_times">服药次数</string>
|
||||
<string name="eat_medical_times_example">例如:1</string>
|
||||
<string name="save">保存</string>
|
||||
</resources>
|
||||
+1
-1
@@ -5,7 +5,7 @@ buildscript {
|
||||
ext.anko_version = '0.10.8'
|
||||
ext.smart_refresh_layout_version = '1.1.0'
|
||||
ext.androidx_base_version = '1.1.0'
|
||||
ext.room_version = "2.2.3"
|
||||
ext.room_version = "2.2.5"
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
Reference in new issue
Block a user