Esempio n. 1
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);


            db.CreateDatabase();
            NoteModel[] dbNotes = (db.GetAllPosts().ToArray());
            ListAdapter = new ArrayAdapter <string>(Activity, Android.Resource.Layout.SimpleListItemActivated1,
                                                    dbNotes.Select(i => i.Title).ToArray());

            if (savedInstanceState != null)
            {
                selectedPlayId = savedInstanceState.GetInt("current_play_id", 0);
            }

            var quoteContainer = Activity.FindViewById(Resource.Id.playquote_container);

            showingTwoFragments = quoteContainer != null &&
                                  quoteContainer.Visibility == ViewStates.Visible;
            if (showingTwoFragments)
            {
                ListView.ChoiceMode = ChoiceMode.Single;
                ShowPlayQuote(selectedPlayId);
            }
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            if (Resources.Configuration.Orientation == Android.Content.Res.Orientation.Landscape)
            {
                Finish();
            }
            SetContentView(Resource.Layout.ShowQuote);
            PlayId = Intent.Extras.GetInt("current_play_id", 0);
            TextView text         = FindViewById <TextView>(Resource.Id.Dialogue);
            Button   SaveEdit     = FindViewById <Button>(Resource.Id.EditSaveBtn);
            Button   DeleteCancel = FindViewById <Button>(Resource.Id.DeleteCancelBtn);



            db.CreateDatabase();
            NoteModel[] noteModels = db.GetAllPosts().ToArray();
            string[]    Text       = noteModels.Select(i => i.Dialogue).ToArray();
            text.Text           = Text[PlayId];
            SaveEdit.Click     += Saveedit_Click;
            DeleteCancel.Click += DeleteCancel_Click;
        }
Esempio n. 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (container == null)
            {
                return(null);
            }

            var textView = new TextView(Activity);
            var padding  = Convert.ToInt32(TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Activity.Resources.DisplayMetrics));

            textView.SetPadding(padding, padding, padding, padding);
            textView.TextSize = 24;
            db.CreateDatabase();


            NoteModel[] noteModels = db.GetAllPosts().ToArray();
            string[]    Text       = noteModels.Select(i => i.Dialogue).ToArray();
            textView.Text = Text[PlayId];

            var scroller = new ScrollView(Activity);

            scroller.AddView(textView);
            return(scroller);
        }