Browse Source

Forum Tab Guest fix, color accent suggestion, CSS tweaks

pull/24/head
Ezerous 8 years ago
parent
commit
3b4dd721e4
  1. 352
      app/src/main/assets/style.css
  2. 5
      app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseActivity.java
  3. 33
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  4. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java
  5. 2
      app/src/main/res/layout/fragment_forum_category_row.xml
  6. 4
      app/src/main/res/values/colors.xml

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

@ -63,22 +63,10 @@ ul#catlist li
margin: 0; margin: 0;
} }
/* TP rss feed styles */
.rss_title{
font-weight: bold;
}
.rss_body{
margin-bottom: 1ex;
}
.rss_image{
margin: 4px 0 4px 0;
}
/* Normal, standard links. */ /* Normal, standard links. */
a:link, a:visited a:link, a:visited
{ {
color: #004080; color: #26A69A;
text-decoration: none; text-decoration: none;
} }
a:hover a:hover
@ -170,9 +158,9 @@ a img
.quote .quote
{ {
font-family: tahoma, sans-serif; font-family: tahoma, sans-serif;
color: #000000; color: #FFFFFF;
background-color: #D7DAEC; background-color: #404D50;
border: 1px solid #000000; border: 1px solid #E7E7E7;
margin: 1px; margin: 1px;
padding: 1px; padding: 1px;
font-size: x-small; font-size: x-small;
@ -332,132 +320,6 @@ a img
line-height: 1.3em; line-height: 1.3em;
} }
/* Sometimes there will be an error when you post */
.error
{
color: red;
}
/* definitions for the main tab, active means the tab reflects which page is displayed */
.maintab_first, .maintab_back, .maintab_last, .maintab_active_first, .maintab_active_back, .maintab_active_last
{
text-transform: uppercase;
vertical-align: top;
}
.maintab_back, .maintab_active_back
{
text-decoration: none;
font-size: 9px;
vertical-align: top;
padding: 2px 6px 6px 6px;
font-family: Trebuchet, sans-serif;
}
.maintab_first
{
display: none;
}
.maintab_back
{
}
.maintab_last
{
display: none;
}
.maintab_active_first
{
display: none;
}
.maintab_active_back
{
background: #ffd;
}
.maintab_active_last
{
display: none;
}
/* how links behave in main tab. */
.maintab_back a:link , .maintab_back a:visited, .maintab_active_back a:link , .maintab_active_back a:visited
{
color: black;
text-decoration: none;
}
.maintab_back a:hover, .maintab_active_back a:hover
{
text-decoration: underline;
}
/* definitions for the mirror tab */
.mirrortab_first, .mirrortab_back, .mirrortab_last, .mirrortab_active_first, .mirrortab_active_back, .mirrortab_active_last
{
color: black;
text-transform: uppercase;
vertical-align: top;
}
.mirrortab_back, .mirrortab_active_back
{
text-decoration: none;
font-size: 9px;
vertical-align: bottom;
padding: 6px 6px 2px 6px;
font-family: Trebuchet, sans-serif;
}
.mirrortab_first
{
display: none;
}
.mirrortab_back
{
}
.mirrortab_last
{
display: none;
}
.mirrortab_active_first
{
display: none;
}
.mirrortab_active_back
{
background: #ffd;
}
.mirrortab_active_last
{
display: none;
}
/* how links behave in mirror tab. */
.mirrortab_back a:link , .mirrortab_back a:visited, .mirrortab_active_back a:link , .mirrortab_active_back a:visited
{
color: black;
text-decoration: none;
}
.mirrortab_back a:hover, .mirrortab_active_back a:hover
{
text-decoration: underline;
}
/* The AJAX notifier */
#ajax_in_progress
{
background: #32CD32;
color: white;
text-align: center;
font-weight: bold;
font-size: 18pt;
padding: 3px;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
/* ################################### */
#left #left
{ {
background: url(images/img2/leftbg.jpg) repeat-y white; background: url(images/img2/leftbg.jpg) repeat-y white;
@ -495,28 +357,7 @@ ul#menubox
top: 87px; top: 87px;
background: url(images/img2/leftbot.gif) no-repeat bottom left; background: url(images/img2/leftbot.gif) no-repeat bottom left;
} }
#smfshout
{
padding: 6px;
font-size: xx-small;
}
.smfshout_delete
{
border: solid 1px #888;
background: white;
padding: 1px;
}
.smfshout_body
{
border: solid 1px #888;
background: white;
padding: 3px;
text-align: left;
}
.smfshout_frame
{
padding: 5px 0 0 0;
}
ul#menubox li ul#menubox li
{ {
padding: 0 0 0 8px; padding: 0 0 0 8px;
@ -560,188 +401,6 @@ ul#menubox li.m5
padding-left: 18px; padding-left: 18px;
} }
/* home button */
a#homebtn
{
background: url(images/features/home.gif) no-repeat;
}
a#homebtn:hover
{
background: url(images/features/home-over.gif) no-repeat;
}
a.chosen#homebtn
{
background: url(images/features/home-select.gif) no-repeat;
}
/* help button */
a#helpbtn
{
background: url(images/features/help.gif) no-repeat;
}
a#helpbtn:hover
{
background: url(images/features/help-over.gif) no-repeat;
}
a.chosen#helpbtn
{
background: url(images/features/help-select.gif) no-repeat;
}
/* forum button */
a#forumbtn
{
background: url(images/features/forum.gif) no-repeat;
}
a#forumbtn:hover
{
background: url(images/features/forum-over.gif) no-repeat;
}
a.chosen#forumbtn
{
background: url(images/features/forum-select.gif) no-repeat;
}
/* search button */
a#searchbtn
{
background: url(images/features/search.gif) no-repeat;
}
a#searchbtn:hover
{
background: url(images/features/search-over.gif) no-repeat;
}
a.chosen#searchbtn
{
background: url(images/features/search-select.gif) no-repeat;
}
/* profile button */
a#profilebtn
{
background: url(images/features/profile.gif) no-repeat;
}
a#profilebtn:hover
{
background: url(images/features/profile-over.gif) no-repeat;
}
a.chosen#profilebtn
{
background: url(images/features/profile-select.gif) no-repeat;
}
/* admin button */
a#adminbtn
{
background: url(images/features/admin.gif) no-repeat;
}
a#adminbtn:hover
{
background: url(images/features/admin-over.gif) no-repeat;
}
a.chosen#adminbtn
{
background: url(images/features/admin-select.gif) no-repeat;
}
/* pm button */
a#pmbtn
{
background: url(images/features/pm.gif) no-repeat;
}
a#pmbtn:hover
{
background: url(images/features/pm-over.gif) no-repeat;
}
a.chosen#pmbtn
{
background: url(images/features/pm-select.gif) no-repeat;
}
/* calendar button */
a#calendarbtn
{
background: url(images/features/calendar.gif) no-repeat;
}
a#calendarbtn:hover
{
background: url(images/features/calendar-over.gif) no-repeat;
}
a.chosen#calendarbtn
{
background: url(images/features/calendar-select.gif) no-repeat;
}
/* register button */
a#registerbtn
{
background: url(images/features/register.gif) no-repeat;
}
a#registerbtn:hover
{
background: url(images/features/register-over.gif) no-repeat;
}
a.chosen#registerbtn
{
background: url(images/features/register-select.gif) no-repeat;
}
/* login button */
a#loginbtn
{
background: url(images/features/login.gif) no-repeat;
}
a#loginbtn:hover
{
background: url(images/features/login-over.gif) no-repeat;
}
a.chosen#loginbtn
{
background: url(images/features/login-select.gif) no-repeat;
}
/* logout button */
a#logoutbtn
{
background: url(images/features/logout.gif) no-repeat;
}
a#logoutbtn:hover
{
background: url(images/features/logout-over.gif) no-repeat;
}
a.chosen#logoutbtn
{
background: url(images/features/logout-select.gif) no-repeat;
}
/* shop button */
a#shopbtn
{
background: url(images/features/shop.gif) no-repeat;
}
a#shopbtn:hover
{
background: url(images/features/shop-over.gif) no-repeat;
}
a.chosen#shopbtn
{
background: url(images/features/shop-select.gif) no-repeat;
}
/* arcade button */
a#arcadebtn
{
background: url(images/features/arcade.gif) no-repeat;
}
a#arcadebtn:hover
{
background: url(images/features/arcade-over.gif) no-repeat;
}
a.chosen#arcadebtn
{
background: url(images/features/arcade-select.gif) no-repeat;
}
/* gallery button */
a#gallerybtn
{
background: url(images/features/gallery.gif) no-repeat;
}
a#gallerybtn:hover
{
background: url(images/features/gallery-over.gif) no-repeat;
}
a.chosen#gallerybtn
{
background: url(images/features/gallery-select.gif) no-repeat;
}
#myuser #myuser
{ {
@ -839,6 +498,7 @@ ul#topmenu li a:hover
width: 100%; width: 100%;
} }
/* Additions */
img img
{ {
max-width:100% !important; max-width:100% !important;

5
app/src/main/java/gr/thmmy/mthmmy/activities/base/BaseActivity.java

@ -134,6 +134,11 @@ public abstract class BaseActivity extends AppCompatActivity
return client; return client;
} }
public static SessionManager getSessionManager()
{
return sessionManager;
}
//TODO: move stuff below //TODO: move stuff below
//------------------------------------------DRAWER STUFF---------------------------------------- //------------------------------------------DRAWER STUFF----------------------------------------
protected static final int HOME_ID=0; protected static final int HOME_ID=0;

33
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.base.BaseActivity;
import gr.thmmy.mthmmy.activities.base.BaseFragment; import gr.thmmy.mthmmy.activities.base.BaseFragment;
import gr.thmmy.mthmmy.data.Board; import gr.thmmy.mthmmy.data.Board;
import gr.thmmy.mthmmy.data.Category; import gr.thmmy.mthmmy.data.Category;
@ -33,6 +34,8 @@ import okhttp3.HttpUrl;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import static gr.thmmy.mthmmy.session.SessionManager.LOGGED_IN;
/** /**
* A {@link BaseFragment} subclass. * A {@link BaseFragment} subclass.
* Activities that contain this fragment must implement the * Activities that contain this fragment must implement the
@ -101,20 +104,26 @@ public class ForumFragment extends BaseFragment
forumAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() { forumAdapter.setExpandCollapseListener(new ExpandableRecyclerAdapter.ExpandCollapseListener() {
@Override @Override
public void onParentExpanded(int parentPosition) { public void onParentExpanded(int parentPosition) {
if(forumTask.getStatus()== AsyncTask.Status.RUNNING) if(BaseActivity.getSessionManager().getLogStatus()== LOGGED_IN)
forumTask.cancel(true); {
forumTask =new ForumTask(); if(forumTask.getStatus()== AsyncTask.Status.RUNNING)
forumTask.setUrl(categories.get(parentPosition).getCategoryURL()); forumTask.cancel(true);
forumTask.execute(); forumTask =new ForumTask();
forumTask.setUrl(categories.get(parentPosition).getCategoryURL());
forumTask.execute();
}
} }
@Override @Override
public void onParentCollapsed(int parentPosition) { public void onParentCollapsed(int parentPosition) {
if(forumTask.getStatus()== AsyncTask.Status.RUNNING) if(BaseActivity.getSessionManager().getLogStatus()== LOGGED_IN)
forumTask.cancel(true); {
forumTask =new ForumTask(); if(forumTask.getStatus()== AsyncTask.Status.RUNNING)
forumTask.setUrl(categories.get(parentPosition).getCategoryURL()); forumTask.cancel(true);
forumTask.execute(); forumTask =new ForumTask();
forumTask.setUrl(categories.get(parentPosition).getCategoryURL());
forumTask.execute();
}
} }
}); });
@ -164,6 +173,7 @@ public class ForumFragment extends BaseFragment
parse(document); parse(document);
categories.clear(); categories.clear();
categories.addAll(fetchedCategories); categories.addAll(fetchedCategories);
Report.d(TAG, "SIZE: " + String.valueOf(fetchedCategories.get(0).getBoards().size()));
fetchedCategories.clear(); fetchedCategories.clear();
return 0; return 0;
} catch (IOException e) { } catch (IOException e) {
@ -197,8 +207,7 @@ public class ForumFragment extends BaseFragment
String categoryUrl = categoryElement.attr("href"); String categoryUrl = categoryElement.attr("href");
Category category = new Category(categoryElement.text(), categoryUrl); Category category = new Category(categoryElement.text(), categoryUrl);
category.setExpanded(categoryUrl.contains("sa=collapse")); if(categoryUrl.contains("sa=collapse")|| BaseActivity.getSessionManager().getLogStatus()!= LOGGED_IN)
if(categoryUrl.contains("sa=collapse"))
{ {
category.setExpanded(true); category.setExpanded(true);
Elements boardsElements = categoryBlock.select("b [name]"); Elements boardsElements = categoryBlock.select("b [name]");

1
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -93,6 +93,7 @@ class TopicAdapter extends RecyclerView.Adapter<TopicAdapter.MyViewHolder> {
username = (TextView) view.findViewById(R.id.username); username = (TextView) view.findViewById(R.id.username);
subject = (TextView) view.findViewById(R.id.subject); subject = (TextView) view.findViewById(R.id.subject);
post = (WebView) view.findViewById(R.id.post); post = (WebView) view.findViewById(R.id.post);
post.setBackgroundColor(Color.argb(1, 255, 255, 255));
quoteToggle = (ImageButton) view.findViewById(R.id.toggle_quote_button); quoteToggle = (ImageButton) view.findViewById(R.id.toggle_quote_button);
bodyFooterDivider = view.findViewById(R.id.body_footer_divider); bodyFooterDivider = view.findViewById(R.id.body_footer_divider);
postFooter = (LinearLayout) view.findViewById(R.id.post_footer); postFooter = (LinearLayout) view.findViewById(R.id.post_footer);

2
app/src/main/res/layout/fragment_forum_category_row.xml

@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:textAppearance="?attr/textAppearanceListItem" android:textAppearance="?attr/textAppearanceListItem"
android:textColor="@color/md_yellow_600"/> android:textColor="@color/accent"/>
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"

4
app/src/main/res/values/colors.xml

@ -27,7 +27,7 @@
<color name="primary">#2B2B2B</color> <color name="primary">#2B2B2B</color>
<color name="primary_dark">#333333</color> <color name="primary_dark">#333333</color>
<color name="primary_light">#3C3F41</color> <color name="primary_light">#3C3F41</color>
<color name="accent">#BF4040</color> <color name="accent">#26A69A</color>
<color name="primary_text">#E7E7E7</color> <color name="primary_text">#E7E7E7</color>
<color name="secondary_text">#757575</color> <color name="secondary_text">#757575</color>
<color name="background">#303234</color> <color name="background">#303234</color>
@ -37,5 +37,5 @@
<color name="white">#FFFFFF</color> <color name="white">#FFFFFF</color>
<color name="iron">#CCCCCC</color> <color name="iron">#CCCCCC</color>
<color name="card_expand_text_color">#E7E7E7</color> <color name="card_expand_text_color">#E7E7E7</color>
<color name="dialog_bg_semi_transparent">#80BF4040</color> <color name="dialog_bg_semi_transparent">#8026A69A</color>
</resources> </resources>

Loading…
Cancel
Save