enum class 應用
enum class ApplyData {
JOB {
override fun getTitle(): String {
return FindJobApplication.applicationContext().getString(R.string.accountJobApplyRecordContentJobLabel)
}
override fun getErrorMessage(): String {
return "此${getTitle()}已關閉,無法查看"
}
override fun getLayoutId(): Int {
return R.id.clApplyRecordJobLayout
}
override fun getIntent(context: Context, data: HashMap<String, String>): Intent {
val i = Intent(context, JobDetailActivity::class.java)
data.forEach {
i.putExtra(it.key, it.value)
}
return i
}
};
abstract fun getTitle(): String
abstract fun getErrorMessage(): String
abstract fun getLayoutId(): Int
abstract fun getIntent(context: Context, data: HashMap<String, String>): Intent
}