2023-03-18 21:19:23 +00:00
|
|
|
package xyz.r0r5chach.cpsAssist.notes;
|
|
|
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
2023-03-26 01:11:08 +00:00
|
|
|
import android.widget.TextView;
|
2023-03-18 21:19:23 +00:00
|
|
|
|
|
|
|
|
import xyz.r0r5chach.cpsAssist.R;
|
|
|
|
|
|
|
|
|
|
public class NotesActivity extends AppCompatActivity {
|
2023-03-24 23:20:41 +00:00
|
|
|
private Adapter adapter;
|
2023-03-18 21:19:23 +00:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
setContentView(R.layout.activity_notes);
|
|
|
|
|
initRecycler();
|
2023-03-26 14:12:49 +00:00
|
|
|
setTitle("Notes- " + getIntent().getStringExtra("username"));
|
2023-03-24 23:20:41 +00:00
|
|
|
findViewById(R.id.add_Button).setOnClickListener(new BtnOnClickListener(adapter));
|
2023-03-18 21:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void initRecycler() {
|
2023-03-24 23:20:41 +00:00
|
|
|
RecyclerView list = findViewById(R.id.notesList);
|
2023-03-26 01:11:08 +00:00
|
|
|
adapter = new Adapter(getExternalFilesDir(null), getIntent().getStringExtra("username"));
|
2023-03-24 23:20:41 +00:00
|
|
|
list.setAdapter(adapter);
|
2023-03-18 21:19:23 +00:00
|
|
|
list.setLayoutManager(new LinearLayoutManager(this));
|
2023-03-26 01:11:08 +00:00
|
|
|
adapter.notifyItemRangeChanged(0, adapter.getItemCount());
|
2023-03-18 21:19:23 +00:00
|
|
|
}
|
|
|
|
|
}
|