Browse Source

ProfileActivity improvements

pull/70/head
Ezerous 5 years ago
parent
commit
b717fde7b8
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 16
      app/src/main/assets/style.css
  2. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java
  3. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java
  4. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java
  5. 9
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java
  6. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java
  7. 2
      app/src/main/res/drawable/member_of_the_month_card.xml
  8. 2
      app/src/main/res/drawable/mention_card.xml
  9. 8
      app/src/main/res/layout-v21/activity_topic_post_row.xml
  10. 2
      app/src/main/res/layout/activity_board_sub_board_row.xml
  11. 2
      app/src/main/res/layout/activity_downloads_row.xml
  12. 4
      app/src/main/res/layout/activity_topic_edit_row.xml
  13. 8
      app/src/main/res/layout/activity_topic_post_row.xml
  14. 4
      app/src/main/res/layout/activity_topic_quick_reply_row.xml
  15. 2
      app/src/main/res/layout/editor_view_color_picker.xml
  16. 0
      app/src/main/res/layout/fragment_profile_latest_posts.xml
  17. 0
      app/src/main/res/layout/fragment_profile_latest_posts_empty_message.xml
  18. 4
      app/src/main/res/layout/fragment_profile_latest_posts_row.xml
  19. 24
      app/src/main/res/layout/fragment_profile_stats.xml
  20. 2
      app/src/main/res/layout/fragment_profile_summary.xml
  21. 4
      app/src/main/res/layout/fragment_shoutbox_shout_row.xml
  22. 2
      app/src/main/res/values/colors.xml
  23. 1
      app/src/main/res/values/dimens.xml
  24. 2
      app/src/main/res/values/styles.xml

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

@ -156,7 +156,7 @@ a img
}
/* A quote, perhaps from another post. */
.quote
{
{
font-family: tahoma, sans-serif;
color: #FFFFFF;
background-color: #404D50;
@ -420,16 +420,16 @@ ul#menubox li.m5
margin-bottom: 1em;
padding-bottom: 1em;
}
.clearfix:after
.clearfix:after
{
content: ".";
display: block;
height: 0;
clear: both;
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix
.clearfix
{
display: inline-block;
}
@ -519,7 +519,7 @@ img
}
.customSignature{
background: #323232;
background: #3C3F41;
}
[style="color: blue;"]

4
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java

@ -77,11 +77,11 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
subBoardTitle.setText(context.getString(R.string.child_board_title));
subBoardTitle.setTypeface(subBoardTitle.getTypeface(), Typeface.BOLD);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
subBoardTitle.setBackgroundColor(context.getColor(R.color.card_background));
subBoardTitle.setBackgroundColor(context.getColor(R.color.background_light));
subBoardTitle.setTextColor(context.getColor(R.color.accent));
} else {
//noinspection deprecation
subBoardTitle.setBackgroundColor(context.getResources().getColor(R.color.card_background));
subBoardTitle.setBackgroundColor(context.getResources().getColor(R.color.background_light));
//noinspection deprecation
subBoardTitle.setTextColor(context.getResources().getColor(R.color.accent));
}

4
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsAdapter.java

@ -53,12 +53,12 @@ class LatestPostsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (viewType == VIEW_TYPE_EMPTY) {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.fragment_latest_posts_empty_message, parent, false);
inflate(R.layout.fragment_profile_latest_posts_empty_message, parent, false);
return new RecyclerView.ViewHolder(view){};
}
if (viewType == VIEW_TYPE_ITEM) {
View view = LayoutInflater.from(parent.getContext()).
inflate(R.layout.fragment_latest_posts_row, parent, false);
inflate(R.layout.fragment_profile_latest_posts_row, parent, false);
return new LatestPostViewHolder(view);
} else if (viewType == VIEW_TYPE_LOADING) {
View view = LayoutInflater.from(parent.getContext()).

2
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java

@ -84,7 +84,7 @@ public class LatestPostsFragment extends BaseFragment implements LatestPostsAdap
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_latest_posts, container, false);
final View rootView = inflater.inflate(R.layout.fragment_profile_latest_posts, container, false);
latestPostsAdapter = new LatestPostsAdapter(this.getContext(), fragmentInteractionListener, parsedTopicSummaries);
RecyclerView mainContent = rootView.findViewById(R.id.profile_latest_posts_recycler);
mainContent.setAdapter(latestPostsAdapter);

9
app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java

@ -36,6 +36,8 @@ import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.net.ssl.SSLHandshakeException;
@ -90,7 +92,7 @@ public class StatsFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_stats, container, false);
final View rootView = inflater.inflate(R.layout.fragment_profile_stats, container, false);
mainContent = rootView.findViewById(R.id.main_content);
progressBar = rootView.findViewById(R.id.progressBar);
if (profileStatsTask!=null && profileStatsTask.getStatus() == AsyncTask.Status.FINISHED)
@ -172,6 +174,11 @@ public class StatsFragment extends Fragment {
{
Elements titleRows = statsPage.select("table.bordercolor[align]>tbody>tr.titlebg");
generalStatisticsTitle = titleRows.first().text();
Pattern pattern = Pattern.compile("(.+)\\s-");
Matcher matcher = pattern.matcher(generalStatisticsTitle);
if (matcher.find())
generalStatisticsTitle = matcher.group(1);
if (userHasPosts) {
postingActivityByTimeTitle = titleRows.get(1).text();
mostPopularBoardsByPostsTitle = titleRows.last().select("td").first().text();

6
app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java

@ -9,7 +9,6 @@ import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -25,6 +24,7 @@ import java.util.Objects;
import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.utils.parsing.ParseHelpers;
import gr.thmmy.mthmmy.views.ReactiveWebView;
import timber.log.Timber;
/**
@ -76,7 +76,7 @@ public class SummaryFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_summary, container, false);
final View rootView = inflater.inflate(R.layout.fragment_profile_summary, container, false);
mainContent = rootView.findViewById(R.id.profile_activity_content);
if (!parsedProfileSummaryData.isEmpty() && isAdded())
populateLayout();
@ -169,7 +169,7 @@ public class SummaryFragment extends Fragment {
for (String profileSummaryRow : parsedProfileSummaryData) {
if (profileSummaryRow.contains("Signature")
|| profileSummaryRow.contains("Υπογραφή")) { //This may contain css
WebView signatureEntry = new WebView(this.getContext());
ReactiveWebView signatureEntry = new ReactiveWebView(this.getContext());
signatureEntry.setBackgroundColor(Color.argb(1, 255, 255, 255));
signatureEntry.loadDataWithBaseURL("file:///android_asset/", profileSummaryRow,
"text/html", "UTF-8", null);

2
app/src/main/res/drawable/member_of_the_month_card.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/card_background"/>
<solid android:color="@color/background_light"/>
<stroke
android:width="1dip"
android:color="@color/member_of_the_month"/>

2
app/src/main/res/drawable/mention_card.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/card_background"/>
<solid android:color="@color/background_light"/>
<stroke
android:width="1dip"
android:color="@color/mention_color"/>

8
app/src/main/res/layout-v21/activity_topic_post_row.xml

@ -15,7 +15,7 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="@color/card_background"
card_view:cardBackgroundColor="@color/background_light"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
@ -89,7 +89,7 @@
android:layout_width="@dimen/post_image_button"
android:layout_height="@dimen/post_image_button"
android:layout_marginTop="9dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:contentDescription="@string/post_quote_button"
android:focusable="true"
@ -111,7 +111,7 @@
android:layout_height="@dimen/post_image_button"
android:layout_marginTop="9dp"
android:layout_marginEnd="9dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:contentDescription="@string/post_overflow_menu_button"
android:focusable="true"
@ -232,7 +232,7 @@
android:layout_gravity="center"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:focusable="true"
android:text="@string/post" />

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

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background">
android:background="@color/background_light">
<LinearLayout
android:id="@+id/child_board_row"

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

@ -5,7 +5,7 @@
android:id="@+id/upper_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:background="@color/background_light"
android:orientation="vertical">
<LinearLayout

4
app/src/main/res/layout/activity_topic_edit_row.xml

@ -13,7 +13,7 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="@color/card_background"
card_view:cardBackgroundColor="@color/background_light"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
@ -82,7 +82,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@color/card_background"
android:background="@color/background_light"
card_view:hint="Post message" />
</LinearLayout>
</androidx.cardview.widget.CardView>

8
app/src/main/res/layout/activity_topic_post_row.xml

@ -15,7 +15,7 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="@color/card_background"
card_view:cardBackgroundColor="@color/background_light"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
@ -88,7 +88,7 @@
android:layout_width="@dimen/post_image_button"
android:layout_height="@dimen/post_image_button"
android:layout_marginTop="9dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:contentDescription="@string/post_quote_button"
android:focusable="true"
@ -110,7 +110,7 @@
android:layout_height="@dimen/post_image_button"
android:layout_marginTop="9dp"
android:layout_marginEnd="9dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:contentDescription="@string/post_overflow_menu_button"
android:focusable="true"
@ -232,7 +232,7 @@
android:layout_gravity="center"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:focusable="true"
android:text="@string/post" />

4
app/src/main/res/layout/activity_topic_quick_reply_row.xml

@ -13,7 +13,7 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardBackgroundColor="@color/card_background"
card_view:cardBackgroundColor="@color/background_light"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
@ -82,7 +82,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@color/card_background"
android:background="@color/background_light"
card_view:hint="Post message" />
</LinearLayout>
</androidx.cardview.widget.CardView>

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

@ -2,7 +2,7 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/card_background">
android:background="@color/background_light">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"

0
app/src/main/res/layout/fragment_latest_posts.xml → app/src/main/res/layout/fragment_profile_latest_posts.xml

0
app/src/main/res/layout/fragment_latest_posts_empty_message.xml → app/src/main/res/layout/fragment_profile_latest_posts_empty_message.xml

4
app/src/main/res/layout/fragment_latest_posts_row.xml → app/src/main/res/layout/fragment_profile_latest_posts_row.xml

@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background">
android:background="@color/background_light">
<RelativeLayout
android:id="@+id/latest_posts_row"
@ -54,7 +54,7 @@
android:id="@+id/post"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:background="@color/background_light"
android:text="@string/post"/>
</FrameLayout>
</RelativeLayout>

24
app/src/main/res/layout/fragment_stats.xml → app/src/main/res/layout/fragment_profile_stats.xml

@ -3,7 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/background_light">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
@ -12,7 +13,7 @@
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:background="@color/background">
android:background="@color/background_light">
<LinearLayout
android:id="@+id/main_content"
@ -24,10 +25,11 @@
android:id="@+id/general_statistics_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="@string/general_statistics_title"
android:textAlignment="center"
android:textColor="@color/primary_text"
android:textColor="@color/accent"
android:textStyle="bold"/>
<TextView
@ -41,10 +43,10 @@
android:id="@+id/posting_activity_by_time_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:layout_marginTop="@dimen/profile_stats_category_margin_top"
android:text="@string/posting_activity_by_time_title"
android:textAlignment="center"
android:textColor="@color/primary_text"
android:textColor="@color/accent"
android:textStyle="bold"/>
<com.github.mikephil.charting.charts.LineChart
@ -57,10 +59,10 @@
android:id="@+id/most_popular_boards_by_posts_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:layout_marginTop="@dimen/profile_stats_category_margin_top"
android:text="@string/most_popular_boards_by_posts_title"
android:textAlignment="center"
android:textColor="@color/primary_text"
android:textColor="@color/accent"
android:textStyle="bold"/>
<com.github.mikephil.charting.charts.HorizontalBarChart
@ -73,17 +75,17 @@
android:id="@+id/most_popular_boards_by_activity_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/card_background"
android:layout_marginTop="@dimen/profile_stats_category_margin_top"
android:text="@string/most_popular_boards_by_activity_title"
android:textAlignment="center"
android:textColor="@color/primary_text"
android:textColor="@color/accent"
android:textStyle="bold"/>
<com.github.mikephil.charting.charts.HorizontalBarChart
android:id="@+id/most_popular_boards_by_activity_chart"
android:layout_width="match_parent"
android:layout_height="250dp"
android:layout_marginBottom="4dp"/>
android:layout_marginBottom="14dp"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>

2
app/src/main/res/layout/fragment_summary.xml → app/src/main/res/layout/fragment_profile_summary.xml

@ -4,7 +4,7 @@
android:id="@+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:background="@color/background_light"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:scrollbars="none">

4
app/src/main/res/layout/fragment_shoutbox_shout_row.xml

@ -8,7 +8,7 @@
android:layout_marginEnd="8dp"
android:foreground="?android:attr/selectableItemBackground"
android:orientation="vertical"
card_view:cardBackgroundColor="@color/card_background"
card_view:cardBackgroundColor="@color/background_light"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="2dp"
card_view:cardPreventCornerOverlap="false"
@ -57,7 +57,7 @@
android:layout_gravity="center"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="@color/card_background"
android:background="@color/background_light"
android:clickable="true"
android:focusable="true"
android:scrollbars="none"

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

@ -14,7 +14,7 @@
<color name="primary_text">#E7E7E7</color>
<color name="secondary_text">#757575</color>
<color name="background">#323232</color>
<color name="card_background">#3C3F41</color>
<color name="background_light">#3C3F41</color>
<color name="divider">#8B8B8B</color>
<color name="link_color">#FF9800</color>
<color name="mention_color">#FAA61A</color>

1
app/src/main/res/values/dimens.xml

@ -14,4 +14,5 @@
<dimen name="refresh_label_border_radius">12dp</dimen>
<dimen name="material_drawer_account_header_title">16sp</dimen>
<dimen name="profile_activity_avatar_size">90dp</dimen>
<dimen name="profile_stats_category_margin_top">28dp</dimen>
</resources>

2
app/src/main/res/values/styles.xml

@ -7,7 +7,7 @@
<item name="android:textColorPrimary">@color/primary_text</item>
<item name="android:textColorSecondary">@color/secondary_text</item>
<item name="android:windowBackground">@color/primary</item>
<item name="cardBackgroundColor">@color/card_background</item>
<item name="cardBackgroundColor">@color/background_light</item>
<item name="colorControlNormal">@color/iron</item>
<item name="colorControlActivated">@color/white</item>

Loading…
Cancel
Save