Esempio n. 1
0
        public void CreateRecyclerView(View view)
        {
            recyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.addressRecyclerView);

            Android.Support.V7.Widget.DividerItemDecoration dividerItemDecoration = new
                                                                                    Android.Support.V7.Widget.DividerItemDecoration(recyclerView.Context, Android.Support.V7.Widget.LinearLayoutManager.Vertical);

            List <AddressBook> addressBookList = new List <AddressBook>();

            addressBookAdapter = new AddressBookAdapter(addressBookList);

            recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(Context));
            recyclerView.SetAdapter(addressBookAdapter);
            recyclerView.AddItemDecoration(dividerItemDecoration);
            recyclerView.AddOnItemTouchListener(new RecyclerViewOnItemTouchListener(Context, recyclerView, new ClickListener(Context, searchEditView)));

            addressBookList.Add(new AddressBook("Steven Howchenhowser", "*****@*****.**", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"));
            addressBookList.Add(new AddressBook("Taun Olson", "*****@*****.**", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"));
            addressBookList.Add(new AddressBook("Todd Hoffman", "*****@*****.**", "PKM90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q"));
            addressBookList.Add(new AddressBook("Todd Swasinger", "*****@*****.**", "20M90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q"));
            addressBookList.Add(new AddressBook("Ramin Zahraie", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH1X"));
            addressBookList.Add(new AddressBook("Steve Smith", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH2H"));
            addressBookList.Add(new AddressBook("William Johnson", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH27T"));

            addressBookAdapter.NotifyDataSetChanged();
        }
Esempio n. 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            view = inflater.Inflate(Resource.Layout.GalleryFragment, container, false);

            var capturedImages = GlobalVariables.db.GetAllCapturedImages();

            adapter            = new GalleryAdapter(capturedImages);
            adapter.ItemClick += OnItemClick;

            mRecyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.GalleryRecyclerView);
            var emptyTextView = view.FindViewById <TextView>(Resource.Id.EmptyGalleryTextView);
            var fab           = view.FindViewById <CustomFAB>(Resource.Id.GalleryTabFAB);

            if (capturedImages.Count < 1)
            {
                mRecyclerView.Visibility = ViewStates.Gone;
                emptyTextView.Visibility = ViewStates.Visible;
            }
            else
            {
                emptyTextView.Visibility = ViewStates.Gone;
                mRecyclerView.Visibility = ViewStates.Visible;
            }
            mRecyclerView.SetAdapter(adapter);

            mLayoutManager = new Android.Support.V7.Widget.GridLayoutManager(Context, 2, Android.Support.V7.Widget.GridLayoutManager.Vertical, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            fab.AttachToRecyclerView(mRecyclerView);
            var rootView = fab.RootView;

            fab.Click += (sender, args) =>
            {
                var          ImageDirectory = FileAccessHelper.GetImageDirectory();
                var          imageName      = Guid.NewGuid() + ".jpg";
                Java.IO.File ImageFile      = new Java.IO.File(ImageDirectory, imageName.ToString());

                ((MainActivity)Activity).setImageFile(ImageFile);
                ((MainActivity)Activity).setImageName(imageName.ToString());
                ((MainActivity)Activity).setImageDirectory(ImageDirectory.AbsolutePath);

                var intent = new Intent(MediaStore.ActionImageCapture);
                intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(ImageFile));
                ((MainActivity)Activity).StartActivityForResult(intent, 0);
            };

            return(view);
        }
Esempio n. 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.layout3);
            mRecyclerView = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.recyclerView);

            // Plug in the linear layout manager:
            mLayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            // Plug in my adapter:
            var mAdapter = new RecyclerAdapter(Resource.Mipmap.us);

            mRecyclerView.SetAdapter(mAdapter);
        }
Esempio n. 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.LonelyRecycler, container, false);

            ListView = view.FindViewById <RecyclerView>(Resource.Id.recycler);
            ListView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(MainActivity.instance));
            if (item != null)
            {
                CreateHeader();
            }

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            PopulateList();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            view = inflater.Inflate(Resource.Layout.TranslationHistoryDetail, container, false);

            translationHistoryDetailAdapter            = new TranslationHistoryDetailAdapter(((TranslationHistoryMainActivity)Activity).translationHistoryDetails, GlobalVariables.db.GetAllLanguages());
            translationHistoryDetailAdapter.ItemClick += OnItemClick;

            Android.Support.V7.Widget.RecyclerView mRecyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.TranslationDetailRecyclerView);
            mRecyclerView.SetAdapter(translationHistoryDetailAdapter);

            mLayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(Context, Android.Support.V7.Widget.LinearLayoutManager.Vertical, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            return(view);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);

            view = inflater.Inflate(Resource.Layout.TranslationHistoryList, container, false);

            var translationHistory = GlobalVariables.db.GetAllTranslationHistory();

            translationHistoryAdapter            = new TranslationHistoryAdapter(translationHistory, GlobalVariables.db.GetAllLanguages());
            translationHistoryAdapter.ItemClick += OnItemClick;
            Android.Support.V7.Widget.RecyclerView mRecyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.TranslationListRecyclerView);

            var emptyTextView = view.FindViewById <TextView>(Resource.Id.EmptyTextHistoryTextView);
            var fab           = view.FindViewById <CustomFAB>(Resource.Id.TextTabFAB);

            if (translationHistory.Count < 1)
            {
                mRecyclerView.Visibility = ViewStates.Gone;
                emptyTextView.Visibility = ViewStates.Visible;
            }
            else
            {
                emptyTextView.Visibility = ViewStates.Gone;
                mRecyclerView.Visibility = ViewStates.Visible;
            }

            mRecyclerView.SetAdapter(translationHistoryAdapter);

            mLayoutManager = new Android.Support.V7.Widget.GridLayoutManager(Context, 2, Android.Support.V7.Widget.GridLayoutManager.Vertical, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            fab.AttachToRecyclerView(mRecyclerView);
            var rootView = fab.RootView;

            fab.Click += (sender, args) =>
            {
                var intent2 = new Intent(Context, typeof(TranslatorActivity));

                StartActivity(intent2);
            };

            return(view);
        }
Esempio n. 7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.LonelyRecycler, container, false);

            ListView = view.FindViewById <RecyclerView>(Resource.Id.recycler);
            ListView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(MainActivity.instance));
            ListView.SetAdapter(new PlaylistTrackAdapter(new SearchableList <Song>()));
            ListView.ScrollChange += ListView_ScrollChange;

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            PopulateList();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            if (useHeader && item != null)
            {
                CreateHeader();
            }
            //if (item.SyncState == SyncState.Error)
            //    CreateSyncBanner();
            return(view);
        }
Esempio n. 8
0
        public override Java.Lang.Object InstantiateItem(ViewGroup container, int position)
        {
            Context        context  = container.Context;
            LayoutInflater inflater = LayoutInflater.From(context);
            View           view     = null;

            if (position == 0)
            {
                view = inflater.Inflate(Resource.Layout.samples, container, false);
            }
            else
            {
                view = inflater.Inflate(Resource.Layout.item_font, container, false);
                RecyclerView recyclerView = view.FindViewById <RecyclerView> (Resource.Id.recyclerView);
                int          nbColumns    = AndroidUtils.getScreenSize((Activity)context).width / context.Resources.GetDimensionPixelSize(Resource.Dimension.item_width);
                recyclerView.SetLayoutManager(new GridLayoutManager(context, nbColumns));
                recyclerView.SetAdapter(new IconAdapter(fonts [position - 1].Value.Characters));
            }
            container.AddView(view);
            return(view);
        }
Esempio n. 9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            MobileCenter.Start("e67780b5-ce73-4898-9932-78adc99e961f",
                               typeof(Analytics), typeof(Crashes));
            SetContentView(Resource.Layout.list);

            Android.Support.V7.Widget.RecyclerView recyclerView = FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.recyclerView);

            // improve performance if you know that changes in content
            // do not change the size of the RecyclerView
            recyclerView.HasFixedSize = true;

            // use a linear layout manager
            Android.Support.V7.Widget.LinearLayoutManager layoutManager = new Android.Support.V7.Widget.LinearLayoutManager(this);
            recyclerView.SetLayoutManager(layoutManager);

            List <RootObject> mytempObjet = MyClass.readDataFromFile();
            // specify an adapter
            RecyclarAdapter adapter = new RecyclarAdapter(this, mytempObjet);

            recyclerView.SetAdapter(adapter);
        }
        private void ShowSendDialog()
        {
            var builder = new Android.Support.V7.App.AlertDialog.Builder(Context);

            builder.SetTitle("Send");

            LayoutInflater layoutInflater = Activity.LayoutInflater;

            View view = layoutInflater.Inflate(Resource.Layout.sendlayout, null, false);

            mainLayout = view.FindViewById <LinearLayout>(Resource.Id.mainSendLayout);

            List <AddressBook> addressBookList = new List <AddressBook>();

            btcAddressLayout = view.FindViewById <Android.Support.Design.Widget.TextInputLayout>(
                Resource.Id.username_layout);
            labelLayout = view.FindViewById <Android.Support.Design.Widget.TextInputLayout>(
                Resource.Id.labelLayout);
            amountLayout = view.FindViewById <Android.Support.Design.Widget.TextInputLayout>(
                Resource.Id.amountLayout);
            recyclerView = view.FindViewById <Android.Support.V7.Widget.RecyclerView>(Resource.Id.recyclerView);

            addressBookAdapter = new AddressBookAdapter(addressBookList);

            bitCoinAddressView = view.FindViewById <AutoCompleteTextView>(Resource.Id.autoComplete);
            labelTextView      = view.FindViewById <TextInputEditText>(Resource.Id.labelEdit);
            amountTextView     = view.FindViewById <TextInputEditText>(Resource.Id.amountEdit);

            buttonLayout = view.FindViewById <LinearLayout>(Resource.Id.buttonLayout);

            addressBookButton = view.FindViewById <Button>(Resource.Id.addressBook);
            qrCodeButton      = view.FindViewById <Button>(Resource.Id.qrCode);
            clearButton       = view.FindViewById <Button>(Resource.Id.clear);

            Android.Support.V7.Widget.DividerItemDecoration dividerItemDecoration = new
                                                                                    Android.Support.V7.Widget.DividerItemDecoration(recyclerView.Context, Android.Support.V7.Widget.LinearLayoutManager.Vertical);

            recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(builder.Context));
            recyclerView.SetAdapter(addressBookAdapter);
            recyclerView.AddItemDecoration(dividerItemDecoration);
            //recyclerView.AddOnItemTouchListener(new RecyclerViewOnItemTouchListener(Context, recyclerView, new ClickListener(Context)));

            addressBookList.Add(new AddressBook("Steven Howchenhowser", "*****@*****.**", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"));
            addressBookList.Add(new AddressBook("Taun Olson", "*****@*****.**", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"));
            addressBookList.Add(new AddressBook("Todd Hoffman", "*****@*****.**", "PKM90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q"));
            addressBookList.Add(new AddressBook("Todd Swasinger", "*****@*****.**", "20M90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q"));
            addressBookList.Add(new AddressBook("Ramin Zahraie", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH1X"));
            addressBookList.Add(new AddressBook("Steve Smith", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH2H"));
            addressBookList.Add(new AddressBook("William Johnson", "*****@*****.**", "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH27T"));


            addressBookAdapter.NotifyDataSetChanged();

            //@@address book


            addressBookButton.Click += AddressBookButton_Click;
            clearButton.Click       += ClearButton_Click;

            List <string> addressList = new List <string>()
            {
                "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L",
                "1NU19iag9jJgTHD1VXjvLCEnZuQ3rKDE9L",
                "PKM90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q",
                "20M90iag9jJgTHD1VXjvLCEnZuQ3rTCF0Q",
                "58M90iag9jJgTHD1VXjvLCEnZuQ3rTCH1X"
            };

            ArrayAdapter <String> addressListDataAdapters = new ArrayAdapter <String>(Context,
                                                                                      Android.Resource.Layout.SimpleListItem1, addressList);

            //bitCoinAddressView.Adapter = addressListDataAdapters;


            bitCoinAddressView.FocusChange += BitCoinAddressView_FocusChange;
            //bitCoinAddressView.AddTextChangedListener(new TextWatcher(ref addressBookAdapter));
            bitCoinAddressView.AfterTextChanged += BitCoinAddressView_AfterTextChanged;
            bitCoinAddressView.TextChanged      += BitCoinAddressView_TextChanged;
            labelTextView.FocusChange           += LabelTextView_FocusChange;
            amountTextView.FocusChange          += AmountTextView_FocusChange;

            builder.SetView(view);

            builder.SetPositiveButton(Resource.String.send, (senderAlert, args) =>
            {
                if ((bitCoinAddressView.Text.Length != 0) && (labelTextView.Text.Length != 0) &&
                    (amountTextView.Text.Length != 0))
                {
                    dataRepository.AddTransactionData(DateTime.Now, bitCoinAddressView.Text, labelTextView.Text, Convert.ToDecimal(amountTextView.Text),
                                                      GetValue(amountTextView.Text), "Sent to");

                    Snackbar s = Snackbar.Make(mainView, "Request sent. Add " + bitCoinAddressView.Text + " to address book?", Snackbar.LengthLong).SetAction("Yes", (v) =>
                    {
                        ShowAddressBookAddEntry();
                    });

                    s.Show();
                }
            });

            builder.SetNegativeButton(Resource.String.cancel, (senderAlert, args) => { });

            builder.Show();
        }