dodanie funkcji zapisu notatki

This commit is contained in:
Naiki00 2021-02-15 20:06:57 +01:00
parent 99bf648dc7
commit 4d6e51813f

View File

@ -5,9 +5,12 @@ import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.example.notatkon.database.NoteEntity;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
@ -37,7 +40,19 @@ public class CreateNote extends AppCompatActivity {
textDataTime.setText( textDataTime.setText(
new SimpleDateFormat("EEEE, dd MM yyyy HH:mm", Locale.getDefault()) new SimpleDateFormat("EEEE, dd MM yyyy HH:mm", Locale.getDefault())
.format(new Date()) .format(new Date())
); );
} }
private void saveNote() {
final NoteEntity note = new NoteEntity();
note.setTitle(noteTitle.getText().toString());
note.setSubtitle(noteSubtitle.getText().toString());
note.setContent(inputNote.getText().toString());
note.setDateTime(textDataTime.getText().toString());
}
} }