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
val forecastday = response.forecast.forecastday | |
val data = weather { | |
currentDegrees = response.current.temp_c.toString() | |
currentLocation = response.location.name | |
forecast { | |
dayName = forecastday[0].date.toDay() | |
degrees = forecastday[0].day.avgtemp_c.toString() | |
} | |
forecast { |
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
fun weather(block: WeatherBuilder.() -> Unit): Weather = WeatherBuilder().apply(block).build() | |
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 ForecastBuilder{ | |
var dayName: String? = null | |
var degrees: String? = null | |
fun build(): Forecast = Forecast(dayName, degrees) | |
} |
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 WeatherBuilder{ | |
var currentDegrees: String? = null | |
var currentLocation: String? = null | |
val forecast = mutableListOf<Forecast>() | |
fun forecast(block: ForecastBuilder.() -> Unit){ | |
forecast.add(ForecastBuilder().apply(block).build()) | |
} |
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
data class Forecast( | |
var dayName: String? = null, | |
var degrees: String? = null | |
) |
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
data class Weather( | |
var currentDegrees: String? = null, | |
var currentLocation: String? = null, | |
var forecast: List<Forecast>? = null | |
) |
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
package com.klinikraisha.apiretrofit.relay; | |
import io.reactivex.functions.Predicate; | |
/** | |
* Created by ocittwo on 11/18/17. | |
*/ | |
public class AppendOnlyLinkedArrayList<T> { | |
private final int capacity; |
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
package com.ahmadrosid.knifelite; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.support.v7.widget.AppCompatButton; | |
import android.view.View; | |
import android.widget.Toast; | |
import com.ahmadrosid.knifelite.knife.Knife; | |
import com.ahmadrosid.knifelite.knife.annotation.KnifeView; |
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.app.Activity; | |
import android.view.View; | |
import com.ahmadrosid.knifelite.knife.annotation.KnifeView; | |
import com.ahmadrosid.knifelite.knife.annotation.KnifeClick; | |
import com.ahmadrosid.knifelite.knife.annotation.KnifeLongClick; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Field; |
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
sudo apt-get install -y python-software-properties | |
sudo add-apt-repository -y ppa:ondrej/php | |
sudo apt-get update -y | |
sudo apt-get install php7.1 |