Skip to content

Commit

Permalink
[UI] 홈화면 전부다
Browse files Browse the repository at this point in the history
  • Loading branch information
2xHjin committed Jun 10, 2023
1 parent bfa6ff5 commit 22b9a05
Show file tree
Hide file tree
Showing 6 changed files with 339 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
android:theme="@style/Theme.IDear"
tools:targetApi="31">
<activity

android:name=".home.StartInfoActivity"
android:name=".home.WriteRecordInfoActivity"
android:exported="false">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".home.StarActivity"
android:name=".home.StartInfoActivity"
android:exported="false"></activity>

android:name=".mypage.AddProfileActivity"
<activity
android:name=".home.StarActivity"
android:exported="false" />

<activity
android:name=".mypage.MyPageActivity"
android:exported="false" />
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/nbit/Idear/home/ProxyWriteAdapter.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,6 +13,8 @@ class ProxyWriteAdapter (private val dataList:ArrayList<ProxyWriteData>):
RecyclerView.Adapter<ProxyWriteAdapter.DataViewHolder>() {
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)
Expand All @@ -30,6 +33,11 @@ class ProxyWriteAdapter (private val dataList:ArrayList<ProxyWriteData>):
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)
Expand All @@ -49,6 +57,11 @@ class ProxyWriteAdapter (private val dataList:ArrayList<ProxyWriteData>):
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

}
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/nbit/Idear/home/SubAdapter.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,10 +9,15 @@ import com.nbit.Idear.databinding.ItemSubWriteBinding
class SubAdapter(private val dataList:ArrayList<WriteSubData>):
RecyclerView.Adapter<SubAdapter.DataViewHolder>(){
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 {

}
Expand Down
35 changes: 35 additions & 0 deletions app/src/main/java/com/nbit/Idear/home/WriteRecordInfoActivity.kt
Original file line number Diff line number Diff line change
@@ -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()
}
*/
Loading

0 comments on commit 22b9a05

Please sign in to comment.