(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
sealed class NetworkResult<T>( | |
val data: T? = null, | |
val message: String? = null | |
) { | |
class Success<T>(data: T) : NetworkResult<T>(data) | |
class Error<T>(message: String?, data: T? = null) : NetworkResult<T>(data, message) | |
class Loading<T> : NetworkResult<T>() |
class UserDatasourceImpl @Inject constructor( | |
private val auth: FirebaseAuth, | |
) : UserDatasource { | |
override fun registerUserWithEmailAndPassword( | |
userName: String, | |
password: String, | |
): NetworkResult<Any> { | |
lateinit var networkResponse: NetworkResult<Any> |
NoteAdapter adapter = new NoteAdapter(); | |
RecyclerView recyclerView = findViewById(R.id.recycler_view); | |
recyclerView.setLayoutManager(new LinearLayoutManager(this)); | |
recyclerView.setAdapter(adapter); | |
adapter.setContacts(list,cxt,this); |
class ContactHolder extends RecyclerView.ViewHolder { | |
private TextView textViewTitle; | |
private TextView numone; | |
private TextView numtwo; | |
private TextView numthree; | |
private TextView numfour; | |
private ImageView imageview1,imageview2,imageview3,imageview4; |
public class ContactAdapter extends RecyclerView.Adapter<contactAdapter.ContactHolder> { | |
private List<Contact> contacts = new ArrayList<>(); | |
private Context cxt; | |
String telnum; | |
Activity activity; | |
@Override | |
public ContactHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
public class ContactAdapter extends RecyclerView.Adapter<contactAdapter.ContactHolder> { | |
private List<Contact> contacts = new ArrayList<>(); | |
private Context cxt; | |
String telnum; | |
Activity activity; | |
@Override | |
public ContactHolder onCreateViewHolder(ViewGroup parent, int viewType) { |
public class ContactAdapter extends RecyclerView.Adapter<contactAdapter.ContactHolder> { | |
class ContactHolder extends RecyclerView.ViewHolder { |
public class ContactAdapter extends RecyclerView.Adapter<contactAdapter.ContactHolder>{ | |
} |
public class Contact { | |
private int id; | |
private String title; | |
private String description; | |
private int priority; | |
private String numone; | |
private String numtwo; | |
private String numthree; | |
private String numfour; | |
private String type; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.