Merge branch 'discover_api_fix' into 'master'
Change discover endpoint used See merge request pixeldroid/PixelDroid!403
This commit is contained in:
commit
102a79e2b2
@ -28,8 +28,8 @@ android {
|
|||||||
applicationId "org.pixeldroid.app"
|
applicationId "org.pixeldroid.app"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 31
|
targetSdkVersion 31
|
||||||
versionCode 4
|
versionCode 5
|
||||||
versionName "1.0.beta4"
|
versionName "1.0.beta5"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
testInstrumentationRunnerArguments clearPackageData: 'true'
|
testInstrumentationRunnerArguments clearPackageData: 'true'
|
||||||
@ -153,11 +153,11 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
|
|
||||||
//Dagger (dependency injection)
|
//Dagger (dependency injection)
|
||||||
implementation 'com.google.dagger:dagger-android:2.40.2'
|
implementation 'com.google.dagger:dagger-android:2.40.3'
|
||||||
implementation 'com.google.dagger:dagger-android-support:2.40.2'
|
implementation 'com.google.dagger:dagger-android-support:2.40.3'
|
||||||
// if you use the support libraries
|
// if you use the support libraries
|
||||||
kapt 'com.google.dagger:dagger-android-processor:2.40.2'
|
kapt 'com.google.dagger:dagger-android-processor:2.40.3'
|
||||||
kapt 'com.google.dagger:dagger-compiler:2.40.2'
|
kapt 'com.google.dagger:dagger-compiler:2.40.3'
|
||||||
|
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
|
@ -85,7 +85,7 @@ class SearchDiscoverFragment : BaseFragment() {
|
|||||||
lifecycleScope.launchWhenCreated {
|
lifecycleScope.launchWhenCreated {
|
||||||
try {
|
try {
|
||||||
val discoverPosts = api.discover()
|
val discoverPosts = api.discover()
|
||||||
adapter.addPosts(discoverPosts.posts)
|
adapter.addPosts(discoverPosts)
|
||||||
binding.discoverNoInfiniteLoad.visibility = View.VISIBLE
|
binding.discoverNoInfiniteLoad.visibility = View.VISIBLE
|
||||||
showError(show = false)
|
showError(show = false)
|
||||||
} catch (exception: IOException) {
|
} catch (exception: IOException) {
|
||||||
|
@ -29,7 +29,7 @@ class LicenseActivity: BaseActivity() {
|
|||||||
|
|
||||||
private fun setupRecyclerView() {
|
private fun setupRecyclerView() {
|
||||||
val text: String = applicationContext.assets.open("licenses.json")
|
val text: String = applicationContext.assets.open("licenses.json")
|
||||||
.bufferedReader().use { it.readText().replace("\r\n", "\n") }
|
.bufferedReader().use { it.readText() }
|
||||||
val listObj: List<OpenSourceItem> = Gson().fromJson(text, Libraries::class.java).libraries
|
val listObj: List<OpenSourceItem> = Gson().fromJson(text, Libraries::class.java).libraries
|
||||||
|
|
||||||
val adapter = OpenSourceLicenseAdapter()
|
val adapter = OpenSourceLicenseAdapter()
|
||||||
|
@ -291,8 +291,8 @@ interface PixelfedAPI {
|
|||||||
): Observable<Attachment>
|
): Observable<Attachment>
|
||||||
|
|
||||||
// get discover
|
// get discover
|
||||||
@GET("/api/v2/discover/posts")
|
@GET("/api/v1/discover/posts")
|
||||||
suspend fun discover() : DiscoverPosts
|
suspend fun discover() : List<Status>
|
||||||
|
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("/api/v1/reports")
|
@POST("/api/v1/reports")
|
||||||
|
@ -7,7 +7,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
Loading…
x
Reference in New Issue
Block a user