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 HomeController( | |
val onSmallNavigationClick: (SmallNavigationSection, Int) -> Unit, | |
) : PagedListEpoxyController<HomeSection>() { | |
override fun buildItemModel( | |
currentPosition: Int, | |
item: HomeSection? | |
): EpoxyModel<*> = when (item) { | |
is SmallNavigationSection -> buildSmallNav( | |
item, |
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 fun section(obj: JSONObject): HomeSection? { | |
val serverType = obj.getString("type") | |
val serverData = obj.optJSONObject("data") ?: return null | |
val type = HomeSection.UiType.fromString(serverType) ?: return null | |
val adapter = moshi.adapter(type.toClass().java) | |
return try { | |
val section = adapter.fromJson(serverData.toString()) | |
if (section?.type != type) { |
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":"storyList", | |
"data":{ | |
"heading":"Science Fiction and Fantasy", | |
"items":[ | |
{ | |
"title":"The Ants that Carried Us", | |
"cover":"https://a.wattpad.com/cover/185650009-256-k836366.jpg", | |
"tag":"empire" | |
} |
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":"scifiRow", | |
"stories":[ | |
{ | |
"id":"1234", | |
"title":"The Ants that Carried Us", | |
"description":"They say that the two things Shah Minos loves most are fire and spies...", | |
"cover":"https://a.wattpad.com/cover/185650009-256-k836366.jpg", | |
"tags":[ | |
"action", |
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 fun section(obj: JSONObject): HomeSection? { | |
val serverType = obj.getString("type") | |
val serverData = obj.optJSONObject("data") ?: return null | |
val type = HomeSection.UiType.fromString(serverType) ?: return null | |
val adapter = moshi.adapter(type.toClass().java) | |
return try { | |
val section = adapter.fromJson(serverData.toString()) | |
if (section?.type != type) { |
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.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.LinearSnapHelper; | |
import android.support.v7.widget.OrientationHelper; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.RecyclerView.LayoutManager; | |
import android.view.Gravity; | |
import android.view.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
@echo off | |
TITLE JAR Builder by Muhammad Osama | |
REM Creating a Newline variable (the two blank lines are required!) | |
set NLM=^ | |
set NL=^^^%NLM%%NLM%^%NLM%%NLM% | |
set /p mainc=Enter name of the class that includes your main method (do not include .class) : | |
set /p yname=Enter author's name : | |
echo Main-Class: %mainc%%NL%>manifest.txt |