✨Android Resources:Google Android Developer Site Google Android Developer Tool Site Google Android Developer Blog StackOverflow Android Questions Gradle Reddit-androiddev Android Chat at Slack Amazon Android Dev JavaRanch Android Forum G+ Android Dev Tools G+ Android Dev G+ Android Developers G+ Android Design G+ UX Design [G+ Android MVP ](https://plus.google.com/c
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Copyright (C) 2016 Fred Grott(aka shareme GrottWorkShop) | |
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in | |
compliance with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software distributed under the License is | |
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
The Taggable Interface for the simple adapter
public interface Taggable {
void setTag(@Nullable Object tag);
@Nullable
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
The SimpleAdapter interface
public interface SimpleAdapter<VM, A> {
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
SimpleBindingAdapter abstract class:
public abstract class SimpleBindingAdapter<A, VM, VH extends RecyclerView.ViewHolder>
extends RecyclerView.Adapter<VH> {
//== Operating fields =======================================================
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
The AdaptableViewModel
public class AdaptableViewModel<A, VM> extends BaseObservable {
@NonNull A adaptable;
@Nullable VM viewModel;
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
AdaptOnDemandSimpleBindingAdapter
public abstract class AdaptOnDemandSimpleBindingAdapter<A, VM,
VH extends RecyclerView.ViewHolder &
Taggable>
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
@Override
public void onBindViewHolder(final VH loadingViewHolder,
int position) {
final AdaptableViewModel<A, VM> adaptableViewModel = items.get(position);
VM viewModel = adaptableViewModel.viewModel;
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
public interface AdaptableViewModel<VM> {
/**
* Get the
* already-{@link AdaptableAdapter#adapt(AdaptableViewModel) adapted}
* version of this object, which had been saved by a previous call to
Original code developed by Robert LaThanh Modifications by Fred Grott, all under Apache License 2.0 Copyright (C) 2016
public abstract class AbstractAdaptableViewModel<VM>
extends BaseObservable
implements AdaptableViewModel<VM> {
private @Nullable VM viewModel;