Fix bug #549, add more file ext to file viewer (#560)

Fix empty release notes bug

Add new sponsor

Fix bug #549, add more file ext to file viewer

Co-authored-by: M M Arif <mmarif@swatian.com>
Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/560
Reviewed-by: opyale <opyale@noreply.codeberg.org>
Reviewed-by: 6543 <6543@noreply.codeberg.org>
This commit is contained in:
M M Arif 2020-06-28 16:45:39 +02:00 committed by 6543
parent f285d47a0b
commit 95fc5e1e9a
6 changed files with 11 additions and 5 deletions

View File

@ -273,11 +273,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
String instanceUrlWithProtocol;
if(protocol.toLowerCase().equals("https")) {
instanceUrl = "https://" + instanceHost + "/api/v1/";
instanceUrlWithProtocol = "https://" + instanceHost;
instanceUrlWithProtocol = "https://" + instanceHost + "/";
}
else {
instanceUrl = "http://" + instanceHost + "/api/v1/";
instanceUrlWithProtocol = "http://" + instanceHost;
instanceUrlWithProtocol = "http://" + instanceHost + "/";
}
tinyDb.putString("instanceUrlRaw", instanceHost);

View File

@ -59,6 +59,7 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
private TextView repoStars;
private TextView repoForks;
private TextView repoOpenIssuesCount;
private TextView repoType;
private LinearLayout archiveRepo;
private ReposSearchViewHolder(View itemView) {
@ -75,6 +76,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);
repoType = itemView.findViewById(R.id.repoType);
archiveRepo = itemView.findViewById(R.id.archiveRepoFrame);
itemView.setOnClickListener(v -> {
@ -233,9 +235,11 @@ public class ExploreRepositoriesAdapter extends RecyclerView.Adapter<ExploreRepo
holder.fullName.setText(currentItem.getFullname());
if(currentItem.getPrivateFlag()) {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_lock_bold);
holder.repoType.setText(R.string.strPrivate);
}
else {
holder.repoPrivatePublic.setImageResource(R.drawable.ic_public);
holder.repoType.setText(R.string.strPublic);
}
holder.repoStars.setText(currentItem.getStars_count());
holder.repoForks.setText(currentItem.getForks_count());

View File

@ -203,7 +203,7 @@ public class ReleasesAdapter extends RecyclerView.Adapter<ReleasesAdapter.Releas
markwon.setParsedMarkdown(holder.releaseBodyContent, bodyWithMD);
}
else {
holder.releaseBodyContent.setVisibility(View.GONE);
holder.releaseBodyContent.setText(R.string.noReleaseBodyContent);
}
holder.downloadFrame.setOnClickListener(v -> {

View File

@ -261,7 +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", "cvs", "cmake", "in", "info", "spec", "m4", "am", "dist", "pam"};
return Arrays.asList(extValues).contains(ext);

View File

@ -9,6 +9,7 @@
<item>Sameer Gupta</item>
<item>Yin Yihang</item>
<item>Svierne</item>
<item>Sam Forest</item>
</string-array>
</resources>

View File

@ -217,6 +217,7 @@
<string name="noDataReleasesTab">No releases found</string>
<string name="releaseTag">Tag: %1$s</string>
<string name="releasePublishedBy">Published by @%1$s</string>
<string name="noReleaseBodyContent">Release notes are not provided by the publisher.</string>
<string name="collaboratorsNameToast">Collaborator : %1$s</string>
<string name="noDataCollaboratorTab">No collaborators found</string>