| Name | Message | Date |
|---|---|---|
| 📄 FolderPickerActivity.cs | 4 days ago | |
| 📄 NoteListActivity.cs | 4 days ago | |
| 📄 NoteViewActivity.cs | 4 days ago | |
| 📄 SettingsActivity.cs | 4 days ago |
📄
src/Activities/NoteViewActivity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Android.Views; using NotesApp.Graph; namespace NotesApp.Activities; [Activity(Label = "@string/app_name", Exported = false)] public class NoteViewActivity : Activity { public const string ExtraNoteId = "note_id"; public const string ExtraNoteName = "note_name"; public const string ExtraNotePreview = "note_preview"; private TextView _contentView = null!; private ProgressBar _progressBar = null!; private GraphService _graphService = null!; protected override void OnCreate(Bundle? savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_note_view); var noteId = Intent?.GetStringExtra(ExtraNoteId); Title = Intent?.GetStringExtra(ExtraNoteName) ?? GetString(Resource.String.app_name); _contentView = FindViewById<TextView>(Resource.Id.note_view_content)!; _progressBar = FindViewById<ProgressBar>(Resource.Id.note_view_progress)!; _contentView.Text = Intent?.GetStringExtra(ExtraNotePreview) ?? ""; _graphService = new GraphService(this); if (noteId != null) _ = LoadContentAsync(noteId); } private async Task LoadContentAsync(string noteId) { _progressBar.Visibility = ViewStates.Visible; try { _contentView.Text = await _graphService.GetContentAsync(noteId); } catch (Exception ex) { Toast.MakeText(this, ex.Message, ToastLength.Long)?.Show(); // Leave the preview text in place as a partial fallback rather than blanking it. } finally { _progressBar.Visibility = ViewStates.Gone; } } }