przypisano pola do pól tekstu w notatce, dodano funkcję wyświetlania daty

This commit is contained in:
Naiki00 2021-02-15 19:21:26 +01:00
parent 16b8ce646a
commit 99bf648dc7

View File

@ -2,24 +2,42 @@ package com.example.notatkon;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class CreateNote extends AppCompatActivity {
private EditText noteTitle, noteSubtitle, inputNote;
private TextView textDataTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.create_note);
ImageView imageBack = findViewById(R.id.back);
imageBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
noteTitle = findViewById(R.id.noteTitle);
noteSubtitle = findViewById(R.id.noteSubtitle);
inputNote = findViewById(R.id.inputNote);
textDataTime = findViewById(R.id.textDateTime);
textDataTime.setText(
new SimpleDateFormat("EEEE, dd MM yyyy HH:mm", Locale.getDefault())
.format(new Date())
);
}
}