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 request{ | |
public void test1(){ | |
//ServiceA() --> return list object {"id":1,"name":""} | |
//ServiceB(id) --> return detail for object | |
service.getAllGeneros("movie","list","da0d692f7f62a1dc687580f79dc1e6a0") | |
.subscribeOn(Schedulers.newThread()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.flatMap(userResponse -> Observable.just(userResponse.getGenres())) //get list from response |
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.example.hackro.myapplication.home; | |
/** | |
* Created by hackro on 21/01/17. | |
*/ | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; |
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
Retrofit repo = new Retrofit.Builder() | |
.baseUrl("https://api.themoviedb.org/3/genre/") | |
.addConverterFactory(GsonConverterFactory.create()) | |
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) | |
.build(); | |
Observable<GenerosResponse> Genres = repo | |
.create(services.class) | |
.getAllGeneros("movie","list","da0d692f7f62a1dc687580f79dc1e6a0") | |
.subscribeOn(Schedulers.newThread()) |
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
//Interface API | |
public interface api{ | |
@GET("{movie}/{list}") | |
Observable<GenerosResponse> getAllGeneros(@Path("movie")String movie,@Path("list")String list,@Query("api_key")String key); | |
@GET("{number}/{movies}") | |
Observable<ResponseMovies> getAllMovies(@Path("number")int number,@Path("movies")String movies,@Query("api_key")String key, @Query("sort_by")String sort_by); | |
} | |
//Pojo -> List Genres Movies |
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
const Client = require('node-rest-client').Client | |
var client = new Client() | |
//const key = 'AIzaSyArQQ_RJgWEKUlM2Y8Jw_lc_BMjzt3yR7I' | |
const key = 'AIzaSyBWtpveyWKoj26zuaMs-vHT8u0o2i0rKqY' | |
const radius = 3000 | |
getListPlacesToken = (lat,long,token)=>{ | |
url = '' | |
if(token == '') |
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
const express = require('express') | |
const bodyParser = require('body-parser') | |
const request = require('request') | |
const app = express() | |
const functions = require('./function') | |
app.use(bodyParser.json()) | |
app.use(bodyParser.urlencoded({ | |
extended: true | |
})) |
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 final class CompaniesObserver extends DefaultSubscriber<SearchResponseDomain> { | |
@Override | |
public void onCompleted() { | |
super.onCompleted(); | |
getView().hideLoading(); | |
if(travleSimple) | |
getView().showCompanies(departureTrip); | |
else { | |
combineResults(departureTrip,returnTrip); |
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.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; | |
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/background_light" | |
android:fitsSystemWindows="true" | |
> |
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 java | |
private void initDialogPassengers() { | |
dialog = new Dialog(this, android.R.style.ThemeOverlay_Material_Light); | |
dialog.setContentView(R.layout.example); | |
dialog.getWindow().getAttributes().windowAnimations = R.style.DialogTheme; | |
} | |
---------------------------------------------------------------------------------------------------------------- |
OlderNewer