GitNex-Android-App/app/src/main/java/org/mian/gitnex/viewmodels/FilesViewModel.java

113 lines
3.6 KiB
Java
Raw Normal View History

package org.mian.gitnex.viewmodels;
2019-10-18 15:40:54 +02:00
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
2019-10-18 15:40:54 +02:00
import org.mian.gitnex.R;
import org.mian.gitnex.clients.RetrofitClient;
2019-10-18 15:40:54 +02:00
import org.mian.gitnex.helpers.Toasty;
import org.mian.gitnex.models.Files;
2019-10-02 14:58:29 +02:00
import java.util.Collections;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* Author M M Arif
*/
public class FilesViewModel extends ViewModel {
private static MutableLiveData<List<Files>> filesList;
2019-10-03 20:50:57 +02:00
private static MutableLiveData<List<Files>> filesList2;
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
public LiveData<List<Files>> getFilesList(String instanceUrl, String token, String owner, String repo, String ref, Context ctx) {
filesList = new MutableLiveData<>();
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
loadFilesList(instanceUrl, token, owner, repo, ref, ctx);
return filesList;
}
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
private static void loadFilesList(String instanceUrl, String token, String owner, String repo, String ref, final Context ctx) {
Call<List<Files>> call = RetrofitClient
2019-11-13 16:52:49 +01:00
.getInstance(instanceUrl, ctx)
.getApiInterface()
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
.getFiles(token, owner, repo, ref);
call.enqueue(new Callback<List<Files>>() {
@Override
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
if (response.isSuccessful()) {
2019-10-18 15:40:54 +02:00
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
assert response.body() != null;
Collections.sort(response.body(), (byType1, byType2) -> byType1.getType().compareTo(byType2.getType()));
filesList.postValue(response.body());
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
} else {
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
Toasty.warning(ctx, ctx.getString(R.string.noDataFilesTab));
Log.i("onResponse", String.valueOf(response.code()));
}
}
@Override
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
public void onFailure(@NonNull Call<List<Files>> call, @NonNull Throwable t) {
Log.i("onFailure", t.toString());
}
});
}
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
public LiveData<List<Files>> getFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir, String ref, Context ctx) {
2019-10-03 20:50:57 +02:00
2019-10-18 15:40:54 +02:00
filesList2 = new MutableLiveData<>();
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
loadFilesList2(instanceUrl, token, owner, repo, filesDir, ref, ctx);
2019-10-03 20:50:57 +02:00
2019-10-18 15:40:54 +02:00
return filesList2;
2019-10-03 20:50:57 +02:00
}
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
private static void loadFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir, String ref, final Context ctx) {
2019-10-03 20:50:57 +02:00
Call<List<Files>> call = RetrofitClient
2019-11-13 16:52:49 +01:00
.getInstance(instanceUrl, ctx)
2019-10-03 20:50:57 +02:00
.getApiInterface()
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
.getDirFiles(token, owner, repo, filesDir, ref);
2019-10-03 20:50:57 +02:00
call.enqueue(new Callback<List<Files>>() {
@Override
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
2019-10-18 15:40:54 +02:00
if (response.isSuccessful()) {
2019-10-03 20:50:57 +02:00
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
assert response.body() != null;
Collections.sort(response.body(), (byType1, byType2) -> byType1.getType().compareTo(byType2.getType()));
2019-10-18 15:40:54 +02:00
filesList2.postValue(response.body());
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
2019-10-03 20:50:57 +02:00
} else {
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
Toasty.warning(ctx, ctx.getString(R.string.noDataFilesTab));
2019-10-03 20:50:57 +02:00
Log.i("onResponse", String.valueOf(response.code()));
}
}
@Override
Switch branches (#571) Fix default branch Merge branch 'master' into switch-branches # Conflicts: # app/src/main/res/layout/bottom_sheet_repo.xml # app/src/main/res/values/strings.xml update icon Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches update the missing parts Minor updates Merge branch 'master' into switch-branches Merge branch 'master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/CreateIssueActivity.java # app/src/main/java/org/mian/gitnex/activities/RepoDetailActivity.java # app/src/main/java/org/mian/gitnex/fragments/BottomSheetRepoFragment.java # app/src/main/java/org/mian/gitnex/fragments/FilesFragment.java Add branch to breadcrumb and dir structure fix Make change branch work clean up Merge branch 'master' into switch-branches add icon in top bar, add interface listener Merge branch 'master' into switch-branches Merge remote-tracking branch 'remotes/main/master' into switch-branches # Conflicts: # app/src/main/java/org/mian/gitnex/activities/LoginActivity.java # app/src/main/java/org/mian/gitnex/fragments/ProfileFragment.java # app/src/main/java/org/mian/gitnex/helpers/PathsHelper.java Switching between branches. Minor fixes Merge remote-tracking branch 'remotes/main/master' into login-fix URL parsing, label and other improvements. Co-authored-by: M M Arif <mmarif@swatian.com> Co-authored-by: 6543 <6543@noreply.codeberg.org> Co-authored-by: opyale <opyale@noreply.gitea.io> Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/571 Reviewed-by: 6543 <6543@noreply.codeberg.org>
2020-07-12 17:14:50 +02:00
public void onFailure(@NonNull Call<List<Files>> call, @NonNull Throwable t) {
2019-10-03 20:50:57 +02:00
Log.i("onFailure", t.toString());
}
});
}
}