TermsOfUserActivity.kt 2.18 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_terms_of_use.*

class TermsOfUserActivity : AppCompatActivity() {

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

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

        terms_use.setOnClickListener{
            var intent = Intent(this, TermsDetailActivity::class.java)
            startActivity(intent)
        }
        terms_use2.setOnClickListener {
            var intent = Intent(this, PrivacyPolicyActivity::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
        }
}