SettingsInForm.kt 2.36 KB
package com.wello.vip

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.google.android.material.bottomnavigation.BottomNavigationView
import kotlinx.android.synthetic.main.activity_settings_in_form.*

class SettingsInForm : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_settings_in_form)

        val bottomNavigationView: BottomNavigationView = findViewById(R.id.bottomNavigation_setting) as BottomNavigationView
        bottomNavigationView.selectedItemId = R.id.bottomInfo
        bottomNavigationView.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)

        accountBtn.setOnClickListener {
            var intent = Intent(this, AccountSettingActivity::class.java)
            startActivity(intent)
        }

        info_push.setOnClickListener {
            var intent = Intent(this, PushInfoActivity::class.java)
            startActivity(intent)
            // 설정 눌렀을 때
        }
        terms_of_use.setOnClickListener{
            var intent = Intent(this, TermsOfUserActivity::class.java)
            startActivity(intent)
        }
    }

    private val mOnNavigationItemSelectedListener=
        BottomNavigationView.OnNavigationItemSelectedListener{ item->
            when (item.itemId){
                R.id.bottomHome ->{
                    val intent = Intent(this, SignInActivity::class.java)
                    startActivity(intent)
                    return@OnNavigationItemSelectedListener true
                }
                R.id.bottomRecommend ->{
                    val intent = Intent(this, RecommendActivity::class.java)
                    startActivity(intent)
                    return@OnNavigationItemSelectedListener true
                }
                R.id.bottomFavorites ->{
                    val intent = Intent(this, FavoritesActivity::class.java)
                    startActivity(intent)
                    return@OnNavigationItemSelectedListener true
                }
                R.id.bottomInfo ->{
                    val intent = Intent(this, InfoActivity::class.java)
                    startActivity(intent)
                    return@OnNavigationItemSelectedListener true
                }
            }
            false
        }
}