InfoActivity.kt 1.91 KB
package com.example.vip

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.os.Build
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.Window
import android.view.WindowManager
import android.widget.ImageView
import android.widget.Toast
import kotlinx.android.synthetic.main.activity_info.*
import android.graphics.drawable.ColorDrawable
import androidx.core.content.ContextCompat

class InfoActivity : AppCompatActivity() {

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

        // statusbar color chacnge
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            getWindow().setStatusBarColor(getResources().getColor(R.color.infomainColor));
        }
        val prof: SharedPreferences =getSharedPreferences("profdata", Context.MODE_PRIVATE)
        val editor: SharedPreferences.Editor=prof.edit()

        Toast.makeText(applicationContext,prof.getString("manorwoman","nothing"),
            Toast.LENGTH_SHORT).show()

        //temp
        var accountImage: ImageView =findViewById(R.id.infoAccountImage)

        accountImage.setImageResource(R.drawable.image01)

        //temp

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

        //pushing test start
        InfoButtonSettings.setOnClickListener {
            //var intent = Intent(this, SettingActivity::class.java)
            //test start
            var intent = Intent(this, InputProfilFirstOneActivity::class.java)
            //test end
            startActivity(intent)
        }
        //pushing test end
    }
}