package com.flightfeather.ducha.module.login
|
|
import android.content.Intent
|
import android.os.Bundle
|
import cn.flightfeather.thirdappmodule.module.login.CardFragment
|
import com.flightfeather.ducha.R
|
import com.flightfeather.ducha.module.DCMainActivity
|
|
/**
|
* @author riku
|
* Date: 2021/7/29
|
*/
|
class DCCardFragment : CardFragment() {
|
|
companion object {
|
@JvmStatic
|
fun newInstance(type: Int, position: Int): DCCardFragment {
|
val dcCardFragment = DCCardFragment()
|
val bundle = Bundle()
|
bundle.putInt(USER_TYPE, type)
|
bundle.putInt(POSITION, position)
|
dcCardFragment.arguments = bundle
|
return dcCardFragment
|
}
|
}
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
super.onCreate(savedInstanceState)
|
|
FFUSER = "督查人员"
|
}
|
|
override fun setUserTag(type: Int) {
|
when (type) {
|
1 -> {
|
mtv_name.text = FFUSER
|
miv_photo.setImageResource(R.mipmap.ic_inspector)
|
}
|
2 -> {
|
mtv_name.text = ADMIN
|
miv_photo.setImageResource(R.drawable.icon_people)
|
}
|
3 -> {
|
mtv_name.text = POLLUTION
|
miv_photo.setImageResource(R.drawable.icon_pollution2)
|
}
|
}
|
}
|
|
override fun loginSuccess() {
|
startActivity(Intent(activity, DCMainActivity::class.java))
|
}
|
}
|