mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-02 10:23:33 +00:00
feat: implemented version number control and update dialog for Github flavor
This commit is contained in:
parent
c243fa9edc
commit
0a26f0a7b8
19 changed files with 477 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.cappielloantonio.tempo.App;
|
||||
import com.cappielloantonio.tempo.github.models.LatestRelease;
|
||||
import com.cappielloantonio.tempo.interfaces.SystemCallback;
|
||||
import com.cappielloantonio.tempo.subsonic.base.ApiResponse;
|
||||
import com.cappielloantonio.tempo.subsonic.models.OpenSubsonicExtension;
|
||||
|
|
@ -92,4 +93,27 @@ public class SystemRepository {
|
|||
|
||||
return extensionsResult;
|
||||
}
|
||||
|
||||
public MutableLiveData<LatestRelease> checkTempoUpdate() {
|
||||
MutableLiveData<LatestRelease> latestRelease = new MutableLiveData<>();
|
||||
|
||||
App.getGithubClientInstance()
|
||||
.getReleaseClient()
|
||||
.getLatestRelease()
|
||||
.enqueue(new Callback<LatestRelease>() {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<LatestRelease> call, @NonNull Response<LatestRelease> response) {
|
||||
if (response.isSuccessful() && response.body() != null) {
|
||||
latestRelease.postValue(response.body());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<LatestRelease> call, @NonNull Throwable t) {
|
||||
latestRelease.postValue(null);
|
||||
}
|
||||
});
|
||||
|
||||
return latestRelease;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue