diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/notes/activities/MainActivity.kt index 2ce252fd..6e5aabcf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/activities/MainActivity.kt @@ -39,12 +39,6 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener { pager_title_strip.setTextSize(TypedValue.COMPLEX_UNIT_PX, getTextSize()) pager_title_strip.layoutParams.height = (pager_title_strip.height + resources.getDimension(R.dimen.activity_margin) * 2).toInt() - - notes_fab.setOnClickListener { displayNewNoteDialog() } - notes_fab.viewTreeObserver.addOnGlobalLayoutListener { - val heightDiff = notes_coordinator.rootView.height - notes_coordinator.height - notes_fab.visibility = if (heightDiff > dpToPx(200f)) View.INVISIBLE else View.VISIBLE - } } fun initViewPager() { @@ -97,6 +91,10 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener { displayOpenNoteDialog() true } + R.id.new_note -> { + displayNewNoteDialog() + true + } R.id.rename_note -> { displayRenameDialog() true diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 8c2ad7ab..96de51fd 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,32 +1,16 @@ - - - - - - - - - + android:layout_gravity="top" + android:paddingLeft="@dimen/activity_margin" + android:paddingRight="@dimen/activity_margin"/> + diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 84d2757b..100782b7 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -6,6 +6,11 @@ android:icon="@mipmap/open_note" android:title="@string/open_note" app:showAsAction="ifRoom"/> +