From 22b9a05c0a565c69efe8d388a42e01faed2db094 Mon Sep 17 00:00:00 2001 From: hhj Date: Sun, 11 Jun 2023 04:58:32 +0900 Subject: [PATCH] =?UTF-8?q?[UI]=20=ED=99=88=ED=99=94=EB=A9=B4=20=EC=A0=84?= =?UTF-8?q?=EB=B6=80=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 13 +- .../com/nbit/Idear/home/ProxyWriteAdapter.kt | 13 + .../java/com/nbit/Idear/home/SubAdapter.kt | 6 + .../Idear/home/WriteRecordInfoActivity.kt | 35 +++ .../res/layout/activity_write_record_info.xml | 277 ++++++++++++++++++ app/src/main/res/layout/item_sub_write.xml | 1 + 6 files changed, 339 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/com/nbit/Idear/home/WriteRecordInfoActivity.kt create mode 100644 app/src/main/res/layout/activity_write_record_info.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dfa21ec..6b2a83e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,17 +12,18 @@ android:theme="@style/Theme.IDear" tools:targetApi="31"> + - - android:name=".mypage.AddProfileActivity" + - diff --git a/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt b/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt index 9e2be25..42704dd 100644 --- a/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt +++ b/app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt @@ -1,5 +1,6 @@ package com.nbit.Idear.home +import android.content.Intent import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -12,6 +13,8 @@ class ProxyWriteAdapter (private val dataList:ArrayList): RecyclerView.Adapter() { inner class DataViewHolder(private val viewBinding: ItemWriteBinding) : RecyclerView.ViewHolder(viewBinding.root) { // var chk=false; + private val context = viewBinding.root.context + fun bind(data: ProxyWriteData) { //viewBinding.ivProfile.background=data.image viewBinding.ivProfile.setImageResource(data.image) @@ -30,6 +33,11 @@ class ProxyWriteAdapter (private val dataList:ArrayList): viewBinding.subCardView.visibility=View.VISIBLE viewBinding.recyclerView.visibility = View.VISIBLE + viewBinding.rightBtn.setOnClickListener { + val intent = Intent(context, WriteRecordInfoActivity::class.java) + // startActivity(intent) + intent.run { context.startActivity(this) } + } viewBinding.recyclerView.apply { setHasFixedSize(true) @@ -49,6 +57,11 @@ class ProxyWriteAdapter (private val dataList:ArrayList): else{ if (!viewBinding.upBtn.isSelected) { viewBinding.subCardView.visibility=View.VISIBLE + viewBinding.rightBtn.setOnClickListener { + val intent = Intent(context, WriteRecordInfoActivity::class.java) + // startActivity(intent) + intent.run { context.startActivity(this) } + } viewBinding.upBtn.isSelected = true } diff --git a/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt b/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt index e74b4fa..ef9d138 100644 --- a/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt +++ b/app/src/main/java/com/nbit/Idear/home/SubAdapter.kt @@ -1,5 +1,6 @@ package com.nbit.Idear.home +import android.content.Intent import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView @@ -8,10 +9,15 @@ import com.nbit.Idear.databinding.ItemSubWriteBinding class SubAdapter(private val dataList:ArrayList): RecyclerView.Adapter(){ inner class DataViewHolder(private val viewBinding:ItemSubWriteBinding) :RecyclerView.ViewHolder(viewBinding.root){ + private val context = viewBinding.root.context fun bind(data:WriteSubData){ viewBinding.subContentText.text=data.subContent + viewBinding.rightBtn.setOnClickListener { + val intent = Intent(context, WriteRecordInfoActivity::class.java) + intent.run { context.startActivity(this) } + } viewBinding.cardView.setOnClickListener { } diff --git a/app/src/main/java/com/nbit/Idear/home/WriteRecordInfoActivity.kt b/app/src/main/java/com/nbit/Idear/home/WriteRecordInfoActivity.kt new file mode 100644 index 0000000..5e8a47a --- /dev/null +++ b/app/src/main/java/com/nbit/Idear/home/WriteRecordInfoActivity.kt @@ -0,0 +1,35 @@ +package com.nbit.Idear.home + +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import com.nbit.Idear.R +import com.nbit.Idear.databinding.ActivityStartInfoBinding +import com.nbit.Idear.databinding.ActivityWriteRecordInfoBinding + +class WriteRecordInfoActivity : AppCompatActivity() { + lateinit var binding: ActivityWriteRecordInfoBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + binding=ActivityWriteRecordInfoBinding.inflate(layoutInflater) + + setContentView(binding.root) + + binding.leftArrowBtn.setOnClickListener { + finish() + } + } +} + +/* + lateinit var binding:ActivityStartInfoBinding + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding=ActivityStartInfoBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.leftArrowBtn.setOnClickListener { + finish() + } + */ \ No newline at end of file diff --git a/app/src/main/res/layout/activity_write_record_info.xml b/app/src/main/res/layout/activity_write_record_info.xml new file mode 100644 index 0000000..9dd096e --- /dev/null +++ b/app/src/main/res/layout/activity_write_record_info.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_sub_write.xml b/app/src/main/res/layout/item_sub_write.xml index 6f4b4a0..fc5df38 100644 --- a/app/src/main/res/layout/item_sub_write.xml +++ b/app/src/main/res/layout/item_sub_write.xml @@ -32,6 +32,7 @@ />