Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
626746be8b | |||
f21f23c1f0 | |||
5005fcc5b5 | |||
008e446b93 | |||
50e0142f6c | |||
42640f2d1c | |||
4a8ee2ea96 | |||
acc55e3433 | |||
e267aa5100 | |||
5e41469452 | |||
55473701b8 | |||
546346ff48 | |||
4f0091f151 | |||
37367e142f |
@ -4,11 +4,16 @@ end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
max_line_length = 150
|
||||
|
||||
[*.java]
|
||||
indent_style = tab
|
||||
max_line_length = 220
|
||||
line_comment = //
|
||||
block_comment_start = /*
|
||||
block_comment = *
|
||||
block_comment_end = */
|
||||
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
|
@ -1,2 +1,2 @@
|
||||
# Changelog
|
||||
[Check out the release notes](https://gitea.com/gitnex/GitNex/releases)
|
||||
[Check out the release notes](https://codeberg.org/gitnex/GitNex/releases)
|
||||
|
@ -10,7 +10,7 @@ Please ask if you are not sure about the scope of work to be submitted to avoid
|
||||
**Code Standards**
|
||||
Please follow the code standards, this will help other developers to understand your code too.
|
||||
It also helps maintaining the code afterwards.
|
||||
It is documented in the Wiki: [Code-Standards](https://gitea.com/gitnex/GitNex/wiki/Code-Standards)
|
||||
It is documented in the Wiki: [Code-Standards](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards)
|
||||
|
||||
**How to submit a PR**
|
||||
Fork this repository. Pull the forked repository from your namespace to your local machine. Create new branch and work on the bug/feature/enhancement you would like to submit. Push it to your forked version. From there create Pull Request(PR) against **master** branch.
|
||||
|
21
README.md
21
README.md
@ -1,4 +1,4 @@
|
||||
[](https://www.gnu.org/licenses/gpl-3.0) [](https://gitea.com/gitnex/GitNex/releases) [](https://drone.gitea.com/gitnex/GitNex) [](https://crowdin.com/project/gitnex) [](https://discord.gg/FbSS4rf)
|
||||
[](https://www.gnu.org/licenses/gpl-3.0) [](https://codeberg.org/gitnex/GitNex/releases) [](https://crowdin.com/project/gitnex) [](https://discord.gg/FbSS4rf)
|
||||
|
||||
[<img alt="Become a Patroen" src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" height="40"/>](https://www.patreon.com/mmarif) [<img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg" height="40"/>](https://liberapay.com/mmarif/donate)
|
||||
|
||||
@ -18,7 +18,7 @@ Download latest build from master: [https://cloud.swatian.com/s/Cq592xGEfnsGAAW]
|
||||
## Note about Gitea version
|
||||
Please make sure that you are on latest stable release or later for better app experience.
|
||||
|
||||
Check the versions [compatibility page](https://gitea.com/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with compatibility ratio.
|
||||
Check the versions [compatibility page](https://codeberg.org/gitnex/GitNex/wiki/Compatibility) which lists all the supported versions with compatibility ratio.
|
||||
|
||||
## Build from source
|
||||
Option 1 - Download the source code, open it in Android Studio and build it there.
|
||||
@ -32,36 +32,36 @@ Option 2 - Open terminal(Linux) and cd to the project dir. Run `./gradlew build`
|
||||
- Issues list
|
||||
- Pull requests
|
||||
- Merge pull request
|
||||
- [MANY MORE](https://gitea.com/gitnex/GitNex/wiki/Features)
|
||||
- [MANY MORE](https://codeberg.org/gitnex/GitNex/wiki/Features)
|
||||
|
||||
## Contributing
|
||||
[CONTRIBUTING](https://gitea.com/gitnex/GitNex/src/branch/master/CONTRIBUTING.md)
|
||||
[CONTRIBUTING](https://codeberg.org/gitnex/GitNex/src/branch/master/CONTRIBUTING.md)
|
||||
|
||||
## Translation
|
||||
Help us translate GitNex to your native language.
|
||||
|
||||
We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please request [here](https://gitea.com/gitnex/GitNex/issues) to add it to the project.
|
||||
We use [Crowdin](https://crowdin.com/project/gitnex) for translation. If your language is not listed, please request [here](https://codeberg.org/gitnex/GitNex/issues) to add it to the project.
|
||||
|
||||
**Link: https://crowdin.com/project/GitNex**
|
||||
|
||||
## Screenshots:
|
||||
|
||||
<img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/001.png" alt="001.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/002.png" alt="002.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/003.png" alt="003.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/004.png" alt="004.png" width="200"/>
|
||||
<img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/001.png" alt="001.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/002.png" alt="002.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/003.png" alt="003.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/004.png" alt="004.png" width="200"/>
|
||||
---|---|---|---
|
||||
<img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/005.png" alt="005.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/006.png" alt="006.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/007.png" alt="007.png" width="200"/> | <img src="https://gitea.com/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/008.png" alt="008.png" width="200"/>
|
||||
<img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/005.png" alt="005.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/006.png" alt="006.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/007.png" alt="007.png" width="200"/> | <img src="https://codeberg.org/gitnex/GitNex/raw/branch/master/fastlane/metadata/android/en-US/images/phoneScreenshots/008.png" alt="008.png" width="200"/>
|
||||
|
||||
|
||||
## FAQ
|
||||
[Faq](https://gitea.com/gitnex/GitNex/wiki/FAQ)
|
||||
[Faq](https://codeberg.org/gitnex/GitNex/wiki/FAQ)
|
||||
|
||||
## Links
|
||||
[Website](https://gitnex.com)
|
||||
|
||||
[Wiki](https://gitea.com/gitnex/GitNex/wiki/Home)
|
||||
[Wiki](https://codeberg.org/gitnex/GitNex/wiki/Home)
|
||||
|
||||
[Website Repository](https://gitlab.com/mmarif4u/gitnex-website)
|
||||
|
||||
[Troubleshoot Guide](https://gitea.com/gitnex/GitNex/wiki/Troubleshoot-Guide)
|
||||
[Troubleshoot Guide](https://codeberg.org/gitnex/GitNex/wiki/Troubleshoot-Guide)
|
||||
|
||||
## Thanks
|
||||
Thanks to all the open source libraries, contributors and donators.
|
||||
@ -87,5 +87,6 @@ Open source libraries
|
||||
- Droidsonroids.gif/android-gif-drawable
|
||||
- Barteksc/AndroidPdfViewer
|
||||
- Ge0rg/MemorizingTrustManager
|
||||
- Dimezis/BlurView
|
||||
|
||||
[Follow me on Fediverse - mastodon.social/@mmarif](https://mastodon.social/@mmarif)
|
||||
|
@ -6,8 +6,8 @@ android {
|
||||
applicationId "org.mian.gitnex"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 295
|
||||
versionName "3.0.0-rc1"
|
||||
versionCode 296
|
||||
versionName "3.0.0-rc2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
viewBinding {
|
||||
@ -41,8 +41,8 @@ dependencies {
|
||||
def acra = "5.5.0"
|
||||
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "androidx.appcompat:appcompat:1.2.0-rc01"
|
||||
implementation "com.google.android.material:material:1.2.0-beta01"
|
||||
implementation "androidx.appcompat:appcompat:1.3.0-alpha01"
|
||||
implementation "com.google.android.material:material:1.3.0-alpha01"
|
||||
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
|
||||
implementation "androidx.legacy:legacy-support-v4:1.0.0"
|
||||
testImplementation "junit:junit:4.13"
|
||||
@ -86,5 +86,6 @@ dependencies {
|
||||
implementation "ch.acra:acra-mail:$acra"
|
||||
implementation "ch.acra:acra-limiter:$acra"
|
||||
implementation "ch.acra:acra-notification:$acra"
|
||||
implementation 'com.eightbitlab:blurview:1.6.3'
|
||||
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ public class IssueActions {
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.info(ctx, ctx.getString(R.string.subscribtionError));
|
||||
Toasty.info(ctx, ctx.getString(R.string.subscriptionError));
|
||||
|
||||
}
|
||||
|
||||
@ -263,7 +263,7 @@ public class IssueActions {
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.info(ctx, ctx.getString(R.string.unsubscribtionError));
|
||||
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
|
||||
|
||||
}
|
||||
|
||||
@ -272,7 +272,7 @@ public class IssueActions {
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<Void> call, @NonNull Throwable t) {
|
||||
|
||||
Toasty.info(ctx, ctx.getString(R.string.unsubscribtionError));
|
||||
Toasty.info(ctx, ctx.getString(R.string.unsubscriptionError));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import org.mian.gitnex.adapters.CommitsAdapter;
|
||||
import org.mian.gitnex.clients.AppApiService;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.StaticGlobalVariables;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.interfaces.ApiInterface;
|
||||
import org.mian.gitnex.models.Commits;
|
||||
@ -102,7 +101,7 @@ public class CommitsActivity extends BaseActivity {
|
||||
swipeRefresh.setOnRefreshListener(() -> new Handler().postDelayed(() -> {
|
||||
|
||||
swipeRefresh.setRefreshing(false);
|
||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName);
|
||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName, resultLimit);
|
||||
adapter.notifyDataChanged();
|
||||
|
||||
}, 200));
|
||||
@ -113,7 +112,7 @@ public class CommitsActivity extends BaseActivity {
|
||||
if(commitsList.size() == resultLimit || pageSize == resultLimit) {
|
||||
|
||||
int page = (commitsList.size() + resultLimit) / resultLimit;
|
||||
loadMore(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, page, branchName);
|
||||
loadMore(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, page, branchName, resultLimit);
|
||||
|
||||
}
|
||||
|
||||
@ -124,13 +123,13 @@ public class CommitsActivity extends BaseActivity {
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
api = AppApiService.createService(ApiInterface.class, instanceUrl, ctx);
|
||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName);
|
||||
loadInitial(Authorization.returnAuthentication(ctx, loginUid, instanceToken), repoOwner, repoName, branchName, resultLimit);
|
||||
|
||||
}
|
||||
|
||||
private void loadInitial(String token, String repoOwner, String repoName, String branchName) {
|
||||
private void loadInitial(String token, String repoOwner, String repoName, String branchName, int resultLimit) {
|
||||
|
||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, 1, branchName);
|
||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, 1, branchName, resultLimit);
|
||||
|
||||
call.enqueue(new Callback<List<Commits>>() {
|
||||
|
||||
@ -175,13 +174,13 @@ public class CommitsActivity extends BaseActivity {
|
||||
|
||||
}
|
||||
|
||||
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName) {
|
||||
private void loadMore(String token, String repoOwner, String repoName, final int page, String branchName, int resultLimit) {
|
||||
|
||||
//add loading progress view
|
||||
commitsList.add(new Commits("load"));
|
||||
adapter.notifyItemInserted((commitsList.size() - 1));
|
||||
|
||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName);
|
||||
Call<List<Commits>> call = api.getRepositoryCommits(token, repoOwner, repoName, page, branchName, resultLimit);
|
||||
|
||||
call.enqueue(new Callback<List<Commits>>() {
|
||||
|
||||
@ -204,7 +203,6 @@ public class CommitsActivity extends BaseActivity {
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.info(ctx, getString(R.string.noMoreData));
|
||||
adapter.setMoreDataAvailable(false);
|
||||
|
||||
}
|
||||
|
@ -10,17 +10,17 @@ import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.adapters.FilesDiffAdapter;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.ParseDiff;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.helpers.Version;
|
||||
import org.mian.gitnex.models.FileDiffView;
|
||||
import org.mian.gitnex.util.AppUtil;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
@ -33,14 +33,15 @@ import retrofit2.Callback;
|
||||
public class FileDiffActivity extends BaseActivity {
|
||||
|
||||
private View.OnClickListener onClickListener;
|
||||
private TextView toolbar_title;
|
||||
private TextView toolbarTitle;
|
||||
private ListView mListView;
|
||||
private ProgressBar mProgressBar;
|
||||
final Context ctx = this;
|
||||
private Context appCtx;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId(){
|
||||
protected int getLayoutResourceId() {
|
||||
|
||||
return R.layout.activity_file_diff;
|
||||
}
|
||||
|
||||
@ -58,18 +59,17 @@ public class FileDiffActivity extends BaseActivity {
|
||||
String[] parts = repoFullName.split("/");
|
||||
final String repoOwner = parts[0];
|
||||
final String repoName = parts[1];
|
||||
final String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
final String loginUid = tinyDb.getString("loginUid");
|
||||
final String instanceToken = "token " + tinyDb.getString(loginUid + "-token");
|
||||
|
||||
ImageView closeActivity = findViewById(R.id.close);
|
||||
toolbar_title = findViewById(R.id.toolbar_title);
|
||||
toolbarTitle = findViewById(R.id.toolbar_title);
|
||||
mListView = findViewById(R.id.listView);
|
||||
mProgressBar = findViewById(R.id.progress_bar);
|
||||
|
||||
mListView.setDivider(null);
|
||||
|
||||
toolbar_title.setText(R.string.processingText);
|
||||
toolbarTitle.setText(R.string.processingText);
|
||||
initCloseListener();
|
||||
closeActivity.setOnClickListener(onClickListener);
|
||||
|
||||
@ -77,91 +77,48 @@ public class FileDiffActivity extends BaseActivity {
|
||||
|
||||
String pullIndex = tinyDb.getString("issueNumber");
|
||||
|
||||
getPullDiffContent(tinyDb.getString("instanceUrlWithProtocol"), repoOwner, repoName, pullIndex);
|
||||
boolean apiCall = true;
|
||||
String instanceUrl = tinyDb.getString("instanceUrl");
|
||||
|
||||
// fallback for old gitea instances
|
||||
if(new Version(tinyDb.getString("giteaVersion")).less("1.13.0")) {
|
||||
apiCall = false;
|
||||
instanceUrl = tinyDb.getString("instanceUrlWithProtocol");
|
||||
}
|
||||
|
||||
getPullDiffContent(instanceUrl, repoOwner, repoName, pullIndex, instanceToken, apiCall);
|
||||
|
||||
}
|
||||
|
||||
private void getPullDiffContent(String instanceUrl, String owner, String repo, String filename) {
|
||||
private void getPullDiffContent(String instanceUrl, String owner, String repo, String pullIndex, String token, boolean apiCall) {
|
||||
|
||||
Call<ResponseBody> call = RetrofitClient
|
||||
.getInstance(instanceUrl, ctx)
|
||||
.getWebInterface()
|
||||
.getPullDiffContent(owner, repo, filename);
|
||||
Call<ResponseBody> call;
|
||||
if(apiCall) {
|
||||
call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getPullDiffContent(token, owner, repo, pullIndex);
|
||||
}
|
||||
else {
|
||||
call = RetrofitClient.getInstance(instanceUrl, ctx).getWebInterface().getPullDiffContent(owner, repo, pullIndex);
|
||||
}
|
||||
|
||||
call.enqueue(new Callback<ResponseBody>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<ResponseBody> call, @NonNull retrofit2.Response<ResponseBody> response) {
|
||||
|
||||
if (response.code() == 200) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
try {
|
||||
assert response.body() != null;
|
||||
|
||||
AppUtil appUtil = new AppUtil();
|
||||
List<FileDiffView> fileContentsArray = new ArrayList<>();
|
||||
|
||||
String[] lines = response.body().string().split("diff");
|
||||
|
||||
if(lines.length > 0) {
|
||||
|
||||
for (int i = 1; i < lines.length; i++) {
|
||||
|
||||
if(lines[i].contains("@@ -")) {
|
||||
|
||||
String[] level2nd = lines[i].split("@@ -"); // main content part of single diff view
|
||||
|
||||
String[] fileName_ = level2nd[0].split("\\+\\+\\+ b/"); // filename part
|
||||
String fileNameFinal = fileName_[1];
|
||||
|
||||
String[] fileContents_ = level2nd[1].split("@@"); // file info / content part
|
||||
String fileInfoFinal = fileContents_[0];
|
||||
StringBuilder fileContentsFinal = new StringBuilder(fileContents_[1]);
|
||||
|
||||
if(level2nd.length > 2) {
|
||||
for (int j = 2; j < level2nd.length; j++) {
|
||||
fileContentsFinal.append(level2nd[j]);
|
||||
}
|
||||
}
|
||||
|
||||
String fileExtension = FileUtils.getExtension(fileNameFinal);
|
||||
|
||||
String fileContentsFinalWithBlankLines = fileContentsFinal.toString().replaceAll( ".*@@.*", "" );
|
||||
String fileContentsFinalWithoutBlankLines = fileContentsFinal.toString().replaceAll( ".*@@.*(\r?\n|\r)?", "" );
|
||||
fileContentsFinalWithoutBlankLines = fileContentsFinalWithoutBlankLines.replaceAll( ".*\\ No newline at end of file.*(\r?\n|\r)?", "" );
|
||||
|
||||
fileContentsArray.add(new FileDiffView(fileNameFinal, appUtil.imageExtension(fileExtension), fileInfoFinal, fileContentsFinalWithoutBlankLines));
|
||||
}
|
||||
else {
|
||||
|
||||
String[] getFileName = lines[i].split("--git a/");
|
||||
|
||||
String[] getFileName_ = getFileName[1].split("b/");
|
||||
String getFileNameFinal = getFileName_[0].trim();
|
||||
|
||||
String[] binaryFile = getFileName_[1].split("GIT binary patch");
|
||||
String binaryFileRaw = binaryFile[1].substring(binaryFile[1].indexOf('\n')+1);
|
||||
String binaryFileFinal = binaryFile[1].substring(binaryFileRaw.indexOf('\n')+1);
|
||||
|
||||
String fileExtension = FileUtils.getExtension(getFileNameFinal);
|
||||
|
||||
if(appUtil.imageExtension(FileUtils.getExtension(getFileNameFinal))) {
|
||||
|
||||
fileContentsArray.add(new FileDiffView(getFileNameFinal, appUtil.imageExtension(fileExtension), "", binaryFileFinal));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
List<FileDiffView> fileContentsArray = ParseDiff.getFileDiffViewArray(response.body().string());
|
||||
|
||||
int filesCount = fileContentsArray.size();
|
||||
if(filesCount > 1) {
|
||||
toolbar_title.setText(getResources().getString(R.string.fileDiffViewHeader, Integer.toString(filesCount)));
|
||||
toolbarTitle.setText(getResources().getString(R.string.fileDiffViewHeader, Integer.toString(filesCount)));
|
||||
}
|
||||
else {
|
||||
toolbar_title.setText(getResources().getString(R.string.fileDiffViewHeaderSingle, Integer.toString(filesCount)));
|
||||
toolbarTitle.setText(getResources().getString(R.string.fileDiffViewHeaderSingle, Integer.toString(filesCount)));
|
||||
}
|
||||
|
||||
FilesDiffAdapter adapter = new FilesDiffAdapter(ctx, fileContentsArray);
|
||||
@ -169,17 +126,15 @@ public class FileDiffActivity extends BaseActivity {
|
||||
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
} catch (IOException e) {
|
||||
}
|
||||
catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
else if(response.code() == 401) {
|
||||
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle),
|
||||
getResources().getString(R.string.alertDialogTokenRevokedMessage),
|
||||
getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton),
|
||||
getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
||||
AlertDialogs.authorizationTokenRevokedDialog(ctx, getResources().getString(R.string.alertDialogTokenRevokedTitle), getResources().getString(R.string.alertDialogTokenRevokedMessage), getResources().getString(R.string.alertDialogTokenRevokedCopyNegativeButton), getResources().getString(R.string.alertDialogTokenRevokedCopyPositiveButton));
|
||||
|
||||
}
|
||||
else if(response.code() == 403) {
|
||||
@ -202,6 +157,7 @@ public class FileDiffActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onFailure(@NonNull Call<ResponseBody> call, @NonNull Throwable t) {
|
||||
|
||||
Log.e("onFailure", t.toString());
|
||||
}
|
||||
});
|
||||
@ -209,9 +165,12 @@ public class FileDiffActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void initCloseListener() {
|
||||
|
||||
onClickListener = new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
getIntent().removeExtra("singleFileName");
|
||||
finish();
|
||||
}
|
||||
|
@ -439,10 +439,9 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
|
||||
gitea_version = new Version(version.getVersion());
|
||||
}
|
||||
catch(Error e) {
|
||||
SnackBar.error(ctx, layoutView, getResources().getString(R.string.versionUnknow));
|
||||
SnackBar.error(ctx, layoutView, getResources().getString(R.string.versionUnknown));
|
||||
enableProcessButton();
|
||||
}
|
||||
//(getString(R.string.versionLow), getString(), version.getVersion());
|
||||
|
||||
// UNSUPPORTED_OLD
|
||||
if(gitea_version.less(getString(R.string.versionLow))) {
|
||||
|
@ -12,6 +12,7 @@ import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@ -22,7 +23,6 @@ import androidx.drawerlayout.widget.DrawerLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import com.google.android.material.navigation.NavigationView;
|
||||
import com.squareup.picasso.NetworkPolicy;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
@ -38,6 +38,7 @@ import org.mian.gitnex.fragments.StarredRepositoriesFragment;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.ChangeLog;
|
||||
import org.mian.gitnex.helpers.ColorInverter;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.models.GiteaVersion;
|
||||
@ -45,6 +46,8 @@ import org.mian.gitnex.models.UserInfo;
|
||||
import org.mian.gitnex.util.AppUtil;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.Objects;
|
||||
import eightbitlab.com.blurview.BlurView;
|
||||
import eightbitlab.com.blurview.RenderScriptBlur;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
@ -55,9 +58,12 @@ import retrofit2.Callback;
|
||||
public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener {
|
||||
|
||||
private DrawerLayout drawer;
|
||||
private BlurView blurView;
|
||||
private TextView userFullName;
|
||||
private TextView userEmail;
|
||||
private ImageView userAvatar;
|
||||
private ImageView userAvatarBackground;
|
||||
private ViewGroup navHeaderFrame;
|
||||
private TextView toolbarTitle;
|
||||
final Context ctx = this;
|
||||
private Context appCtx;
|
||||
@ -131,6 +137,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
FragmentManager fm = getSupportFragmentManager();
|
||||
Fragment fragmentById = fm.findFragmentById(R.id.fragment_container);
|
||||
|
||||
if(fragmentById instanceof SettingsFragment) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
||||
}
|
||||
@ -163,15 +170,10 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||
toggle.getDrawerArrowDrawable().setColor(getResources().getColor(R.color.darkGreen));
|
||||
|
||||
drawer.addDrawerListener(toggle);
|
||||
|
||||
drawer.addDrawerListener(new DrawerLayout.DrawerListener() {
|
||||
|
||||
@Override
|
||||
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawerOpened(@NonNull View drawerView) {
|
||||
|
||||
@ -184,78 +186,118 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
String userFullNameNav = tinyDb.getString("userFullname");
|
||||
String userAvatarNav = tinyDb.getString("userAvatar");
|
||||
|
||||
blurView = hView.findViewById(R.id.blurView);
|
||||
userEmail = hView.findViewById(R.id.userEmail);
|
||||
userFullName = hView.findViewById(R.id.userFullname);
|
||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||
userAvatarBackground = hView.findViewById(R.id.userAvatarBackground);
|
||||
navHeaderFrame = hView.findViewById(R.id.navHeaderFrame);
|
||||
|
||||
userEmail.setTypeface(myTypeface);
|
||||
userFullName.setTypeface(myTypeface);
|
||||
|
||||
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(tinyDb.getBoolean("userIsAdmin"));
|
||||
|
||||
if(!userEmailNav.equals("")) {
|
||||
userEmail.setText(userEmailNav);
|
||||
userEmail.setTypeface(myTypeface);
|
||||
}
|
||||
|
||||
userFullName = hView.findViewById(R.id.userFullname);
|
||||
if(!userFullNameNav.equals("")) {
|
||||
userFullName.setText(userFullNameNav);
|
||||
userFullName.setTypeface(myTypeface);
|
||||
}
|
||||
|
||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||
if(!userAvatarNav.equals("")) {
|
||||
PicassoService.getInstance(ctx).get().load(userAvatarNav).networkPolicy(NetworkPolicy.OFFLINE).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(160, 160).centerCrop().into(userAvatar);
|
||||
|
||||
PicassoService.getInstance(ctx).get()
|
||||
.load(userAvatarNav)
|
||||
.placeholder(R.drawable.loader_animated)
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.resize(160, 160)
|
||||
.centerCrop().into(userAvatar);
|
||||
|
||||
PicassoService.getInstance(ctx).get()
|
||||
.load(userAvatarNav)
|
||||
.into(userAvatarBackground, new com.squareup.picasso.Callback() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
int textColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground);
|
||||
|
||||
userFullName.setTextColor(textColor);
|
||||
userEmail.setTextColor(textColor);
|
||||
|
||||
blurView.setupWith(navHeaderFrame)
|
||||
.setBlurAlgorithm(new RenderScriptBlur(ctx))
|
||||
.setBlurRadius(5)
|
||||
.setHasFixedTransformationMatrix(false);
|
||||
|
||||
}
|
||||
|
||||
userAvatar.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onError(Exception e) {}
|
||||
|
||||
public void onClick(View v) {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
userAvatar.setOnClickListener(v -> {
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||
drawer.closeDrawers();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawerClosed(@NonNull View drawerView) {
|
||||
// Called when a drawer has settled in a completely closed state.
|
||||
}
|
||||
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {}
|
||||
|
||||
@Override
|
||||
public void onDrawerStateChanged(int newState) {
|
||||
// Called when the drawer motion state changes. The new state will be one of STATE_IDLE, STATE_DRAGGING or STATE_SETTLING.
|
||||
}
|
||||
public void onDrawerClosed(@NonNull View drawerView) {}
|
||||
|
||||
@Override
|
||||
public void onDrawerStateChanged(int newState) {}
|
||||
|
||||
});
|
||||
|
||||
toggle.syncState();
|
||||
|
||||
if(savedInstanceState == null) {
|
||||
if(tinyDb.getInt("homeScreenId") == 0) {
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_home);
|
||||
}
|
||||
else if(tinyDb.getInt("homeScreenId") == 1) {
|
||||
|
||||
switch(tinyDb.getInt("homeScreenId")) {
|
||||
|
||||
case 1:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_starred_repos);
|
||||
}
|
||||
else if(tinyDb.getInt("homeScreenId") == 2) {
|
||||
break;
|
||||
|
||||
case 2:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_organizations);
|
||||
}
|
||||
else if(tinyDb.getInt("homeScreenId") == 3) {
|
||||
break;
|
||||
|
||||
case 3:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_repositories);
|
||||
}
|
||||
else if(tinyDb.getInt("homeScreenId") == 4) {
|
||||
break;
|
||||
|
||||
case 4:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_profile);
|
||||
}
|
||||
else {
|
||||
break;
|
||||
|
||||
default:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
||||
navigationView.setCheckedItem(R.id.nav_home);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!connToInternet) {
|
||||
@ -269,7 +311,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
}
|
||||
else {
|
||||
|
||||
displayUserInfo(instanceUrl, instanceToken, loginUid);
|
||||
loadUserInfo(instanceUrl, instanceToken, loginUid);
|
||||
giteaVersion(instanceUrl);
|
||||
tinyDb.putBoolean("noConnection", false);
|
||||
|
||||
@ -314,46 +356,56 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
|
||||
|
||||
switch(menuItem.getItemId()) {
|
||||
|
||||
case R.id.nav_home:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleMyRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new MyRepositoriesFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_organizations:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleOrganizations));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new OrganizationsFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_profile:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleProfile));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_repositories:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleRepositories));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new RepositoriesFragment()).commit();
|
||||
|
||||
break;
|
||||
|
||||
case R.id.nav_settings:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleSettings));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new SettingsFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_logout:
|
||||
logout(this, ctx);
|
||||
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
|
||||
break;
|
||||
|
||||
case R.id.nav_about:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAbout));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AboutFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_rate_app:
|
||||
rateThisApp();
|
||||
break;
|
||||
|
||||
case R.id.nav_starred_repos:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleStarredRepos));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new StarredRepositoriesFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_explore:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleExplore));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ExploreRepositoriesFragment()).commit();
|
||||
break;
|
||||
|
||||
case R.id.nav_administration:
|
||||
toolbarTitle.setText(getResources().getString(R.string.pageTitleAdministration));
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new AdministrationFragment()).commit();
|
||||
@ -422,15 +474,12 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
}
|
||||
|
||||
private void displayUserInfo(String instanceUrl, String token, String loginUid) {
|
||||
private void loadUserInfo(String instanceUrl, String token, String loginUid) {
|
||||
|
||||
final TinyDB tinyDb = new TinyDB(appCtx);
|
||||
|
||||
Call<UserInfo> call = RetrofitClient.getInstance(instanceUrl, ctx).getApiInterface().getUserInfo(Authorization.returnAuthentication(ctx, loginUid, token));
|
||||
|
||||
NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
final View hView = navigationView.getHeaderView(0);
|
||||
|
||||
call.enqueue(new Callback<UserInfo>() {
|
||||
|
||||
@Override
|
||||
@ -443,12 +492,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert userDetails != null;
|
||||
|
||||
if(userDetails.getIs_admin() != null) {
|
||||
tinyDb.putBoolean("userIsAdmin", userDetails.getIs_admin());
|
||||
navigationView.getMenu().findItem(R.id.nav_administration).setVisible(userDetails.getIs_admin());
|
||||
}
|
||||
|
||||
tinyDb.putString("userLogin", userDetails.getLogin());
|
||||
tinyDb.putInt("userId", userDetails.getId());
|
||||
|
||||
if(!userDetails.getFullname().equals("")) {
|
||||
tinyDb.putString("userFullname", userDetails.getFullname());
|
||||
}
|
||||
@ -458,51 +509,14 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
|
||||
tinyDb.putString("userEmail", userDetails.getEmail());
|
||||
tinyDb.putString("userAvatar", userDetails.getAvatar());
|
||||
|
||||
if(userDetails.getLang() != null) {
|
||||
tinyDb.putString("userLang", userDetails.getLang());
|
||||
}
|
||||
else {
|
||||
tinyDb.putString("userLang", "...");
|
||||
}
|
||||
|
||||
userAvatar = hView.findViewById(R.id.userAvatar);
|
||||
if(!Objects.requireNonNull(userDetails).getAvatar().equals("")) {
|
||||
PicassoService.getInstance(ctx).get().load(userDetails.getAvatar()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(160, 160).centerCrop().into(userAvatar);
|
||||
}
|
||||
else {
|
||||
userAvatar.setImageResource(R.mipmap.app_logo_round);
|
||||
}
|
||||
|
||||
userFullName = hView.findViewById(R.id.userFullname);
|
||||
if(!userDetails.getFullname().equals("")) {
|
||||
userFullName.setText(userDetails.getFullname());
|
||||
}
|
||||
else if(!userDetails.getLogin().equals("")) {
|
||||
userFullName.setText(userDetails.getLogin());
|
||||
}
|
||||
else {
|
||||
userFullName.setText("...");
|
||||
}
|
||||
|
||||
userEmail = hView.findViewById(R.id.userEmail);
|
||||
if(!userDetails.getEmail().equals("")) {
|
||||
userEmail.setText(userDetails.getEmail());
|
||||
}
|
||||
else {
|
||||
userEmail.setText("...");
|
||||
}
|
||||
|
||||
userAvatar.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container, new ProfileFragment()).commit();
|
||||
drawer.closeDrawers();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if(response.code() == 401) {
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class SettingsAppearanceActivity extends BaseActivity {
|
||||
|
||||
AlertDialog.Builder hsBuilder = new AlertDialog.Builder(SettingsAppearanceActivity.this);
|
||||
|
||||
hsBuilder.setTitle(R.string.settingshomeScreenSelectorDialogTitle);
|
||||
hsBuilder.setTitle(R.string.settingsHomeScreenSelectorDialogTitle);
|
||||
if(homeScreenSelectedChoice != -1) {
|
||||
hsBuilder.setCancelable(true);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@ -58,6 +59,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
||||
private TextView repoStars;
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
private LinearLayout archiveRepo;
|
||||
|
||||
private ReposSearchViewHolder(View itemView) {
|
||||
|
||||
@ -73,6 +75,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
||||
repoForks = itemView.findViewById(R.id.repoForks);
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
@ -242,6 +245,13 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
|
||||
}
|
||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||
|
||||
if(currentItem.isArchived()) {
|
||||
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.archiveRepo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -165,6 +165,7 @@ public class FilesAdapter extends RecyclerView.Adapter<FilesAdapter.FilesViewHol
|
||||
holder.fileInfo.setText(AppUtil.formatFileSizeInDetail(currentItem.getSize()));
|
||||
}
|
||||
else if(currentItem.getType().equals("dir")) {
|
||||
holder.fileInfo.setVisibility(View.GONE);
|
||||
holder.fileTypeImage.setImageDrawable(mCtx.getResources().getDrawable(R.drawable.ic_folder_24));
|
||||
}
|
||||
else {
|
||||
|
@ -86,7 +86,7 @@ public class FilesDiffAdapter extends BaseAdapter {
|
||||
FileDiffView data = (FileDiffView) getItem(position);
|
||||
headerFileName.setText(data.getFileName());
|
||||
|
||||
if(data.isFileType()) {
|
||||
if(data.isFileBinary()) {
|
||||
|
||||
diffStats.setVisibility(View.GONE);
|
||||
diffLines.addView(getMessageView(context.getResources().getString(R.string.binaryFileError)));
|
||||
@ -97,7 +97,7 @@ public class FilesDiffAdapter extends BaseAdapter {
|
||||
diffStats.setVisibility(View.VISIBLE);
|
||||
headerFileInfo.setText(data.getFileInfo());
|
||||
|
||||
String[] codeLines = getLines(data.getFileContents());
|
||||
String[] codeLines = getLines(data.toString());
|
||||
|
||||
if(MAXIMUM_LINES > codeLines.length) {
|
||||
|
||||
|
@ -2,7 +2,6 @@ package org.mian.gitnex.adapters;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.Spanned;
|
||||
@ -15,7 +14,6 @@ import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialog;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import org.mian.gitnex.R;
|
||||
@ -112,7 +110,6 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
private TextView msOpenIssues;
|
||||
private TextView msClosedIssues;
|
||||
private TextView msDueDate;
|
||||
private ImageView msStatus;
|
||||
private ProgressBar msProgress;
|
||||
private TextView milestoneStatus;
|
||||
|
||||
@ -122,7 +119,6 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
|
||||
milestoneId = itemView.findViewById(R.id.milestoneId);
|
||||
msTitle = itemView.findViewById(R.id.milestoneTitle);
|
||||
msStatus = itemView.findViewById(R.id.milestoneState);
|
||||
msDescription = itemView.findViewById(R.id.milestoneDescription);
|
||||
msOpenIssues = itemView.findViewById(R.id.milestoneIssuesOpen);
|
||||
msClosedIssues = itemView.findViewById(R.id.milestoneIssuesClosed);
|
||||
@ -188,10 +184,9 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
milestoneId.setText(String.valueOf(dataModel.getId()));
|
||||
milestoneStatus.setText(dataModel.getState());
|
||||
|
||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(context))
|
||||
.usePlugin(CorePlugin.create())
|
||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||
Markwon markwon = Markwon.builder(Objects.requireNonNull(context)).usePlugin(CorePlugin.create()).usePlugin(ImagesPlugin.create(plugin -> {
|
||||
plugin.addSchemeHandler(new SchemeHandler() {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ImageItem handle(@NonNull String raw, @NonNull Uri uri) {
|
||||
@ -213,13 +208,16 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
return Collections.singleton("drawable");
|
||||
}
|
||||
});
|
||||
|
||||
plugin.placeholderProvider(drawable -> null);
|
||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create(context.getResources()));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(context.getResources()));
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||
|
||||
}))
|
||||
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
public void configureTheme(@NonNull MarkwonTheme.Builder builder) {
|
||||
@ -239,85 +237,58 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
Spanned msTitle_ = markwon.toMarkdown(dataModel.getTitle());
|
||||
markwon.setParsedMarkdown(msTitle, msTitle_);
|
||||
|
||||
if(dataModel.getState().equals("open")) {
|
||||
if(!dataModel.getDescription().equals("")) {
|
||||
|
||||
@SuppressLint("ResourceType") int color = Color.parseColor(context.getResources().getString(R.color.releaseStable));
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
//.useFont(Typeface.DEFAULT)
|
||||
.textColor(context.getResources().getColor(R.color.white))
|
||||
.fontSize(30)
|
||||
.toUpperCase()
|
||||
.width(120)
|
||||
.height(60)
|
||||
.endConfig()
|
||||
.buildRoundRect("open", color, 8);
|
||||
|
||||
msStatus.setImageDrawable(drawable);
|
||||
|
||||
}
|
||||
else if(dataModel.getState().equals("closed")) {
|
||||
|
||||
@SuppressLint("ResourceType") int color = Color.parseColor(context.getResources().getString(R.color.colorRed));
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
//.useFont(Typeface.DEFAULT)
|
||||
.textColor(context.getResources().getColor(R.color.white))
|
||||
.fontSize(30)
|
||||
.toUpperCase()
|
||||
.width(140)
|
||||
.height(60)
|
||||
.endConfig()
|
||||
.buildRoundRect("closed", color, 8);
|
||||
|
||||
msStatus.setImageDrawable(drawable);
|
||||
|
||||
}
|
||||
|
||||
if (!dataModel.getDescription().equals("")) {
|
||||
final CharSequence bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(dataModel.getDescription()));
|
||||
CharSequence bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(dataModel.getDescription()));
|
||||
msDescription.setText(bodyWithMD);
|
||||
|
||||
}
|
||||
else {
|
||||
msDescription.setText("");
|
||||
|
||||
msDescription.setText(context.getString(R.string.milestoneNoDescription));
|
||||
}
|
||||
|
||||
msOpenIssues.setText(String.valueOf(dataModel.getOpen_issues()));
|
||||
msOpenIssues.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneOpenIssues, dataModel.getOpen_issues()), context));
|
||||
msOpenIssues.setText(context.getString(R.string.milestoneIssueStatusOpen, dataModel.getOpen_issues()));
|
||||
msClosedIssues.setText(context.getString(R.string.milestoneIssueStatusClosed, dataModel.getClosed_issues()));
|
||||
|
||||
msClosedIssues.setText(String.valueOf(dataModel.getClosed_issues()));
|
||||
msClosedIssues.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneClosedIssues, dataModel.getClosed_issues()), context));
|
||||
if((dataModel.getOpen_issues() + dataModel.getClosed_issues()) > 0) {
|
||||
|
||||
if ((dataModel.getOpen_issues() + dataModel.getClosed_issues()) > 0) {
|
||||
if(dataModel.getOpen_issues() == 0) {
|
||||
|
||||
if (dataModel.getOpen_issues() == 0) {
|
||||
msProgress.setProgress(100);
|
||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 100), context));
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
int msCompletion = 100 * dataModel.getClosed_issues() / (dataModel.getOpen_issues() + dataModel.getClosed_issues());
|
||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, msCompletion), context));
|
||||
msProgress.setProgress(msCompletion);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
msProgress.setProgress(0);
|
||||
msProgress.setOnClickListener(new ClickListener(context.getResources().getString(R.string.milestoneCompletion, 0), context));
|
||||
|
||||
}
|
||||
|
||||
if(dataModel.getDue_on() != null) {
|
||||
|
||||
if (timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
||||
if(timeFormat.equals("normal") || timeFormat.equals("pretty")) {
|
||||
|
||||
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd", new Locale(locale));
|
||||
Date date = null;
|
||||
|
||||
try {
|
||||
date = formatter.parse(dataModel.getDue_on());
|
||||
}
|
||||
catch (ParseException e) {
|
||||
catch(ParseException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
}
|
||||
|
||||
assert date != null;
|
||||
String dueDate = formatter.format(date);
|
||||
|
||||
@ -329,16 +300,19 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
msDueDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToast(dataModel.getDue_on()), context));
|
||||
|
||||
}
|
||||
else if (timeFormat.equals("normal1")) {
|
||||
else if(timeFormat.equals("normal1")) {
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy", new Locale(locale));
|
||||
|
||||
Date date1 = null;
|
||||
|
||||
try {
|
||||
date1 = formatter.parse(dataModel.getDue_on());
|
||||
}
|
||||
catch (ParseException e) {
|
||||
catch(ParseException e) {
|
||||
Log.e(TAG, e.toString());
|
||||
}
|
||||
|
||||
assert date1 != null;
|
||||
String dueDate = formatter.format(date1);
|
||||
msDueDate.setText(dueDate);
|
||||
@ -347,7 +321,8 @@ public class MilestonesAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
|
||||
|
||||
}
|
||||
else {
|
||||
msDueDate.setText("");
|
||||
|
||||
msDueDate.setText(context.getString(R.string.milestoneNoDueDate));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
@ -56,6 +57,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
private TextView repoOpenIssuesCount;
|
||||
private TextView repoType;
|
||||
private CheckBox isRepoAdmin;
|
||||
private LinearLayout archiveRepo;
|
||||
|
||||
private MyReposViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@ -70,6 +72,7 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
repoType = itemView.findViewById(R.id.repoType);
|
||||
isRepoAdmin = itemView.findViewById(R.id.repoIsAdmin);
|
||||
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
@ -252,6 +255,13 @@ public class MyReposListAdapter extends RecyclerView.Adapter<MyReposListAdapter.
|
||||
}
|
||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||
|
||||
if(currentItem.isArchived()) {
|
||||
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.archiveRepo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -188,9 +188,11 @@ public class PullRequestsAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
||||
|
||||
prNumber.setText(String.valueOf(prModel.getNumber()));
|
||||
prMergeable.setText(String.valueOf(prModel.isMergeable()));
|
||||
if(prModel.getHead() != null) {
|
||||
prHeadBranch.setText(prModel.getHead().getRef());
|
||||
prIsFork.setText(String.valueOf(prModel.getHead().getRepo().isFork()));
|
||||
prForkFullName.setText(prModel.getHead().getRepo().getFull_name());
|
||||
}
|
||||
prCommentsCount.setText(String.valueOf(prModel.getComments()));
|
||||
|
||||
prCreatedTime.setText(TimeHelper.formatTime(prModel.getCreated_at(), new Locale(locale), timeFormat, context));
|
||||
|
@ -10,19 +10,25 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.vdurmont.emoji.EmojiParser;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.helpers.ClickListener;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.models.Releases;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.core.CorePlugin;
|
||||
@ -31,7 +37,6 @@ import io.noties.markwon.ext.strikethrough.StrikethroughPlugin;
|
||||
import io.noties.markwon.ext.tables.TablePlugin;
|
||||
import io.noties.markwon.ext.tasklist.TaskListPlugin;
|
||||
import io.noties.markwon.html.HtmlPlugin;
|
||||
import io.noties.markwon.image.AsyncDrawable;
|
||||
import io.noties.markwon.image.DefaultMediaDecoder;
|
||||
import io.noties.markwon.image.ImageItem;
|
||||
import io.noties.markwon.image.ImagesPlugin;
|
||||
@ -51,23 +56,42 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
|
||||
static class ReleasesViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private ImageView releaseType;
|
||||
private TextView releaseTitle;
|
||||
private TextView releaseDescription;
|
||||
private TextView releaseDownload;
|
||||
private TextView releaseType;
|
||||
private TextView releaseName;
|
||||
private ImageView authorAvatar;
|
||||
private TextView authorName;
|
||||
private TextView releaseTag;
|
||||
private TextView releaseCommitSha;
|
||||
private TextView releaseDate;
|
||||
private TextView releaseBodyContent;
|
||||
private LinearLayout downloadFrame;
|
||||
private RelativeLayout downloads;
|
||||
private TextView releaseZipDownload;
|
||||
private TextView releaseTarDownload;
|
||||
private TextView releaseTag;
|
||||
private ImageView downloadDropdownIcon;
|
||||
private RecyclerView downloadList;
|
||||
|
||||
private ReleasesViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
|
||||
releaseType = itemView.findViewById(R.id.releaseType);
|
||||
releaseTitle = itemView.findViewById(R.id.releaseTitle);
|
||||
releaseDescription = itemView.findViewById(R.id.releaseDescription);
|
||||
releaseName = itemView.findViewById(R.id.releaseName);
|
||||
authorAvatar = itemView.findViewById(R.id.authorAvatar);
|
||||
authorName = itemView.findViewById(R.id.authorName);
|
||||
releaseTag = itemView.findViewById(R.id.releaseTag);
|
||||
releaseCommitSha = itemView.findViewById(R.id.releaseCommitSha);
|
||||
releaseDate = itemView.findViewById(R.id.releaseDate);
|
||||
releaseBodyContent = itemView.findViewById(R.id.releaseBodyContent);
|
||||
downloadFrame = itemView.findViewById(R.id.downloadFrame);
|
||||
downloads = itemView.findViewById(R.id.downloads);
|
||||
releaseZipDownload = itemView.findViewById(R.id.releaseZipDownload);
|
||||
releaseTarDownload = itemView.findViewById(R.id.releaseTarDownload);
|
||||
releaseTag = itemView.findViewById(R.id.releaseTag);
|
||||
downloadDropdownIcon = itemView.findViewById(R.id.downloadDropdownIcon);
|
||||
downloadList = itemView.findViewById(R.id.downloadList);
|
||||
|
||||
downloadList.setHasFixedSize(true);
|
||||
downloadList.setLayoutManager(new LinearLayoutManager(itemView.getContext()));
|
||||
|
||||
}
|
||||
}
|
||||
@ -88,48 +112,46 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
public void onBindViewHolder(@NonNull ReleasesAdapter.ReleasesViewHolder holder, int position) {
|
||||
|
||||
final TinyDB tinyDb = new TinyDB(mCtx);
|
||||
final String locale = tinyDb.getString("locale");
|
||||
final String timeFormat = tinyDb.getString("dateFormat");
|
||||
|
||||
Releases currentItem = releasesList.get(position);
|
||||
|
||||
holder.releaseTitle.setText(currentItem.getName());
|
||||
|
||||
if(!currentItem.getTag_name().equals("")) {
|
||||
holder.releaseTag.setText(mCtx.getResources().getString(R.string.releaseTag, currentItem.getTag_name()));
|
||||
}
|
||||
else {
|
||||
holder.releaseTag.setVisibility(View.GONE);
|
||||
}
|
||||
holder.releaseName.setText(currentItem.getName());
|
||||
|
||||
if(currentItem.isPrerelease()) {
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
//.useFont(Typeface.DEFAULT)
|
||||
.textColor(mCtx.getResources().getColor(R.color.white))
|
||||
.fontSize(34)
|
||||
.width(260)
|
||||
.height(60)
|
||||
.endConfig()
|
||||
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypePre), mCtx.getResources().getColor(R.color.releasePre), 8);
|
||||
holder.releaseType.setImageDrawable(drawable);
|
||||
holder.releaseType.setBackgroundResource(R.drawable.shape_pre_release);
|
||||
holder.releaseType.setText(R.string.releaseTypePre);
|
||||
}
|
||||
else if(currentItem.isDraft()) {
|
||||
holder.releaseType.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
TextDrawable drawable = TextDrawable.builder()
|
||||
.beginConfig()
|
||||
//.useFont(Typeface.DEFAULT)
|
||||
.textColor(mCtx.getResources().getColor(R.color.white))
|
||||
.fontSize(34)
|
||||
.width(260)
|
||||
.height(60)
|
||||
.endConfig()
|
||||
.buildRoundRect(mCtx.getResources().getString(R.string.releaseTypeStable), mCtx.getResources().getColor(R.color.releaseStable), 8);
|
||||
holder.releaseType.setImageDrawable(drawable);
|
||||
holder.releaseType.setBackgroundResource(R.drawable.shape_stable_release);
|
||||
holder.releaseType.setText(R.string.releaseTypeStable);
|
||||
}
|
||||
|
||||
if(currentItem.getAuthor().getAvatar_url() != null) {
|
||||
PicassoService.getInstance(mCtx).get().load(currentItem.getAuthor().getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(holder.authorAvatar);
|
||||
}
|
||||
|
||||
holder.authorName.setText(mCtx.getResources().getString(R.string.releasePublishedBy, currentItem.getAuthor().getUsername()));
|
||||
|
||||
if(currentItem.getTag_name() != null) {
|
||||
holder.releaseTag.setText(currentItem.getTag_name());
|
||||
}
|
||||
|
||||
if(currentItem.getPublished_at() != null) {
|
||||
holder.releaseDate.setText(TimeHelper.formatTime(currentItem.getPublished_at(), new Locale(locale), timeFormat, mCtx));
|
||||
}
|
||||
|
||||
if(timeFormat.equals("pretty")) {
|
||||
holder.releaseDate.setOnClickListener(new ClickListener(TimeHelper.customDateFormatForToastDateFormat(currentItem.getPublished_at()), mCtx));
|
||||
}
|
||||
|
||||
final Markwon markwon = Markwon.builder(Objects.requireNonNull(mCtx))
|
||||
.usePlugin(CorePlugin.create())
|
||||
.usePlugin(ImagesPlugin.create(new ImagesPlugin.ImagesConfigure() {
|
||||
@Override
|
||||
public void configureImages(@NonNull ImagesPlugin plugin) {
|
||||
.usePlugin(ImagesPlugin.create(plugin -> {
|
||||
plugin.addSchemeHandler(new SchemeHandler() {
|
||||
@NonNull
|
||||
@Override
|
||||
@ -152,19 +174,12 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
return Collections.singleton("drawable");
|
||||
}
|
||||
});
|
||||
plugin.placeholderProvider(new ImagesPlugin.PlaceholderProvider() {
|
||||
@Nullable
|
||||
@Override
|
||||
public Drawable providePlaceholder(@NonNull AsyncDrawable drawable) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
plugin.placeholderProvider(drawable -> null);
|
||||
plugin.addMediaDecoder(GifMediaDecoder.create(false));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create(mCtx.getResources()));
|
||||
plugin.addMediaDecoder(SvgMediaDecoder.create());
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create(mCtx.getResources()));
|
||||
plugin.defaultMediaDecoder(DefaultMediaDecoder.create());
|
||||
}
|
||||
}))
|
||||
.usePlugin(new AbstractMarkwonPlugin() {
|
||||
@Override
|
||||
@ -185,12 +200,29 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
Spanned bodyWithMD = markwon.toMarkdown(EmojiParser.parseToUnicode(currentItem.getBody()));
|
||||
|
||||
if(!currentItem.getBody().equals("")) {
|
||||
markwon.setParsedMarkdown(holder.releaseDescription, bodyWithMD);
|
||||
markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD);
|
||||
}
|
||||
else {
|
||||
holder.releaseDescription.setVisibility(View.GONE);
|
||||
holder.releaseBodyContent.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
holder.downloadFrame.setOnClickListener(v -> {
|
||||
|
||||
if(holder.downloads.getVisibility() == View.GONE) {
|
||||
|
||||
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_down);
|
||||
holder.downloads.setVisibility(View.VISIBLE);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
holder.downloadDropdownIcon.setImageResource(R.drawable.ic_arrow_right);
|
||||
holder.downloads.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
holder.releaseZipDownload.setText(
|
||||
Html.fromHtml("<a href='" + currentItem.getZipball_url() + "'>" + mCtx.getResources().getString(R.string.zipArchiveDownloadReleasesTab) + "</a> "));
|
||||
holder.releaseZipDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
@ -199,6 +231,9 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
|
||||
Html.fromHtml("<a href='" + currentItem.getTarball_url() + "'>" + mCtx.getResources().getString(R.string.tarArchiveDownloadReleasesTab) + "</a> "));
|
||||
holder.releaseTarDownload.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
ReleasesDownloadsAdapter adapter = new ReleasesDownloadsAdapter(currentItem.getAssets());
|
||||
holder.downloadList.setAdapter(adapter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,68 @@
|
||||
package org.mian.gitnex.adapters;
|
||||
|
||||
import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.models.Releases;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
**/
|
||||
|
||||
public class ReleasesDownloadsAdapter extends RecyclerView.Adapter<ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder> {
|
||||
|
||||
private List<Releases.assetsObject> releasesDownloadsList;
|
||||
|
||||
static class ReleasesDownloadsViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
private TextView downloadName;
|
||||
|
||||
private ReleasesDownloadsViewHolder(View itemView) {
|
||||
|
||||
super(itemView);
|
||||
|
||||
downloadName = itemView.findViewById(R.id.downloadName);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ReleasesDownloadsAdapter(List<Releases.assetsObject> releasesDownloadsMain) {
|
||||
|
||||
this.releasesDownloadsList = releasesDownloadsMain;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_releases_downloads, parent, false);
|
||||
return new ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder(v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ReleasesDownloadsAdapter.ReleasesDownloadsViewHolder holder, int position) {
|
||||
|
||||
Releases.assetsObject currentItem = releasesDownloadsList.get(position);
|
||||
|
||||
if(currentItem.getName() != null) {
|
||||
|
||||
holder.downloadName.setText(
|
||||
Html.fromHtml("<a href='" + currentItem.getBrowser_download_url() + "'>" + currentItem.getName() + "</a> "));
|
||||
holder.downloadName.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return releasesDownloadsList.size();
|
||||
}
|
||||
|
||||
}
|
@ -109,13 +109,6 @@ public class RepoStargazersAdapter extends BaseAdapter {
|
||||
viewHolder.memberName.setTypeface(myTypeface);
|
||||
}
|
||||
|
||||
if(tinyDb.getInt("themeId") == 1) { //light
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||
}
|
||||
else { // dark
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -109,13 +109,6 @@ public class RepoWatchersAdapter extends BaseAdapter {
|
||||
viewHolder.memberName.setTypeface(myTypeface);
|
||||
}
|
||||
|
||||
if(tinyDb.getInt("themeId") == 1) { //light
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||
}
|
||||
else { // dark
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
@ -56,6 +57,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
private TextView repoType;
|
||||
private LinearLayout archiveRepo;
|
||||
|
||||
private ReposViewHolder(View itemView) {
|
||||
|
||||
@ -71,6 +73,7 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
repoType = itemView.findViewById(R.id.repoType);
|
||||
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
@ -249,6 +252,13 @@ public class ReposListAdapter extends RecyclerView.Adapter<ReposListAdapter.Repo
|
||||
}
|
||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||
|
||||
if(currentItem.isArchived()) {
|
||||
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.archiveRepo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
@ -56,6 +57,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
private TextView repoType;
|
||||
private LinearLayout archiveRepo;
|
||||
|
||||
private OrgReposViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@ -70,6 +72,7 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
repoType = itemView.findViewById(R.id.repoType);
|
||||
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
@ -252,6 +255,13 @@ public class RepositoriesByOrgAdapter extends RecyclerView.Adapter<RepositoriesB
|
||||
}
|
||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||
|
||||
if(currentItem.isArchived()) {
|
||||
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.archiveRepo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,6 +11,7 @@ import android.widget.CheckBox;
|
||||
import android.widget.Filter;
|
||||
import android.widget.Filterable;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import com.amulyakhare.textdrawable.TextDrawable;
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator;
|
||||
@ -56,6 +57,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
private TextView repoForks;
|
||||
private TextView repoOpenIssuesCount;
|
||||
private TextView repoType;
|
||||
private LinearLayout archiveRepo;
|
||||
|
||||
private StarredReposViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
@ -70,6 +72,7 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
repoOpenIssuesCount = itemView.findViewById(R.id.repoOpenIssuesCount);
|
||||
ImageView reposDropdownMenu = itemView.findViewById(R.id.reposDropdownMenu);
|
||||
repoType = itemView.findViewById(R.id.repoType);
|
||||
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
|
||||
|
||||
itemView.setOnClickListener(v -> {
|
||||
|
||||
@ -252,6 +255,13 @@ public class StarredReposListAdapter extends RecyclerView.Adapter<StarredReposLi
|
||||
}
|
||||
holder.isRepoAdmin.setChecked(currentItem.getPermissions().isAdmin());
|
||||
|
||||
if(currentItem.isArchived()) {
|
||||
holder.archiveRepo.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
holder.archiveRepo.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -111,12 +111,5 @@ public class TeamMembersByOrgAdapter extends BaseAdapter {
|
||||
viewHolder.memberName.setTypeface(myTypeface);
|
||||
}
|
||||
|
||||
if(tinyDb.getInt("themeId") == 1) { //light
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.lightThemeTextColor));
|
||||
}
|
||||
else { // dark
|
||||
viewHolder.memberName.setTextColor(mCtx.getResources().getColor(R.color.white));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,16 +14,18 @@ import javax.net.ssl.X509TrustManager;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
/**
|
||||
* Author anonTree1417
|
||||
* Author opyale
|
||||
*/
|
||||
|
||||
public class PicassoService {
|
||||
|
||||
private static PicassoService picassoService;
|
||||
private static File cachePath;
|
||||
private Picasso picasso;
|
||||
|
||||
private PicassoService(Context context) {
|
||||
|
||||
cachePath = new File(context.getCacheDir() + "/picasso_cache/");
|
||||
Picasso.Builder builder = new Picasso.Builder(context);
|
||||
|
||||
try {
|
||||
@ -45,10 +47,6 @@ public class PicassoService {
|
||||
|
||||
});
|
||||
|
||||
File cachePath = new File(context.getCacheDir() + "/picasso_cache/");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
cachePath.mkdirs();
|
||||
|
||||
picasso = builder.memoryCache(new PicassoCache(cachePath, context)).build();
|
||||
|
||||
}
|
||||
@ -61,7 +59,9 @@ public class PicassoService {
|
||||
|
||||
public Picasso get() {
|
||||
|
||||
cachePath.mkdirs();
|
||||
return picasso;
|
||||
|
||||
}
|
||||
|
||||
public static synchronized PicassoService getInstance(Context context) {
|
||||
|
@ -64,7 +64,10 @@ public class BottomSheetSingleIssueFragment extends BottomSheetDialogFragment {
|
||||
mergePullRequest.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if(tinyDB.getString("repoType").equals("public")) {
|
||||
if(new Version(tinyDB.getString("giteaVersion")).higherOrEqual("1.13.0")) {
|
||||
openFilesDiff.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else if(tinyDB.getString("repoType").equals("public")) {
|
||||
openFilesDiff.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
|
@ -77,6 +77,8 @@ public class MilestonesFragment extends Fragment {
|
||||
dataList = new ArrayList<>();
|
||||
adapter = new MilestonesAdapter(ctx, dataList);
|
||||
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
@ -88,6 +90,8 @@ public class MilestonesFragment extends Fragment {
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
viewBinding.recyclerView.setHasFixedSize(true);
|
||||
viewBinding.recyclerView.setLayoutManager(new LinearLayoutManager(ctx));
|
||||
viewBinding.recyclerView.setAdapter(adapter);
|
||||
@ -113,6 +117,9 @@ public class MilestonesFragment extends Fragment {
|
||||
dataList.clear();
|
||||
|
||||
adapter = new MilestonesAdapter(ctx, dataList);
|
||||
|
||||
if(new Version(tinyDb.getString("giteaVersion")).higherOrEqual("1.12.0")) {
|
||||
|
||||
adapter.setLoadMoreListener(() -> viewBinding.recyclerView.post(() -> {
|
||||
|
||||
if(dataList.size() == resultLimit || pageSize == resultLimit) {
|
||||
@ -124,6 +131,8 @@ public class MilestonesFragment extends Fragment {
|
||||
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
tinyDb.putString("milestoneState", milestoneState);
|
||||
|
||||
viewBinding.progressBar.setVisibility(View.VISIBLE);
|
||||
@ -171,7 +180,7 @@ public class MilestonesFragment extends Fragment {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
assert response.body() != null;
|
||||
if(response.body().size() > 0) {
|
||||
@ -222,7 +231,7 @@ public class MilestonesFragment extends Fragment {
|
||||
@Override
|
||||
public void onResponse(@NonNull Call<List<Milestones>> call, @NonNull Response<List<Milestones>> response) {
|
||||
|
||||
if(response.isSuccessful()) {
|
||||
if(response.code() == 200) {
|
||||
|
||||
//remove loading view
|
||||
dataList.remove(dataList.size() - 1);
|
||||
@ -238,7 +247,6 @@ public class MilestonesFragment extends Fragment {
|
||||
}
|
||||
else {
|
||||
|
||||
Toasty.info(ctx, getString(R.string.noMoreData));
|
||||
adapter.setMoreDataAvailable(false);
|
||||
|
||||
}
|
||||
|
@ -3,17 +3,16 @@ package org.mian.gitnex.fragments;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
@ -21,6 +20,8 @@ import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.models.Organization;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -37,6 +38,7 @@ public class OrganizationInfoFragment extends Fragment {
|
||||
private TextView orgDescInfo;
|
||||
private TextView orgWebsiteInfo;
|
||||
private TextView orgLocationInfo;
|
||||
private LinearLayout orgInfoLayout;
|
||||
|
||||
private RepoInfoFragment.OnFragmentInteractionListener mListener;
|
||||
|
||||
@ -76,6 +78,7 @@ public class OrganizationInfoFragment extends Fragment {
|
||||
orgDescInfo = v.findViewById(R.id.orgDescInfo);
|
||||
orgWebsiteInfo = v.findViewById(R.id.orgWebsiteInfo);
|
||||
orgLocationInfo = v.findViewById(R.id.orgLocationInfo);
|
||||
orgInfoLayout = v.findViewById(R.id.orgInfoLayout);
|
||||
|
||||
orgNameInfo.setText(orgName);
|
||||
|
||||
@ -99,19 +102,46 @@ public class OrganizationInfoFragment extends Fragment {
|
||||
|
||||
Organization orgInfo = response.body();
|
||||
|
||||
if (response.isSuccessful()) {
|
||||
|
||||
if (response.code() == 200) {
|
||||
|
||||
orgInfoLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
assert orgInfo != null;
|
||||
PicassoService.getInstance(ctx).get().load(orgInfo.getAvatar_url()).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(180, 180).centerCrop().into(orgAvatar);
|
||||
|
||||
PicassoService.getInstance(ctx).get()
|
||||
.load(orgInfo.getAvatar_url())
|
||||
.placeholder(R.drawable.loader_animated)
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.resize(230, 230)
|
||||
.centerCrop().into(orgAvatar);
|
||||
|
||||
if(!orgInfo.getDescription().isEmpty()) {
|
||||
orgDescInfo.setText(orgInfo.getDescription());
|
||||
}
|
||||
else {
|
||||
orgDescInfo.setText(getString(R.string.noDataDescription));
|
||||
}
|
||||
|
||||
if(!orgInfo.getWebsite().isEmpty()) {
|
||||
orgWebsiteInfo.setText(orgInfo.getWebsite());
|
||||
}
|
||||
else {
|
||||
orgWebsiteInfo.setText(getString(R.string.noDataWebsite));
|
||||
}
|
||||
|
||||
if(!orgInfo.getLocation().isEmpty()) {
|
||||
orgLocationInfo.setText(orgInfo.getLocation());
|
||||
}
|
||||
else {
|
||||
orgLocationInfo.setText(getString(R.string.noDataLocation));
|
||||
}
|
||||
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
else if(response.code() == 404) {
|
||||
|
||||
mProgressBar.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
else {
|
||||
|
@ -3,12 +3,6 @@ package org.mian.gitnex.fragments;
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@ -17,13 +11,24 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.squareup.picasso.Callback;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.activities.MainActivity;
|
||||
import org.mian.gitnex.clients.PicassoService;
|
||||
import org.mian.gitnex.helpers.ColorInverter;
|
||||
import org.mian.gitnex.helpers.RoundedTransformation;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import eightbitlab.com.blurview.BlurView;
|
||||
import eightbitlab.com.blurview.RenderScriptBlur;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -31,26 +36,67 @@ import java.util.Objects;
|
||||
|
||||
public class ProfileFragment extends Fragment {
|
||||
|
||||
private Context ctx = getContext();
|
||||
private Context ctx;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
|
||||
ctx = getContext();
|
||||
|
||||
View v = inflater.inflate(R.layout.fragment_profile, container, false);
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
TinyDB tinyDb = new TinyDB(getContext());
|
||||
|
||||
BlurView blurView = v.findViewById(R.id.blurView);
|
||||
TextView userFullName = v.findViewById(R.id.userFullName);
|
||||
ImageView userAvatarBackground = v.findViewById(R.id.userAvatarBackground);
|
||||
ImageView userAvatar = v.findViewById(R.id.userAvatar);
|
||||
TextView userLogin = v.findViewById(R.id.userLogin);
|
||||
TextView userEmail = v.findViewById(R.id.userEmail);
|
||||
TextView userLanguage = v.findViewById(R.id.userLanguage);
|
||||
|
||||
ViewGroup aboutFrame = v.findViewById(R.id.aboutFrame);
|
||||
|
||||
String[] userLanguageCodes = tinyDb.getString("userLang").split("-");
|
||||
Locale locale = new Locale(userLanguageCodes[0], userLanguageCodes[1]);
|
||||
|
||||
userFullName.setText(tinyDb.getString("userFullname"));
|
||||
PicassoService.getInstance(ctx).get().load(tinyDb.getString("userAvatar")).placeholder(R.drawable.loader_animated).transform(new RoundedTransformation(8, 0)).resize(120, 120).centerCrop().into(userAvatar);
|
||||
userLogin.setText(getString(R.string.usernameWithAt, tinyDb.getString("userLogin")));
|
||||
userEmail.setText(tinyDb.getString("userEmail"));
|
||||
userLanguage.setText(locale.getDisplayCountry());
|
||||
|
||||
PicassoService.getInstance(ctx).get()
|
||||
.load(tinyDb.getString("userAvatar"))
|
||||
.transform(new RoundedTransformation(8, 0))
|
||||
.placeholder(R.drawable.loader_animated)
|
||||
.resize(120, 120)
|
||||
.centerCrop().into(userAvatar);
|
||||
|
||||
PicassoService.getInstance(ctx).get()
|
||||
.load(tinyDb.getString("userAvatar"))
|
||||
.into(userAvatarBackground, new Callback() {
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
|
||||
int textColor = new ColorInverter().getImageViewContrastColor(userAvatarBackground);
|
||||
|
||||
userFullName.setTextColor(textColor);
|
||||
userLogin.setTextColor(textColor);
|
||||
userLanguage.setTextColor(textColor);
|
||||
|
||||
blurView.setupWith(aboutFrame)
|
||||
.setBlurAlgorithm(new RenderScriptBlur(ctx))
|
||||
.setBlurRadius(3)
|
||||
.setHasFixedTransformationMatrix(true);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Exception e) {}
|
||||
|
||||
});
|
||||
|
||||
|
||||
ProfileFragment.SectionsPagerAdapter mSectionsPagerAdapter = new SectionsPagerAdapter(getChildFragmentManager());
|
||||
|
||||
@ -79,11 +125,16 @@ public class ProfileFragment extends Fragment {
|
||||
|
||||
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
|
||||
int tabsCount = vg.getChildCount();
|
||||
|
||||
for (int j = 0; j < tabsCount; j++) {
|
||||
|
||||
ViewGroup vgTab = (ViewGroup) vg.getChildAt(j);
|
||||
int tabChildCount = vgTab.getChildCount();
|
||||
|
||||
for (int i = 0; i < tabChildCount; i++) {
|
||||
|
||||
View tabViewChild = vgTab.getChildAt(i);
|
||||
|
||||
if (tabViewChild instanceof TextView) {
|
||||
((TextView) tabViewChild).setTypeface(myTypeface);
|
||||
}
|
||||
@ -108,15 +159,22 @@ public class ProfileFragment extends Fragment {
|
||||
public Fragment getItem(int position) {
|
||||
|
||||
Fragment fragment = null;
|
||||
|
||||
switch (position) {
|
||||
|
||||
case 0: // followers
|
||||
return ProfileFollowersFragment.newInstance("repoOwner", "repoName");
|
||||
|
||||
case 1: // following
|
||||
return ProfileFollowingFragment.newInstance("repoOwner", "repoName");
|
||||
|
||||
case 2: // emails
|
||||
return ProfileEmailsFragment.newInstance("repoOwner", "repoName");
|
||||
|
||||
}
|
||||
|
||||
return fragment;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,9 +186,11 @@ public class ProfileFragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||
|
||||
menu.clear();
|
||||
Objects.requireNonNull(getActivity()).getMenuInflater().inflate(R.menu.profile_dotted_menu, menu);
|
||||
super.onCreateOptionsMenu(menu, inflater);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -139,17 +199,20 @@ public class ProfileFragment extends Fragment {
|
||||
int id = item.getItemId();
|
||||
|
||||
switch (id) {
|
||||
|
||||
case android.R.id.home:
|
||||
((MainActivity)ctx).finish();
|
||||
return true;
|
||||
|
||||
case R.id.profileMenu:
|
||||
BottomSheetProfileFragment bottomSheet = new BottomSheetProfileFragment();
|
||||
bottomSheet.show(getChildFragmentManager(), "profileBottomSheet");
|
||||
return true;
|
||||
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,10 +4,34 @@ import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.ClickListener;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.AppUtil;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import io.noties.markwon.AbstractMarkwonPlugin;
|
||||
import io.noties.markwon.Markwon;
|
||||
import io.noties.markwon.core.CorePlugin;
|
||||
@ -26,30 +50,6 @@ import io.noties.markwon.image.svg.SvgMediaDecoder;
|
||||
import io.noties.markwon.linkify.LinkifyPlugin;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import android.text.Spanned;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import org.mian.gitnex.R;
|
||||
import org.mian.gitnex.clients.RetrofitClient;
|
||||
import org.mian.gitnex.helpers.AlertDialogs;
|
||||
import org.mian.gitnex.helpers.Authorization;
|
||||
import org.mian.gitnex.helpers.ClickListener;
|
||||
import org.mian.gitnex.helpers.TimeHelper;
|
||||
import org.mian.gitnex.helpers.Toasty;
|
||||
import org.mian.gitnex.models.UserRepositories;
|
||||
import org.mian.gitnex.util.AppUtil;
|
||||
import org.mian.gitnex.util.TinyDB;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
@ -252,7 +252,14 @@ public class RepoInfoFragment extends Fragment {
|
||||
|
||||
assert repoInfo != null;
|
||||
repoMetaName.setText(repoInfo.getName());
|
||||
|
||||
if(!repoInfo.getDescription().isEmpty()) {
|
||||
repoMetaDescription.setText(repoInfo.getDescription());
|
||||
}
|
||||
else {
|
||||
repoMetaDescription.setText(getString(R.string.noDataDescription));
|
||||
}
|
||||
|
||||
repoMetaStars.setText(repoInfo.getStars_count());
|
||||
|
||||
if(repoInfo.getOpen_pull_count() != null) {
|
||||
@ -269,7 +276,7 @@ public class RepoInfoFragment extends Fragment {
|
||||
repoMetaSize.setText(AppUtil.formatFileSize(repoInfo.getSize()));
|
||||
}
|
||||
else {
|
||||
repoMetaSize.setText("0");
|
||||
repoMetaSize.setText("0 B");
|
||||
}
|
||||
|
||||
repoMetaCreatedAt.setText(TimeHelper.formatTime(repoInfo.getCreated_at(), new Locale(locale), timeFormat, ctx));
|
||||
@ -284,27 +291,42 @@ public class RepoInfoFragment extends Fragment {
|
||||
|
||||
repoAdditionalButton.setOnClickListener(v -> {
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
View view = LayoutInflater.from(ctx).inflate(R.layout.layout_repo_more_info, null);
|
||||
|
||||
message.append(getResources().getString(R.string.infoTabRepoDefaultBranch))
|
||||
.append(" :\n").append(repoInfo.getDefault_branch()).append("\n\n");
|
||||
TextView defaultBranchHeader = view.findViewById(R.id.defaultBranchHeader);
|
||||
TextView defaultBranchContent = view.findViewById(R.id.defaultBranchContent);
|
||||
|
||||
message.append(getResources().getString(R.string.infoTabRepoUpdatedAt))
|
||||
.append(" :\n").append(repoMetaUpdatedAt).append("\n\n");
|
||||
TextView lastUpdatedHeader = view.findViewById(R.id.lastUpdatedHeader);
|
||||
TextView lastUpdatedContent = view.findViewById(R.id.lastUpdatedContent);
|
||||
|
||||
message.append(getResources().getString(R.string.infoTabRepoSshUrl))
|
||||
.append(" :\n").append(repoInfo.getSsh_url()).append("\n\n");
|
||||
TextView sshUrlHeader = view.findViewById(R.id.sshUrlHeader);
|
||||
TextView sshUrlContent = view.findViewById(R.id.sshUrlContent);
|
||||
|
||||
message.append(getResources().getString(R.string.infoTabRepoCloneUrl))
|
||||
.append(" :\n").append(repoInfo.getClone_url()).append("\n\n");
|
||||
TextView cloneUrlHeader = view.findViewById(R.id.cloneUrlHeader);
|
||||
TextView cloneUrlContent = view.findViewById(R.id.cloneUrlContent);
|
||||
|
||||
message.append(getResources().getString(R.string.infoTabRepoRepoUrl))
|
||||
.append(" :\n").append(repoInfo.getHtml_url());
|
||||
TextView repoUrlHeader = view.findViewById(R.id.repoUrlHeader);
|
||||
TextView repoUrlContent = view.findViewById(R.id.repoUrlContent);
|
||||
|
||||
defaultBranchHeader.setText(getString(R.string.infoTabRepoDefaultBranch));
|
||||
defaultBranchContent.setText(repoInfo.getDefault_branch());
|
||||
|
||||
lastUpdatedHeader.setText(getString(R.string.infoTabRepoUpdatedAt));
|
||||
lastUpdatedContent.setText(repoMetaUpdatedAt);
|
||||
|
||||
sshUrlHeader.setText(getString(R.string.infoTabRepoSshUrl));
|
||||
sshUrlContent.setText(repoInfo.getSsh_url());
|
||||
|
||||
cloneUrlHeader.setText(getString(R.string.infoTabRepoCloneUrl));
|
||||
cloneUrlContent.setText(repoInfo.getClone_url());
|
||||
|
||||
repoUrlHeader.setText(getString(R.string.infoTabRepoRepoUrl));
|
||||
repoUrlContent.setText(repoInfo.getHtml_url());
|
||||
|
||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(ctx);
|
||||
|
||||
alertDialog.setTitle(getResources().getString(R.string.infoMoreInformation));
|
||||
alertDialog.setMessage(message);
|
||||
alertDialog.setView(view);
|
||||
alertDialog.setPositiveButton(getResources().getString(R.string.close), (dialog, which) -> dialog.dismiss());
|
||||
alertDialog.create().show();
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.widget.ImageView;
|
||||
import androidx.annotation.ColorInt;
|
||||
|
||||
/**
|
||||
@ -16,7 +19,7 @@ public class ColorInverter {
|
||||
|
||||
int d;
|
||||
if (a < 0.5) {
|
||||
d = 0; // black
|
||||
d = 30; // almost black
|
||||
} else {
|
||||
d = 255; // white
|
||||
}
|
||||
@ -24,4 +27,20 @@ public class ColorInverter {
|
||||
return Color.rgb(d, d, d);
|
||||
}
|
||||
|
||||
@ColorInt
|
||||
public int getImageViewContrastColor(ImageView imageView) {
|
||||
|
||||
if(imageView != null) {
|
||||
|
||||
Bitmap bitmap = ((BitmapDrawable) imageView.getDrawable()).getBitmap();
|
||||
return getContrastColor(bitmap.getPixel(bitmap.getWidth() / 2, bitmap.getHeight() / 2));
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
return Color.rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
145
app/src/main/java/org/mian/gitnex/helpers/ParseDiff.java
Normal file
145
app/src/main/java/org/mian/gitnex/helpers/ParseDiff.java
Normal file
@ -0,0 +1,145 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import org.mian.gitnex.models.FileDiffView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Author 6543
|
||||
*/
|
||||
|
||||
public class ParseDiff {
|
||||
|
||||
private static String[] getFileNames(String raw) {
|
||||
|
||||
String[] lines2 = raw.split(" b/");
|
||||
if(lines2.length < 2) {
|
||||
return new String[1];
|
||||
}
|
||||
String oldName = lines2[0];
|
||||
String newName = lines2[1].split("\\n")[0];
|
||||
return new String[]{oldName, newName};
|
||||
}
|
||||
|
||||
private static String getFileInfo(String raw) {
|
||||
|
||||
if(raw.contains("\ndeleted file mode \\d+\n")) {
|
||||
return "delete";
|
||||
}
|
||||
else if(raw.contains("\nnew file mode \\d+\n")) {
|
||||
return "new";
|
||||
}
|
||||
return "change";
|
||||
}
|
||||
|
||||
private static int[] countRemoveAdd(String raw) {
|
||||
|
||||
int rm = 0, add = 0;
|
||||
|
||||
Pattern rmPattern = Pattern.compile("\n-");
|
||||
Pattern addPattern = Pattern.compile("\n\\+");
|
||||
Matcher rmMatcher = rmPattern.matcher(raw);
|
||||
Matcher addMatcher = addPattern.matcher(raw);
|
||||
|
||||
while(rmMatcher.find())
|
||||
rm++;
|
||||
while(addMatcher.find())
|
||||
add++;
|
||||
|
||||
return new int[]{rm, add};
|
||||
}
|
||||
|
||||
public static List<FileDiffView> getFileDiffViewArray(String raw) {
|
||||
|
||||
List<FileDiffView> fileContentsArray = new ArrayList<>();
|
||||
|
||||
String[] lines = raw.split("(^|\\n)diff --git a/");
|
||||
if(lines.length > 1) {
|
||||
|
||||
// for each file in diff
|
||||
for(int i = 1; i < lines.length; i++) {
|
||||
|
||||
// check if it is a binary file
|
||||
if(lines[i].contains("\nBinary files a/")) {
|
||||
String[] fileNames = getFileNames(lines[i]);
|
||||
if(fileNames.length != 2) {
|
||||
continue;
|
||||
}
|
||||
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "binary", "", null));
|
||||
}
|
||||
|
||||
// check if it is a binary patch
|
||||
else if(lines[i].contains("\nGIT binary patch\n")) {
|
||||
String[] fileNames = getFileNames(lines[i]);
|
||||
if(fileNames.length != 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] tmp = lines[i].split("literal \\d+\\n");
|
||||
String rawContent = "";
|
||||
if(tmp.length >= 2) {
|
||||
rawContent = tmp[1].replace("\n", "");
|
||||
}
|
||||
|
||||
List<FileDiffView.Content> contents = new ArrayList<>();
|
||||
contents.add(new FileDiffView.Content(rawContent));
|
||||
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "binary", getFileInfo(lines[i]), contents));
|
||||
}
|
||||
|
||||
// check if it is normal diff
|
||||
else if(lines[i].contains("\n@@ -")) {
|
||||
String[] fileNames = getFileNames(lines[i]);
|
||||
if(fileNames.length != 2) {
|
||||
continue;
|
||||
}
|
||||
String[] rawDiffs = lines[i].split("\n@@ -");
|
||||
if(rawDiffs.length <= 1) {
|
||||
continue;
|
||||
}
|
||||
List<FileDiffView.Content> contents = new ArrayList<>();
|
||||
// parse each section starting with "@@" at line beginning
|
||||
for(int j = 1; j < rawDiffs.length; j++) {
|
||||
// remove stats info (ending with @@)
|
||||
// raw diff is the whole raw diff without any diff meta info's
|
||||
String[] rawDiff = rawDiffs[j].split("^\\d+(,\\d+)? \\+\\d+(,\\d+)? @@");
|
||||
if(rawDiff.length <= 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// extract the diff stats info of the first line
|
||||
String statsLine = rawDiffs[j].split("\n")[0].split(" @@")[0];
|
||||
|
||||
// parse "-1,2 +2,3" and "-1 -3" and so on
|
||||
int oldStart = 0, newStart = 0;
|
||||
String diffPos[] = statsLine.split(" \\+");
|
||||
if(diffPos.length == 2) {
|
||||
oldStart = Integer.parseInt(diffPos[0].split(",")[0]);
|
||||
newStart = Integer.parseInt(diffPos[1].split(",")[0]);
|
||||
|
||||
}
|
||||
|
||||
// get stat
|
||||
int[] stats = countRemoveAdd(rawDiff[1]);
|
||||
|
||||
contents.add(new FileDiffView.Content(rawDiff[1], oldStart, newStart, stats[0], stats[1]));
|
||||
}
|
||||
fileContentsArray.add(new FileDiffView(fileNames[0], fileNames[1], "diff", getFileInfo(lines[i]), contents));
|
||||
}
|
||||
|
||||
// a rename
|
||||
else if(lines[i].contains("\nrename from")) {
|
||||
String[] lines2 = lines[i].split("\\nrename (from|to )");
|
||||
if(lines2.length != 3) {
|
||||
continue;
|
||||
}
|
||||
fileContentsArray.add(new FileDiffView(lines2[1], lines2[2].split("\\n")[0], "rename", "rename", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fileContentsArray;
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
@ -70,7 +70,7 @@ public class Version {
|
||||
* @param v
|
||||
* @return
|
||||
*/
|
||||
public boolean equal(@NotNull Version v) {
|
||||
public boolean equal(@NonNull Version v) {
|
||||
|
||||
int rounds = Math.min(this.values.size(), v.values.size());
|
||||
for(int i = 0; i < rounds; i++) {
|
||||
@ -101,7 +101,7 @@ public class Version {
|
||||
* @param v
|
||||
* @return
|
||||
*/
|
||||
public boolean less(@NotNull Version v) {
|
||||
public boolean less(@NonNull Version v) {
|
||||
|
||||
int rounds = Math.min(this.values.size(), v.values.size());
|
||||
for(int i = 0; i < rounds; i++) {
|
||||
@ -142,7 +142,7 @@ public class Version {
|
||||
* @param v
|
||||
* @return
|
||||
*/
|
||||
public boolean higher(@NotNull Version v) {
|
||||
public boolean higher(@NonNull Version v) {
|
||||
|
||||
int rounds = Math.min(this.values.size(), v.values.size());
|
||||
for(int i = 0; i < rounds; i++) {
|
||||
@ -182,7 +182,7 @@ public class Version {
|
||||
* @param v
|
||||
* @return
|
||||
*/
|
||||
public boolean lessOrEqual(@NotNull Version v) {
|
||||
public boolean lessOrEqual(@NonNull Version v) {
|
||||
|
||||
int rounds = Math.min(this.values.size(), v.values.size());
|
||||
for(int i = 0; i < rounds; i++) {
|
||||
@ -213,7 +213,7 @@ public class Version {
|
||||
* @param v
|
||||
* @return
|
||||
*/
|
||||
public boolean higherOrEqual(@NotNull Version v) {
|
||||
public boolean higherOrEqual(@NonNull Version v) {
|
||||
|
||||
int rounds = Math.min(this.values.size(), v.values.size());
|
||||
for(int i = 0; i < rounds; i++) {
|
||||
|
@ -605,7 +605,7 @@ public class MemorizingTrustManager implements X509TrustManager {
|
||||
|
||||
private boolean interactHostname(X509Certificate cert, String hostname) {
|
||||
|
||||
if(interact(hostNameMessage(cert, hostname), R.string.mtm_accept_servername) == MTMDecision.DECISION_ALWAYS) {
|
||||
if(interact(hostNameMessage(cert, hostname), R.string.mtm_accept_server_name) == MTMDecision.DECISION_ALWAYS) {
|
||||
storeCert(hostname, cert);
|
||||
return true;
|
||||
}
|
||||
|
@ -267,11 +267,14 @@ public interface ApiInterface {
|
||||
@GET("repos/{owner}/{repo}/pulls") // get repository pull requests
|
||||
Call<List<PullRequests>> getPullRequests(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("state") String state, @Query("limit") int limit);
|
||||
|
||||
@GET("repos/{owner}/{repo}/pulls/{index}.diff") // get pull diff file contents
|
||||
Call<ResponseBody> getPullDiffContent(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Path("index") String pullIndex);
|
||||
|
||||
@POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request
|
||||
Call<ResponseBody> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body MergePullRequest jsonStr);
|
||||
|
||||
@GET("repos/{owner}/{repo}/commits") // get all commits
|
||||
Call<List<Commits>> getRepositoryCommits(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("sha") String branchName);
|
||||
Call<List<Commits>> getRepositoryCommits(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("sha") String branchName, @Query("limit") int limit);
|
||||
|
||||
@PATCH("repos/{owner}/{repo}/milestones/{index}") // close / reopen milestone
|
||||
Call<JsonElement> closeReopenMilestone(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body Milestones jsonStr);
|
||||
|
@ -1,39 +1,159 @@
|
||||
package org.mian.gitnex.models;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Author M M Arif
|
||||
* Author 6543
|
||||
*/
|
||||
|
||||
public class FileDiffView {
|
||||
|
||||
private String fileName;
|
||||
private boolean fileType;
|
||||
private String fileNewName;
|
||||
private String fileOldName;
|
||||
private String diffType;
|
||||
private String fileInfo;
|
||||
private String fileContents;
|
||||
private Stats stats;
|
||||
private List<Content> contents;
|
||||
|
||||
public FileDiffView(String fileName, boolean fileType, String fileInfo, String fileContents)
|
||||
{
|
||||
public class Stats {
|
||||
|
||||
this.fileName = fileName;
|
||||
this.fileType = fileType;
|
||||
private int lineAdded;
|
||||
private int lineRemoved;
|
||||
|
||||
public Stats(int added, int removed) {
|
||||
|
||||
this.lineAdded = added;
|
||||
this.lineRemoved = removed;
|
||||
}
|
||||
|
||||
public int getAdded() {
|
||||
|
||||
return lineAdded;
|
||||
}
|
||||
|
||||
public int getRemoved() {
|
||||
|
||||
return lineRemoved;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String toString() {
|
||||
|
||||
return "+" + this.lineAdded + ", -" + this.lineRemoved;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Content {
|
||||
|
||||
private int lineAdded;
|
||||
private int lineRemoved;
|
||||
private int oldLineStart;
|
||||
private int newLineStart;
|
||||
private String raw;
|
||||
|
||||
public Content(String content) {
|
||||
|
||||
this.raw = content;
|
||||
}
|
||||
|
||||
public Content(String content, int oldStart, int newStart, int removed, int added) {
|
||||
|
||||
this.raw = content;
|
||||
this.lineAdded = added;
|
||||
this.lineRemoved = removed;
|
||||
this.oldLineStart = oldStart;
|
||||
this.newLineStart = newStart;
|
||||
}
|
||||
|
||||
public String getRaw() {
|
||||
|
||||
return raw;
|
||||
}
|
||||
|
||||
public int getLineAdded() {
|
||||
|
||||
return this.lineAdded;
|
||||
}
|
||||
|
||||
public int getLineRemoved() {
|
||||
|
||||
return this.lineRemoved;
|
||||
}
|
||||
|
||||
public int getOldLineStart() {
|
||||
|
||||
return this.oldLineStart;
|
||||
}
|
||||
|
||||
public int getNewLineStart() {
|
||||
|
||||
return this.newLineStart;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public FileDiffView(String oldName, String newName, String diffType, String fileInfo, List<Content> fileContents) {
|
||||
|
||||
this.fileNewName = newName.trim();
|
||||
this.fileOldName = oldName.trim();
|
||||
this.diffType = diffType;
|
||||
this.fileInfo = fileInfo;
|
||||
this.fileContents = fileContents;
|
||||
this.contents = fileContents;
|
||||
this.stats = new Stats(0, 0);
|
||||
if(fileContents != null) {
|
||||
for(Content content : this.contents) {
|
||||
stats.lineAdded += content.lineAdded;
|
||||
stats.lineRemoved += content.lineRemoved;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
|
||||
if(fileOldName.length() != 0 && !fileOldName.equals(fileNewName)) {
|
||||
return fileOldName + " -> " + fileNewName;
|
||||
}
|
||||
return fileNewName;
|
||||
}
|
||||
|
||||
public boolean isFileType() {
|
||||
return fileType;
|
||||
public boolean isFileBinary() {
|
||||
|
||||
return diffType.equals("binary");
|
||||
}
|
||||
|
||||
public String getFileInfo() {
|
||||
|
||||
if(diffType.equals("binary")) {
|
||||
return diffType + " " + fileInfo;
|
||||
}
|
||||
|
||||
if(fileInfo.equals("change") && this.stats != null) {
|
||||
return this.stats.toString();
|
||||
}
|
||||
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
public String getFileContents() {
|
||||
return fileContents;
|
||||
@NonNull
|
||||
public String toString() {
|
||||
|
||||
StringBuilder raw = new StringBuilder();
|
||||
if(this.contents != null) {
|
||||
for(Content c : this.contents) {
|
||||
raw.append(c.getRaw());
|
||||
}
|
||||
}
|
||||
return raw.toString();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public List<Content> getFileContents() {
|
||||
|
||||
return this.contents;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ public class UserRepositories {
|
||||
private String forks_count;
|
||||
private Boolean has_issues;
|
||||
private String avatar_url;
|
||||
private boolean archived;
|
||||
|
||||
private permissionsObject permissions;
|
||||
|
||||
@ -167,4 +168,24 @@ public class UserRepositories {
|
||||
return avatar_url;
|
||||
}
|
||||
|
||||
public boolean isPrivateFlag() {
|
||||
|
||||
return privateFlag;
|
||||
}
|
||||
|
||||
public String getOpen_pr_counter() {
|
||||
|
||||
return open_pr_counter;
|
||||
}
|
||||
|
||||
public String getRelease_counter() {
|
||||
|
||||
return release_counter;
|
||||
}
|
||||
|
||||
public boolean isArchived() {
|
||||
|
||||
return archived;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,48 +24,57 @@ import java.util.Locale;
|
||||
public class AppUtil {
|
||||
|
||||
public static String strReplace(String str, String original, String replace) {
|
||||
|
||||
return str.replace(original, replace);
|
||||
}
|
||||
|
||||
public static boolean haveNetworkConnection(Context context) {
|
||||
|
||||
boolean haveConnectedWifi = false;
|
||||
boolean haveConnectedMobile = false;
|
||||
|
||||
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
assert cm != null;
|
||||
NetworkInfo[] netInfo = cm.getAllNetworkInfo();
|
||||
for (NetworkInfo ni : netInfo) {
|
||||
if (ni.getTypeName().equalsIgnoreCase("WIFI"))
|
||||
if (ni.isConnected())
|
||||
for(NetworkInfo ni : netInfo) {
|
||||
if(ni.getTypeName().equalsIgnoreCase("WIFI")) {
|
||||
if(ni.isConnected()) {
|
||||
haveConnectedWifi = true;
|
||||
if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
|
||||
if (ni.isConnected())
|
||||
}
|
||||
}
|
||||
if(ni.getTypeName().equalsIgnoreCase("MOBILE")) {
|
||||
if(ni.isConnected()) {
|
||||
haveConnectedMobile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return haveConnectedWifi || haveConnectedMobile;
|
||||
}
|
||||
|
||||
public static int getAppBuildNo(Context context) {
|
||||
|
||||
try {
|
||||
PackageInfo packageInfo = context.getPackageManager()
|
||||
.getPackageInfo(context.getPackageName(), 0);
|
||||
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||
return packageInfo.versionCode;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
}
|
||||
catch(PackageManager.NameNotFoundException e) {
|
||||
throw new RuntimeException("Could not get package name: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getAppVersion(Context context) {
|
||||
|
||||
try {
|
||||
PackageInfo packageInfo = context.getPackageManager()
|
||||
.getPackageInfo(context.getPackageName(), 0);
|
||||
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
|
||||
return packageInfo.versionName;
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
}
|
||||
catch(PackageManager.NameNotFoundException e) {
|
||||
throw new RuntimeException("Could not get package name: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
public int charactersLength(String str) {
|
||||
|
||||
return str.length();
|
||||
}
|
||||
|
||||
@ -86,6 +95,7 @@ public class AppUtil {
|
||||
}
|
||||
|
||||
public Boolean checkIntegers(String str) {
|
||||
|
||||
return str.matches("\\d+");
|
||||
}
|
||||
|
||||
@ -117,22 +127,22 @@ public class AppUtil {
|
||||
|
||||
String repoSize = null;
|
||||
|
||||
double m = size/1024.0;
|
||||
double g = ((size/1024.0)/1024.0);
|
||||
double t = (((size/1024.0)/1024.0)/1024.0);
|
||||
double m = size / 1024.0;
|
||||
double g = ((size / 1024.0) / 1024.0);
|
||||
double t = (((size / 1024.0) / 1024.0) / 1024.0);
|
||||
|
||||
DecimalFormat dec = new DecimalFormat("0.00");
|
||||
|
||||
if ( t > 1 ) {
|
||||
if(t > 1) {
|
||||
repoSize = dec.format(t).concat(" TB");
|
||||
}
|
||||
else if ( g > 1 ) {
|
||||
else if(g > 1) {
|
||||
repoSize = dec.format(g).concat(" GB");
|
||||
}
|
||||
else if ( m > 1 ) {
|
||||
else if(m > 1) {
|
||||
repoSize = dec.format(m).concat(" MB");
|
||||
}
|
||||
else if ( (double) size > 1 ) {
|
||||
else if((double) size > 1) {
|
||||
repoSize = dec.format((double) size).concat(" KB");
|
||||
}
|
||||
|
||||
@ -144,26 +154,26 @@ public class AppUtil {
|
||||
|
||||
String fileSize = null;
|
||||
|
||||
double k = size/1024.0;
|
||||
double m = ((size/1024.0)/1024.0);
|
||||
double g = (((size/1024.0)/1024.0)/1024.0);
|
||||
double t = ((((size/1024.0)/1024.0)/1024.0)/1024.0);
|
||||
double k = size / 1024.0;
|
||||
double m = ((size / 1024.0) / 1024.0);
|
||||
double g = (((size / 1024.0) / 1024.0) / 1024.0);
|
||||
double t = ((((size / 1024.0) / 1024.0) / 1024.0) / 1024.0);
|
||||
|
||||
DecimalFormat dec = new DecimalFormat("0.00");
|
||||
|
||||
if ( t > 1 ) {
|
||||
if(t > 1) {
|
||||
fileSize = dec.format(t).concat(" TB");
|
||||
}
|
||||
else if ( g > 1 ) {
|
||||
else if(g > 1) {
|
||||
fileSize = dec.format(g).concat(" GB");
|
||||
}
|
||||
else if ( m > 1 ) {
|
||||
else if(m > 1) {
|
||||
fileSize = dec.format(m).concat(" MB");
|
||||
}
|
||||
else if ( k > 1 ) {
|
||||
else if(k > 1) {
|
||||
fileSize = dec.format(k).concat(" KB");
|
||||
}
|
||||
else if ( (double) size > 1 ) {
|
||||
else if((double) size > 1) {
|
||||
fileSize = dec.format((double) size).concat(" B");
|
||||
}
|
||||
|
||||
@ -179,16 +189,18 @@ public class AppUtil {
|
||||
final String day = parts[2];
|
||||
|
||||
String sMonth;
|
||||
if (Integer.parseInt(month) < 10) {
|
||||
sMonth = "0"+ month;
|
||||
} else {
|
||||
if(Integer.parseInt(month) < 10) {
|
||||
sMonth = "0" + month;
|
||||
}
|
||||
else {
|
||||
sMonth = month;
|
||||
}
|
||||
|
||||
String sDay;
|
||||
if (Integer.parseInt(day) < 10) {
|
||||
sDay = "0"+ day;
|
||||
} else {
|
||||
if(Integer.parseInt(day) < 10) {
|
||||
sDay = "0" + day;
|
||||
}
|
||||
else {
|
||||
sDay = day;
|
||||
}
|
||||
|
||||
@ -204,16 +216,18 @@ public class AppUtil {
|
||||
int mSeconds = c.get(Calendar.SECOND);
|
||||
|
||||
String sMin;
|
||||
if ((mMinute) < 10) {
|
||||
sMin = "0"+ mMinute;
|
||||
} else {
|
||||
if((mMinute) < 10) {
|
||||
sMin = "0" + mMinute;
|
||||
}
|
||||
else {
|
||||
sMin = String.valueOf(mMinute);
|
||||
}
|
||||
|
||||
String sSec;
|
||||
if ((mSeconds) < 10) {
|
||||
sSec = "0"+ mSeconds;
|
||||
} else {
|
||||
if((mSeconds) < 10) {
|
||||
sSec = "0" + mSeconds;
|
||||
}
|
||||
else {
|
||||
sSec = String.valueOf(mSeconds);
|
||||
}
|
||||
|
||||
@ -247,13 +261,7 @@ public class AppUtil {
|
||||
|
||||
public Boolean sourceCodeExtension(String ext) {
|
||||
|
||||
String[] extValues = new String[] {"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m",
|
||||
"cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript",
|
||||
"coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt",
|
||||
"ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs",
|
||||
"vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js",
|
||||
"html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat",
|
||||
"twig"};
|
||||
String[] extValues = new String[]{"md", "json", "java", "go", "php", "c", "cc", "cpp", "h", "cxx", "cyc", "m", "cs", "bash", "sh", "bsh", "cv", "python", "perl", "pm", "rb", "ruby", "javascript", "coffee", "rc", "rs", "rust", "basic", "clj", "css", "dart", "lisp", "erl", "hs", "lsp", "rkt", "ss", "llvm", "ll", "lua", "matlab", "pascal", "r", "scala", "sql", "latex", "tex", "vb", "vbs", "vhd", "tcl", "wiki.meta", "yaml", "yml", "markdown", "xml", "proto", "regex", "py", "pl", "js", "html", "htm", "volt", "ini", "htaccess", "conf", "gitignore", "gradle", "txt", "properties", "bat", "twig"};
|
||||
|
||||
return Arrays.asList(extValues).contains(ext);
|
||||
|
||||
@ -261,7 +269,7 @@ public class AppUtil {
|
||||
|
||||
public Boolean pdfExtension(String ext) {
|
||||
|
||||
String[] extValues = new String[] {"pdf"};
|
||||
String[] extValues = new String[]{"pdf"};
|
||||
|
||||
return Arrays.asList(extValues).contains(ext);
|
||||
|
||||
@ -269,7 +277,7 @@ public class AppUtil {
|
||||
|
||||
public Boolean imageExtension(String ext) {
|
||||
|
||||
String[] extValues = new String[] {"jpg", "jpeg", "gif", "png", "ico"};
|
||||
String[] extValues = new String[]{"jpg", "jpeg", "gif", "png", "ico"};
|
||||
|
||||
return Arrays.asList(extValues).contains(ext);
|
||||
|
||||
@ -277,17 +285,16 @@ public class AppUtil {
|
||||
|
||||
public Boolean excludeFilesInFileViewerExtension(String ext) {
|
||||
|
||||
String[] extValues = new String[] {"doc", "docx", "ppt", "pptx", "xls", "xlsx", "xlsm", "odt",
|
||||
"ott", "odf", "ods", "ots", "exe", "jar", "odg", "otg", "odp", "otp", "bin", "dmg", "psd",
|
||||
"xcf"};
|
||||
String[] extValues = new String[]{"doc", "docx", "ppt", "pptx", "xls", "xlsx", "xlsm", "odt", "ott", "odf", "ods", "ots", "exe", "jar", "odg", "otg", "odp", "otp", "bin", "dmg", "psd", "xcf"};
|
||||
|
||||
return Arrays.asList(extValues).contains(ext);
|
||||
|
||||
}
|
||||
|
||||
public String getLastCharactersOfWord( String str, int count ) {
|
||||
public String getLastCharactersOfWord(String str, int count) {
|
||||
|
||||
return str.substring(str.length() - count);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
5
app/src/main/res/drawable/ic_archive.xml
Normal file
5
app/src/main/res/drawable/ic_archive.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#368F73"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M20.54,5.23l-1.39,-1.68C18.88,3.21 18.47,3 18,3H6c-0.47,0 -0.88,0.21 -1.16,0.55L3.46,5.23C3.17,5.57 3,6.02 3,6.5V19c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2V6.5c0,-0.48 -0.17,-0.93 -0.46,-1.27zM12,17.5L6.5,12H10v-2h4v2h3.5L12,17.5zM5.12,5l0.81,-1h12l0.94,1H5.12z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_arrow_right.xml
Normal file
5
app/src/main/res/drawable/ic_arrow_right.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#368F73"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_code.xml
Normal file
5
app/src/main/res/drawable/ic_code.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#368F73"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
|
||||
</vector>
|
5
app/src/main/res/drawable/ic_location.xml
Normal file
5
app/src/main/res/drawable/ic_location.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="#368F73"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||
</vector>
|
@ -9,8 +9,8 @@
|
||||
android:right="1dp"
|
||||
android:left="1dp">
|
||||
<shape>
|
||||
<corners android:radius="15dp"/>
|
||||
<solid android:color="@color/divider"/>
|
||||
<corners android:radius="10dp"/>
|
||||
<solid android:color="?attr/inputBackgroundColor"/>
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="15dp" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
|
8
app/src/main/res/drawable/shape_archived.xml
Normal file
8
app/src/main/res/drawable/shape_archived.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
|
||||
<corners android:radius="3dp"/>
|
||||
<solid android:color="@color/releasePre" />
|
||||
|
||||
</shape>
|
14
app/src/main/res/drawable/shape_pre_release.xml
Normal file
14
app/src/main/res/drawable/shape_pre_release.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid
|
||||
android:color="@color/releasePre">
|
||||
</solid>
|
||||
|
||||
<corners
|
||||
android:radius="3dp">
|
||||
</corners>
|
||||
|
||||
</shape>
|
14
app/src/main/res/drawable/shape_stable_release.xml
Normal file
14
app/src/main/res/drawable/shape_stable_release.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid
|
||||
android:color="@color/releaseStable">
|
||||
</solid>
|
||||
|
||||
<corners
|
||||
android:radius="3dp">
|
||||
</corners>
|
||||
|
||||
</shape>
|
@ -54,7 +54,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -58,7 +58,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -160,7 +160,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseTypeText"
|
||||
android:checked="true"
|
||||
android:checked="false"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
@ -170,7 +170,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseDraftText"
|
||||
android:checked="true"
|
||||
android:checked="false"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
|
@ -74,7 +74,7 @@
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
||||
android:textColorHighlight="?attr/primaryTextColor" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@ -97,7 +97,7 @@
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
||||
android:textColorHighlight="?attr/primaryTextColor" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@ -105,7 +105,7 @@
|
||||
android:text="@string/newTeamPermission"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teamPermission"
|
||||
@ -116,10 +116,10 @@
|
||||
android:textSize="14sp"
|
||||
tools:ignore="Autofill"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHint="@color/white"
|
||||
android:inputType="none"
|
||||
android:textColorHighlight="@color/white"/>
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textColorHighlight="?attr/primaryTextColor"
|
||||
android:inputType="none" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teamPermissionDetail"
|
||||
@ -128,7 +128,7 @@
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp"
|
||||
android:gravity="start"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@ -136,7 +136,7 @@
|
||||
android:text="@string/newTeamAccessControls"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teamAccessControls"
|
||||
@ -147,16 +147,16 @@
|
||||
android:textSize="14sp"
|
||||
tools:ignore="Autofill"
|
||||
android:background="@drawable/shape_inputs"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textColorHint="?attr/primaryTextColor"
|
||||
android:inputType="none"
|
||||
android:textColorHighlight="?attr/primaryTextColor"/>
|
||||
android:textColor="?attr/inputTextColor"
|
||||
android:textColorHint="?attr/hintColor"
|
||||
android:textColorHighlight="?attr/primaryTextColor"
|
||||
android:inputType="none" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teamAccessControlsArray"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/createTeamButton"
|
||||
@ -171,7 +171,7 @@
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"/>
|
||||
android:layout_height="35dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
<GridView
|
||||
|
@ -49,10 +49,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</LinearLayout>
|
@ -34,7 +34,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
<TextView
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -15,7 +15,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@ -11,90 +13,131 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/orgInfoLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="15dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/orgAvatar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="10dp"
|
||||
android:contentDescription="@string/orgContentAvatar"
|
||||
android:layout_marginBottom="20dp"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/nameText"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:contentDescription="@string/orgContentAvatar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orgNameInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/descriptionText"
|
||||
android:textSize="16sp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_marginTop="15dp"/>
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orgDescInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/websiteText"
|
||||
app:srcCompat="@drawable/ic_link_24dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/websiteText"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_marginTop="15dp"/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orgWebsiteInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="5dp"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.9"
|
||||
android:autoLink="web"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="14sp"
|
||||
tools:text="29" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
android:paddingRight="15dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/locationText"
|
||||
app:srcCompat="@drawable/ic_location" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/locationText"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_marginTop="15dp"/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/orgLocationInfo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="16sp"
|
||||
android:paddingTop="5dp"
|
||||
android:autoLink="web"
|
||||
android:textColor="?attr/primaryTextColor"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.9"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="29" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -105,13 +148,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ProgressBar android:id="@+id/progress_bar"
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Base.Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="true"
|
||||
android:visibility="visible"
|
||||
android:layout_centerInParent="true" />
|
||||
tools:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -10,24 +10,36 @@
|
||||
<RelativeLayout
|
||||
android:id="@+id/aboutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="172dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/nav_background"
|
||||
android:gravity="top">
|
||||
android:layout_height="200dp"
|
||||
android:gravity="top"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userAvatarBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<eightbitlab.com.blurview.BlurView
|
||||
android:id="@+id/blurView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:blurOverlayColor="@color/blurColor">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutFrameAccount"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="186dp"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userAvatar"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@mipmap/app_logo_round" />
|
||||
|
||||
@ -35,34 +47,53 @@
|
||||
android:id="@+id/userFullName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center" />
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userLogin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userEmail"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@color/colorWhite" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginRight="2dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:src="@drawable/ic_language"
|
||||
app:tint="@color/colorWhite" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/userLanguage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center" />
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</eightbitlab.com.blurview.BlurView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
|
@ -14,7 +14,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -14,7 +14,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -14,7 +14,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -16,7 +16,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -62,9 +62,9 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="GitNex" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoMetaDescription"
|
||||
@ -75,12 +75,12 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
tools:text="Android client for Gitea https://gitnex.com" />
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
@ -88,7 +88,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/repoMetaStarsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
@ -110,7 +110,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/repoMetaPullRequestsFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
@ -132,7 +132,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/repoMetaForksFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
@ -154,7 +154,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/repoMetaWatchersFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
@ -179,12 +179,11 @@
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:alpha="0.2"
|
||||
android:background="@color/lightGray" />
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
@ -224,7 +223,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
@ -264,7 +263,7 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="15dp"
|
||||
|
@ -15,7 +15,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -42,7 +42,7 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingStart="60dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:text="@string/appreanceHintText"
|
||||
android:text="@string/appearanceHintText"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
@ -15,7 +15,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:padding="4dp"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
116
app/src/main/res/layout/layout_repo_more_info.xml
Normal file
116
app/src/main/res/layout/layout_repo_more_info.xml
Normal file
@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="25dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/defaultBranchHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/defaultBranchContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lastUpdatedHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lastUpdatedContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sshUrlHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sshUrlContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cloneUrlHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cloneUrlContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoUrlHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoUrlContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:textColorLink="@color/lightBlue"
|
||||
android:textColor="?attr/primaryTextColor" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -3,10 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:padding="15dp"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
|
||||
<LinearLayout
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/commitList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:context=".activities.CommitsActivity"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<LinearLayout
|
||||
@ -12,10 +11,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="15dp"
|
||||
tools:ignore="UselessParent">
|
||||
android:layout_margin="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/commitTitleVw"
|
||||
@ -80,7 +77,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -4,7 +4,7 @@
|
||||
android:id="@+id/linearLayoutFilesFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_margin="12dp"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
|
@ -1,15 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/relativeLayoutFrameIssuesList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/issueNumber"
|
||||
@ -17,6 +12,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assigneeAvatar"
|
||||
android:layout_width="48dp"
|
||||
@ -91,12 +94,13 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_below="@id/infoSection"
|
||||
android:layout_below="@id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:layout_marginTop="15dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</RelativeLayout>
|
@ -1,40 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/relativeLayoutMainFrame"
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="15dp"
|
||||
android:id="@+id/labelsFrame"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/labelsView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:contentDescription="@string/labelMenuContentDesc"
|
||||
android:gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitStart"
|
||||
android:src="@drawable/ic_label" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/labelsOptionsMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_weight="0.15"
|
||||
android:contentDescription="@string/labelMenuContentDesc"
|
||||
android:gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/ic_dotted_menu_horizontal" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -53,6 +25,36 @@
|
||||
android:visibility="gone"
|
||||
android:id="@+id/labelColor"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="15dp"
|
||||
android:id="@+id/labelsFrame"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/labelsView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:paddingTop="5dp"
|
||||
android:contentDescription="@string/labelMenuContentDesc"
|
||||
android:gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:scaleType="fitStart"
|
||||
android:src="@drawable/ic_label" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/labelsOptionsMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_weight="0.15"
|
||||
android:contentDescription="@string/labelMenuContentDesc"
|
||||
android:gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/ic_dotted_menu_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -20,6 +20,7 @@
|
||||
android:gravity="top|center_horizontal"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="@string/orgMember"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:id="@+id/milestoneFrame"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:orientation="vertical">
|
||||
@ -15,125 +16,173 @@
|
||||
android:id="@+id/milestoneId" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/milestoneStatus" />
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/frameTitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneTitle"
|
||||
android:layout_width="0dp"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".80"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight="0"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestoneState"
|
||||
<ProgressBar
|
||||
android:id="@+id/milestoneProgress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight=".15"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:contentDescription="@string/pageTitleCreateMilestone"
|
||||
android:layout_marginBottom="5dp" />
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_weight="1"
|
||||
android:indeterminate="false"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/progress_bar"
|
||||
android:progressTint="@color/btnBackground" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_calendar" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDueDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dueDate"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_issue_open" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesOpen"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoStars"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="5dp"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_issue_closed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesClosed"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoWatchers"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/milestoneDateMenuFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/dueDateFrame"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight=".90"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/repoDescription"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesClosed"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoWatchers"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/milestoneProgress"
|
||||
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="80"
|
||||
android:progress="50"
|
||||
android:layout_marginTop="2dp"
|
||||
android:progressDrawable="@drawable/progress_bar"
|
||||
android:progressTint="@color/colorLightGreen" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneIssuesOpen"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="8"
|
||||
android:text="@string/repoStars"
|
||||
android:gravity="end"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/milestoneDateMenuFrame"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".90"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/dueDateFrame"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/milestoneDueDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dueDate"
|
||||
android:gravity="start"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="14sp"
|
||||
android:visibility="visible" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/milestonesMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".10"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_weight=".10"
|
||||
android:contentDescription="@string/menuContentDesc"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/ic_dotted_menu_horizontal"
|
||||
android:contentDescription="@string/menuContentDesc" />
|
||||
android:src="@drawable/ic_dotted_menu_horizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_below="@id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:id="@+id/divider"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,19 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/linearLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp"
|
||||
tools:context=".activities.MainActivity">
|
||||
android:padding="15dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/organizationId"
|
||||
@ -26,7 +24,6 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:src="@drawable/ic_android"
|
||||
android:contentDescription="@string/orgContentAvatar"/>
|
||||
|
||||
@ -50,7 +47,6 @@
|
||||
android:id="@+id/orgDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/orgDescription"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
|
@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/relativeLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
tools:context=".activities.RepoDetailActivity">
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/prNumber"
|
||||
@ -38,6 +36,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/mainFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assigneeAvatar"
|
||||
android:layout_width="48dp"
|
||||
@ -111,4 +117,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
@ -3,10 +3,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="15dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:padding="15dp"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
|
||||
<TextView
|
||||
|
@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:padding="15dp"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
|
||||
<ImageView
|
||||
@ -27,7 +25,6 @@
|
||||
android:id="@+id/userFullName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="@string/userName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
@ -36,10 +33,9 @@
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="@string/userName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:padding="15dp"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
|
||||
<ImageView
|
||||
@ -27,7 +25,6 @@
|
||||
android:id="@+id/userFullName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="@string/userName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
@ -36,10 +33,9 @@
|
||||
android:id="@+id/userName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:text="@string/userName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -1,100 +1,259 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_margin="15dp" >
|
||||
android:padding="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/headerFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".70"
|
||||
android:id="@+id/releaseName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseTitle"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_weight="1"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="3.0.0-rc1" />
|
||||
|
||||
<ImageView
|
||||
<TextView
|
||||
android:id="@+id/releaseType"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight=".30"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:scaleType="fitEnd"
|
||||
android:contentDescription="@string/releaseType"
|
||||
android:src="@drawable/ic_android" />
|
||||
android:layout_weight="0"
|
||||
android:background="@drawable/shape_stable_release"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/authorAvatar"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
tools:srcCompat="@tools:sample/avatars[7]"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/authorName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="Published by @mmarif" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="end|center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_label"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseTag"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/releaseTag"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginStart="5dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseDescription"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/releaseDescription"
|
||||
android:textIsSelectable="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseDownload"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseDownloadText"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="?attr/inputBackgroundColor" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseZipDownload"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:text="@string/releaseZip"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textColorLink="@color/lightBlue"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseTarDownload"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/releaseTar"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="16sp"
|
||||
android:textColorLink="@color/lightBlue"/>
|
||||
android:textSize="14sp"
|
||||
tools:text="3.0.0-rc1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_code"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseCommitSha"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="8b1c79c0c3" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end|center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_calendar"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseDate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="1 day ago" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bodyFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseBodyContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="Put your release body here" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/downloadFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/downloadDropdownIcon"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:tint="?attr/primaryTextColor"
|
||||
android:src="@drawable/ic_arrow_right"
|
||||
app:srcCompat="@drawable/ic_arrow_right" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
android:text="@string/releaseDownloadText"
|
||||
tools:text="Downloads" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/downloads"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseZipDownload"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:drawableStart="@drawable/ic_file_download_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="Source code (ZIP)" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/releaseTarDownload"
|
||||
android:layout_below="@+id/releaseZipDownload"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:drawableStart="@drawable/ic_file_download_24dp"
|
||||
android:drawablePadding="8dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="Source code (TAR)" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/downloadList"
|
||||
android:layout_below="@+id/releaseTarDownload"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/primaryBackgroundColor"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
27
app/src/main/res/layout/list_releases_downloads.xml
Normal file
27
app/src/main/res/layout/list_releases_downloads.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_file_download_24dp"
|
||||
android:contentDescription="@string/generalImgContentText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloadName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp"
|
||||
tools:text="Source code (ZIP)" />
|
||||
|
||||
</LinearLayout>
|
@ -20,6 +20,7 @@
|
||||
android:gravity="top|center_horizontal"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="@string/starMember"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
@ -20,6 +20,7 @@
|
||||
android:gravity="top|center_horizontal"
|
||||
android:layout_marginTop="1dp"
|
||||
android:text="@string/watcherMember"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/primaryBackgroundColor" >
|
||||
android:background="?attr/primaryBackgroundColor">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoType"
|
||||
@ -14,7 +16,6 @@
|
||||
android:id="@+id/linearLayoutFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="15dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
@ -37,23 +38,54 @@
|
||||
android:id="@+id/frameRepoName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repoName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight=".95"
|
||||
android:text="@string/repoName"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/archiveRepoFrame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@drawable/shape_archived"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/archivedRepository"
|
||||
android:textColor="@color/colorWhite" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
app:srcCompat="@drawable/ic_archive"
|
||||
app:tint="@color/colorWhite" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageRepoType"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_weight=".05"
|
||||
android:contentDescription="@string/privateAvatar"
|
||||
android:src="@drawable/ic_lock_24dp" />
|
||||
|
@ -1,9 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/navHeaderFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/userAvatarBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/generalImgContentText"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<eightbitlab.com.blurview.BlurView
|
||||
android:id="@+id/blurView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:blurOverlayColor="@color/blurColor">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:background="@drawable/nav_background"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="bottom"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
@ -58,5 +76,8 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?attr/dividerColor" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</eightbitlab.com.blurview.BlurView>
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -11,14 +11,15 @@
|
||||
<color name="black">#000009</color>
|
||||
<color name="white">#ffffff</color>
|
||||
<color name="tooltipBackground">#1e88ce</color>
|
||||
<color name="blurColor">#41818181</color>
|
||||
<color name="btnBackground">#009486</color>
|
||||
<color name="btnTextColor">#ffffff</color>
|
||||
<color name="inputBackground">#1d1d1d</color>
|
||||
<color name="toastBackground">#1d1d1d</color>
|
||||
<color name="divider">#1d1d1d</color>
|
||||
<color name="releasePre">#eb7121</color>
|
||||
<color name="releaseStable">#219214</color>
|
||||
<color name="colorRed">#eb3718</color>
|
||||
<color name="releasePre">#f2711c</color>
|
||||
<color name="releaseStable">@color/btnBackground</color>
|
||||
<color name="colorRed">#CC361C</color>
|
||||
<color name="colorLightGreen">#49da39</color>
|
||||
<color name="colorDarkGreen">#009486</color>
|
||||
<color name="darkRed">#e74c3c</color>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="versionLow" translatable="false">1.10</string>
|
||||
<string name="versionHigh" translatable="false">1.12</string>
|
||||
<string name="versionLow" translatable="false">1.11</string>
|
||||
<string name="versionHigh" translatable="false">1.13</string>
|
||||
|
||||
</resources>
|
@ -4,9 +4,9 @@
|
||||
<string name="appAuthor" translatable="false">Developer : M M Arif</string>
|
||||
<string name="appEmail" translatable="false">gitnex@swatian.com</string>
|
||||
<string name="appRepo" translatable="false">Source code</string>
|
||||
<string name="appRepoLink" translatable="false">https://gitea.com/gitnex/GitNex</string>
|
||||
<string name="appRepoIssuesLink" translatable="false">https://gitea.com/gitnex/GitNex/issues</string>
|
||||
<string name="appRepoContributingLink" translatable="false">https://gitea.com/gitnex/GitNex/src/branch/master/CONTRIBUTING.md</string>
|
||||
<string name="appRepoLink" translatable="false">https://codeberg.org/gitnex/GitNex</string>
|
||||
<string name="appRepoIssuesLink" translatable="false">https://codeberg.org/gitnex/GitNex/issues</string>
|
||||
<string name="appRepoContributingLink" translatable="false">https://codeberg.org/gitnex/GitNex/src/branch/master/CONTRIBUTING.md</string>
|
||||
<string name="appWebsite" translatable="false">Website</string>
|
||||
<string name="appWebsiteLink" translatable="false">https://gitnex.com/</string>
|
||||
<string name="commitPage" translatable="false">Your Gitea version\n</string>
|
||||
@ -216,6 +216,7 @@
|
||||
<string name="releaseTypeStable" translatable="false">Stable</string>
|
||||
<string name="noDataReleasesTab">No releases found</string>
|
||||
<string name="releaseTag">Tag: %1$s</string>
|
||||
<string name="releasePublishedBy">Published by @%1$s</string>
|
||||
|
||||
<string name="collaboratorsNameToast">Collaborator : %1$s</string>
|
||||
<string name="noDataCollaboratorTab">No collaborators found</string>
|
||||
@ -232,8 +233,10 @@
|
||||
<string name="milestoneCreated">Milestone created successfully</string>
|
||||
<string name="milestoneCreatedError">Something went wrong, please try again</string>
|
||||
<string name="milestoneDateEmpty">Please choose due date</string>
|
||||
<string name="milestoneOpenIssues">Open issues : %1$d</string>
|
||||
<string name="milestoneClosedIssues">Closed issues : %1$d</string>
|
||||
<string name="milestoneNoDueDate">No due date</string>
|
||||
<string name="milestoneNoDescription">No description</string>
|
||||
<string name="milestoneIssueStatusOpen">%1$d Open</string>
|
||||
<string name="milestoneIssueStatusClosed">%1$d Closed</string>
|
||||
|
||||
<string name="newIssueSelectAssigneesListTitle">Select Assignees</string>
|
||||
<string name="newIssueSelectLabelsListTitle">Select Labels</string>
|
||||
@ -276,7 +279,7 @@
|
||||
<string name="settingsCodeBlockSelectorDialogTitle">Code Block Color Selector</string>
|
||||
<string name="settingsHomeScreenHeaderText">Home Screen</string>
|
||||
<string name="settingsHomeScreenSelectedText">My Repositories</string>
|
||||
<string name="settingshomeScreenSelectorDialogTitle">Select Home Screen</string>
|
||||
<string name="settingsHomeScreenSelectorDialogTitle">Select Home Screen</string>
|
||||
<string name="settingsCustomFontHeaderText">Font</string>
|
||||
<string name="settingsCustomFontSelectorDialogTitle">Choose Font</string>
|
||||
<string name="settingsCustomFontDefault" translatable="false">Manrope</string>
|
||||
@ -404,7 +407,7 @@
|
||||
<string name="emailErrorInUse">Email address is already in use</string>
|
||||
<string name="emailTypeText">Primary</string>
|
||||
<string name="profileTabEmails">Emails</string>
|
||||
<string name="usernameWithAt" translatable="false">\u0040\u0020%1$s</string>
|
||||
<string name="usernameWithAt" translatable="false">\u0040%1$s</string>
|
||||
<!-- profile section -->
|
||||
|
||||
<!-- single issue section -->
|
||||
@ -484,12 +487,14 @@
|
||||
<string name="noDataStargazers">No stars found</string>
|
||||
<string name="noDataWatchers">No watchers found</string>
|
||||
<string name="noDataWebsite">No website found</string>
|
||||
<string name="noDataDescription">No description found</string>
|
||||
<string name="noDataLocation">No location found</string>
|
||||
<string name="starMember">Star</string>
|
||||
<string name="watcherMember">Watcher</string>
|
||||
|
||||
<string name="commitLinkBranchesTab">Commit</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Zip Archive</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Tar Archive</string>
|
||||
<string name="zipArchiveDownloadReleasesTab">Source code (ZIP)</string>
|
||||
<string name="tarArchiveDownloadReleasesTab">Source code (TAR.GZ)</string>
|
||||
|
||||
<!-- new file -->
|
||||
<string name="newFileNameTintCopy">File Name</string>
|
||||
@ -573,7 +578,7 @@
|
||||
<string name="versionUnsupportedNew">New Gitea version detected! Please UPDATE GitNex!</string>
|
||||
<string name="versionSupportedLatest">Gitea version is up to date</string>
|
||||
<string name="versionDevelopment">Gitea development version</string>
|
||||
<string name="versionUnknow">No Gitea detected!</string>
|
||||
<string name="versionUnknown">No Gitea detected!</string>
|
||||
<string name="versionAlertTitle">Version Alert</string>
|
||||
<string name="versionAlertDialogHeader">Unsupported Version of Gitea</string>
|
||||
|
||||
@ -627,7 +632,7 @@
|
||||
<string name="mtm_accept_cert">Accept Unknown Certificate?</string>
|
||||
<string name="mtm_trust_anchor">The server certificate is not signed by a known Certificate Authority.</string>
|
||||
<string name="mtm_cert_expired">The server certificate is expired.</string>
|
||||
<string name="mtm_accept_servername">Accept Mismatching Server Name?</string>
|
||||
<string name="mtm_accept_server_name">Accept Mismatching Server Name?</string>
|
||||
<string name="mtm_hostname_mismatch">Server could not authenticate as \"%s\". The certificate is only valid for:</string>
|
||||
<string name="mtm_connect_anyway">Do you want to connect anyway?</string>
|
||||
<string name="mtm_cert_details">Certificate details:</string>
|
||||
@ -637,10 +642,10 @@
|
||||
|
||||
<string name="subscribedSuccessfully">Subscribed successfully</string>
|
||||
<string name="alreadySubscribed">You have already subscribed</string>
|
||||
<string name="subscribtionError">Subscription failed</string>
|
||||
<string name="subscriptionError">Subscription failed</string>
|
||||
<string name="unsubscribedSuccessfully">Unsubscribed successfully</string>
|
||||
<string name="alreadyUnsubscribed">You have already Unsubscribed</string>
|
||||
<string name="unsubscribtionError">Un-Subscription failed</string>
|
||||
<string name="unsubscriptionError">Un-Subscription failed</string>
|
||||
|
||||
<string name="closeMilestone">Close Milestone</string>
|
||||
<string name="openMilestone">Open Milestone</string>
|
||||
@ -654,9 +659,11 @@
|
||||
<string name="setCrashReports">Crash reports</string>
|
||||
<string name="crashMessage">You can tap the OK button to send the crash report by email. It will help to fix it :)\n\nYou can also add additional content in the email. Thank you!</string>
|
||||
|
||||
<string name="appreanceHintText">Themes, fonts, badges, code block theme</string>
|
||||
<string name="appearanceHintText">Themes, fonts, badges, code block theme</string>
|
||||
<string name="fileViewerHintText">PDF mode, source code theme</string>
|
||||
<string name="securityHintText">SSL certificates, cache</string>
|
||||
<string name="languagesHintText">Languages</string>
|
||||
<string name="reportsHintText">Crash reports</string>
|
||||
|
||||
<string name="archivedRepository">Archived</string>
|
||||
</resources>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<changelog>
|
||||
|
||||
<release version="3.0.0-rc1" versioncode="295">
|
||||
<release version="3.0.0-rc2" versioncode="296">
|
||||
<change>Under development</change>
|
||||
</release>
|
||||
|
||||
|
51
app/src/test/java/org/mian/gitnex/helpers/ParseDiffTest.java
Normal file
51
app/src/test/java/org/mian/gitnex/helpers/ParseDiffTest.java
Normal file
@ -0,0 +1,51 @@
|
||||
package org.mian.gitnex.helpers;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.mian.gitnex.models.FileDiffView;
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Author 6543
|
||||
*/
|
||||
|
||||
public class ParseDiffTest {
|
||||
|
||||
private String commitDiff = "diff --git a/blob.bin b/blob.bin\n" + "deleted file mode 100644\n" + "index 0d73bd2..0000000\n" + "Binary files a/blob.bin and /dev/null differ\n" + "diff --git a/newOne.txt b/newOne.txt\n" + "new file mode 100644\n" + "index 0000000..d46eed0\n" + "--- /dev/null\n" + "+++ b/newOne.txt\n" + "@@ -0,0 +1,2 @@\n" + "+a new file\n" + "+is ok\n" + "diff --git a/toDel.txt b/toDel.txt\n" + "deleted file mode 100644\n" + "index db7b61d..0000000\n" + "--- a/toDel.txt\n" + "+++ /dev/null\n" + "@@ -1,6 +0,0 @@\n" + "-fdsafew\n" + "-fcdsafd\n" + "-saf\n" + "-dsa\n" + "-fds\n" + "-af\n" + "diff --git a/wow.txt b/wow.txt\n" + "index 92e7b0a..c6f2550 100644\n" + "--- a/wow.txt\n" + "+++ b/wow.txt\n" + "@@ -1 +1 @@\n" + "-no newLN\n" + "\\ No newline at end of file\n" + "+no newLN";
|
||||
private String pullDiff = "diff --git a/blob.bin b/blob.bin\n" + "deleted file mode 100644\n" + "index 0d73bd22356cdedbda15802490dbba5677c0bf82..0000000000000000000000000000000000000000\n" + "GIT binary patch\n" + "literal 0\n" + "HcmV?d00001\n" + "\n" + "literal 1048576\n" + "zcmV(nK=QwPuB28ikRJ&1O;k}2;ZJdPRlcSh&H3ZzL{FUXh$7I70$=OgJ&|C6l9n5^\n" + "z)($UbdKG~u1=kru;-zP`c59V|o(6s6w`nh4BZjq62uO^~OO=?T8h^2Wd<-s#e_iI~\n" + "zURkze=$MhaJ$k?4&39P$(BT6=fYUYoKa5hsMqqt;d=e0W61jUQXj5h&>9Mf9aHlLn\n" + "zL?z4mKo3>xs9>gwR}Cx#ZeNWKy0M;5CRQHq%6NVh5=X<1a8P)FsE7yASIj-Jq{{ex\n" + "z2A~tfI3XyuL5>6ot@$SpZItcakZOhIGXKm-LOOpY_XVQ@3=@2EfJq~TXJfiw$1e+3\n" + "zGr~C0-C$O1g|{ndCbn0qMk{!T3Yz523kz;7D*LkRfhH7eYxM4fpC`qUAu4irPjtJy\n" + "Jx`FK##b8Ms9rXYJ\n" + "diff --git a/newOne.txt b/newOne.txt\n" + "new file mode 100644\n" + "index 0000000..d46eed0\n" + "--- /dev/null\n" + "+++ b/newOne.txt\n" + "@@ -0,0 +1,2 @@\n" + "+a new file\n" + "+is ok\n" + "diff --git a/toDel.txt b/toDel.txt\n" + "deleted file mode 100644\n" + "index db7b61d..0000000\n" + "--- a/toDel.txt\n" + "+++ /dev/null\n" + "@@ -1,6 +0,0 @@\n" + "-fdsafew\n" + "-fcdsafd\n" + "-saf\n" + "-dsa\n" + "-fds\n" + "-af\n" + "diff --git a/wow.txt b/wow.txt\n" + "index 92e7b0a..c6f2550 100644\n" + "--- a/wow.txt\n" + "+++ b/wow.txt\n" + "@@ -1 +1 @@\n" + "-no newLN\n" + "\\ No newline at end of file\n" + "+no newLN";
|
||||
|
||||
@Test
|
||||
public void parseCommitDiff() {
|
||||
|
||||
List<FileDiffView> parsed = ParseDiff.getFileDiffViewArray(commitDiff);
|
||||
assertEquals(4, parsed.size());
|
||||
assertTrue(parsed.get(0).isFileBinary());
|
||||
assertFalse(parsed.get(1).isFileBinary());
|
||||
|
||||
assertEquals(1, parsed.get(1).getFileContents().size());
|
||||
assertEquals(2, parsed.get(1).getFileContents().get(0).getLineAdded());
|
||||
assertEquals(0, parsed.get(1).getFileContents().get(0).getLineRemoved());
|
||||
|
||||
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineAdded());
|
||||
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineRemoved());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void parsePullDiff() {
|
||||
|
||||
List<FileDiffView> parsed = ParseDiff.getFileDiffViewArray(pullDiff);
|
||||
assertEquals(4, parsed.size());
|
||||
assertTrue(parsed.get(0).isFileBinary());
|
||||
assertFalse(parsed.get(1).isFileBinary());
|
||||
|
||||
assertEquals(1, parsed.get(1).getFileContents().size());
|
||||
assertEquals(2, parsed.get(1).getFileContents().get(0).getLineAdded());
|
||||
assertEquals(0, parsed.get(1).getFileContents().get(0).getLineRemoved());
|
||||
|
||||
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineAdded());
|
||||
assertEquals(1, parsed.get(3).getFileContents().get(0).getLineRemoved());
|
||||
}
|
||||
|
||||
}
|
@ -7,7 +7,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@
|
||||
Release notes will be published with the stable release.
|
||||
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
||||
|
||||
https://gitea.com/gitnex/GitNex/milestone/171?q=&type=all&sort=&state=closed&labels=&assignee=0
|
||||
https://codeberg.org/gitnex/GitNex/milestone/296?type=all&state=closed
|
||||
|
@ -3,4 +3,4 @@
|
||||
Release notes will be published with the stable release.
|
||||
In the mean time check the milestone for pull requests and issues that are merged/closed.
|
||||
|
||||
https://gitea.com/gitnex/GitNex/milestone/171?q=&type=all&state=closed
|
||||
https://codeberg.org/gitnex/GitNex/milestone/296?type=all&state=closed
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user