AccountSettingActivity.kt 3.21 KB
package com.example.vip

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

class AccountSettingActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_account_settings)


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

        /*
        val prof: SharedPreferences = getSharedPreferences("policy_key", Context.MODE_PRIVATE)
        val editor: SharedPreferences.Editor=prof.edit()

        input_db.setOnClickListener{
            editor.putString("0", "[신한금융그룹] 신한 희망사회프로젝트 위기가정 재기지원사업 2년차 사업(2019년 5월~2020년 4월)")
            editor.putString("1", "2020년 동계 아름드리 대학생 해외봉사단원 모집")
            editor.putString("2", "초록우산 어린이재단 인재양성사업 - 2020 아이리더 모집공고")
            editor.putString("3", "(열매나눔복지재단, 처갓집양념치킨)2019 저소득가구 창업지원사업 처갓집양념치킨 창업자 모집공고(5.31-)")
            editor.putString("4", "[2017년도] 예비부부교실 / 신혼부부교실 : 연간일정")
            editor.putString("5", "신생아지원")
            editor.putString("6", "성폭력피해아동청소년 전용쉼터운영지원")
            editor.putString("7", "국가유공자등취업지원")
            editor.putString("8", "결혼이민자 통번역 서비스")
            editor.putString("9", "한부모가족자녀 교육비 지원")
            editor.commit()
        }

         */
    }
    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
        }
}