From 5b4654f3aa128d1ad44a8458f1fe4eeaa299b80a Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sat, 4 Nov 2017 12:54:54 +0200 Subject: [PATCH] Multiple layout changes (Recent, Unread, Topic) --- .../mthmmy/activities/main/recent/RecentAdapter.java | 2 +- .../mthmmy/activities/main/recent/RecentFragment.java | 8 ++++++-- .../mthmmy/activities/main/unread/UnreadAdapter.java | 2 +- .../mthmmy/activities/main/unread/UnreadFragment.java | 3 +++ app/src/main/res/layout-v21/activity_topic_post_row.xml | 9 +++++---- app/src/main/res/layout/activity_topic_post_row.xml | 9 +++++---- app/src/main/res/layout/fragment_recent_row.xml | 2 +- .../main/res/layout/fragment_unread_mark_read_row.xml | 2 +- app/src/main/res/layout/fragment_unread_row.xml | 2 +- app/src/main/res/values/strings.xml | 3 --- 10 files changed, 24 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java index 15b9bc36..de128cb1 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java @@ -43,7 +43,7 @@ class RecentAdapter extends RecyclerView.Adapter { public void onBindViewHolder(final ViewHolder holder, final int position) { holder.mTitleView.setText(recentList.get(position).getSubject()); holder.mDateTimeView.setText(recentList.get(position).getDateTimeModified()); - holder.mUserView.setText(context.getString(R.string.byUser, recentList.get(position).getLastUser())); + holder.mUserView.setText(recentList.get(position).getLastUser()); holder.topic = recentList.get(position); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java index 78b8632f..b1ee1500 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java @@ -164,10 +164,14 @@ public class RecentFragment extends BaseFragment { throw new ParseException("Parsing failed (lastUser)"); String dateTime = recent.get(i + 2).text(); - pattern = Pattern.compile("\\[(.*)\\]"); + pattern = Pattern.compile("\\[(.*)]"); matcher = pattern.matcher(dateTime); - if (matcher.find()) + if (matcher.find()) { dateTime = matcher.group(1); + dateTime=dateTime.substring(0,dateTime.lastIndexOf(":")); + if(!dateTime.contains(",")) + dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1); + } else throw new ParseException("Parsing failed (dateTime)"); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java index 3aedfd07..4b7c235b 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java @@ -67,7 +67,7 @@ class UnreadAdapter extends RecyclerView.Adapter { viewHolder.mTitleView.setText(unreadList.get(holder.getAdapterPosition()).getSubject()); viewHolder.mDateTimeView.setText(unreadList.get(holder.getAdapterPosition()).getDateTimeModified()); - viewHolder.mUserView.setText(context.getString(R.string.byUser, unreadList.get(position).getLastUser())); + viewHolder.mUserView.setText(unreadList.get(position).getLastUser()); viewHolder.topic = unreadList.get(holder.getAdapterPosition()); diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java index f08bd303..ee420732 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java @@ -174,6 +174,9 @@ public class UnreadFragment extends BaseFragment { dateTime = dateTime.substring(0, dateTime.indexOf("
")); dateTime = dateTime.replace("", ""); dateTime = dateTime.replace("", ""); + dateTime=dateTime.substring(0,dateTime.lastIndexOf(":")); + if(!dateTime.contains(",")) + dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1); topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime)); } diff --git a/app/src/main/res/layout-v21/activity_topic_post_row.xml b/app/src/main/res/layout-v21/activity_topic_post_row.xml index de20aef3..82dcb9b8 100644 --- a/app/src/main/res/layout-v21/activity_topic_post_row.xml +++ b/app/src/main/res/layout-v21/activity_topic_post_row.xml @@ -96,6 +96,7 @@ android:clickable="true" android:contentDescription="@string/post_quote_button" android:focusable="true" + android:src="@drawable/ic_format_quote_unchecked" /> @@ -177,8 +178,8 @@ android:layout_height="wrap_content" android:gravity="start" android:text="" - android:textColor="@color/card_expand_text_color" - android:textSize="10sp" /> + android:textColor="@color/accent" + android:textSize="11sp" /> + android:textColor="@color/accent" + android:textSize="11sp" /> diff --git a/app/src/main/res/layout/activity_topic_post_row.xml b/app/src/main/res/layout/activity_topic_post_row.xml index 907f67d1..167053b6 100644 --- a/app/src/main/res/layout/activity_topic_post_row.xml +++ b/app/src/main/res/layout/activity_topic_post_row.xml @@ -95,6 +95,7 @@ android:clickable="true" android:contentDescription="@string/post_quote_button" android:focusable="true" + android:visibility="gone" android:src="@drawable/ic_format_quote_unchecked" /> @@ -176,8 +177,8 @@ android:layout_height="wrap_content" android:gravity="start" android:text="" - android:textColor="@color/card_expand_text_color" - android:textSize="10sp" /> + android:textColor="@color/accent" + android:textSize="11sp" /> + android:textColor="@color/accent" + android:textSize="11sp" /> diff --git a/app/src/main/res/layout/fragment_recent_row.xml b/app/src/main/res/layout/fragment_recent_row.xml index 8f256f2e..7d136a4e 100644 --- a/app/src/main/res/layout/fragment_recent_row.xml +++ b/app/src/main/res/layout/fragment_recent_row.xml @@ -38,7 +38,7 @@ android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_below="@+id/spacer" - android:textColor="@color/secondary_text"/> + android:textColor="@color/accent"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_unread_row.xml b/app/src/main/res/layout/fragment_unread_row.xml index 8f256f2e..7d136a4e 100644 --- a/app/src/main/res/layout/fragment_unread_row.xml +++ b/app/src/main/res/layout/fragment_unread_row.xml @@ -38,7 +38,7 @@ android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_below="@+id/spacer" - android:textColor="@color/secondary_text"/> + android:textColor="@color/accent"/> LOGIN Don\'t have an account? Continue as guest! - - by %1$s - Child Boards Exp/Coll