mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-01-19 09:09:47 +01:00
add a FAB for creating new notes
This commit is contained in:
parent
87442a9515
commit
87530d9fbc
@ -7,6 +7,7 @@ import android.os.Bundle;
|
||||
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;
|
||||
|
||||
@ -17,6 +18,7 @@ import com.simplemobiletools.notes.models.Note;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class MainActivity extends SimpleActivity {
|
||||
@BindView(R.id.notes_view) EditText mNotesView;
|
||||
@ -77,6 +79,11 @@ public class MainActivity extends SimpleActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.notes_fab)
|
||||
public void fabClicked(View view) {
|
||||
|
||||
}
|
||||
|
||||
private void saveText() {
|
||||
final String newText = getCurrentNote();
|
||||
final String oldText = mCurrentNote.getValue();
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/notes_coordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
@ -22,4 +23,13 @@
|
||||
android:padding="@dimen/activity_margin"/>
|
||||
</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"
|
||||
app:backgroundTint="@color/colorPrimary"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
Loading…
Reference in New Issue
Block a user