Skip to content

Commit

Permalink
ProfileActivity viewbinding, recommend -> comment
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhooon committed Jun 19, 2021
1 parent b3c369e commit 3aceb79
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
28 changes: 10 additions & 18 deletions app/src/main/java/kr/ac/konkuk/koogle/Activity/ProfileActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package kr.ac.konkuk.koogle.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -34,20 +33,13 @@ import kr.ac.konkuk.koogle.databinding.ActivityProfileBinding
class ProfileActivity : ProfileCommonActivity() {
// private var tag_debug_data: ArrayList<TagModel> = ArrayList()
lateinit var binding: ActivityProfileBinding
lateinit var tagRecyclerView: RecyclerView
lateinit var recommendRecyclerView: RecyclerView
lateinit var tagAdapter: TagAdapter
lateinit var commentAdapter: CommentAdapter


//파이어베이스 인증 객체 초기화
private val auth: FirebaseAuth by lazy {
Firebase.auth
}

//DB 객체 초기화
private val firebaseUser = auth.currentUser!!

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityProfileBinding.inflate(layoutInflater)
Expand Down Expand Up @@ -112,20 +104,18 @@ class ProfileActivity : ProfileCommonActivity() {
}

private fun initRecommendRecyclerView() {
recommendRecyclerView = findViewById(R.id.recommendRecyclerView)
recommendRecyclerView.layoutManager = LinearLayoutManager(this)
binding.commentRecyclerView.layoutManager = LinearLayoutManager(this)
// 구분선 넣기
recommendRecyclerView.addItemDecoration(DividerItemDecoration(tagRecyclerView.context, 1))
binding.commentRecyclerView.addItemDecoration(DividerItemDecoration(this, 1))
commentAdapter = CommentAdapter()
// 아이템 클릭 리스터 설정(미구현)
recommendRecyclerView.adapter = commentAdapter
binding.commentRecyclerView.adapter = commentAdapter
}

override fun initTagRecyclerView(data: ArrayList<TagModel>) {
tagRecyclerView = findViewById<RecyclerView>(R.id.tagRecyclerView)
tagRecyclerView.layoutManager = LinearLayoutManager(this)
binding.tagRecyclerView.layoutManager = LinearLayoutManager(this)
// 구분선 넣기
tagRecyclerView.addItemDecoration(DividerItemDecoration(tagRecyclerView.context, 1))
binding.tagRecyclerView.addItemDecoration(DividerItemDecoration(this, 1))

tagAdapter = TagAdapter(this, data)
tagAdapter.itemClickListener = object : TagAdapter.OnItemClickListener {
Expand All @@ -138,7 +128,7 @@ class ProfileActivity : ProfileCommonActivity() {
// 미구현
}
}
tagRecyclerView.adapter = tagAdapter
binding.tagRecyclerView.adapter = tagAdapter
val simpleCallBack = object : ItemTouchHelper.SimpleCallback(
ItemTouchHelper.DOWN or ItemTouchHelper.UP,
ItemTouchHelper.RIGHT
Expand All @@ -157,8 +147,10 @@ class ProfileActivity : ProfileCommonActivity() {
}
}
val itemTouchHelper = ItemTouchHelper(simpleCallBack)
itemTouchHelper.attachToRecyclerView(tagRecyclerView)
itemTouchHelper.attachToRecyclerView(binding.tagRecyclerView)
}

private fun initData() {}
private fun initData() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import kr.ac.konkuk.koogle.databinding.ActivitySignUpBinding

class SignUpActivity : AppCompatActivity() {

private lateinit var auth: FirebaseAuth
private val auth:FirebaseAuth by lazy {
Firebase.auth
}

lateinit var binding: ActivitySignUpBinding

Expand All @@ -26,8 +28,6 @@ class SignUpActivity : AppCompatActivity() {
binding = ActivitySignUpBinding.inflate(layoutInflater)
setContentView(binding.root)

auth = Firebase.auth

initSignUpButton()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class GroupFragment : Fragment(R.layout.fragment_group) {
private val auth: FirebaseAuth by lazy {
Firebase.auth
}

private val firebaseUser = auth.currentUser!!

private val groupRef: DatabaseReference by lazy {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
android:textSize="18sp" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recommendRecyclerView"
android:id="@+id/commentRecyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginHorizontal="12dp"
Expand Down

0 comments on commit 3aceb79

Please sign in to comment.