Skip to content

Commit

Permalink
Release version
Browse files Browse the repository at this point in the history
  • Loading branch information
v-grishechko committed Mar 1, 2014
1 parent 0650b1b commit 41ccb29
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<application
android:label="BSUIR Helper"
android:icon="@drawable/ic_launcher"
android:debuggable="true"
android:debuggable="false"
android:theme="@style/Theme.AppCompat"
>
<!-- ACTIVITIES -->
Expand Down
5 changes: 3 additions & 2 deletions app/res/layout/view_note.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

This comment has been minimized.

Copy link
@yas375

yas375 Mar 1, 2014

Member

@ultimate39 До этой строки не дойдет выполнение. Ты до этого в if else в обоих случаях возвращаешь true. Тогда тут и сам if не нужен получается.

This comment has been minimized.

Copy link
@v-grishechko

v-grishechko Mar 1, 2014

Author Member

Он может вернуть false если не выполнится условие if (currentTime.getHourOfDay() + 1 > dt.getHourOfDay()) {
return true;
}

This comment has been minimized.

Copy link
@yas375

yas375 Mar 1, 2014

Member

@ultimate39 ааа, блин. Без нормальных отступов читаю не верно) Зря за отступами не следишь. Легче код будет читать ;)

}

Expand Down
4 changes: 4 additions & 0 deletions app/src/ru/bsuirhelper/android/ui/ActivityDrawerMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 41ccb29

Please sign in to comment.