mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-15 15:57:24 +02: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.util.TypedValue;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ import com.simplemobiletools.notes.models.Note;
|
|||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
import butterknife.OnClick;
|
||||||
|
|
||||||
public class MainActivity extends SimpleActivity {
|
public class MainActivity extends SimpleActivity {
|
||||||
@BindView(R.id.notes_view) EditText mNotesView;
|
@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() {
|
private void saveText() {
|
||||||
final String newText = getCurrentNote();
|
final String newText = getCurrentNote();
|
||||||
final String oldText = mCurrentNote.getValue();
|
final String oldText = mCurrentNote.getValue();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<android.support.design.widget.CoordinatorLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/notes_coordinator"
|
android:id="@+id/notes_coordinator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
@ -22,4 +23,13 @@
|
|||||||
android:padding="@dimen/activity_margin"/>
|
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"
|
||||||
|
app:backgroundTint="@color/colorPrimary"/>
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user