From 2725e08e03573b114d749d74be97a0ae865b162f Mon Sep 17 00:00:00 2001 From: Ezerous Date: Fri, 17 Nov 2017 13:22:38 +0200 Subject: [PATCH] UnreadFragment date/time fix & other minor fixes --- README.md | 2 +- .../activities/downloads/DownloadsActivity.java | 12 +++++++----- .../activities/main/unread/UnreadFragment.java | 7 ++++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f27cc28a..0a93376c 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ Do not hesitate to contact us for any matter, either by sending an email to `thm **Legal attribution: Google Play and the Google Play logo are trademarks of Google Inc.* [discord-server]: https://discord.gg/CVt3yrn -[trello-board]: https://trello.com/invite/b/4MVlkrkg/44a931707bd0b84a5e0bdfc42b9ae4f1/mthmmy +[trello-board]: https://trello.com/b/4MVlkrkg/mthmmy diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java index 3df917af..7e3a4526 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java @@ -64,7 +64,7 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter. if (downloadsUrl != null && !Objects.equals(downloadsUrl, "")) { ThmmyPage.PageCategory target = ThmmyPage.resolvePageCategory(Uri.parse(downloadsUrl)); if (!target.is(ThmmyPage.PageCategory.DOWNLOADS)) { - Timber.e("Bundle came with a non board url!\nUrl:\n%s" , downloadsUrl); + Timber.e("Bundle came with a non downloads url!\nUrl:\n%s" , downloadsUrl); Toast.makeText(this, "An error has occurred\nAborting.", Toast.LENGTH_SHORT).show(); finish(); } @@ -72,9 +72,10 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter. //Initialize toolbar toolbar = findViewById(R.id.toolbar); - if (downloadsTitle == null || Objects.equals(downloadsTitle, "")) + if (downloadsTitle == null || downloadsTitle.equals("")) toolbar.setTitle("Downloads"); - toolbar.setTitle(downloadsTitle); + else + toolbar.setTitle(downloadsTitle); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); @@ -235,8 +236,9 @@ public class DownloadsActivity extends BaseActivity implements DownloadsAdapter. @Override protected void postParsing(ResultCode result) { - if (downloadsTitle != null && !Objects.equals(downloadsTitle, "") && - toolbar.getTitle() != downloadsTitle) + if (downloadsTitle != null && !downloadsTitle.equals("") + && !downloadsTitle.equals("Αρχεία για λήψη") + && toolbar.getTitle() != downloadsTitle) toolbar.setTitle(downloadsTitle); ++pagesLoaded; 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 0141f646..93824a61 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,7 +174,12 @@ public class UnreadFragment extends BaseFragment { dateTime = dateTime.substring(0, dateTime.indexOf("
")); dateTime = dateTime.replace("", ""); dateTime = dateTime.replace("", ""); - dateTime = dateTime.replaceAll(":[0-5][0-9] ", " "); + if (dateTime.contains(" am") || dateTime.contains(" pm") || + dateTime.contains(" πμ") || dateTime.contains(" μμ")) { + dateTime = dateTime.replaceAll(":[0-5][0-9] ", " "); + } else { + dateTime=dateTime.substring(0,dateTime.lastIndexOf(":")); + } if (!dateTime.contains(",")) { dateTime = dateTime.replaceAll(".+? ([0-9])", "$1"); }