diff --git a/app/src/main/assets/highlight/styles/prettify.css b/app/src/main/assets/highlight/styles/prettify.css index e1d43c60..2a963e10 100644 --- a/app/src/main/assets/highlight/styles/prettify.css +++ b/app/src/main/assets/highlight/styles/prettify.css @@ -24,7 +24,7 @@ li.L6, li.L7, li.L8, li.L9 { - padding-left: 0px !important; + padding-left: 1em; background-color: #fff; list-style-type: decimal; } diff --git a/app/src/main/assets/highlight/styles/prettify_dark.css b/app/src/main/assets/highlight/styles/prettify_dark.css new file mode 100644 index 00000000..192cfaca --- /dev/null +++ b/app/src/main/assets/highlight/styles/prettify_dark.css @@ -0,0 +1,122 @@ +body { + background: #22252A; +} + +.prettyprint { + background: #22252A; + font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace; + border: 0 !important; +} + +.pln { + color: #e6e9ed; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; + color: #656d78; +} + +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + padding-left: 1em; + background-color: #22252A; + list-style-type: decimal; +} + +@media screen { + + /* string content */ + + .str { + color: #ffce54; + } + + /* keyword */ + + .kwd { + color: #4fc1e9; + } + + /* comment */ + + .com { + color: #656d78; + } + + /* type name */ + + .typ { + color: #4fc1e9; + } + + /* literal value */ + + .lit { + color: #ac92ec; + } + + /* punctuation */ + + .pun { + color: #e6e9ed; + } + + /* lisp open bracket */ + + .opn { + color: #e6e9ed; + } + + /* lisp close bracket */ + + .clo { + color: #e6e9ed; + } + + /* markup tag name */ + + .tag { + color: #ed5565; + } + + /* markup attribute name */ + + .atn { + color: #a0d468; + } + + /* markup attribute value */ + + .atv { + color: #ffce54; + } + + /* declaration */ + + .dec { + color: #ac92ec; + } + + /* variable name */ + + .var { + color: #e6e9ed; + } + + /* function name */ + + .fun { + color: #e6e9ed; + } +} \ No newline at end of file diff --git a/app/src/main/assets/md/github_dark.css b/app/src/main/assets/md/github_dark.css new file mode 100755 index 00000000..2ce8b1ae --- /dev/null +++ b/app/src/main/assets/md/github_dark.css @@ -0,0 +1,564 @@ +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 16px; + padding: 15px; + line-height: 1.5; + word-wrap: break-word; + background: #22252A; + color: #ccc; +} + +a { + color: #00E5FF !important; +} + +body::before { + display: table; + content: "" +} + +body::after { + display: table; + clear: both; + content: "" +} + +body>:first-child { + margin-top: 0!important +} + +body>:last-child { + margin-bottom: 0!important +} + +body a:not([href]) { + color: inherit; + text-decoration: none +} + +body .absent { + color: #c0392b +} + +body .anchor { + float: left; + padding-right: 4px; + margin-left: -20px; + line-height: 1 +} + +body .anchor:focus { + outline: none +} + +body p, body blockquote, body ul, body ol, body dl, body table, body pre { + margin-top: 0; + margin-bottom: 16px +} + +body hr { + height: .25em; + padding: 0; + margin: 24px 0; + background-color: #c0c0c0; + border: 0 +} + +body blockquote { + padding: 0 1em; + color: #777; + border-left: .25em solid #ddd +} + +body blockquote>:first-child { + margin-top: 0 +} + +body blockquote>:last-child { + margin-bottom: 0 +} + +body kbd { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + line-height: 10px; + color: #656d78; + vertical-align: middle; + background-color: #22252A; + border: solid 1px #656d78; + border-bottom-color: #bbb; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #656d78 +} + +body .loweralpha { + list-style-type: lower-alpha +} + +body h1, body h2, body h3, body h4, body h5, body h6 { + margin-top: 24px; + margin-bottom: 16px; + font-weight: 600; + line-height: 1.25; + color: #fff; +} + +body h1 .octicon-link, body h2 .octicon-link, body h3 .octicon-link, body h4 .octicon-link, body h5 .octicon-link, body h6 .octicon-link { + color: #fff; + vertical-align: middle; + visibility: hidden +} + +body h1:hover .anchor, body h2:hover .anchor, body h3:hover .anchor, body h4:hover .anchor, body h5:hover .anchor, body h6:hover .anchor { + text-decoration: none +} + +body h1:hover .anchor .octicon-link, body h2:hover .anchor .octicon-link, body h3:hover .anchor .octicon-link, body h4:hover .anchor .octicon-link, body h5:hover .anchor .octicon-link, body h6:hover .anchor .octicon-link { + visibility: visible +} + +body h1 tt, body h1 code, body h2 tt, body h2 code, body h3 tt, body h3 code, body h4 tt, body h4 code, body h5 tt, body h5 code, body h6 tt, body h6 code { + font-size: inherit +} + +body h1 { + padding-bottom: .3em; + font-size: 2em; + border-bottom: 1px solid #656d78 +} + +body h2 { + padding-bottom: .3em; + font-size: 1.5em; + border-bottom: 1px solid #656d78 +} + +body h3 { + font-size: 1.25em +} + +body h4 { + font-size: 1em +} + +body h5 { + font-size: .875em +} + +body h6 { + font-size: .85em; + color: #c0c0c0 +} + +body ul, body ol { + padding-left: 2em +} + +body ul.no-list, body ol.no-list { + padding: 0; + list-style-type: none +} + +body ul ul, body ul ol, body ol ol, body ol ul { + margin-top: 0; + margin-bottom: 0 +} + +body li>p { + margin-top: 16px +} + +body li+li { + margin-top: .25em +} + +body dl { + padding: 0 +} + +body dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: 700 +} + +body dl dd { + padding: 0 16px; + margin-bottom: 16px +} + +body table { + display: block; + width: 100%; + overflow: auto +} + +body table th { + font-weight: 700 +} + +body table th, body table td { + padding: 6px 13px; + border: 1px solid #656d78 +} + +body table tr { + background-color: #22252A; + border-top: 1px solid #656d78 +} + +body table tr:nth-child(2n) { + background-color: #656d78 +} + +body img { + max-width: 100%; + box-sizing: content-box; + background-color: transparent; +} + +body img[align=right] { + padding-left: 20px +} + +body img[align=left] { + padding-right: 20px +} + +body .emoji { + max-width: none; + vertical-align: text-top; + background-color: transparent +} + +body span.frame { + display: block; + overflow: hidden +} + +body span.frame>span { + display: block; + float: left; + width: auto; + padding: 7px; + margin: 13px 0 0; + overflow: hidden; + border: 1px solid #656d78 +} + +body span.frame span img { + display: block; + float: left +} + +body span.frame span span { + display: block; + padding: 5px 0 0; + clear: both; + color: #ccc +} + +body span.align-center { + display: block; + overflow: hidden; + clear: both +} + +body span.align-center>span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: center +} + +body span.align-center span img { + margin: 0 auto; + text-align: center +} + +body span.align-right { + display: block; + overflow: hidden; + clear: both +} + +body span.align-right>span { + display: block; + margin: 13px 0 0; + overflow: hidden; + text-align: right +} + +body span.align-right span img { + margin: 0; + text-align: right +} + +body span.float-left { + display: block; + float: left; + margin-right: 13px; + overflow: hidden +} + +body span.float-left span { + margin: 13px 0 0 +} + +body span.float-right { + display: block; + float: right; + margin-left: 13px; + overflow: hidden +} + +body span.float-right>span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: right +} + +body code, body tt { + padding: 0; + padding-top: .2em; + padding-bottom: .2em; + margin: 0; + font-size: 85%; + background-color: rgba(84, 84, 84, 0.04); + border-radius: 3px +} + +body code::before, body code::after, body tt::before, body tt::after { + letter-spacing: -.2em; + content: "\00a0" +} + +body code br, body tt br { + display: none +} + +body del code { + text-decoration: inherit +} + +body pre { + word-wrap: normal +} + +body pre>code { + padding: 0; + margin: 0; + font-size: 100%; + word-break: normal; + white-space: pre; + background: transparent; + border: 0 +} + +body .highlight { + margin-bottom: 16px +} + +body .highlight pre { + margin-bottom: 0; + word-break: normal +} + +body .highlight pre, body pre { + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: #2D3035; + border-radius: 3px +} + +body pre code, body pre tt { + display: inline; + max-width: auto; + padding: 0; + margin: 0; + overflow: visible; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0 +} + +body pre code::before, body pre code::after, body pre tt::before, body pre tt::after { + content: normal +} + +body .csv-data td, body .csv-data th { + padding: 5px; + overflow: hidden; + font-size: 12px; + line-height: 1; + text-align: left; + white-space: nowrap +} + +body .csv-data .blob-num { + padding: 10px 8px 9px; + text-align: right; + background: #656d78; + border: 0 +} + +body .csv-data tr { + border-top: 0 +} + +body .csv-data th { + font-weight: 700; + background: #656d78; + border-top: 0 +} + +body { + font-size: 15px +} + +body blockquote { + margin-right: 0; + margin-left: 0 +} + +body code { + white-space: normal +} + +body.email-format { + line-height: 1.5em!important +} + +body.email-format div { + white-space: pre-wrap +} + +body .email-hidden-reply { + display: none; + white-space: pre-wrap +} + +body .email-hidden-reply.expanded { + display: block +} + +body .email-quoted-reply, body .email-signature-reply { + padding: 0 15px; + margin-bottom: 15px; + color: #c0c0c0; + border-left: 4px solid #656d78 +} + +.pl-c { + color: #E0E0E0 +} + +.pl-c1, .pl-s .pl-v { + color: #2196F3 +} + +.pl-e, .pl-en { + color: #AB47BC +} + +.pl-smi, .pl-s .pl-s1 { + color: #C2185B +} + +.pl-ent { + color: #4CAF50 +} + +.pl-k { + color: #d32f2f +} + +.pl-s, .pl-pds, .pl-s .pl-pse .pl-s1, .pl-sr, .pl-sr .pl-cce, .pl-sr .pl-sre, .pl-sr .pl-sra { + color: #2196F3 +} + +.pl-v { + color: #F57C00 +} + +.pl-id { + color: #E64A19 +} + +.pl-ii { + color: #f8f8f8; + background-color: #d32f2f +} + +.pl-sr .pl-cce { + font-weight: 700; + color: #4CAF50 +} + +.pl-ml { + color: #ef5350 +} + +.pl-mh, .pl-mh .pl-en, .pl-ms { + font-weight: 700; + color: #2196F3 +} + +.pl-mq { + color: #0097A7 +} + +.pl-mi { + font-style: italic; + color: #333 +} + +.pl-mb { + font-weight: 700; + color: #333 +} + +.pl-md { + color: #ef5350; + background-color: #656d78 +} + +.pl-mi1 { + color: #4CAF50; + background-color: #656d78 +} + +.pl-mdr { + font-weight: 700; + color: #AB47BC +} + +.pl-mo { + color: #2196F3 +} + +kbd { + display: inline-block; + padding: 3px 5px; + font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + color: #555; + vertical-align: middle; + background-color: #656d78; + border: solid 1px #586b78; + border-bottom-color: #556578; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #656d78 +} + +.badmono { + font-family: sans-serif; + font-weight: 700 +} \ No newline at end of file diff --git a/app/src/main/assets/md/github_wrap_dark.css b/app/src/main/assets/md/github_wrap_dark.css new file mode 100755 index 00000000..2fa8db48 --- /dev/null +++ b/app/src/main/assets/md/github_wrap_dark.css @@ -0,0 +1,602 @@ +html { + overflow: hidden !important; +} +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 16px; + line-height: 1.5; + word-wrap: break-word; + overflow: hidden !important; + margin: 0 !important; + padding: 0 !important; + background: #2D3035; + color: #ccc; +} + +a { + color: #00E5FF !important; +} + +body::before { + display: table; + content: ""; +} + +body::after { + display: table; + clear: both; + content: ""; +} + +body>:first-child { + margin-top: 2px !important +} + +body>:last-child { + margin-bottom: 0!important +} + +body a:not([href]) { + color: inherit; + text-decoration: none +} + +body .absent { + color: #c00 +} + +body .anchor { + float: left; + padding-right: 4px; + margin-left: -20px; + line-height: 1 +} + +body .anchor:focus { + outline: none +} + +p, blockquote, ul, ol, dl, table, pre { + margin-top: 0; + margin-bottom: 4px +} + +body hr { + height: .25em; + padding: 0; + margin: 24px 0; + background-color: #c0c0c0; + border: 0 +} + +body blockquote { + padding: 0 1em; + color: #777; + border-left: .25em solid #ddd +} + +body blockquote>:first-child { + margin-top: 0 +} + +body blockquote>:last-child { + margin-bottom: 0 +} + +body kbd { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + line-height: 10px; + color: #555; + vertical-align: middle; + background-color: #22252A; + border: solid 1px #656d78; + border-bottom-color: #bbb; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #656d78 +} + +body .loweralpha { + list-style-type: lower-alpha +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 24px; + margin-bottom: 4px; + font-weight: 600; + line-height: 1.25 + color: #fff; +} + +body h1 .octicon-link, body h2 .octicon-link, body h3 .octicon-link, body h4 .octicon-link, body h5 .octicon-link, body h6 .octicon-link { + color: #fff; + vertical-align: middle; + visibility: hidden +} + +body h1:hover .anchor, body h2:hover .anchor, body h3:hover .anchor, body h4:hover .anchor, body h5:hover .anchor, body h6:hover .anchor { + text-decoration: none +} + +body h1:hover .anchor .octicon-link, body h2:hover .anchor .octicon-link, body h3:hover .anchor .octicon-link, body h4:hover .anchor .octicon-link, body h5:hover .anchor .octicon-link, body h6:hover .anchor .octicon-link { + visibility: visible +} + +body h1 tt, body h1 code, body h2 tt, body h2 code, body h3 tt, body h3 code, body h4 tt, body h4 code, body h5 tt, body h5 code, body h6 tt, body h6 code { + font-size: inherit +} + +body h1 { + padding-bottom: .3em; + font-size: 2em; + border-bottom: 1px solid #656d78 +} + +body h2 { + padding-bottom: .3em; + font-size: 1.5em; + border-bottom: 1px solid #656d78 +} + +body h3 { + font-size: 1.25em +} + +body h4 { + font-size: 1em +} + +body h5 { + font-size: .875em +} + +body h6 { + font-size: .85em; + color: #c0c0c0 +} + +body ul, body ol { + padding-left: 2em +} + +body ul.no-list, body ol.no-list { + padding: 0; + list-style-type: none +} + +body ul ul, body ul ol, body ol ol, body ol ul { + margin-top: 0; + margin-bottom: 0 +} + +body li>p { + margin-top: 16px +} + +body li+li { + margin-top: .25em +} + +body dl { + padding: 0 +} + +body dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: 700 +} + +dl dd { + padding: 0 16px; + margin-bottom: 4px +} + +body table { + display: block; + width: 100%; + overflow: auto +} + +body table th { + font-weight: 700 +} + +body table th, body table td { + padding: 6px 13px; + border: 1px solid #656d78 +} + +body table tr { + background-color: #22252A; + border-top: 1px solid #656d78 +} + +body table tr:nth-child(2n) { + background-color: #656d78 +} + +body img { + max-width: 100%; + box-sizing: content-box; + background-color: transparent; +} + +body img[align=right] { + padding-left: 20px +} + +body img[align=left] { + padding-right: 20px +} + +body .emoji { + max-width: none; + vertical-align: text-top; + background-color: transparent +} + +body span.frame { + display: block; + overflow: hidden +} + +body span.frame>span { + display: block; + float: left; + width: auto; + padding: 7px; + margin: 13px 0 0; + overflow: hidden; + border: 1px solid #656d78 +} + +body span.frame span img { + display: block; + float: left +} + +body span.frame span span { + display: block; + padding: 5px 0 0; + clear: both; + color: #ccc +} + +body span.align-center { + display: block; + overflow: hidden; + clear: both +} + +body span.align-center>span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: center +} + +body span.align-center span img { + margin: 0 auto; + text-align: center +} + +body span.align-right { + display: block; + overflow: hidden; + clear: both +} + +body span.align-right>span { + display: block; + margin: 13px 0 0; + overflow: hidden; + text-align: right +} + +body span.align-right span img { + margin: 0; + text-align: right +} + +body span.float-left { + display: block; + float: left; + margin-right: 13px; + overflow: hidden +} + +body span.float-left span { + margin: 13px 0 0 +} + +body span.float-right { + display: block; + float: right; + margin-left: 13px; + overflow: hidden +} + +body span.float-right>span { + display: block; + margin: 13px auto 0; + overflow: hidden; + text-align: right +} + +body code, body tt { + padding: 0; + padding-top: .2em; + padding-bottom: .2em; + margin: 0; + font-size: 85%; + background-color: rgba(84, 84, 84, 0.04); + border-radius: 3px +} + +body code::before, body code::after, body tt::before, body tt::after { + letter-spacing: -.2em; + content: "\00a0" +} + +body code br, body tt br { + display: none +} + +body del code { + text-decoration: inherit +} + +body pre { + word-wrap: normal +} + +body pre>code { + padding: 0; + margin: 0; + font-size: 100%; + word-break: normal; + white-space: pre; + background: transparent; + border: 0 +} + +.highlight { + margin-bottom: 16px +} + +body .highlight pre { + margin-bottom: 0; + word-break: normal +} + +body .highlight pre, body pre { + padding: 8px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: #26282C; + border-radius: 3px +} + +body pre code, body pre tt { + display: inline; + max-width: auto; + padding: 0; + margin: 0; + overflow: visible; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0 +} + +body pre code::before, body pre code::after, body pre tt::before, body pre tt::after { + content: normal +} + +body .csv-data td, body .csv-data th { + padding: 5px; + overflow: hidden; + font-size: 12px; + line-height: 1; + text-align: left; + white-space: nowrap +} + +body .csv-data .blob-num { + padding: 10px 8px 9px; + text-align: right; + background: #656d78; + border: 0 +} + +body .csv-data tr { + border-top: 0 +} + +body .csv-data th { + font-weight: 700; + background: #656d78; + border-top: 0 +} + +body { + font-size: 15px +} + +body blockquote { + margin-right: 0; + margin-left: 0 +} + +body code { + white-space: normal +} + +body.email-format { + line-height: 1.5em!important +} + +body.email-format div { + white-space: pre-wrap +} + +body .email-hidden-reply { + display: none; + white-space: pre-wrap +} + +body .email-hidden-reply.expanded { + display: block +} + +.email-quoted-reply, .email-signature-reply { + padding: 0 15px; + margin-bottom: 15px; + color: #c0c0c0; + border-left: 4px solid #656d78 +} + +.pl-c { + color: #E0E0E0 +} + +.pl-c1, .pl-s .pl-v { + color: #2196F3 +} + +.pl-e, .pl-en { + color: #AB47BC +} + +.pl-smi, .pl-s .pl-s1 { + color: #C2185B +} + +.pl-ent { + color: #4CAF50 +} + +.pl-k { + color: #d32f2f +} + +.pl-s, .pl-pds, .pl-s .pl-pse .pl-s1, .pl-sr, .pl-sr .pl-cce, .pl-sr .pl-sre, .pl-sr .pl-sra { + color: #2196F3 +} + +.pl-v { + color: #F57C00 +} + +.pl-id { + color: #E64A19 +} + +.pl-ii { + color: #f8f8f8; + background-color: #d32f2f +} + +.pl-sr .pl-cce { + font-weight: 700; + color: #4CAF50 +} + +.pl-ml { + color: #ef5350 +} + +.pl-mh, .pl-mh .pl-en, .pl-ms { + font-weight: 700; + color: #2196F3 +} + +.pl-mq { + color: #0097A7 +} + +.pl-mi { + font-style: italic; + color: #333 +} + +.pl-mb { + font-weight: 700; + color: #333 +} + +.pl-md { + color: #ef5350; + background-color: #656d78 +} + +.pl-mi1 { + color: #4CAF50; + background-color: #656d78 +} + +.pl-mdr { + font-weight: 700; + color: #AB47BC +} + +.pl-mo { + color: #2196F3 +} + +kbd { + display: inline-block; + padding: 3px 5px; + font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + color: #555; + vertical-align: middle; + background-color: #656d78; + border: solid 1px #586b78; + border-bottom-color: #556578; + border-radius: 3px; + box-shadow: inset 0 -1px 0 #656d78 +} + +.badmono { + font-family: sans-serif; + font-weight: 700 +} + +pre { + word-wrap: break-all; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; + margin-right: -10px !important; +} + +pre code { + word-wrap: break-all !important; + white-space: pre-wrap !important; + white-space: -moz-pre-wrap !important; + white-space: -pre-wrap !important; + white-space: -o-pre-wrap !important; + word-wrap: break-word !important; +} + +img { + max-width: 100% !important; +} + +table { + word-wrap: break-all !important; + white-space: pre-wrap !important; + white-space: -moz-pre-wrap !important; + white-space: -pre-wrap !important; + white-space: -o-pre-wrap !important; + word-wrap: break-word !important; + margin: 4px 0px 4px 0px !important; +} diff --git a/app/src/main/java/com/fastaccess/App.java b/app/src/main/java/com/fastaccess/App.java index 6e6864a0..3a8e4bfa 100644 --- a/app/src/main/java/com/fastaccess/App.java +++ b/app/src/main/java/com/fastaccess/App.java @@ -2,6 +2,7 @@ package com.fastaccess; import android.support.annotation.NonNull; import android.support.multidex.MultiDexApplication; +import android.support.v7.app.AppCompatDelegate; import android.support.v7.preference.PreferenceManager; import com.fastaccess.data.dao.model.Models; @@ -27,6 +28,10 @@ public class App extends MultiDexApplication { private static App instance; private SingleEntityStore dataStore; + static { + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + } + @Override public void onCreate() { super.onCreate(); instance = this; diff --git a/app/src/main/java/com/fastaccess/helper/AppHelper.java b/app/src/main/java/com/fastaccess/helper/AppHelper.java index 04bcc743..27658b9b 100644 --- a/app/src/main/java/com/fastaccess/helper/AppHelper.java +++ b/app/src/main/java/com/fastaccess/helper/AppHelper.java @@ -4,6 +4,8 @@ import android.app.NotificationManager; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; +import android.content.res.Configuration; +import android.content.res.Resources; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; @@ -41,4 +43,9 @@ public class AppHelper { clipboard.setPrimaryClip(clip); Toasty.success(context, context.getString(R.string.success_copied)).show(); } + + public static boolean isNightMode(@NonNull Resources resources) { + int currentNightMode = resources.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; + return currentNightMode == Configuration.UI_MODE_NIGHT_YES; + } } diff --git a/app/src/main/java/com/fastaccess/ui/adapter/viewholder/IssueTimelineViewHolder.java b/app/src/main/java/com/fastaccess/ui/adapter/viewholder/IssueTimelineViewHolder.java index 7cc9212c..9a2ac772 100644 --- a/app/src/main/java/com/fastaccess/ui/adapter/viewholder/IssueTimelineViewHolder.java +++ b/app/src/main/java/com/fastaccess/ui/adapter/viewholder/IssueTimelineViewHolder.java @@ -8,8 +8,8 @@ import android.view.ViewGroup; import com.fastaccess.R; import com.fastaccess.data.dao.IssueEventAdapterModel; -import com.fastaccess.data.dao.model.IssueEvent; import com.fastaccess.data.dao.LabelModel; +import com.fastaccess.data.dao.model.IssueEvent; import com.fastaccess.data.dao.types.IssueEventType; import com.fastaccess.helper.InputHelper; import com.fastaccess.helper.ParseDateFormat; diff --git a/app/src/main/java/com/fastaccess/ui/modules/repos/code/commit/details/CommitPagerView.java b/app/src/main/java/com/fastaccess/ui/modules/repos/code/commit/details/CommitPagerView.java index cd3bd008..097720f2 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/repos/code/commit/details/CommitPagerView.java +++ b/app/src/main/java/com/fastaccess/ui/modules/repos/code/commit/details/CommitPagerView.java @@ -113,6 +113,7 @@ public class CommitPagerView extends BaseActivity loadDataWithBaseURL("file:///android_asset/highlight/", page, "text/html", "utf-8", null)); } } @@ -120,7 +120,7 @@ public class PrettifyWebView extends NestedWebView { } if (!InputHelper.isEmpty(source)) { if (!wrap) addJavascriptInterface(new MarkDownInterceptorInterface(this), "Android"); - String page = GithubHelper.generateContent(source, baseUrl, wrap); + String page = GithubHelper.generateContent(source, baseUrl, wrap, AppHelper.isNightMode(getResources())); post(() -> loadDataWithBaseURL("file:///android_asset/md/", page, "text/html", "utf-8", null)); } } diff --git a/app/src/main/java/com/prettifier/pretty/helper/GithubHelper.java b/app/src/main/java/com/prettifier/pretty/helper/GithubHelper.java index 0a7302f0..9c1ece90 100755 --- a/app/src/main/java/com/prettifier/pretty/helper/GithubHelper.java +++ b/app/src/main/java/com/prettifier/pretty/helper/GithubHelper.java @@ -25,15 +25,11 @@ public class GithubHelper { "}" + ""; - @NonNull public static String generateContent(@NonNull String source, @Nullable String baseUrl) { - return generateContent(source, baseUrl, false); - } - - @NonNull public static String generateContent(@NonNull String source, @Nullable String baseUrl, boolean wrap) { + @NonNull public static String generateContent(@NonNull String source, @Nullable String baseUrl, boolean wrap, boolean dark) { if (baseUrl == null) { - return mergeContent(source, wrap); + return mergeContent(source, wrap, dark); } else { - return mergeContent(validateImageBaseUrl(source, baseUrl), wrap); + return mergeContent(validateImageBaseUrl(source, baseUrl), wrap, dark); } } @@ -77,13 +73,13 @@ public class GithubHelper { return source; } - private static String mergeContent(@NonNull String source, boolean wrap) { + private static String mergeContent(@NonNull String source, boolean wrap, boolean dark) { return "\n" + "\n" + "\n" + " \n" + " " + - " \n" + + " \n" + "\n" + "\n" + "\n" + @@ -95,4 +91,8 @@ public class GithubHelper { "\n"; } + private static String getStyle(boolean dark, boolean isWrap) { + return isWrap ? dark ? "./github_wrap_dark.css" : "./github_wrap.css" : dark ? "./github_dark.css" : "./github.css"; + } + } diff --git a/app/src/main/java/com/prettifier/pretty/helper/PrettifyHelper.java b/app/src/main/java/com/prettifier/pretty/helper/PrettifyHelper.java index b48d7229..08c0765a 100755 --- a/app/src/main/java/com/prettifier/pretty/helper/PrettifyHelper.java +++ b/app/src/main/java/com/prettifier/pretty/helper/PrettifyHelper.java @@ -22,16 +22,16 @@ public class PrettifyHelper { ""; - @NonNull public static String generateContent(@NonNull String source) { - return String.format(HTML_CONTENT, getStyle(), getFormattedSource(source)); + @NonNull public static String generateContent(@NonNull String source, boolean isDark) { + return String.format(HTML_CONTENT, getStyle(isDark), getFormattedSource(source)); } @NonNull private static String getFormattedSource(@NonNull String source) { return source.replaceAll("<", "<").replaceAll(">", ">"); } - @NonNull private static String getStyle() { - return "prettify.css"; + @NonNull private static String getStyle(boolean isDark) { + return !isDark ? "prettify.css" : "prettify_dark.css"; } } diff --git a/app/src/main/res/animator/raise_selector.xml b/app/src/main/res/animator/raise_selector.xml index 844f0e2f..02205224 100644 --- a/app/src/main/res/animator/raise_selector.xml +++ b/app/src/main/res/animator/raise_selector.xml @@ -7,7 +7,7 @@ android:duration="@android:integer/config_shortAnimTime" android:propertyName="backgroundColor" android:valueFrom="@color/windowBackground" - android:valueTo="@color/white" + android:valueTo="@color/card_highlighter" android:valueType="colorType"/> diff --git a/app/src/main/res/drawable-night-xxhdpi/ic_ic_timeline_arrow_left_9.png b/app/src/main/res/drawable-night-xxhdpi/ic_ic_timeline_arrow_left_9.png new file mode 100755 index 00000000..c41402f2 Binary files /dev/null and b/app/src/main/res/drawable-night-xxhdpi/ic_ic_timeline_arrow_left_9.png differ diff --git a/app/src/main/res/drawable-night/splash_screen_drawable.xml b/app/src/main/res/drawable-night/splash_screen_drawable.xml new file mode 100644 index 00000000..5b3c0089 --- /dev/null +++ b/app/src/main/res/drawable-night/splash_screen_drawable.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layouts/main_layouts/layout/activity_fragment_layout.xml b/app/src/main/res/layouts/main_layouts/layout/activity_fragment_layout.xml index cac96811..44ea449a 100644 --- a/app/src/main/res/layouts/main_layouts/layout/activity_fragment_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/activity_fragment_layout.xml @@ -3,7 +3,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> diff --git a/app/src/main/res/layouts/main_layouts/layout/commit_with_branch_layout.xml b/app/src/main/res/layouts/main_layouts/layout/commit_with_branch_layout.xml index 96b30318..0fcd3278 100644 --- a/app/src/main/res/layouts/main_layouts/layout/commit_with_branch_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/commit_with_branch_layout.xml @@ -13,7 +13,6 @@ android:layout_height="wrap_content" android:layout_margin="@dimen/grid_spacing" android:background="@color/universal_primary_dark_color" - android:clickable="true" android:orientation="horizontal" android:paddingBottom="@dimen/spacing_micro" android:paddingEnd="@dimen/spacing_xs_large" @@ -25,6 +24,7 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@string/switch_branch" + android:layout_marginEnd="@dimen/spacing_xs_large" android:padding="@dimen/spacing_normal" android:src="@drawable/ic_branch"/> @@ -33,8 +33,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginEnd="@dimen/spacing_xs_large" - android:layout_marginStart="@dimen/spacing_xs_large" android:layout_weight="1" android:spinnerMode="dialog" app:backgroundTint="?colorAccent" diff --git a/app/src/main/res/layouts/main_layouts/layout/create_gist_layout.xml b/app/src/main/res/layouts/main_layouts/layout/create_gist_layout.xml index 335e33fd..ca0fe794 100644 --- a/app/src/main/res/layouts/main_layouts/layout/create_gist_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/create_gist_layout.xml @@ -37,6 +37,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" @@ -68,6 +69,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" diff --git a/app/src/main/res/layouts/main_layouts/layout/create_issue_layout.xml b/app/src/main/res/layouts/main_layouts/layout/create_issue_layout.xml index 66138aae..99f57357 100644 --- a/app/src/main/res/layouts/main_layouts/layout/create_issue_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/create_issue_layout.xml @@ -28,6 +28,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" @@ -58,6 +59,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" diff --git a/app/src/main/res/layouts/main_layouts/layout/create_milestone_layout.xml b/app/src/main/res/layouts/main_layouts/layout/create_milestone_layout.xml index 2393bcc6..93c46af5 100644 --- a/app/src/main/res/layouts/main_layouts/layout/create_milestone_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/create_milestone_layout.xml @@ -20,6 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" @@ -51,6 +52,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacing_xs_large" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" diff --git a/app/src/main/res/layouts/main_layouts/layout/general_viewer_layout.xml b/app/src/main/res/layouts/main_layouts/layout/general_viewer_layout.xml index 2dc5c432..582881e1 100644 --- a/app/src/main/res/layouts/main_layouts/layout/general_viewer_layout.xml +++ b/app/src/main/res/layouts/main_layouts/layout/general_viewer_layout.xml @@ -12,7 +12,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" - android:visibility="gone"> + android:visibility="gone" + tools:visibility="visible"> - diff --git a/app/src/main/res/layouts/other_layouts/layout/empty_layout.xml b/app/src/main/res/layouts/other_layouts/layout/empty_layout.xml index a2871a51..fa97c861 100644 --- a/app/src/main/res/layouts/other_layouts/layout/empty_layout.xml +++ b/app/src/main/res/layouts/other_layouts/layout/empty_layout.xml @@ -9,7 +9,6 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginBottom="@dimen/spacing_s_large" - android:background="@color/transparent" android:gravity="center" android:orientation="vertical"> diff --git a/app/src/main/res/layouts/other_layouts/layout/message_dialog.xml b/app/src/main/res/layouts/other_layouts/layout/message_dialog.xml index 34b1a87e..5015089a 100644 --- a/app/src/main/res/layouts/other_layouts/layout/message_dialog.xml +++ b/app/src/main/res/layouts/other_layouts/layout/message_dialog.xml @@ -4,6 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="@color/windowBackground" android:orientation="vertical"> diff --git a/app/src/main/res/layouts/row_layouts/layout/commit_file_row_item.xml b/app/src/main/res/layouts/row_layouts/layout/commit_file_row_item.xml index c7021531..d862dc0b 100644 --- a/app/src/main/res/layouts/row_layouts/layout/commit_file_row_item.xml +++ b/app/src/main/res/layouts/row_layouts/layout/commit_file_row_item.xml @@ -9,6 +9,7 @@ android:clickable="true" android:foreground="?android:selectableItemBackground" android:stateListAnimator="@animator/cardview_selector" + app:cardBackgroundColor="@color/card_background" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" app:contentPaddingRight="@dimen/spacing_xs_large" @@ -31,15 +32,15 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="1" - android:maxLines="2" android:ellipsize="end" + android:maxLines="2" android:textColor="@color/primary_text" tools:text="When one acquires"/> diff --git a/app/src/main/res/layouts/row_layouts/layout/gist_files_row_item.xml b/app/src/main/res/layouts/row_layouts/layout/gist_files_row_item.xml index e8001c27..98fce83e 100644 --- a/app/src/main/res/layouts/row_layouts/layout/gist_files_row_item.xml +++ b/app/src/main/res/layouts/row_layouts/layout/gist_files_row_item.xml @@ -1,13 +1,15 @@ + android:stateListAnimator="@animator/cardview_selector" + app:cardBackgroundColor="@color/card_background"> diff --git a/app/src/main/res/layouts/row_layouts/layout/profile_overview_layout.xml b/app/src/main/res/layouts/row_layouts/layout/profile_overview_layout.xml index 1018cbe7..7fa3d33b 100644 --- a/app/src/main/res/layouts/row_layouts/layout/profile_overview_layout.xml +++ b/app/src/main/res/layouts/row_layouts/layout/profile_overview_layout.xml @@ -35,6 +35,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="36dp" + app:cardBackgroundColor="@color/card_background" app:cardUseCompatPadding="true" app:contentPaddingBottom="@dimen/spacing_normal" app:contentPaddingLeft="@dimen/spacing_xs_large" @@ -133,6 +134,7 @@ + + #2D3035 + #26282C + #00E5FF + #22252A + #fff + @color/material_blue_grey_200 + @color/primary_dark + @color/primary + @color/secondary_text + @color/windowBackground + \ No newline at end of file diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml new file mode 100644 index 00000000..d0686b0a --- /dev/null +++ b/app/src/main/res/values-night/styles.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 199c8648..5f11ebea 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -16,6 +16,8 @@ #00000000 #FF000000 #FFFFFF + @color/white + @color/cardview_light_background #80000000 @color/primary_light @color/primary_light diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 2fedf675..09234097 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,7 +4,7 @@ - - -