- gradle update

- added nsfw
This commit is contained in:
Stefan Schueller 2018-11-07 23:11:19 +01:00
parent 7ffc0444d3
commit 3709b6c043
5 changed files with 16 additions and 10 deletions

View File

@ -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'

View File

@ -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);
}

View File

@ -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}")

View File

@ -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

View File

@ -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