mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-01 09:37:48 +01:00
add a fab for creating new notes
This commit is contained in:
parent
c01c01c12f
commit
e2c1573059
@ -32,6 +32,7 @@ dependencies {
|
|||||||
compile 'com.android.support:appcompat-v7:23.4.0'
|
compile 'com.android.support:appcompat-v7:23.4.0'
|
||||||
compile 'com.jakewharton:butterknife:8.0.1'
|
compile 'com.jakewharton:butterknife:8.0.1'
|
||||||
compile 'com.github.yukuku:ambilwarna:2.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'
|
apt 'com.jakewharton:butterknife-compiler:8.0.1'
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import android.support.v7.app.AlertDialog;
|
|||||||
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;
|
||||||
|
|
||||||
@ -19,9 +20,11 @@ import com.simplemobiletools.notes.Utils;
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
private SharedPreferences mPrefs;
|
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() {
|
private void displayAutosavePrompt() {
|
||||||
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
|
final AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
|
||||||
alertDialog.setTitle(getString(R.string.unsaved_changes));
|
alertDialog.setTitle(getString(R.string.unsaved_changes));
|
||||||
|
@ -1,16 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView
|
<android.support.design.widget.CoordinatorLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
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">
|
||||||
android:fillViewport="true">
|
|
||||||
|
|
||||||
<EditText
|
<ScrollView
|
||||||
android:id="@+id/notes_view"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/notes_scrollview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:background="@null"
|
android:fillViewport="true">
|
||||||
android:gravity="top"
|
|
||||||
android:padding="@dimen/activity_margin"/>
|
|
||||||
|
|
||||||
</ScrollView>
|
<EditText
|
||||||
|
android:id="@+id/notes_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="top"
|
||||||
|
android:inputType="textCapSentences|textMultiLine"
|
||||||
|
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"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
BIN
app/src/main/res/mipmap-hdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 232 B |
BIN
app/src/main/res/mipmap-mdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 148 B |
BIN
app/src/main/res/mipmap-xhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 B |
BIN
app/src/main/res/mipmap-xxhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 292 B |
BIN
app/src/main/res/mipmap-xxxhdpi/plus.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 B |
Loading…
x
Reference in New Issue
Block a user