Compare commits
7 Commits
2.2.0
...
release-2.
Author | SHA1 | Date | |
---|---|---|---|
5999b8ed4a | |||
2cba285076 | |||
24a552f0a9 | |||
d9a7fa4e44 | |||
9950d4ea65 | |||
98054b89cc | |||
24d56c625e |
@ -6,8 +6,8 @@ android {
|
|||||||
applicationId "org.mian.gitnex"
|
applicationId "org.mian.gitnex"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 70
|
versionCode 72
|
||||||
versionName "2.2.0"
|
versionName "2.2.2"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -192,7 +192,7 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
|||||||
|
|
||||||
FilesViewModel filesModel = new ViewModelProvider(this).get(FilesViewModel.class);
|
FilesViewModel filesModel = new ViewModelProvider(this).get(FilesViewModel.class);
|
||||||
|
|
||||||
filesModel.getFilesList(instanceUrl, instanceToken, owner, repo).observe(this, new Observer<List<Files>>() {
|
filesModel.getFilesList(instanceUrl, instanceToken, owner, repo, getContext()).observe(this, new Observer<List<Files>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(@Nullable List<Files> filesListMain) {
|
public void onChanged(@Nullable List<Files> filesListMain) {
|
||||||
adapter = new FilesAdapter(getContext(), filesListMain, FilesFragment.this);
|
adapter = new FilesAdapter(getContext(), filesListMain, FilesFragment.this);
|
||||||
@ -225,7 +225,7 @@ public class FilesFragment extends Fragment implements FilesAdapter.FilesAdapter
|
|||||||
|
|
||||||
FilesViewModel filesModel2 = new ViewModelProvider(this).get(FilesViewModel.class);
|
FilesViewModel filesModel2 = new ViewModelProvider(this).get(FilesViewModel.class);
|
||||||
|
|
||||||
filesModel2.getFilesList2(instanceUrl, instanceToken, owner, repo, filesDir).observe(this, new Observer<List<Files>>() {
|
filesModel2.getFilesList2(instanceUrl, instanceToken, owner, repo, filesDir, getContext()).observe(this, new Observer<List<Files>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(@Nullable List<Files> filesListMain2) {
|
public void onChanged(@Nullable List<Files> filesListMain2) {
|
||||||
adapter = new FilesAdapter(getContext(), filesListMain2, FilesFragment.this);
|
adapter = new FilesAdapter(getContext(), filesListMain2, FilesFragment.this);
|
||||||
|
@ -89,6 +89,7 @@ public class MyRepositoriesFragment extends Fragment {
|
|||||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||||
final String loginUid = tinyDb.getString("loginUid");
|
final String loginUid = tinyDb.getString("loginUid");
|
||||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||||
|
final String userLogin = tinyDb.getString("userLogin");
|
||||||
|
|
||||||
final SwipeRefreshLayout swipeRefresh = v.findViewById(R.id.pullToRefresh);
|
final SwipeRefreshLayout swipeRefresh = v.findViewById(R.id.pullToRefresh);
|
||||||
|
|
||||||
@ -140,13 +141,13 @@ public class MyRepositoriesFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
swipeRefresh.setRefreshing(false);
|
swipeRefresh.setRefreshing(false);
|
||||||
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), loginUid);
|
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin);
|
||||||
}
|
}
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
fetchDataAsync(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), loginUid);
|
fetchDataAsync(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -164,16 +165,17 @@ public class MyRepositoriesFragment extends Fragment {
|
|||||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||||
final String loginUid = tinyDb.getString("loginUid");
|
final String loginUid = tinyDb.getString("loginUid");
|
||||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||||
|
final String userLogin = tinyDb.getString("userLogin");
|
||||||
|
|
||||||
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), loginUid);
|
MyRepositoriesViewModel.loadMyReposList(instanceUrl, Authorization.returnAuthentication(getContext(), loginUid, instanceToken), userLogin);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fetchDataAsync(String instanceUrl, String instanceToken, String username) {
|
private void fetchDataAsync(String instanceUrl, String instanceToken, String userLogin) {
|
||||||
|
|
||||||
MyRepositoriesViewModel myRepoModel = new ViewModelProvider(this).get(MyRepositoriesViewModel.class);
|
MyRepositoriesViewModel myRepoModel = new ViewModelProvider(this).get(MyRepositoriesViewModel.class);
|
||||||
|
|
||||||
myRepoModel.getCurrentUserRepositories(instanceUrl, instanceToken, username).observe(this, new Observer<List<UserRepositories>>() {
|
myRepoModel.getCurrentUserRepositories(instanceUrl, instanceToken, userLogin).observe(this, new Observer<List<UserRepositories>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(@Nullable List<UserRepositories> myReposListMain) {
|
public void onChanged(@Nullable List<UserRepositories> myReposListMain) {
|
||||||
adapter = new MyReposListAdapter(getContext(), myReposListMain);
|
adapter = new MyReposListAdapter(getContext(), myReposListMain);
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package org.mian.gitnex.viewmodels;
|
package org.mian.gitnex.viewmodels;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
import org.mian.gitnex.R;
|
||||||
import org.mian.gitnex.clients.RetrofitClient;
|
import org.mian.gitnex.clients.RetrofitClient;
|
||||||
|
import org.mian.gitnex.helpers.Toasty;
|
||||||
import org.mian.gitnex.models.Files;
|
import org.mian.gitnex.models.Files;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
@ -23,15 +26,15 @@ public class FilesViewModel extends ViewModel {
|
|||||||
private static MutableLiveData<List<Files>> filesList;
|
private static MutableLiveData<List<Files>> filesList;
|
||||||
private static MutableLiveData<List<Files>> filesList2;
|
private static MutableLiveData<List<Files>> filesList2;
|
||||||
|
|
||||||
public LiveData<List<Files>> getFilesList(String instanceUrl, String token, String owner, String repo) {
|
public LiveData<List<Files>> getFilesList(String instanceUrl, String token, String owner, String repo, Context ctx) {
|
||||||
|
|
||||||
filesList = new MutableLiveData<>();
|
filesList = new MutableLiveData<>();
|
||||||
loadFilesList(instanceUrl, token, owner, repo);
|
loadFilesList(instanceUrl, token, owner, repo, ctx);
|
||||||
|
|
||||||
return filesList;
|
return filesList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadFilesList(String instanceUrl, String token, String owner, String repo) {
|
private static void loadFilesList(String instanceUrl, String token, String owner, String repo, final Context ctx) {
|
||||||
|
|
||||||
Call<List<Files>> call = RetrofitClient
|
Call<List<Files>> call = RetrofitClient
|
||||||
.getInstance(instanceUrl)
|
.getInstance(instanceUrl)
|
||||||
@ -43,16 +46,17 @@ public class FilesViewModel extends ViewModel {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
|
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
|
||||||
|
|
||||||
Collections.sort(response.body(), new Comparator<Files>() {
|
|
||||||
@Override
|
|
||||||
public int compare(Files byType1, Files byType2) {
|
|
||||||
return byType1.getType().compareTo(byType2.getType());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
|
Collections.sort(response.body(), new Comparator<Files>() {
|
||||||
|
@Override
|
||||||
|
public int compare(Files byType1, Files byType2) {
|
||||||
|
return byType1.getType().compareTo(byType2.getType());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
filesList.postValue(response.body());
|
filesList.postValue(response.body());
|
||||||
} else {
|
} else {
|
||||||
|
Toasty.info(ctx, ctx.getString(R.string.noDataFilesTab));
|
||||||
Log.i("onResponse", String.valueOf(response.code()));
|
Log.i("onResponse", String.valueOf(response.code()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,15 +70,15 @@ public class FilesViewModel extends ViewModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveData<List<Files>> getFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir) {
|
public LiveData<List<Files>> getFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir, Context ctx) {
|
||||||
|
|
||||||
filesList = new MutableLiveData<>();
|
filesList2 = new MutableLiveData<>();
|
||||||
loadFilesList2(instanceUrl, token, owner, repo, filesDir);
|
loadFilesList2(instanceUrl, token, owner, repo, filesDir, ctx);
|
||||||
|
|
||||||
return filesList;
|
return filesList2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir) {
|
private static void loadFilesList2(String instanceUrl, String token, String owner, String repo, String filesDir, final Context ctx) {
|
||||||
|
|
||||||
Call<List<Files>> call = RetrofitClient
|
Call<List<Files>> call = RetrofitClient
|
||||||
.getInstance(instanceUrl)
|
.getInstance(instanceUrl)
|
||||||
@ -86,19 +90,17 @@ public class FilesViewModel extends ViewModel {
|
|||||||
@Override
|
@Override
|
||||||
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
|
public void onResponse(@NonNull Call<List<Files>> call, @NonNull Response<List<Files>> response) {
|
||||||
|
|
||||||
assert response.body() != null;
|
if (response.isSuccessful()) {
|
||||||
if(response.body().size() > 0) {
|
|
||||||
Collections.sort(response.body(), new Comparator<Files>() {
|
Collections.sort(response.body(), new Comparator<Files>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(Files byType1, Files byType2) {
|
public int compare(Files byType1, Files byType2) {
|
||||||
return byType1.getType().compareTo(byType2.getType());
|
return byType1.getType().compareTo(byType2.getType());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (response.isSuccessful()) {
|
filesList2.postValue(response.body());
|
||||||
filesList.postValue(response.body());
|
|
||||||
} else {
|
} else {
|
||||||
|
Toasty.info(ctx, ctx.getString(R.string.noDataFilesTab));
|
||||||
Log.i("onResponse", String.valueOf(response.code()));
|
Log.i("onResponse", String.valueOf(response.code()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,6 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
16
fastlane/metadata/android/en-US/changelogs/71.txt
Normal file
16
fastlane/metadata/android/en-US/changelogs/71.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
2.2.1
|
||||||
|
- Bug fix: Crash on empty repository
|
||||||
|
|
||||||
|
2.2.0
|
||||||
|
- New: Explore repositories
|
||||||
|
- New: Files and directory browser (Require Gitea 1.9)
|
||||||
|
- New: Basic file viewer
|
||||||
|
- New: Filter files/directories
|
||||||
|
- New: Star/unstar a repository
|
||||||
|
- New: Watch/unwatch a repository
|
||||||
|
- Improvement: Added Corwdin for translation
|
||||||
|
- Improvement: Bottomsheet scroll and line dividers
|
||||||
|
- Improvement: New languages support
|
||||||
|
|
||||||
|
For more, check the release notes.
|
||||||
|
https://gitea.com/gitnex/GitNex/releases
|
19
fastlane/metadata/android/en-US/changelogs/72.txt
Normal file
19
fastlane/metadata/android/en-US/changelogs/72.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
2.2.2
|
||||||
|
- Bug fix: My repositories when login via email
|
||||||
|
|
||||||
|
2.2.1
|
||||||
|
- Bug fix: Crash on empty repository
|
||||||
|
|
||||||
|
2.2.0
|
||||||
|
- New: Explore repositories
|
||||||
|
- New: Files and directory browser (Require Gitea 1.9)
|
||||||
|
- New: Basic file viewer
|
||||||
|
- New: Filter files/directories
|
||||||
|
- New: Star/unstar a repository
|
||||||
|
- New: Watch/unwatch a repository
|
||||||
|
- Improvement: Added Corwdin for translation
|
||||||
|
- Improvement: Bottomsheet scroll and line dividers
|
||||||
|
- Improvement: New languages support
|
||||||
|
|
||||||
|
For more, check the release notes.
|
||||||
|
https://gitea.com/gitnex/GitNex/releases
|
@ -2,8 +2,9 @@ GitNex is a free, open-source Android client for Git repository management tool
|
|||||||
|
|
||||||
# Features
|
# Features
|
||||||
|
|
||||||
|
- File/Directory browser
|
||||||
|
- File viewer
|
||||||
- Create files
|
- Create files
|
||||||
- File browser
|
|
||||||
- Explore repositories
|
- Explore repositories
|
||||||
- My repositories
|
- My repositories
|
||||||
- Repositories list
|
- Repositories list
|
||||||
@ -28,13 +29,14 @@ GitNex is a free, open-source Android client for Git repository management tool
|
|||||||
- Collaborators view for repository
|
- Collaborators view for repository
|
||||||
- Markdown support
|
- Markdown support
|
||||||
- Emoji support
|
- Emoji support
|
||||||
- Settings : Pretty and Normal time format, language change
|
- Settings : Pretty and Normal time format, language change
|
||||||
|
, issue badge
|
||||||
- Option to access local non-https installs
|
- Option to access local non-https installs
|
||||||
- Basic HTTP authentication support. Use USERNAME@YOUR-DOMAIN.COM in URL field
|
- Basic HTTP authentication support. Use USERNAME@YOUR-DOMAIN.COM in URL field
|
||||||
- 2FA OTP support. Check the Troubleshoot wiki page for usage
|
- 2FA OTP support. Check the Troubleshoot wiki page for usage
|
||||||
- Create a new user - Admin privilege required
|
- Create a new user - Admin privilege required
|
||||||
- Closed issues list
|
- Closed issues list
|
||||||
- Closed issues list
|
- Edit issues
|
||||||
|
|
||||||
More features - https://gitea.com/gitnex/GitNex/wiki/Features
|
More features - https://gitea.com/gitnex/GitNex/wiki/Features
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user