2020-04-09 22:36:59 +02:00
|
|
|
package com.h.pixeldroid
|
|
|
|
|
|
|
|
import android.os.Bundle
|
|
|
|
import androidx.appcompat.app.AppCompatActivity
|
2020-04-10 12:55:02 +02:00
|
|
|
import com.h.pixeldroid.fragments.ProfileFragment
|
2020-04-09 22:36:59 +02:00
|
|
|
import com.h.pixeldroid.objects.Account
|
|
|
|
import com.h.pixeldroid.objects.Account.Companion.ACCOUNT_TAG
|
|
|
|
|
|
|
|
class ProfileActivity : AppCompatActivity() {
|
2020-04-10 12:55:02 +02:00
|
|
|
lateinit var profileFragment : ProfileFragment
|
2020-04-09 22:36:59 +02:00
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
setContentView(R.layout.activity_profile)
|
|
|
|
|
|
|
|
// Set profile according to given account
|
|
|
|
val account = intent.getSerializableExtra(ACCOUNT_TAG) as Account
|
|
|
|
|
2020-04-10 12:55:02 +02:00
|
|
|
profileFragment = ProfileFragment()
|
|
|
|
val arguments = Bundle()
|
2020-04-24 12:10:25 +02:00
|
|
|
arguments.putSerializable(ACCOUNT_TAG, account)
|
2020-04-10 12:55:02 +02:00
|
|
|
profileFragment.arguments = arguments
|
2020-04-09 22:36:59 +02:00
|
|
|
|
2020-04-10 12:55:02 +02:00
|
|
|
supportFragmentManager.beginTransaction()
|
|
|
|
.add(R.id.profileFragmentSingle, profileFragment).commit()
|
2020-04-09 22:36:59 +02:00
|
|
|
}
|
2020-04-10 12:55:02 +02:00
|
|
|
}
|