We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我写了Java和Kotlin两个版本 使用相同的数据和相同的Adapter 但是kotlin的版本不显示数据
代码和截图如下
`class CUQuickEditPopup(mContext: Context) : Dialog(mContext) {
init { val builder = AlertDialog.Builder(context) val view = layoutInflater.inflate(R.layout.pop_up_wheel_view, null) val iconWheelView = WheelView<Pair<String, Pair<Int, Int>>>(context) iconWheelView.setWheelAdapter(ArrayWheelIconAdapter(context)) iconWheelView.skin = WheelView.Skin.Holo iconWheelView.setWheelData(iconItems) val timeWheelView = WheelView<String>(context) timeWheelView.setWheelAdapter(ArrayWheelTimeAdapter(context)) timeWheelView.skin = WheelView.Skin.Holo timeWheelView.setWheelData(timeItems) val typeWheelView = WheelView<Pair<String, Int>>(context) typeWheelView.setWheelAdapter(ArrayWheelTypeAdapter(context)) typeWheelView.skin = WheelView.Skin.Holo typeWheelView.setWheelData(typeItems) builder.setView(view) builder.create().show() } companion object { @JvmStatic val typeItems = arrayListOf("call allowed" to com.hyphenate.easeui.R.string.call_allowed, "text allowed" to com.hyphenate.easeui.R.string.text_allowed, "do not disturb" to com.hyphenate.easeui.R.string.do_not_disturb) @JvmStatic val timeItems = arrayListOf("0.5 ", "1 ", "1.5 ", "2 ", "2.5 ", "3 ") @JvmStatic val iconItems = arrayListOf( "meeting" to Pair(R.string.meeting, R.drawable.ease_blue_add), "work" to Pair(R.string.work, R.drawable.ease_blue_add), "study" to Pair(R.string.study, R.drawable.ease_blue_add), "social" to Pair(R.string.social, R.drawable.ease_blue_add), "meal" to Pair(R.string.meal, R.drawable.ease_blue_add), "entertainment" to Pair(R.string.entertainment, R.drawable.ease_blue_add)) }
}
`
`public class CUQuickEditPopupJava extends Dialog {
public CUQuickEditPopupJava(@NonNull Context context) { super(context); AlertDialog.Builder builder = new AlertDialog.Builder(context); View view = getLayoutInflater().inflate(R.layout.pop_up_wheel_view, null); WheelView iconWheelView = view.findViewById(R.id.iconWheelView); iconWheelView.setWheelAdapter(new ArrayWheelIconAdapter(context)); iconWheelView.setWheelData(CUQuickEditPopup.getIconItems()); WheelView timeWheelView = view.findViewById(R.id.timeWheelView); timeWheelView.setWheelAdapter(new ArrayWheelTimeAdapter(context)); timeWheelView.setWheelData(CUQuickEditPopup.getTimeItems()); WheelView typeWheelView = view.findViewById(R.id.typeWheelView); typeWheelView.setWheelAdapter(new ArrayWheelTypeAdapter(context)); typeWheelView.setWheelData(CUQuickEditPopup.getTypeItems()); builder.setView(view); builder.create().show(); }
} `
The text was updated successfully, but these errors were encountered:
不显示
Sorry, something went wrong.
Java版本
这一块抽出来想用kotlin写,发现不显示。 调试发现adapter的getview方法没有调用。bindview也就没法填充布局了。 用Java写的就没这个问题。
No branches or pull requests
我写了Java和Kotlin两个版本
使用相同的数据和相同的Adapter
但是kotlin的版本不显示数据
代码和截图如下
`class CUQuickEditPopup(mContext: Context) : Dialog(mContext) {
}
`
`public class CUQuickEditPopupJava extends Dialog {
}
`
The text was updated successfully, but these errors were encountered: