<ImageView
android:id="@+id/all_video_mode_image"
android:layout_width="30px"
android:layout_height="30px"
android:layout_alignParentRight="true"
android:layout_marginRight="80px"
android:src="@{theme.isDialogShow()?theme.modePullDown:theme.modePackUp}"
android:visibility="gone" />
fragment 中使用databinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = DataBindingUtil.inflate(
LayoutInflater.from(context),
R.layout.fragment_text, null, false
)
binding?.lifecycleOwner = this
binding?.tlTop?.addTab(binding?.tlTop?.newTab()!!.setText("视频"))
binding?.tlTop?.addTab(binding?.tlTop?.newTab()!!.setText("播单"))
return binding?.root
}