From 41ccb290465118cc1cbbf7d20682a844430c61d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D1=80=D0=B8=D1=88=D0=B5=D1=87=D0=BA=D0=BE=20=D0=92?= =?UTF-8?q?=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2?= Date: Sat, 1 Mar 2014 16:37:38 +0200 Subject: [PATCH] Release version --- app/AndroidManifest.xml | 2 +- app/res/layout/view_note.xml | 5 +++-- .../android/core/schedule/ScheduleManager.java | 8 ++++++-- app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java | 4 ++++ .../bsuirhelper/android/ui/notes/ActivityDetailNote.java | 5 +++++ 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml index a9fb9d2..05e160f 100644 --- a/app/AndroidManifest.xml +++ b/app/AndroidManifest.xml @@ -11,7 +11,7 @@ diff --git a/app/res/layout/view_note.xml b/app/res/layout/view_note.xml index f758f50..017d51a 100644 --- a/app/res/layout/view_note.xml +++ b/app/res/layout/view_note.xml @@ -48,10 +48,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#FFFFFF" - android:text="" + android:text="Вов советского народа" android:padding="4dp" + android:maxLength="15" android:id="@+id/textview_notesubject" - android:visibility="invisible" + android:visibility="visible" android:background="@drawable/rectangle_subject" android:singleLine="true" android:layout_alignBottom="@+id/textview_notetitle" diff --git a/app/src/ru/bsuirhelper/android/core/schedule/ScheduleManager.java b/app/src/ru/bsuirhelper/android/core/schedule/ScheduleManager.java index d3fb2d2..728c4f1 100644 --- a/app/src/ru/bsuirhelper/android/core/schedule/ScheduleManager.java +++ b/app/src/ru/bsuirhelper/android/core/schedule/ScheduleManager.java @@ -47,13 +47,17 @@ public void deleteSchedule(String groupId) { public boolean isLessonsEndToday(String groupId, int subgroup) { DateTime currentTime = new DateTime(); Lesson[] lessons = mScheduleDatabase.getLessonsOfDay(groupId, DateTime.now(), subgroup); - Lesson lesson = lessons[lessons.length - 1]; + if (lessons.length > 0) { + Lesson lesson = lessons[lessons.length - 1]; - DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm"); + DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm"); DateTime dt = formatter.parseDateTime(getFinishTimeOfLesson(lesson)); if (currentTime.getHourOfDay() + 1 > dt.getHourOfDay()) { return true; } + } else { + return true; + } return false; } diff --git a/app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java b/app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java index 2b5ae03..4e4a316 100644 --- a/app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java +++ b/app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java @@ -82,6 +82,10 @@ public void onItemClick(AdapterView adapterView, View view, int position, lon mHandler = new Handler(); FragmentManager fm = getSupportFragmentManager(); fm.beginTransaction().replace(R.id.content_frame, new FragmentSchedule()).commit(); + if (ApplicationSettings.getInstance(this).getBoolean("isFirstShowDrawer", true)) { + openDrawerMenu(); + ApplicationSettings.getInstance(this).putBoolean("isFirstShowDrawer", false); + } } @Override diff --git a/app/src/ru/bsuirhelper/android/ui/notes/ActivityDetailNote.java b/app/src/ru/bsuirhelper/android/ui/notes/ActivityDetailNote.java index be84c5d..346efd5 100644 --- a/app/src/ru/bsuirhelper/android/ui/notes/ActivityDetailNote.java +++ b/app/src/ru/bsuirhelper/android/ui/notes/ActivityDetailNote.java @@ -31,6 +31,8 @@ public void onCreate(Bundle savedInstanceState) { tvNoteTitle = (TextView) findViewById(R.id.textview_notetitle); tvNoteSubject = (TextView) findViewById(R.id.textview_notesubject); tvNoteText = (TextView) findViewById(R.id.textview_notetext); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeButtonEnabled(true); } @Override @@ -57,6 +59,9 @@ public boolean onCreateOptionsMenu(Menu menu) { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; case R.id.action_editnote: Intent intent = new Intent(this, ActivityEditNote.class); intent.putExtra("note_id", mNoteId);