Skip to content

Commit

Permalink
Merge pull request #4 from maks/update-changelog-display
Browse files Browse the repository at this point in the history
Update changelog display, Fix CSS mimetype
  • Loading branch information
maks authored Mar 4, 2020
2 parents 5370695 + 101cc9f commit 9b8c579
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 291 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ android {
applicationId "com.manichord.viperedit"
minSdkVersion 21
targetSdkVersion 29
versionCode 4
versionName "1.1"
versionCode 5
versionName "1.1.2"
}
compileOptions {
sourceCompatibility 1.8
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

<data android:mimeType="text/plain" />
<data android:mimeType="text/markdown" />
<data android:mimeType="text/css" />
<data android:mimeType="application/javascript" />
<data android:mimeType="application/json" />
<data android:host="*" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import android.view.LayoutInflater;

import it.gmariotti.changelibs.library.view.ChangeLogListView;

import com.manichord.viperedit.R;
import com.manichord.viperedit.util.Build;

public class ChangelogDialog extends DialogFragment {

Expand All @@ -60,11 +60,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
.setTitle(R.string.changelog)
.setView(chgList)
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
(dialog, whichButton) -> dialog.dismiss()
)
.setPositiveButton(R.string.vota, new DialogInterface.OnClickListener() {
/**
Expand All @@ -73,14 +69,8 @@ public void onClick(DialogInterface dialog, int whichButton) {
@Override
public void onClick(final DialogInterface dialog, final int which) {
try {
if (Build.FOR_AMAZON) {
String url = "amzn://apps/android?p=com.maskyn.fileeditor";
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} else {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.maskyn.fileeditor"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.manichord.viperedit"))
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
} catch (Exception e) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
import com.manichord.viperedit.dialogfragment.EditTextDialog;
import com.manichord.viperedit.preferences.PreferenceHelper;
import com.manichord.viperedit.util.AlphanumComparator;
import com.manichord.viperedit.util.Build;
import com.manichord.viperedit.util.ThemeUtils;

public class SelectFileActivity extends AppCompatActivity implements SearchView.OnQueryTextListener, AdapterView.OnItemClickListener, EditTextDialog.EditDialogListener {

private static final String ActionKey = "action";
private static final long MAX_FILE_SIZE = 20_000;

private String currentFolder;
private ListView listView;
Expand Down Expand Up @@ -349,7 +349,7 @@ protected LinkedList<AdapterDetailedList.FileDetail> doInBackground(final String
""));
} else if (f.isFile()
&& !FilenameUtils.isExtension(f.getName().toLowerCase(), unopenableExtensions)
&& FileUtils.sizeOf(f) <= Build.MAX_FILE_SIZE * FileUtils.ONE_KB) {
&& FileUtils.sizeOf(f) <= MAX_FILE_SIZE * FileUtils.ONE_KB) {
final long fileSize = f.length();
SimpleDateFormat format = new SimpleDateFormat("MMM dd, yyyy hh:mm a");
String date = format.format(f.lastModified());
Expand Down
57 changes: 0 additions & 57 deletions app/src/main/java/com/manichord/viperedit/util/Build.java

This file was deleted.

11 changes: 1 addition & 10 deletions app/src/main/java/com/manichord/viperedit/util/MimeTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,9 @@
package com.manichord.viperedit.util;

public class MimeTypes {
public static final String[] MIME_TEXT = {
"ajx", "am", "asa", "asc", "asp", "aspx", "awk", "bat", "c", "cdf", "cf", "cfg", "cfm", "cgi", "cnf", "conf",
"cc", "cpp", "css", "csv", "ctl", "dat", "dhtml", "diz", "file", "forward", "grp", "h", "hh", "hpp", "hqx", "hta", "htaccess",
"htc", "htm", "html", "htpasswd", "htt", "htx", "in", "inc", "info", "ini", "ink", "java", "js", "jsp", "key", "latex", "log",
"logfile", "m3u", "m4", "m4a", "mak", "map", "md", "markdown", "model", "msg", "nfo", "nsi", "info", "old", "pas", "patch", "perl",
"php", "php2", "php3", "php4", "php5", "php6", "phtml", "pix", "pl", "pm", "po", "pwd", "py", "qmail", "rb", "rbl", "rbw",
"readme", "reg", "rss", "rtf", "ruby", "session", "setup", "sh", "shtm", "shtml", "sql", "ssh", "stm", "style", "svg", "tcl",
"tex", "text", "threads", "tmpl", "tpl", "txt", "ubb", "vbs", "xhtml", "xml", "xrc", "xsl"
};
public static final String[] MIME_CODE = {
"cs", "php", "js", "java", "py", "rb", "aspx", "cshtml", "vbhtml", "go", "c", "h", "cc", "cpp", "hh", "hpp", "pl", "pm", "t", "pod",
"m", "f", "for", "f90", "f95", "asp", "json", "wiki", "lua", "r"
"m", "f", "for", "f90", "f95", "asp", "json", "wiki", "lua", "r", "dart", "ts", "css", "rs"
};
public static final String[] MIME_HTML = {
"htm", "html", "xhtml"
Expand Down
Loading

0 comments on commit 9b8c579

Please sign in to comment.