Browse Source

YouTube icon overlay fix

pull/70/head
Ezerous 4 years ago
parent
commit
e43825d7a4
  1. BIN
      app/src/main/assets/YouTube_light_color_icon.png
  2. 416
      app/src/main/assets/style.css
  3. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java
  4. 13
      app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java

BIN
app/src/main/assets/YouTube_light_color_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

416
app/src/main/assets/style.css

@ -1,24 +1,26 @@
/* TP specific classes */ /* TP specific classes */
.sitemap{
.sitemap {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
} }
.sitemap_topheader{
.sitemap_topheader {
background: #ECEDF3; background: #ECEDF3;
border-bottom: solid 1px #ffffff; border-bottom: solid 1px #ffffff;
padding: 4px; padding: 4px;
} }
.sitemap_header{ .sitemap_header {
background: #ECEDF3; background: #ECEDF3;
border-bottom: solid 1px #ffffff; border-bottom: solid 1px #ffffff;
padding: 4px; padding: 4px;
display: block; display: block;
font-weight: bold; font-weight: bold;
} }
.sitemap_header_active{ .sitemap_header_active {
background: #C8D6E1; background: #C8D6E1;
border-bottom: solid 1px #ffffff; border-bottom: solid 1px #ffffff;
padding: 4px; padding: 4px;
@ -26,7 +28,8 @@
font-weight: bold; font-weight: bold;
} }
.sitemap_header:hover , .sitemap_header_active:hover{ .sitemap_header:hover,
.sitemap_header_active:hover {
background: #DBE4ED; background: #DBE4ED;
border-bottom: solid 1px #ffffff; border-bottom: solid 1px #ffffff;
padding: 4px; padding: 4px;
@ -34,129 +37,149 @@
text-decoration: none; text-decoration: none;
} }
/* TP other styles */ /* TP other styles */
ul#articlelist
{ ul#articlelist {
margin: 0; margin: 0;
padding: 0.5ex 0; padding: 0.5ex 0;
list-style: none; list-style: none;
} }
ul#catlist
{ ul#catlist {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
border-top: solid 1px #d0d0d0; border-top: solid 1px #d0d0d0;
} }
ul#articlelist li ul#articlelist li {
{
margin: 0; margin: 0;
display: block; display: block;
padding: 0 0 0 3ex; padding: 0 0 0 3ex;
background: url(images/divider.gif) no-repeat 5px 3px; background: url(images/divider.gif) no-repeat 5px 3px;
} }
ul#catlist li
{ ul#catlist li {
display: block; display: block;
padding: 0 0 0 3ex; padding: 0 0 0 3ex;
margin: 0; margin: 0;
} }
/* Normal, standard links. */ /* Normal, standard links. */
a:link, a:visited
{ a:link,
a:visited {
color: #26A69A; color: #26A69A;
text-decoration: none; text-decoration: none;
} }
a:hover
{ a:hover {
text-decoration: underline; text-decoration: underline;
} }
/* Navigation links - for the link tree. */ /* Navigation links - for the link tree. */
.nav, .nav:link, .nav:visited
{ .nav,
.nav:link,
.nav:visited {
color: #000000; color: #000000;
text-decoration: none; text-decoration: none;
} }
a.nav:hover
{ a.nav:hover {
color: #cc3333; color: #cc3333;
} }
/* Tables should show empty cells. */ /* Tables should show empty cells. */
table
{ table {
empty-cells: show; empty-cells: show;
} }
/* The main body of the entire forum. */ /* The main body of the entire forum. */
body
{ body {
background: #3C3F41; background: #3C3F41;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
/* By default (td, body..) use verdana in black. */ /* By default (td, body..) use verdana in black. */
body, td, th , tr
{ body,
td,
th,
tr {
color: #FFFFFF; color: #FFFFFF;
font-size: small; font-size: small;
font-family: Trebuchet, sans-serif; font-family: Trebuchet, sans-serif;
} }
/* Input boxes - just a bit smaller than normal so they align well. */ /* Input boxes - just a bit smaller than normal so they align well. */
input, textarea, button
{ input,
textarea,
button {
color: #FFFFFF; color: #FFFFFF;
font-family: Trebuchet, sans-serif; font-family: Trebuchet, sans-serif;
border: 1px solid #aaa; border: 1px solid #aaa;
} }
input, button
{ input,
button {
font-size: 90%; font-size: 90%;
} }
textarea textarea {
{
font-size: 100%; font-size: 100%;
color: #FFFFFF; color: #FFFFFF;
font-family: Trebuchet, sans-serif; font-family: Trebuchet, sans-serif;
} }
/* All input elements that are checkboxes or radio buttons. */ /* All input elements that are checkboxes or radio buttons. */
input.check
{ input.check {}
}
/* Selects are a bit smaller, because it makes them look even better 8). */ /* Selects are a bit smaller, because it makes them look even better 8). */
select
{ select {
font-size: 90%; font-size: 90%;
font-weight: normal; font-weight: normal;
color: #FFFFFF; color: #FFFFFF;
font-family: Trebuchet, sans-serif; font-family: Trebuchet, sans-serif;
} }
/* Standard horizontal rule.. ([hr], etc.) */ /* Standard horizontal rule.. ([hr], etc.) */
hr, .hrcolor
{ hr,
.hrcolor {
height: 1px; height: 1px;
border: 0; border: 0;
color: #666666; color: #666666;
background-color: #666666; background-color: #666666;
} }
/* No image should have a border when linked */ /* No image should have a border when linked */
a img
{ a img {
border: 0; border: 0;
} }
/* A quote, perhaps from another post. */ /* A quote, perhaps from another post. */
.quote
{ .quote {
font-family: tahoma, sans-serif; font-family: tahoma, sans-serif;
color: #FFFFFF; color: #FFFFFF;
background-color: #404D50; background-color: #404D50;
@ -167,9 +190,10 @@ a img
line-height: 1.4em; line-height: 1.4em;
} }
/* A code block - maybe even PHP ;). */ /* A code block - maybe even PHP ;). */
.code
{ .code {
color: #FFFFFF; color: #FFFFFF;
background-color: #626566; background-color: #626566;
font-family: "Comic Sans MS", "times new roman", monospace; font-family: "Comic Sans MS", "times new roman", monospace;
@ -187,9 +211,11 @@ a img
max-height: 24em; max-height: 24em;
} }
/* The "Quote:" and "Code:" header parts... */ /* The "Quote:" and "Code:" header parts... */
.quoteheader, .codeheader
{ .quoteheader,
.codeheader {
font-family: tahoma, sans-serif; font-family: tahoma, sans-serif;
color: #26A69A; color: #26A69A;
text-decoration: none; text-decoration: none;
@ -199,156 +225,185 @@ a img
line-height: 1.2em; line-height: 1.2em;
} }
/* Generally, those [?] icons. This makes your cursor a help icon. */ /* Generally, those [?] icons. This makes your cursor a help icon. */
.help
{ .help {
cursor: help; cursor: help;
} }
/* /me uses this a lot. (emote, try typing /me in a post.) */ /* /me uses this a lot. (emote, try typing /me in a post.) */
.meaction
{ .meaction {
color: red; color: red;
} }
/* The main post box - this makes it as wide as possible. */ /* The main post box - this makes it as wide as possible. */
.editor
{ .editor {
width: 96%; width: 96%;
} }
/* Highlighted text - such as search results. */ /* Highlighted text - such as search results. */
.highlight
{ .highlight {
background-color: yellow; background-color: yellow;
font-weight: bold; font-weight: bold;
color: black; color: black;
} }
/* Alternating backgrounds for posts, and several other sections of the forum. */ /* Alternating backgrounds for posts, and several other sections of the forum. */
.windowbg
{ .windowbg {
color: #FFFFFF; color: #FFFFFF;
background-color: #E3E6E1; background-color: #E3E6E1;
} }
.windowbg2
{ .windowbg2 {
color: #FFFFFF; color: #FFFFFF;
background-color: #F2F5F0; background-color: #F2F5F0;
} }
.windowbg3
{ .windowbg3 {
color: #FFFFFF; color: #FFFFFF;
background-color: #E1E8E0; background-color: #E1E8E0;
} }
/* the today container in calendar */ /* the today container in calendar */
.calendar_today
{ .calendar_today {
background-color: #FFFFFF; background-color: #FFFFFF;
} }
/* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */ /* These are used primarily for titles, but also for headers (the row that says what everything in the table is.) */
.titlebg, tr.titlebg th, tr.titlebg td, .titlebg2, tr.titlebg2 th, tr.titlebg2 td
{ .titlebg,
tr.titlebg th,
tr.titlebg td,
.titlebg2,
tr.titlebg2 th,
tr.titlebg2 td {
background-color: #A3A392; background-color: #A3A392;
padding-top: 10px; padding-top: 10px;
} }
.titlebg, tr.titlebg th, tr.titlebg td, .titlebg a:link, .titlebg a:visited, .titlebg2, tr.titlebg2 th, tr.titlebg2 td, .titlebg2 a:link, .titlebg2 a:visited
{ .titlebg,
tr.titlebg th,
tr.titlebg td,
.titlebg a:link,
.titlebg a:visited,
.titlebg2,
tr.titlebg2 th,
tr.titlebg2 td,
.titlebg2 a:link,
.titlebg2 a:visited {
color: white; color: white;
font-style: normal; font-style: normal;
} }
.titlebg a:hover
{ .titlebg a:hover {
color: #dfdfdf; color: #dfdfdf;
} }
.catbg, .catbg2, .catbg3 .catbg,
{ .catbg2,
.catbg3 {
font-weight: bold; font-weight: bold;
background-color: #e4e2e0; background-color: #e4e2e0;
color: #FFFFFF; color: #FFFFFF;
} }
/* This is used for tables that have a grid/border background color (such as the topic listing.) */ /* This is used for tables that have a grid/border background color (such as the topic listing.) */
.bordercolor
{ .bordercolor {
background-color: white; background-color: white;
} }
/* This is used on tables that should just have a border around them. */ /* This is used on tables that should just have a border around them. */
.tborder
{ .tborder {
background-color: #FFFFFF; background-color: #FFFFFF;
} }
/* Default font sizes: small (8pt), normal (10pt), and large (14pt). */ /* Default font sizes: small (8pt), normal (10pt), and large (14pt). */
.smalltext
{ .smalltext {
font-size: x-small; font-size: x-small;
font-family: tahoma, sans-serif; font-family: tahoma, sans-serif;
} }
.middletext
{ .middletext {
font-size: 90%; font-size: 90%;
} }
.normaltext
{ .normaltext {
font-size: small; font-size: small;
} }
.largetext
{ .largetext {
font-size: large; font-size: large;
} }
/* Posts and personal messages displayed throughout the forum. */ /* Posts and personal messages displayed throughout the forum. */
.post, .personalmessage
{ .post,
.personalmessage {
width: 100%; width: 100%;
overflow: auto; overflow: auto;
line-height: 1.3em; line-height: 1.3em;
color: white; color: white;
background: #3C3F41 !important; background: #3C3F41 !important;
} }
/* All the signatures used in the forum. If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */ /* All the signatures used in the forum. If your forum users use Mozilla, Opera, or Safari, you might add max-height here ;). */
.signature
{ .signature {
width: 100%; width: 100%;
overflow: auto; overflow: auto;
padding-bottom: 3px; padding-bottom: 3px;
line-height: 1.3em; line-height: 1.3em;
} }
#left #left {
{
background: url(images/img2/leftbg.jpg) repeat-y white; background: url(images/img2/leftbg.jpg) repeat-y white;
margin: auto; margin: auto;
} }
#right
{ #right {
background: url(images/img2/rightbg.gif) repeat-y top right; background: url(images/img2/rightbg.gif) repeat-y top right;
} }
#top
{ #top {
background: url(images/img2/top.jpg) repeat-x; background: url(images/img2/top.jpg) repeat-x;
} }
#topleft
{ #topleft {
background: url(images/img2/lefttop.jpg) no-repeat; background: url(images/img2/lefttop.jpg) no-repeat;
} }
#topright
{ #topright {
background: url(images/img2/logo.jpg) no-repeat top right; background: url(images/img2/logo.jpg) no-repeat top right;
} }
#main
{ #main {
padding: 100px 81px 20px 81px; padding: 100px 81px 20px 81px;
} }
/* #################### */ /* #################### */
ul#menubox ul#menubox {
{
padding: 0 0 44px 0; padding: 0 0 44px 0;
margin: 0; margin: 0;
list-style: none; list-style: none;
@ -358,16 +413,15 @@ ul#menubox
background: url(images/img2/leftbot.gif) no-repeat bottom left; background: url(images/img2/leftbot.gif) no-repeat bottom left;
} }
ul#menubox li ul#menubox li {
{
padding: 0 0 0 8px; padding: 0 0 0 8px;
width: 65px; width: 65px;
height: 44px; height: 44px;
margin: 0; margin: 0;
background: url(images/img2/left.gif) repeat-y; background: url(images/img2/left.gif) repeat-y;
} }
ul#menubox li a
{ ul#menubox li a {
font-family: "Comic Sans MS", serif; font-family: "Comic Sans MS", serif;
display: block; display: block;
color: black; color: black;
@ -375,74 +429,75 @@ ul#menubox li a
height: 42px; height: 42px;
padding: 0 0 0 6px; padding: 0 0 0 6px;
} }
ul#menubox li a span
{ ul#menubox li a span {
display: none; display: none;
} }
ul#menubox li.m1 ul#menubox li.m1 {
{
padding-left: 2px; padding-left: 2px;
} }
ul#menubox li.m2
{ ul#menubox li.m2 {
padding-left: 6px; padding-left: 6px;
} }
ul#menubox li.m3
{ ul#menubox li.m3 {
padding-left: 10px; padding-left: 10px;
} }
ul#menubox li.m4
{ ul#menubox li.m4 {
padding-left: 14px; padding-left: 14px;
} }
ul#menubox li.m5
{ ul#menubox li.m5 {
padding-left: 18px; padding-left: 18px;
} }
#myuser {
#myuser
{
font-size: small; font-size: small;
padding-bottom: 1em; padding-bottom: 1em;
} }
#ava
{ #ava {
float: right; float: right;
margin-right: 10px; margin-right: 10px;
text-align: right; text-align: right;
font-family: "Comic Sans MS", sans-serif; font-family: "Comic Sans MS", sans-serif;
} }
#bodyarea
{ #bodyarea {
border-bottom: solid 1px #ddd; border-bottom: solid 1px #ddd;
margin-bottom: 1em; margin-bottom: 1em;
padding-bottom: 1em; padding-bottom: 1em;
} }
.clearfix:after
{ .clearfix:after {
content: "."; content: ".";
display: block; display: block;
height: 0; height: 0;
clear: both; clear: both;
visibility: hidden; visibility: hidden;
} }
.clearfix .clearfix {
{
display: inline-block; display: inline-block;
} }
/* Hides from IE-mac \*/ /* Hides from IE-mac \*/
* html .clearfix , * html .catbg, * html .catbg2, * html .catbg3
{ * html .clearfix,
* html .catbg,
* html .catbg2,
* html .catbg3 {
height: 1%; height: 1%;
} }
/* End hide from IE-mac */ /* End hide from IE-mac */
ul#topmenu ul#topmenu {
{
position: absolute; position: absolute;
top: 45px; top: 45px;
margin: 0 195px 0 40px; margin: 0 195px 0 40px;
@ -452,12 +507,12 @@ ul#topmenu
font-size: 11px; font-size: 11px;
border-bottom: groove 2px #EDF4ED; border-bottom: groove 2px #EDF4ED;
} }
ul#topmenu li
{ ul#topmenu li {
float: left; float: left;
} }
ul#topmenu li a
{ ul#topmenu li a {
display: block; display: block;
padding: 2px 5px 2px 5px; padding: 2px 5px 2px 5px;
border-style: solid solid; border-style: solid solid;
@ -466,31 +521,31 @@ ul#topmenu li a
font-size: 11px; font-size: 11px;
color: #004080; color: #004080;
} }
ul#topmenu li a:hover
{ ul#topmenu li a:hover {
background: #E3E6E1; background: #E3E6E1;
text-decoration: none; text-decoration: none;
color: #E78E13; color: #E78E13;
} }
#pages
{ #pages {
padding-top: 1em; padding-top: 1em;
} }
#uppersection
{ #uppersection {
padding: 1em; padding: 1em;
background: url(images/img/upper.jpg) repeat-x; background: url(images/img/upper.jpg) repeat-x;
} }
.errorbar
{ .errorbar {
color: white; color: white;
font-size: xx-small; font-size: xx-small;
text-align: center; text-align: center;
padding: 3px; padding: 3px;
border-bottom: solid 1px black; border-bottom: solid 1px black;
} }
#errorpanel
{ #errorpanel {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@ -498,51 +553,46 @@ ul#topmenu li a:hover
width: 100%; width: 100%;
} }
/* Additions */ /* Additions */
img
{ img {
max-width:100% !important; max-width: 100% !important;
height:auto !important; height: auto !important;
} }
.yt { .yt {
position: relative; -webkit-tap-highlight-color: transparent;
} }
.embedded-video-play { .embedded-video-play {
position: absolute; width: 25%;
top: 22%; padding: 15%;
left: 10%; background-repeat: no-repeat;
width: 20%; background-position: center;
opacity: 0.7; background-size: 100% auto;
z-index: 2;
} }
.customSignature{ .customSignature {
background: #3C3F41; background: #3C3F41;
} }
[style="color: blue;"] [style="color: blue;"] {
{ color: #3452fe !important;
color: #3452fe !important;
} }
[style="color: purple;"] [style="color: purple;"] {
{ color: #a511a5 !important;
color: #a511a5 !important;
} }
[style="color: maroon;"] [style="color: maroon;"] {
{ color: #a51111 !important;
color: #a51111 !important;
} }
span[style="background-color: yellow;"] span[style="background-color: yellow;"] {
{ color: black !important;
color: black !important;
} }
[style="color: white;"] > span[style="background-color: yellow;"] [style="color: white;"]>span[style="background-color: yellow;"] {
{ color: white !important;
color: white !important;
} }

3
app/src/main/java/gr/thmmy/mthmmy/activities/shoutbox/ShoutboxFragment.java

@ -60,7 +60,8 @@ public class ShoutboxFragment extends Fragment {
recyclerView.setOnTouchListener((view, motionEvent) -> { recyclerView.setOnTouchListener((view, motionEvent) -> {
editorView.hideMarkdown(); editorView.hideMarkdown();
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE); InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Activity.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editorView.getWindowToken(), 0); if (imm != null)
imm.hideSoftInputFromWindow(editorView.getWindowToken(), 0);
return false; return false;
}); });

13
app/src/main/java/gr/thmmy/mthmmy/utils/parsing/ParseHelpers.java

@ -154,14 +154,15 @@ public class ParseHelpers {
fixed.substring(fixed.indexOf("<embed"), fixed.indexOf("/noembed>") + 9) fixed.substring(fixed.indexOf("<embed"), fixed.indexOf("/noembed>") + 9)
, "<div class=\"yt\">" , "<div class=\"yt\">"
+ "<a href=\"https://www.youtube.com/watch?v=" + "<a href=\"https://www.youtube.com/watch?v="
+ embededVideosUrls.get(tmp_counter) + "\" target=\"_blank\">" + embededVideosUrls.get(tmp_counter)
+ "\" target=\"_blank\">"
+ "<img class=\"embedded-video-play\" " + "<img class=\"embedded-video-play\" "
+ "src=\"YouTube_light_color_icon.png\">" + "src=\"YouTube_light_color_icon.png\" "
+ "</a>" + "style=\"background-image: url('"
+ "<img src=\"https://img.youtube.com/vi/" + "https://img.youtube.com/vi/"
+ embededVideosUrls.get(tmp_counter) + embededVideosUrls.get(tmp_counter)
+ "/default.jpg\" alt=\"\" border=\"0\" width=\"40%\">" + "/default.jpg');\"></a></div>"
+ "</div>"); );
++tmp_counter; ++tmp_counter;
} }
return fixed; return fixed;

Loading…
Cancel
Save