From 6c77089eebea2c16054dcfb86317671ec5b42e00 Mon Sep 17 00:00:00 2001 From: Vlad Golubev Date: Wed, 4 Feb 2015 03:08:43 +0200 Subject: [PATCH] Change update time view --- app/src/main/java/ua/samosfator/moduleok/App.java | 5 +++-- .../navigation_drawer_fragment/sections/SectionAdapter.java | 2 +- .../sections/SectionsRecyclerView.java | 2 +- .../main/java/ua/samosfator/moduleok/parser/Semesters.java | 1 - app/src/main/res/values/strings.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/ua/samosfator/moduleok/App.java b/app/src/main/java/ua/samosfator/moduleok/App.java index 911208a..62e424d 100644 --- a/app/src/main/java/ua/samosfator/moduleok/App.java +++ b/app/src/main/java/ua/samosfator/moduleok/App.java @@ -68,8 +68,9 @@ public static String getVersion() { } public static String getFormattedUpdateTime() { - DateFormat dateFormat = new SimpleDateFormat("kk:mm dd.MM.yy ", Locale.getDefault()); - if (updateTime == null) return "asdasdasdasdasd"; + String formatTemplate = "dd.MM.yy " + mContext.getString(R.string.date_hour_divider) + " kk:mm"; + DateFormat dateFormat = new SimpleDateFormat(formatTemplate, Locale.getDefault()); + if (updateTime == null) return ""; return dateFormat.format(updateTime); } diff --git a/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionAdapter.java b/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionAdapter.java index 22430ad..400adef 100644 --- a/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionAdapter.java +++ b/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionAdapter.java @@ -70,7 +70,7 @@ private boolean isFirstSectionAndLoggedIn(int position) { } private boolean isLastSectionAndLoggedOut(int position) { - return !Auth.isLoggedIn() && position == (data.size() - 1); + return !Auth.isLoggedIn() && position == SectionsEnum.LOG_IN.INDEX; } private void doHighlightSection(SectionViewHolder holder) { diff --git a/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionsRecyclerView.java b/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionsRecyclerView.java index b275728..68320ac 100644 --- a/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionsRecyclerView.java +++ b/app/src/main/java/ua/samosfator/moduleok/fragment/navigation_drawer_fragment/sections/SectionsRecyclerView.java @@ -71,7 +71,7 @@ private void initSections() { SectionDrawer versionSection = new SectionDrawer("v." + App.getVersion(), R.drawable.ic_information_grey600_24dp); mSections.add(versionSection); -SectionDrawer feedbackSection = new SectionDrawer(App.getContext().getString(R.string.feedback_section), R.drawable.ic_help_circle_grey600_24dp); + SectionDrawer feedbackSection = new SectionDrawer(App.getContext().getString(R.string.feedback_section), R.drawable.ic_help_circle_grey600_24dp); mSections.add(feedbackSection); } diff --git a/app/src/main/java/ua/samosfator/moduleok/parser/Semesters.java b/app/src/main/java/ua/samosfator/moduleok/parser/Semesters.java index 52695a8..0b61871 100644 --- a/app/src/main/java/ua/samosfator/moduleok/parser/Semesters.java +++ b/app/src/main/java/ua/samosfator/moduleok/parser/Semesters.java @@ -53,7 +53,6 @@ private boolean semesterHasData(Element semesterElement) { } public Semester get(int index) { - assert index <= 1 && index >= 0; return semesters.get(index); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ee70f55..93e8f46 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -27,6 +27,7 @@ Петро Баклан ПТН-23 + \'at\' Last & Total Modules @@ -40,7 +41,6 @@ Не вірний логін/пароль. Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.45 Safari/537.36 Last synced with mod.tanet - Surprise! App version New score available! Open MODULE.OK to check it out!