This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end | |
import android.support.v7.recyclerview.extensions.ListAdapter | |
import android.support.v7.util.DiffUtil | |
import android.support.v7.widget.RecyclerView | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
class ${NAME} : ListAdapter<${Model_Class}, ${NAME}.ItemViewHolder>(DiffCallback()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game | |
def self.run() | |
<put code here> | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Handler; | |
import android.support.v7.widget.RecyclerView; | |
import com.warmice.android.pathfinderrulebooks.ui.listener.TransactionListener; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by gabriel on 7/19/15. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void bind(Model model) { | |
if (model.id % 2 == 0) { | |
myLayout.setBackgroundResource(R.drawable.background_01); //works | |
textView.setTextColor(Color.BLACK); | |
} else { | |
myLayout.setBackgroundResource(R.drawable.background_02); //works | |
textView.setTextColor(Color.RED); // it's changing the color of the ones that are not "potato" | |
} | |
textView.setText(model.myText); //works | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewHolder extends RecyclerView.ViewHolder { | |
TextView textView; | |
public ViewHolder(View itemView) { | |
super(itemView); | |
// Look up all of your views here, findViewById can be somewhat costl | |
// so you don't want to do it every time the view is recycled | |
textView = ((ViewGroup)itemView).findViewById(R.id.my_text_view); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onBindViewHolder(PageViewHolder holder, int position) { | |
Page page = getList().get(position); | |
holder.bind(page); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void pullRows() { | |
Elements elements = html.getElementsByTag(ROW_TAG); | |
ArrayList<ArrayList<String>> rows = new ArrayList<>(); | |
elements.remove(); | |
for (Element element: elements) { | |
ArrayList<String> row = parseRow(element, CELL_TAG); | |
rows.add(row); | |
} | |
table.setRows(rows); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void pullRows() { | |
Elements elements = html.getElementsByTag(ROW_TAG); | |
elements.remove(); | |
Observable.from(elements) | |
.flatMap(row -> parseRow(row, CELL_TAG)) | |
.toList() | |
.subscribe(table::setRows); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RecyclerViewEmptySupport extends RecyclerView { | |
@Inject ViewFadeAnimator viewFadeAnimator; | |
private int marginTop; | |
private View progressView; | |
private View emptyView; | |
public RecyclerViewEmptySupport(Context context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type listType = new TypeToken<List<JSonModel>>() {}.getType(); | |
List<JsonModel> jsonModels = gson.fromJson(reader, listType); | |
jsonModel = jsonModels.get(0); |
NewerOlder