Browse Source

Multiple layout changes

(Recent, Unread, Topic)
pull/24/head
Ezerous 7 years ago
parent
commit
5b4654f3aa
  1. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java
  2. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  3. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java
  4. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java
  5. 9
      app/src/main/res/layout-v21/activity_topic_post_row.xml
  6. 9
      app/src/main/res/layout/activity_topic_post_row.xml
  7. 2
      app/src/main/res/layout/fragment_recent_row.xml
  8. 2
      app/src/main/res/layout/fragment_unread_mark_read_row.xml
  9. 2
      app/src/main/res/layout/fragment_unread_row.xml
  10. 3
      app/src/main/res/values/strings.xml

2
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentAdapter.java

@ -43,7 +43,7 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> {
public void onBindViewHolder(final ViewHolder holder, final int position) { public void onBindViewHolder(final ViewHolder holder, final int position) {
holder.mTitleView.setText(recentList.get(position).getSubject()); holder.mTitleView.setText(recentList.get(position).getSubject());
holder.mDateTimeView.setText(recentList.get(position).getDateTimeModified()); 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); holder.topic = recentList.get(position);

8
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)"); throw new ParseException("Parsing failed (lastUser)");
String dateTime = recent.get(i + 2).text(); String dateTime = recent.get(i + 2).text();
pattern = Pattern.compile("\\[(.*)\\]"); pattern = Pattern.compile("\\[(.*)]");
matcher = pattern.matcher(dateTime); matcher = pattern.matcher(dateTime);
if (matcher.find()) if (matcher.find()) {
dateTime = matcher.group(1); dateTime = matcher.group(1);
dateTime=dateTime.substring(0,dateTime.lastIndexOf(":"));
if(!dateTime.contains(","))
dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1);
}
else else
throw new ParseException("Parsing failed (dateTime)"); throw new ParseException("Parsing failed (dateTime)");

2
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadAdapter.java

@ -67,7 +67,7 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
viewHolder.mTitleView.setText(unreadList.get(holder.getAdapterPosition()).getSubject()); viewHolder.mTitleView.setText(unreadList.get(holder.getAdapterPosition()).getSubject());
viewHolder.mDateTimeView.setText(unreadList.get(holder.getAdapterPosition()).getDateTimeModified()); 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()); viewHolder.topic = unreadList.get(holder.getAdapterPosition());

3
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("<br>")); dateTime = dateTime.substring(0, dateTime.indexOf("<br>"));
dateTime = dateTime.replace("<b>", ""); dateTime = dateTime.replace("<b>", "");
dateTime = dateTime.replace("</b>", ""); dateTime = dateTime.replace("</b>", "");
dateTime=dateTime.substring(0,dateTime.lastIndexOf(":"));
if(!dateTime.contains(","))
dateTime=dateTime.substring(dateTime.lastIndexOf(" ")+1);
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime)); topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));
} }

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

@ -96,6 +96,7 @@
android:clickable="true" android:clickable="true"
android:contentDescription="@string/post_quote_button" android:contentDescription="@string/post_quote_button"
android:focusable="true" android:focusable="true"
android:src="@drawable/ic_format_quote_unchecked" /> android:src="@drawable/ic_format_quote_unchecked" />
</LinearLayout> </LinearLayout>
@ -177,8 +178,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start" android:gravity="start"
android:text="" android:text=""
android:textColor="@color/card_expand_text_color" android:textColor="@color/accent"
android:textSize="10sp" /> android:textSize="11sp" />
<TextView <TextView
android:id="@+id/post_number" android:id="@+id/post_number"
@ -186,8 +187,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="end" android:gravity="end"
android:text="" android:text=""
android:textColor="@color/card_expand_text_color" android:textColor="@color/accent"
android:textSize="10sp" /> android:textSize="11sp" />
</FrameLayout> </FrameLayout>

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

@ -95,6 +95,7 @@
android:clickable="true" android:clickable="true"
android:contentDescription="@string/post_quote_button" android:contentDescription="@string/post_quote_button"
android:focusable="true" android:focusable="true"
android:visibility="gone"
android:src="@drawable/ic_format_quote_unchecked" /> android:src="@drawable/ic_format_quote_unchecked" />
</LinearLayout> </LinearLayout>
@ -176,8 +177,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="start" android:gravity="start"
android:text="" android:text=""
android:textColor="@color/card_expand_text_color" android:textColor="@color/accent"
android:textSize="10sp" /> android:textSize="11sp" />
<TextView <TextView
android:id="@+id/post_number" android:id="@+id/post_number"
@ -185,8 +186,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="end" android:gravity="end"
android:text="" android:text=""
android:textColor="@color/card_expand_text_color" android:textColor="@color/accent"
android:textSize="10sp" /> android:textSize="11sp" />
</FrameLayout> </FrameLayout>

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

@ -38,7 +38,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_below="@+id/spacer" android:layout_below="@+id/spacer"
android:textColor="@color/secondary_text"/> android:textColor="@color/accent"/>
<TextView <TextView
android:id="@+id/lastUser" android:id="@+id/lastUser"

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

@ -11,6 +11,6 @@
android:id="@+id/mark_read" android:id="@+id/mark_read"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="textEnd" android:textAlignment="center"
android:textColor="@color/accent" /> android:textColor="@color/accent" />
</LinearLayout> </LinearLayout>

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

@ -38,7 +38,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_below="@+id/spacer" android:layout_below="@+id/spacer"
android:textColor="@color/secondary_text"/> android:textColor="@color/accent"/>
<TextView <TextView
android:id="@+id/lastUser" android:id="@+id/lastUser"

3
app/src/main/res/values/strings.xml

@ -18,9 +18,6 @@
<string name="btn_login">LOGIN</string> <string name="btn_login">LOGIN</string>
<string name="btn_continue_as_guest">Don\'t have an account? Continue as guest!</string> <string name="btn_continue_as_guest">Don\'t have an account? Continue as guest!</string>
<!--Main Activity-->
<string name="byUser">by %1$s</string>
<!--Board Activity--> <!--Board Activity-->
<string name="child_board_title">Child Boards</string> <string name="child_board_title">Child Boards</string>
<string name="child_board_button">Exp/Coll</string> <string name="child_board_button">Exp/Coll</string>

Loading…
Cancel
Save