Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.activity_search);

            List <note> allNotes = TableAccess.GetAllNotes();

            foreach (note n in allNotes)
            {
                data.Add(n);
            }

            var edtSearch = FindViewById <EditText>(Resource.Id.edtSearch);
            var lstSearch = FindViewById <ListView>(Resource.Id.lstSearch);

            adapter           = new ArrayAdapter(this, Resource.Layout.listItem, Resource.Id.textView1, data);
            lstSearch.Adapter = adapter;

            lstSearch.ItemClick += LstSearch_ItemClick;

            edtSearch.AddTextChangedListener(this);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            RequestPermissions();

            TableAccess.Create(TableAccess.path);

            if (!Directory.Exists(pathFolder))
            {
                Directory.CreateDirectory(pathFolder);
            }

            btnStart      = FindViewById <Button>(Resource.Id.btnPlay);
            btnStop       = FindViewById <Button>(Resource.Id.btnStop);
            btnRecord     = FindViewById <Button>(Resource.Id.btnRecord);
            btnStopRecord = FindViewById <Button>(Resource.Id.btnStopRecord);
            btnSaveNote   = FindViewById <Button>(Resource.Id.btnSaveNote);
            btnSearch     = FindViewById <Button>(Resource.Id.btnSearch);
            notesListView = FindViewById <ListView>(Resource.Id.notesListView);

            notesList = TableAccess.GetAllNotes();
            foreach (note n in notesList.ToArray())
            {
                if (n.ParentId != -1)
                {
                    notesList.Remove(n);
                }
            }
            adapter = new NotesListAdapter(this, notesList);
            notesListView.Adapter    = adapter;
            notesListView.ItemClick += NotesListView_ItemClick;
            RegisterForContextMenu(notesListView);

            btnStop.Enabled       = false;
            btnStart.Enabled      = false;
            btnStopRecord.Enabled = false;
            btnSaveNote.Enabled   = false;

            btnRecord.Click += delegate
            {
                RecordAudio();
            };
            btnStopRecord.Click += delegate
            {
                StopRecorder();
            };
            btnStart.Click += delegate
            {
                StartLastRecord();
            };
            btnStop.Click += delegate
            {
                StopLastRecord();
            };
            btnSaveNote.Click += delegate
            {
                SaveNote();
            };
            btnSearch.Click += delegate
            {
                Search();
            };
        }
Ejemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.node_activity);

            isGrantedPermission = true;

            fileTemp = pathFolder + "/" + "$temp.3gp";

            btnPlayParent  = FindViewById <Button>(Resource.Id.btnPlayParent);
            btnStopParent  = FindViewById <Button>(Resource.Id.btnStopParent);
            btnRecord      = FindViewById <Button>(Resource.Id.btnRecord);
            btnStopRecord  = FindViewById <Button>(Resource.Id.btnStopRecord);
            btnSaveNote    = FindViewById <Button>(Resource.Id.btnSaveNote);
            notesListView  = FindViewById <ListView>(Resource.Id.notesListView);
            btnStopChild   = FindViewById <Button>(Resource.Id.btnStopChild);
            btnPlayChild   = FindViewById <Button>(Resource.Id.btnPlayChild);
            textViewHeader = FindViewById <TextView>(Resource.Id.textViewHeader);



            parentExtra = Intent.GetStringArrayListExtra("Title and ID");
            parentTitle = parentExtra[0];
            parentId    = Int32.Parse(parentExtra[1]);
            parentFile  = pathFolder + "/" + parentTitle + ".3gp";

            textViewHeader.Text = parentTitle;

            notesList = TableAccess.GetAllNotes();

            foreach (note n in notesList.ToArray())
            {
                if (n.ParentId != parentId)
                {
                    notesList.Remove(n);
                }
            }

            adapter = new NotesListAdapter(this, notesList);

            notesListView.Adapter = adapter;

            notesListView.ItemClick += NotesListView_ItemClick;

            RegisterForContextMenu(notesListView);

            btnStopChild.Enabled  = false;
            btnPlayChild.Enabled  = false;
            btnStopRecord.Enabled = false;
            btnSaveNote.Enabled   = false;

            btnRecord.Click += delegate
            {
                RecordAudio();
            };

            btnStopRecord.Click += delegate
            {
                StopRecorder();
            };

            btnPlayChild.Click += delegate
            {
                StartLastRecord();
            };

            btnStopChild.Click += delegate
            {
                StopLastRecord();
            };

            btnSaveNote.Click += delegate
            {
                SaveNote();
            };
            btnPlayParent.Click += delegate
            {
                StartParentRecord();
            };
        }