- gradle update
- added nsfw
This commit is contained in:
parent
7ffc0444d3
commit
3709b6c043
@ -24,12 +24,12 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
implementation 'com.android.support:appcompat-v7:27.1.1'
|
||||
implementation 'com.android.support:cardview-v7:27.1.1'
|
||||
implementation 'com.android.support:recyclerview-v7:27.1.1'
|
||||
|
||||
implementation 'com.google.android.gms:play-services-auth:15.0.1'
|
||||
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
||||
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
|
||||
|
@ -61,6 +61,7 @@ public class VideoListActivity extends AppCompatActivity {
|
||||
private int count = 12;
|
||||
private String sort = "-createdAt";
|
||||
private String filter = "";
|
||||
private String nsfw = "false";
|
||||
|
||||
private boolean isLoading = false;
|
||||
|
||||
@ -107,8 +108,7 @@ public class VideoListActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_video_list);
|
||||
|
||||
//SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
filter = ""; //"nsfw:" + sharedPref.getBoolean("pref_show_nsfw", true);
|
||||
filter = "";
|
||||
|
||||
// Init icons
|
||||
Iconify.with(new FontAwesomeModule());
|
||||
@ -237,11 +237,14 @@ public class VideoListActivity extends AppCompatActivity {
|
||||
|
||||
isLoading = true;
|
||||
|
||||
SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
nsfw = sharedPref.getBoolean("pref_show_nsfw", true) ? "both" : "false";
|
||||
|
||||
String apiBaseURL = APIUrlHelper.getUrl(this);
|
||||
|
||||
GetVideoDataService service = RetrofitInstance.getRetrofitInstance(apiBaseURL + "/api/v1/").create(GetVideoDataService.class);
|
||||
|
||||
Call<VideoList> call = service.getVideosData(start, count, sort, filter);
|
||||
Call<VideoList> call = service.getVideosData(start, count, sort, nsfw);
|
||||
|
||||
/*Log the URL called*/
|
||||
Log.d("URL Called", call.request().url() + "");
|
||||
@ -255,7 +258,9 @@ public class VideoListActivity extends AppCompatActivity {
|
||||
videoAdapter.clearData();
|
||||
}
|
||||
|
||||
videoAdapter.setData(response.body().getVideoArrayList());
|
||||
if (response.body() != null) {
|
||||
videoAdapter.setData(response.body().getVideoArrayList());
|
||||
}
|
||||
isLoading = false;
|
||||
swipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ public interface GetVideoDataService {
|
||||
@Query("start") int start,
|
||||
@Query("count") int count,
|
||||
@Query("sort") String sort,
|
||||
@Query("filter") String filter
|
||||
@Query("nsfw") String nsfw
|
||||
//@Query("filter") String filter
|
||||
);
|
||||
|
||||
@GET("videos/{id}")
|
||||
|
@ -7,7 +7,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.3'
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
||||
#Sun Jul 01 13:53:14 CEST 2018
|
||||
#Wed Nov 07 22:40:24 CET 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
|
Loading…
Reference in New Issue
Block a user