add a fab for creating new notes

This commit is contained in:
tibbi 2016-09-25 20:05:54 +02:00
parent c01c01c12f
commit e2c1573059
8 changed files with 37 additions and 11 deletions

View File

@ -32,6 +32,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.jakewharton:butterknife:8.0.1'
compile 'com.github.yukuku:ambilwarna:2.0.1'
compile 'com.android.support:design:23.4.0'
apt 'com.jakewharton:butterknife-compiler:8.0.1'
}

View File

@ -10,6 +10,7 @@ import android.support.v7.app.AlertDialog;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
@ -19,9 +20,11 @@ import com.simplemobiletools.notes.Utils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MainActivity extends SimpleActivity {
@BindView(R.id.notes_view) EditText mNotesView;
@BindView(R.id.notes_view)
EditText mNotesView;
private SharedPreferences mPrefs;
@ -95,6 +98,11 @@ public class MainActivity extends SimpleActivity {
}
}
@OnClick(R.id.notes_fab)
public void newNoteClicked(View view) {
}
private void displayAutosavePrompt() {
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle(getString(R.string.unsaved_changes));

View File

@ -1,6 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notes_coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notes_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
@ -11,6 +18,16 @@
android:layout_height="wrap_content"
android:background="@null"
android:gravity="top"
android:inputType="textCapSentences|textMultiLine"
android:padding="@dimen/activity_margin"/>
</ScrollView>
</ScrollView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/notes_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/activity_margin"
android:src="@mipmap/plus"/>
</android.support.design.widget.CoordinatorLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B