riku
2022-01-20 5a0fff8095cd5356f57c181b7e7b820e0f7efacf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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))
    }
}