package com.gh.gamecenter.amway

import android.os.Bundle
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.R

/**
 * 安利墙页面
 */
class AmwayActivity : BaseActivity() {

    override fun getLayoutId(): Int {
        return R.layout.activity_amway
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        DisplayUtils.transparentStatusBar(this)

        val containerFragment = supportFragmentManager.findFragmentByTag(AmwayFragment::class.java.name)
            ?: AmwayFragment().with(intent.extras)
        // 若 placeholder 外层为 RelativeLayout 的话，会出现莫名的偏移
        supportFragmentManager.beginTransaction()
            .replace(R.id.placeholder, containerFragment, AmwayFragment::class.java.name).commitAllowingStateLoss()
    }

}