Closed therealshabi closed 7 years ago
This library can be used for Java projects as well, the signatures of API's will change though.
For example if you want to make a short toast, you will first have to refer to the file name and then call the function.
ToastUtilsKt.shortToast(this, "Hello");
Similarly, for making a recycler adapter.
List<String> list = new ArrayList<>();
RecyclerAdapterUtil<String> adapter = new RecyclerAdapterUtil(this, list, R.layout.item_recycler_view);
adapter.addOnDataBindListener(new Function3<View, String, Integer, Unit>() {
@Override
public Unit invoke(View view, String s, Integer integer) {
TextView textView = (TextView) view.findViewById(R.id.textView);
textView.setText(s);
return null;
}
});
Can this be used for Java files too? or if not can you please make these APIs for Java as well?