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
/** | |
* Success listener to handle the movie listing | |
* process after api returns the movie list | |
* | |
* @return | |
*/ | |
private Response.Listener<String> ReqSuccessListener() { | |
return new Response.Listener<String>() { | |
public void onResponse(String 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
/** | |
* For Adding Load more functionality | |
* | |
*/ | |
rvMoviesList.addOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
super.onScrolled(recyclerView, dx, dy); | |
if (dy > 0) { | |
visibleItemCount = recyclerView.getChildCount(); |
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 callGetTopRatedMoviesApi() { | |
/** | |
* Checking internet connection before api call. | |
* Very important always take care. | |
*/ | |
if (!Utils.isNetworkAvailable(this)) { | |
Toast.makeText(this, | |
"No internet ..Please connect to internet and start app again", |
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.askfortrciks.volleywithgsondemo.activity; | |
import android.os.Bundle; | |
import android.support.annotation.Nullable; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.ProgressBar; |
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.askfortrciks.volleywithgsondemo.volley; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.Response.ErrorListener; | |
import com.android.volley.Response.Listener; | |
import com.android.volley.toolbox.StringRequest; | |
import java.util.HashMap; | |
import java.util.Map; |
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
object Versions { | |
val kotlin = "1.1.51" | |
val support_lib = "27.0.2" | |
val retrofit = "2.3.0" | |
val rxjava = "2.1.9" | |
val min_sdk = 21 | |
val target_sdk = 26 | |
val compile_sdk = 26 | |
val version_code = 1 | |
val version_name = "1.0" |
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
plugins { | |
`kotlin-dsl` | |
} |
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
dependencies { | |
compile fileTree(include: ['*.jar'], dir: 'libs') | |
implementation libs.support_appcompat_v7 | |
implementation libs.picasso | |
implementation libs.recyclerview | |
implementation libs.cardview | |
implementation libs.design | |
} |
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
ext { | |
versions = [ | |
support_lib: "27.0.2", | |
utilities: "2.3.0", | |
picasso: "2.1.9" | |
] | |
libs = [ | |
support_appcompat_v7: "com.android.support:appcompat-v7:${versions.support_lib}", | |
utilities :"com.matthew-tamlin:android-utilities:${versions.utilities}", | |
picasso: "com.squareup.picasso:picasso:${versions.picasso}" |
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
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
compile 'com.android.support:appcompat-v7:23.2.0' | |
compile 'com.matthew-tamlin:android-utilities:1.3.1' | |
} |
NewerOlder