Пример #1
1
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.StudyCardLayout, container, false);
            mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.recyclerView);
            //mListView = view.FindViewById<ListView> (Resource.Id.lvToDoList);
            mFab = view.FindViewById<FloatingActionButton> (Resource.Id.fab);
            mFab.Click += (sender, e) => {
                createFragment(null,true);
            };
            mStudyGroup = new List<StudyGroup> ();
            StudyRequest asyncStudyRquest = new StudyRequest ();
            Task<StudyResponse> data = asyncStudyRquest.StudyRequestAsync (LoginInfo.username, LoginInfo.KEY);

            StudyResponse results = data.Result;
            List<StudyGroup> resultsList = new List<StudyGroup> (results.studyGroups);

            for (int i = 0; i <resultsList.Count; i++) {

                mStudyGroup.Add (resultsList[i]);
            }

            mLayoutManager = new LinearLayoutManager (view.Context);
            mRecyclerView.SetLayoutManager (mLayoutManager);
            mAdapter = new RecyclerAdapter (mStudyGroup,mRecyclerView,this);
            mRecyclerView.SetAdapter (mAdapter);

            return view;
        }
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false);

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            emptyStateLayout = view.FindViewById<LinearLayout> (Resource.Id.ProjectListEmptyState);
            searchEmptyState = view.FindViewById<LinearLayout> (Resource.Id.ProjectListSearchEmptyState);
            tabLayout = view.FindViewById<TabLayout> (Resource.Id.WorkspaceTabLayout);
            newProjectFab = view.FindViewById<AddProjectFab> (Resource.Id.AddNewProjectFAB);
            toolBar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar);

            var activity = (Activity)Activity;
            activity.SetSupportActionBar (toolBar);
            activity.SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            activity.SupportActionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle);

            HasOptionsMenu = true;
            newProjectFab.Click += OnNewProjectFabClick;
            tabLayout.SetOnTabSelectedListener (this);

            return view;
        }
Пример #3
0
 protected void setupFloatingActionButton()
 {
     addButton = FindViewById<FloatingActionButton>(Resource.Id.fab);
     addButton.Click += (sender, e) => {
         Snackbar.Make (addButton, "Here's a snackbar!", Snackbar.LengthLong).SetAction("Action",
             new ClickListener(v => {
                 Console.WriteLine("Action handler");
             })).Show ();
     };
 }
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.View> e)
        {
            base.OnElementChanged(e);

            var FAB = new FloatingActionButton(this.Context);

            FAB.SetImageResource(Resource.Drawable.ic_add);

            SetNativeControl(FAB);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.counters_fragment, null);
            
            _recyclerView = view.FindViewById<RecyclerView>(Resource.Id.countersRecyclerView);
            _recyclerView.SetLayoutManager(new LinearLayoutManager(Context, LinearLayoutManager.Vertical, false));
            _recyclerView.SetAdapter(new CountersAdapter());

            _floatingActionButton = view.FindViewById<FloatingActionButton>(Resource.Id.floatingAddNewCounterButton);
            _floatingActionButton.SetCommand(nameof(FloatingActionButton.Click), ViewModelLocator.Counters.AddNewCounterCommand);

            return view;
        }
 private void initInstances()
 { 
     drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
     //底部悬浮按钮
     fabBtn = FindViewById<FloatingActionButton>(Resource.Id.fabBtn);
     fabBtn.SetOnClickListener(this);
     //v7的actionbar
     toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
     toolbar.SetTitleTextColor(Color.White);
     SetSupportActionBar(toolbar);
     //v7 ActionBar的返回按钮
     SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
     SupportActionBar.SetDisplayHomeAsUpEnabled(true);
 }
Пример #7
0
        private void InitComponent()
        {
            try
            {
                CollapsingToolbar       = (CollapsingToolbarLayout)FindViewById(Resource.Id.collapsingToolbar);
                CollapsingToolbar.Title = "";

                AppBarLayout = FindViewById <AppBarLayout>(Resource.Id.appBarLayout);
                AppBarLayout.SetExpanded(true);
                AppBarLayout.AddOnOffsetChangedListener(this);


                MRecycler    = (RecyclerView)FindViewById(Resource.Id.userRecyler);
                TxtGroupName = FindViewById <EmojiconEditText>(Resource.Id.groupName);
                ImageGroup   = FindViewById <ImageView>(Resource.Id.groupCover);
                BtnImage     = FindViewById <Button>(Resource.Id.btn_selectimage);

                ChatEmojImage = FindViewById <ImageView>(Resource.Id.emojiicon);

                BtnAdd = FindViewById <FloatingActionButton>(Resource.Id.fab);

                BtnDeleteGroup            = FindViewById <Button>(Resource.Id.deleteGroupButton);
                BtnDeleteGroup.Visibility = ViewStates.Visible;

                BtnExitGroup            = FindViewById <TextView>(Resource.Id.exitGroupButton);
                BtnExitGroup.Visibility = ViewStates.Visible;

                if (AppSettings.SetTabDarkTheme)
                {
                    TxtGroupName.SetTextColor(Color.White);
                    TxtGroupName.SetHintTextColor(Color.White);
                }
                else
                {
                    TxtGroupName.SetTextColor(Color.ParseColor("#444444"));
                    TxtGroupName.SetHintTextColor(Color.ParseColor("#444444"));
                }

                var emojisIcon = new EmojIconActions(this, CollapsingToolbar, TxtGroupName, ChatEmojImage);
                emojisIcon.ShowEmojIcon();
                emojisIcon.SetIconsIds(Resource.Drawable.ic_action_keyboard, Resource.Drawable.ic_action_sentiment_satisfied_alt);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            // Store a clean environment.
            EnvironmentBackup = EnvironmentBackup ?? System.Environment.GetEnvironmentVariables();

            SetTheme(Resource.Style.AppTheme);
            base.OnCreate(savedInstanceState);
            ViewGroup root = FindViewById <ViewGroup>(Android.Resource.Id.Content);

            SetContentView(Resource.Layout.MainLayout);

            MainToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.MainToolbar);
            SetSupportActionBar(MainToolbar);
            MainToolbar.SetLogo(Resource.Drawable.InAppLogo);
            SupportActionBar.Title = SupportActionBar.Title.Substring(3);

            FindViewById <TextView>(Resource.Id.MainWarning).ApplyHTML();

            MainFABRefresh        = FindViewById <FloatingActionButton>(Resource.Id.MainFABRefresh);
            MainFABRefresh.Click += (s, e) =>
            {
                LoaderManager.RestartLoader(0, null, this);
            };

            MainListView = FindViewById <ListView>(Resource.Id.MainListView);

            FrameLayout.LayoutParams layoutParams;

            ProgressBar progress = new ProgressBar(this);

            layoutParams = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent,
                GravityFlags.CenterHorizontal | GravityFlags.CenterVertical
                );
            progress.LayoutParameters = layoutParams;
            progress.Indeterminate    = true;
            MainListView.EmptyView    = progress;
            root.AddView(progress);

            MainListAdapter      = new GameInfoListAdapter(this);
            MainListView.Adapter = MainListAdapter;
            LoaderManager.InitLoader(0, null, this);

            MainListView.ItemClick += (s, e) => OpenGamePlay((GameInfo)MainListView.GetItemAtPosition(e.Position));
            RegisterForContextMenu(MainListView);
        }
Пример #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            navigationView.SetNavigationItemSelectedListener(this);

            txtTitle = FindViewById <TextView>(Resource.Id.txtTitle);

            txtContentID = FindViewById <TextView>(Resource.Id.txtContentID);

            txtPKGType       = FindViewById <TextView>(Resource.Id.txtType);
            txtSystemVersion = FindViewById <TextView>(Resource.Id.txtVer);

            imgPkg = FindViewById <ImageView>(Resource.Id.imgpkg);
            ListView listView = (ListView)FindViewById(Resource.Id.lstSFO);

            listView.Visibility = ViewStates.Gone;
            View     usermenu   = navigationView.GetHeaderView(0);
            TextView txtVersion = usermenu.FindViewById <TextView>(Resource.Id.version);

            try
            {
                // get the version number of the application
                txtVersion.Text = "VERSION " + Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName;
            }
            catch (Exception ex)
            {
                txtVersion.Text = "VERSION 1.00";
                //Crashes.TrackError(ex);
            }
        }
Пример #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            MobileBarcodeScanner.Initialize(Application);

            Window.SetFlags(WindowManagerFlags.Secure, WindowManagerFlags.Secure);
            SetContentView(Resource.Layout.activityMain);

            _toolbar = FindViewById <MaterialToolbar>(Resource.Id.toolbar);
            SetSupportActionBar(_toolbar);
            SupportActionBar.SetTitle(Resource.String.categoryAll);

            _bottomAppBar = FindViewById <BottomAppBar>(Resource.Id.bottomAppBar);
            _bottomAppBar.NavigationClick += OnBottomAppBarNavigationClick;
            _bottomAppBar.MenuItemClick   += (sender, args) =>
            {
                _toolbar.Menu.FindItem(Resource.Id.actionSearch).ExpandActionView();
                _authList.SmoothScrollToPosition(0);
            };

            _coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout);
            _progressBar       = FindViewById <ProgressBar>(Resource.Id.appBarProgressBar);

            _addButton        = FindViewById <FloatingActionButton>(Resource.Id.buttonAdd);
            _addButton.Click += OnAddButtonClick;

            _authList               = FindViewById <RecyclerView>(Resource.Id.list);
            _emptyStateLayout       = FindViewById <LinearLayout>(Resource.Id.layoutEmptyState);
            _emptyMessageText       = FindViewById <TextView>(Resource.Id.textEmptyMessage);
            _viewGuideButton        = FindViewById <MaterialButton>(Resource.Id.buttonViewGuide);
            _viewGuideButton.Click += (sender, args) =>
            {
                StartActivity(typeof(GuideActivity));
            };

            _refreshOnActivityResume = false;

            DetectGoogleAPIsAvailability();

            var prefs       = PreferenceManager.GetDefaultSharedPreferences(this);
            var firstLaunch = prefs.GetBoolean("firstLaunch", true);

            if (firstLaunch)
            {
                StartActivity(typeof(IntroActivity));
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.reservas_Mantenedor);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarMantenedorReservas);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.Title = "Mis Reservas";


            trabajador                  = JsonConvert.DeserializeObject <MTrabajador>(Intent.GetStringExtra("trabajador"));
            fab                         = FindViewById <FloatingActionButton>(Resource.Id.fabNuevaReserva);
            fab.Click                  += Fab_Click;
            listViewReservas            = FindViewById <ListView>(Resource.Id.listReservas);
            listViewReservas.ItemClick += ListViewReservas_ItemClick;

            textFechaDesde                = FindViewById <TextInputLayout>(Resource.Id.dateBuscarReservaDesde);
            textFechaDesdeEditText        = FindViewById <EditText>(Resource.Id.dateBuscarReservaDesdeValor);
            textFechaDesdeEditText.Click += TextFechaDesdeEditText_Click;

            textFechaHasta                = FindViewById <TextInputLayout>(Resource.Id.dateBuscarReservaHasta);
            textFechaHastaEditText        = FindViewById <EditText>(Resource.Id.dateBuscarReservaHastaValor);
            textFechaHastaEditText.Click += TextFechaHastaEditText_Click;


            db       = new SQLite.SQLiteConnection(sqlPath);
            reservas = db.Table <MReserva>().Where(x => x.IdUsuario == trabajador.Id).OrderBy(x => x.FechaSalida).ToList();

            try
            {
                //fechaDesde = reservas.Where(x => x.Estado == "Sin confirmar").Min(x => x.FechaSalida);
                fechaDesde = DateTime.Now.AddDays(-1);
                fechaHasta = reservas.Max(x => x.FechaSalida);
            }
            catch
            {
                fechaDesde = DateTime.Now;
                fechaHasta = DateTime.Now;
            }

            textFechaDesde.EditText.Text = fechaDesde.Date.ToShortDateString();
            textFechaHasta.EditText.Text = fechaHasta.Date.ToShortDateString();

            buscarReservas();
            listViewReservas.FastScrollEnabled = true;
            Window.SetSoftInputMode(SoftInput.StateHidden);
        }
Пример #12
0
        private void CreateMenuButton()
        {
            _menuButton = new FloatingActionButton(Context)
            {
                BackgroundTintList = ColorStateList.ValueOf(BackgroundColor),
                Elevation          = ButtonElevation,
                LongClickable      = OpenOnHold,
            };
            _menuButton.SetImageDrawable(Icon);

            _menuButton.Click += (s, e) =>
            {
                if (IsOpened)
                {
                    CloseMenu();
                }
                else
                {
                    ButtonClick?.Invoke(s, e);

                    if (!OpenOnHold)
                    {
                        OpenMenu();
                    }
                }
            };

            if (OpenOnHold)
            {
                _menuButton.LongClick += (s, e) =>
                {
                    if (IsOpened)
                    {
                        CloseMenu();
                    }
                    else
                    {
                        OpenMenu();
                    }
                };
            }
            else
            {
                _menuButton.LongClick += (s, e) => ButtonLongClick?.Invoke(s, e);
            }
        }
Пример #13
0
        private void ActionButton_Click(object sender, EventArgs e)
        {
            FloatingActionButton fabButton = sender as FloatingActionButton;

            if (fabButton != null)
            {
                if (fabButton.Id == Resource.Id.fab2)
                {
                    fabButton.Visibility = ViewStates.Gone;
                }
                else if (fabButton.Id == Resource.Id.fab3)
                {
                    fabButton.Visibility = ViewStates.Visible;
                }
                Toast.MakeText(this, fabButton.LabelText, ToastLength.Short).Show();
            }
        }
Пример #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            Button start = FindViewById <Button>(Resource.Id.button1);

            start.Click += test;
        }
Пример #15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ViewModel = BrowseFragment.ViewModel;

            // Create your application here
            SetContentView(Resource.Layout.activity_add_item);
            saveButton  = FindViewById <FloatingActionButton>(Resource.Id.save_button);
            title       = FindViewById <EditText>(Resource.Id.txtTitle);
            description = FindViewById <EditText>(Resource.Id.txtDesc);

            lblUsername = FindViewById <TextView>(Resource.Id.title);
            lblPassword = FindViewById <TextView>(Resource.Id.description);

            saveButton.Click += SaveButton_Click;
        }
Пример #16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            var prof_pic2 = (GmailProfilePicture)this.FindViewById(Resource.Id.profile_pic2);

            prof_pic2.DisplayText = "TEXT";
            return;
        }
Пример #17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ViewModel = BrowseFragment.ViewModel;

            // Create your application here
            SetContentView(Resource.Layout.activity_add_item);
            saveButton  = FindViewById <FloatingActionButton>(Resource.Id.save_button);
            title       = FindViewById <EditText>(Resource.Id.txtTitle);
            description = FindViewById <EditText>(Resource.Id.txtDesc);

            saveButton.Click += SaveButton_Click;

            gps = new Services.GpsApiClient(this, true);
            gps.LocationUpdated += HandleCustomEvent;
        }
        private void InitComponent()
        {
            try
            {
                ViewPager = FindViewById <ViewPager>(Resource.Id.viewpager);
                TabLayout = FindViewById <TabLayout>(Resource.Id.tabs);

                FloatingActionButtonView = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonView);

                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Пример #19
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            AndroidX.AppCompat.Widget.Toolbar toolbar = FindViewById <AndroidX.AppCompat.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            fab        = FindViewById <FloatingActionButton>(Resource.Id.fab);
            fab.Click += FabOnClick;
            DrawerLayout          drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close);

            drawer.AddDrawerListener(toggle);
            toggle.SyncState();

            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            navigationView.SetNavigationItemSelectedListener(this);
            navigationView.Menu.GetItem(0).SetChecked(true);

            var welcomeTransaction = SupportFragmentManager.BeginTransaction();

            welcomeTransaction.Add(Resource.Id.fragment_container, new WelcomeFragment(), "Welcome");
            welcomeTransaction.Commit();

            var incomingSMSContent = string.Empty;

            // Check for 'incoming' SMS message
            if (Intent.Action == Android.Content.Intent.ActionSend && Intent.Type == "text/plain")
            {
                incomingSMSContent = Intent.GetStringExtra(Android.Content.Intent.ExtraText);
            }

            encryptionService = new EncryptionService();
            if (await encryptionService.PasswordExists() == false)
            {
                PerformFragmentNavigation(new LoginFragment(), "Login");
                fab.Visibility = ViewStates.Invisible;
            }
            else if (string.IsNullOrEmpty(incomingSMSContent) == false)
            {
                var readerFragment = new ReaderFragment(incomingSMSContent);
                PerformFragmentNavigation(readerFragment, "Reader");
            }
        }
Пример #20
0
        public FloatingActionButtonViewRenderer(Context context) : base(context)
        {
            var density = context.Resources?.DisplayMetrics?.Density ?? 0;
            var margin  = (int)(_marginDips * density); // margin in pixels

            _floatingActionButton = new FloatingActionButton(context)
            {
                LayoutParameters = new FrameLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent)
                {
                    Gravity      = GravityFlags.CenterVertical | GravityFlags.CenterHorizontal,
                    LeftMargin   = margin,
                    TopMargin    = margin,
                    BottomMargin = margin,
                    RightMargin  = margin
                }
            };
        }
Пример #21
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.EventsFragment, container, false);


            homeActivity = this.Activity as HomeActivity;

            EventsFromServer = new List <Event>();

            // Get our RecyclerView layout:
            mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.EventsRecyclerView);

            // Use the built-in linear layout manager:
            mLayoutManager = new LinearLayoutManager(this.Activity);

            // Plug the layout manager into the RecyclerView:
            mRecyclerView.SetLayoutManager(mLayoutManager);


            FloatingActionButton button = view.FindViewById <FloatingActionButton>(Resource.Id.floatingActionButton1);

            button.Click += delegate {
                var addEventActivity = new Intent(this.Context, typeof(AddEventActivity));
                StartActivity(addEventActivity);
            };

            // Search EditText
            EditText editSearch = view.FindViewById <EditText>(Resource.Id.editTextSearchEvent);

            editSearch.EditorAction += (object sender, TextView.EditorActionEventArgs e) => {
                if (e.ActionId == ImeAction.Done)
                {
                    EditText et = sender as EditText;
                    SetAdapterWithFilterText(et.Text);
                }
                e.Handled = false;
            };

            // Get open events form server
            GetOpenEventsFromServer();

            // Get active sections
            GetActiveSectionsFromServer();

            return(view);
        }
Пример #22
0
        private void InitComponent()
        {
            try
            {
                ViewPager = FindViewById <ViewPager>(Resource.Id.viewpager);
                TabLayout = FindViewById <TabLayout>(Resource.Id.tabs);

                FloatingActionButtonView = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonView);

                SetUpViewPager(ViewPager);
                TabLayout.SetupWithViewPager(ViewPager);
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.main_activity);

            var locales = Java.Util.Locale.GetAvailableLocales().Select(c => c.DisplayName).ToList <String>();

            this.listView         = FindViewById <ListView>(Resource.Id.list);
            this.listView.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1,
                                                     Android.Resource.Id.Text1, locales);

            this.fab = FindViewById <FloatingActionButton>(Resource.Id.fab);
            this.fab.Hide(false);

            this.fab.PostDelayed(ShowFab, 300);
        }
Пример #24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            this.cameraView = (IO.Fotoapparat.View.CameraView)FindViewById(Resource.Id.cameraView1);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            this.camera = Fotoapparat.With(this).Into(cameraView).Build();

            fab.Click += FabOnClick;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.SimpleActivity);

            SetSupportActionBar(FindViewById <Toolbar>(Resource.Id.simpleActivityToolBar));

            FAB = (FloatingActionButton)FindViewById(Resource.Id.simpleActivityFAB);
            FAB.Hide();


            FM = SupportFragmentManager;
            var ft = FM.BeginTransaction();

            var fragString = Intent.GetStringExtra(Constants.KEY_FRAGMENT_TYPE);
            var longId     = Intent.GetLongExtra(Constants.EXTRA_LONG_ID, -1);

            switch (fragString)
            {
            case "FanReact.LoginPage":
                lpFragment = new LoginPage().CreateFragment(this);
                lft        = FragmentManager.BeginTransaction();
                lft.AddToBackStack(null);
                lft.Replace(Resource.Id.simpleActivityContent, lpFragment, "Login Page");
                lft.Commit();
                return;

            case "FanReact.SecondPage":
                lpFragment = new SecondPage().CreateFragment(this);
                lft        = FragmentManager.BeginTransaction();
                lft.AddToBackStack(null);
                lft.Replace(Resource.Id.simpleActivityContent, lpFragment, "Second Page");
                lft.Commit();
                return;

            case Constants.FRAG_TYPE_ALL_PROGRAMS:
                //GoToAllProgramsPage(longId);
                lpFragment = new AllProgramsPage(longId).CreateFragment(this);
                lft        = FragmentManager.BeginTransaction();
                lft.AddToBackStack(null);
                lft.Replace(Resource.Id.simpleActivityContent, lpFragment, Constants.FRAG_TYPE_ALL_PROGRAMS);
                lft.Commit();
                return;
            }
        }
Пример #26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            treesListview = FindViewById <ListView>(Resource.Id.treesListview);


            treesListview.Adapter = new CustomListAdapter(TreeData.Trees);
        }
Пример #27
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            var btn = FindViewById <Button>(Resource.Id.buttonScan);

            btn.Click += ScanOnClick;

            Xamarin.Essentials.Platform.Init(Application);
            ZXing.Net.Mobile.Forms.Android.Platform.Init();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.main_activity);

            var locales = Java.Util.Locale.GetAvailableLocales().Select(c => c.DisplayName).ToList<String>();
		
            this.listView = FindViewById<ListView>(Resource.Id.list);
            this.listView.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1,
                Android.Resource.Id.Text1, locales);

            this.fab = FindViewById<FloatingActionButton>(Resource.Id.fab);
            this.fab.Hide(false);

            this.fab.PostDelayed(ShowFab, 300);
        }
Пример #29
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="savedInstanceState"></param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            editText_IpAddress = FindViewById <EditText>(Resource.Id.editText_ipaddress);
            editText_Port      = FindViewById <EditText>(Resource.Id.editText_port);

            textView_Detect  = FindViewById <TextView>(Resource.Id.textView_Detect);
            textView_AllTime = FindViewById <TextView>(Resource.Id.textView_AllTime);

            timer_TcpRcv           = new Timer();
            timer_TcpRcv.AutoReset = true;
            timer_TcpRcv.Interval  = 10;
            timer_TcpRcv.Elapsed  += new ElapsedEventHandler(OnTimerEvent_Tcp);
            timer_TcpRcv.Enabled   = false;

            button_TpcOpen        = FindViewById <Button>(Resource.Id.button_TcpOpen);
            button_TpcOpen.Tag    = 0;
            button_TpcOpen.Click += ButtonOnClick;

            button_Send_On_Image        = FindViewById <Button>(Resource.Id.button_Send_On_Image);
            button_Send_On_Image.Tag    = 1;
            button_Send_On_Image.Click += ButtonOnClick;

            toggleButton_Detect         = FindViewById <ToggleButton>(Resource.Id.toggleButton_Detect);
            toggleButton_Detect.Enabled = true;

            imageView_Main = FindViewById <ImageView>(Resource.Id.imageView_Main);

            InitMember();
            InitControll();

            AndroidEnvironment.UnhandledExceptionRaiser += (s, e) => {
                Toast.MakeText(this, "例外発生!!", ToastLength.Short).Show();
                e.Handled = true;
            };
        }
Пример #30
0
        public FloatingActionButtonenderer()
        {
            context = Xamarin.Forms.Forms.Context;

            float d      = context.Resources.DisplayMetrics.Density;
            var   margin = (int)(MARGIN_DIPS * d); // margin in pixels

            fab = new FloatingActionButton(context);
            var lp = new FrameLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);

            lp.Gravity           = GravityFlags.CenterVertical | GravityFlags.CenterHorizontal;
            lp.LeftMargin        = margin;
            lp.TopMargin         = margin;
            lp.BottomMargin      = margin;
            lp.RightMargin       = margin;
            fab.LayoutParameters = lp;
        }
Пример #31
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            // Get our UI controls from the loaded layout
            EditText phoneNumberText     = FindViewById <EditText>(Resource.Id.PhoneNumberText);
            TextView translatedPhoneWord = FindViewById <TextView>(Resource.Id.TranslatedPhoneWord);
            Button   translateButton     = FindViewById <Button>(Resource.Id.TranslateButton);

            Button translationHistoryButton = FindViewById <Button>(Resource.Id.TranslationHistoryButton);

            // Add code to translate number
            string translatedNumber = string.Empty;

            translateButton.Click += (sender, e) =>
            {
                // Translate user's alphanumeric phone number to numeric
                translatedNumber = PhonewordTranslator.ToNumber(phoneNumberText.Text);
                if (string.IsNullOrWhiteSpace(translatedNumber))
                {
                    translatedPhoneWord.Text = "";
                }
                else
                {
                    translatedPhoneWord.Text = translatedNumber;
                    phoneNumbers.Add(translatedNumber);
                    translationHistoryButton.Enabled = true;
                }
            };

            translationHistoryButton.Click += (sender, e) =>
            {
                var intent = new Intent(this, typeof(TranslationHistoryActivity));
                intent.PutStringArrayListExtra("phone_numbers", phoneNumbers);
                StartActivity(intent);
            };

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;
        }
Пример #32
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            //Android.Support.V7.Widget.Toolbar toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            //SetSupportActionBar(toolbar);


            _mainView = this.FindViewById(Resource.Id.main_view);

            _textView = _mainView.FindViewById <TextView>(Resource.Id.id_textView);
            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;
        }
Пример #33
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            msgText = FindViewById <TextView>(Resource.Id.msgText);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            if (Intent.Extras != null)
            {
                foreach (var key in Intent.Extras.KeySet())
                {
                    var value = Intent.Extras.GetString(key);
                    Log.Debug(TAG, "Key: {0} Value: {1}", key, value);
                }
            }

            IsPlayServicesAvailable();
            CreateNotificationChannel();

            var logTokenButton = FindViewById <Button>(Resource.Id.logTokenButton);

            logTokenButton.Click += delegate {
                System.Threading.Tasks.Task.Run(() =>
                {
                    var instanceId = FirebaseInstanceId.Instance.GetInstanceId().AsAsync <IInstanceIdResult>();
                    Log.Debug(TAG, "GetInstanceID token: " + instanceId.Result.Token);

                    var token = FirebaseInstanceId.Instance.GetToken("516342311658", "GCM");
                    Log.Debug(TAG, "InstanceID token: " + token);// FirebaseInstanceId.Instance.Token) ;
                });
            };

            var subscribeButton = FindViewById <Button>(Resource.Id.subscribeButton);

            subscribeButton.Click += delegate {
                FirebaseMessaging.Instance.SubscribeToTopic("news");
                Log.Debug(TAG, "Subscribed to remote notifications");
            };
        }
Пример #34
0
        protected override void OnElementChanged(ElementChangedEventArgs <TabbedPage> e)
        {
            base.OnElementChanged(e);

            element = Element as CurvedBottomTabbedPage;

            var metrics = Resources.DisplayMetrics;
            var width   = metrics.WidthPixels;
            var height  = metrics.HeightPixels;

            if (!(GetChildAt(0) is ViewGroup layout))
            {
                return;
            }

            if (!(layout.GetChildAt(1) is BottomNavigationView bottomNavigationView))
            {
                return;
            }

            bottomNavigationView.RemoveFromParent();
            bottomNavigationView.RemoveAllViews();
            bottomNavigationView.RemoveAllViewsInLayout();

            var bottomView = LayoutInflater.From(Context).Inflate(Resource.Layout.BottomNavBar, null);

            bottombar = bottomView.FindViewById <CurvedBottomNavigationView>(Resource.Id.bottom_nav_bar);
            bottombar.RemoveFromParent();
            actionbutton = bottomView.FindViewById <FloatingActionButton>(Resource.Id.fab);
            actionbutton.RemoveFromParent();

            SetTabItems();
            SettingUpMenu();
            OnChildrenCollectionChanged(null, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));

            SetFabProperties();
            actionbutton.Click += Actionbutton_Click;

            layout.AddView(actionbutton);
            layout.AddView(bottombar);
            bottombar.SetZ(0);

            UpdateBarBackgroundColor();
            UpdateBarTextColor();
            UpdateItemIconColor();
        }
Пример #35
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.DashboardPro);

            SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);

            SetSupportActionBar(toolBar);

            SupportActionBar ab = SupportActionBar;

            ab.SetHomeAsUpIndicator(Resource.Drawable.ic_action_menu);
            ab.SetDisplayHomeAsUpEnabled(true);

            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            if (navigationView != null)
            {
                SetUpDrawerContent(navigationView);
            }

            TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs);

            ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);

            tabs.FillViewport = true;

            SetUpViewPager(viewPager);

            tabs.SetupWithViewPager(viewPager);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += (o, e) =>
            {
                View anchor = o as View;
                Snackbar.Make(anchor, "Action", Snackbar.LengthLong).SetAction("Action", v =>
                {
                    //Perform action
                }).Show();
            };
        }
Пример #36
0
 public HelpAdapterViewHolder(View itemView, Action <HelpAdapterClickEventArgs> clickListener,
                              Action <HelpAdapterClickEventArgs> longClickListener,
                              Action <HelpAdapterClickEventArgs> fabClickListener) : base(itemView)
 {
     //TextView = v;
     Row_FabCall        = itemView.FindViewById <FloatingActionButton>(Resource.Id.row_help_call);
     Row_Title          = itemView.FindViewById <MaterialTextView>(Resource.Id.row_help_title);
     Row_FabCall.Click += (sender, e) => fabClickListener(new HelpAdapterClickEventArgs {
         View = itemView, Position = AbsoluteAdapterPosition
     });
     itemView.Click += (sender, e) => clickListener(new HelpAdapterClickEventArgs {
         View = itemView, Position = AbsoluteAdapterPosition
     });
     itemView.LongClick += (sender, e) => longClickListener(new HelpAdapterClickEventArgs {
         View = itemView, Position = AbsoluteAdapterPosition
     });
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            CARDSETS_DIRECTORY = this.Context.GetExternalFilesDir(null) + "/Cardsets";
            Console.WriteLine(CARDSETS_DIRECTORY);
            LoadAllCardSets();
            view                   = inflater.Inflate(Resource.Layout.fragment_cardsets, container, false);
            createSetButton        = view.FindViewById <FloatingActionButton>(Resource.Id.fab);
            createSetButton.Click += async(sender, e) =>
            {
                PromptResult result = await UserDialogs.Instance.PromptAsync(new PromptConfig
                {
                    InputType  = InputType.Name,
                    OkText     = "Create",
                    CancelText = "Cancel",
                    Title      = "New Cardset"
                });

                if (result.Ok && !string.IsNullOrWhiteSpace(result.Text))
                {
                    //Create new .CSV file in cardsets directory
                    try
                    {
                        FileStream fs = File.Create(CARDSETS_DIRECTORY + "/" + result.Text + ".CSV");
                        fs.Close();
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    LoadAllCardSets();
                    ShowCardSets();
                }
            };
            cardSetsView            = view.FindViewById <ListView>(Resource.Id.listView1);
            cardSetsView.ItemClick += (sender, e) =>
            {
                string clickedSet = Convert.ToString(cardSetsView.GetItemAtPosition(e.Position));
                //switch to cardset editor activity
                Intent intent = new Intent(Context, typeof(CardsetEditorActivity));
                intent.PutExtra("setName", CARDSETS_DIRECTORY + "/" + clickedSet + ".csv");
                StartActivity(intent);
            };

            ShowCardSets();
            return(view);
        }
Пример #38
0
        public EditDataAdapter(AppCompatActivity activity, ViewPager pager, FloatingActionButton finish, ProgressBar progress, 
							   IMenuItem prev = null, IMenuItem next = null)
            : base(activity.SupportFragmentManager)
        {
            Activity = activity;
            Pager = pager;
            Finish = finish;
            Progress = progress;
            Items = new List<EditFragment>();

            Finish.Click += (s, e) => NextPage();

            Pager.Adapter = this;
            Progress.Progress = 1;

            SetNextButton(next);
            SetPreviousButton(prev);
        }
Пример #39
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            HasOptionsMenu = true;
            var view = inflater.Inflate(Resource.Layout.fragment_current_trip, null);

            mapView = view.FindViewById<MapView>(Resource.Id.map);
            mapView.OnCreate(savedInstanceState);

            fab = view.FindViewById<FloatingActionButton>(Resource.Id.fab);
            time = view.FindViewById<TextView>(Resource.Id.text_time);
            distance = view.FindViewById<TextView>(Resource.Id.text_distance);
            distanceUnits = view.FindViewById<TextView>(Resource.Id.text_distance_units);
            consumption = view.FindViewById<TextView>(Resource.Id.text_consumption);
            consumptionUnits = view.FindViewById<TextView>(Resource.Id.text_consumption_units);
            load = view.FindViewById<TextView>(Resource.Id.text_load);
            stats = view.FindViewById<LinearLayout>(Resource.Id.stats);
            stats.Visibility = ViewStates.Invisible;
            return view;
        }
Пример #40
0
		protected override void OnCreate (Bundle savedInstanceState)
		{
			Shared.Bootstrap.Run ();

			base.OnCreate (savedInstanceState);

			SetContentView (Resource.Layout.WeatherActivity);


			floatingButton = FindViewById<FloatingActionButton> (Resource.Id.floatingButton);

			floatingButton.SetOnClickListener (this);


			setupViewPager ();

			getData ();

			//AnalyticsManager.Shared.RegisterForHockeyAppUpdates (this);
		}
Пример #41
0
        //Called on onCreate, init everything here!
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.ManageEvents, container, false);

            recyclerView = view.FindViewById<RecyclerView>(Resource.Id.manageEventsList);
            progressBar = view.FindViewById<ProgressBar>(Resource.Id.loadingProgressBar);
            swipeRefreshLayout = view.FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            floatingAddEventBtn = view.FindViewById<FloatingActionButton>(Resource.Id.floatingAddEventBtn);

            topLeftToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonLeft);
            topRightToolbarButton = Activity.FindViewById<Button>(Resource.Id.topToolbarButtonRight);
            topLeftToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonLeft);
            topRightToolbarImageButton = Activity.FindViewById<ImageButton>(Resource.Id.topToolbarImageButtonRight);

            topLeftToolbarButton.Text = "All";
            topRightToolbarButton.Text = "Mine";
            topLeftToolbarButton.Visibility = ViewStates.Visible;
            topLeftToolbarImageButton.Visibility = ViewStates.Gone;
            topRightToolbarButton.Visibility = ViewStates.Visible;
            topRightToolbarImageButton.Visibility = ViewStates.Gone;

            swipeRefreshLayout.Refresh += SwipeRefreshLayout_Refresh;

            floatingAddEventBtn.Click += FloatingAddEventBtn_Click;

            string facebookUserId = Profile.CurrentProfile.Id;

            webClient = new WebClient();
            ownEventsUrl = new Uri("https://howlout.gear.host/api/EventsAPI/Owner/"+facebookUserId);

            // Call chosen url to retrieve events matching Facebook User Id
            webClient.DownloadDataAsync(ownEventsUrl);
            webClient.DownloadDataCompleted += WebClient_DownloadDataCompleted;

            // Creating the layout manager
            layoutManager = new LinearLayoutManager(this.Activity);
            recyclerView.SetLayoutManager(layoutManager);

            return view;
        }
        private SessionDetailFragmentBinding(LayoutInflater inflater, ViewGroup root, bool attachToRoot)
        {
            Root = inflater.Inflate(Resource.Layout.fragment_session_detail, root, attachToRoot);

            fab = Root.FindViewById<FloatingActionButton>(Resource.Id.fab);
            toolbar = Root.FindViewById<Toolbar>(Resource.Id.toolbar);
            appbar = Root.FindViewById<AppBarLayout>(Resource.Id.app_bar);
            collapsingToolbar = Root.FindViewById<CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            txtSessionTimeRange = Root.FindViewById<TextView>(Resource.Id.txt_session_time_range);
            imgCover = Root.FindViewById<ImageView>(Resource.Id.img_cover);
            txtPlace = Root.FindViewById<TextView>(Resource.Id.txt_place);
            txtCategory = Root.FindViewById<CategoryView>(Resource.Id.txt_category);
            txtLanguage = Root.FindViewById<TextView>(Resource.Id.txt_language);
            txtSpeakerTitle = Root.FindViewById<TextView>(Resource.Id.txt_speaker_title);
            imgSpeaker = Root.FindViewById<ImageView>(Resource.Id.img_speaker);
            txtSpeakerName = Root.FindViewById<TextView>(Resource.Id.txt_speaker_name);
            txtDescriptionTitle = Root.FindViewById<TextView>(Resource.Id.txt_description_title);
            txtDescriptionDetail = Root.FindViewById<TextView>(Resource.Id.txt_description_detail);
            txtFeedback = Root.FindViewById<TextView>(Resource.Id.txt_feedback);
            fab = Root.FindViewById<FloatingActionButton>(Resource.Id.fab);
            speakerSnsIcons = Root.FindViewById<SpeakerSnsIconsView>(Resource.Id.speaker_sns_icons);
        }
Пример #43
0
        protected override void OnCreate(Bundle bundle)
        {
            ApplyLevelColors();
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.LessonFrame);
            SetSupportActionBar(FindViewById<Toolbar>(Resource.Id.toolbar));
            //this.SetSystemBarBackground (Color.ParseColor (DataHolder.Current.CurrentModule.Color));
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;
            progressList = new List<Progress>();

            ivGoBack = FindViewById<ImageView>(Resource.Id.ivGoBack);
            ivGoBack.Click += ((sender, e) => PreviousLesson());
            ivGoFwd = FindViewById<ImageView>(Resource.Id.ivGoFwd);
            ivGoFwd.Click += ((sender, e) => NextLesson(true, false));
            btnNext = FindViewById<FloatingActionButton>(Resource.Id.btnNext);
            btnNext.Click += BtnNext_Click;

            rvProgress = FindViewById<RecyclerView>(Resource.Id.rvProgress);
            rvProgress.SetLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false));
            rvProgress.SetAdapter(new ProgressAdapter(progressList,
                Color.ParseColor(DataHolder.Current.CurrentModule.Color),
                Resources.DisplayMetrics.Density));
            txtCapitalAlphabet = FindViewById<TextView>(Resource.Id.txtCapitalAlphabet);
            txtLowerAlphabet = FindViewById<TextView>(Resource.Id.txtLowerAlphabet);
            fragmentContainer = FindViewById<FrameLayout>(Resource.Id.fragmentContainer);
            ivBadge = FindViewById<ImageView>(Resource.Id.ivBadge);
            ivIrmgard = FindViewById<ImageView>(Resource.Id.ivIrmgard);
            ivIrmgard.Click += (s, e) => PlayOrStopInstruction();

            // Initially hide success image
            ivBadge.Visibility = ViewStates.Gone;

            praiseFilesAvail = AssetHelper.Instance.List(Path.Combine(Common.AssetSoundDir, Common.AssetPraiseDir)).Select(s => Path.Combine(Common.AssetPraiseDir, s)).ToList();
            criticismFilesAvail = AssetHelper.Instance.List(Path.Combine(Common.AssetSoundDir, Common.AssetCriticismDir)).Select(s => Path.Combine(Common.AssetCriticismDir, s)).ToList();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.recyclerview_activity);

            var locales = Java.Util.Locale.GetAvailableLocales();
            this.progressTypes = new LinkedList<ProgressType>();
            foreach (var item in (ProgressType[])Enum.GetValues(typeof(ProgressType)))
            {
                this.progressTypes.AddLast(item);
            }

            fab = FindViewById<FloatingActionButton>(Resource.Id.fab);
            fab.Max = this.maxProgress;
            fab.Click += FabClickHandler;


            RecyclerView recyclerView = FindViewById<RecyclerView>(Resource.Id.my_recycler_view);
            recyclerView.HasFixedSize = true;
            recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            recyclerView.SetAdapter(new LanguageAdapter(locales));
            recyclerView.AddOnScrollListener(new RecyclerScrollListener(this.fab, this.scrollOffset));
        }
 public FloatingActionButtonClickBinding(FloatingActionButton floatingActionButton) : base(floatingActionButton)
 {
     this.floatingActionButton = floatingActionButton;
 }
Пример #46
0
 private void DecreaseButtonVisibility(FloatingActionButton button)
 {
     button.BackgroundTintList = ColorStateList.ValueOf(Color.White);
     button.SetColorFilter(Color.Gray);
 }
 private void DemomFloatingActionButton()
 {
     mFloatingActionButton = (FloatingActionButton)mParentView.FindViewById(Resource.Id.action_button).JavaCast<FloatingActionButton>();
     mFloatingActionButton.SetOnClickListener(this);
 }
Пример #48
0
 private void IncreaseButtonVisibility(FloatingActionButton button)
 {
     button.BackgroundTintList = ColorStateList.ValueOf(Resources.GetColor(Resource.Color.primary_light));
     button.SetColorFilter(Color.White);
 }
Пример #49
0
        //private string _parameterText;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            _locator = CrossGeolocator.Current;
            // New in iOS 9 allowsBackgroundLocationUpdates must be set if you are running a background agent to track location. I have exposed this on the Geolocator via:
            // disable because it drill down the battery very quickly
            _locator.AllowsBackgroundUpdates = false;
            _locator.DesiredAccuracy = 50;
            _locator.PositionChanged -= Locator_PositionChanged;
            _locator.PositionChanged += Locator_PositionChanged;

            // parse params to show any shared location if it exists
            ParseIntent();

            var tintManager = new SystemBarTintManager(this);
            // set the transparent color of the status bar, 30% darker
            tintManager.SetTintColor(Color.ParseColor("#30000000"));
            tintManager.SetNavigationBarTintEnabled(true);
            tintManager.StatusBarTintEnabled = true;

            // prevent the soft keyboard from pushing the view up
            Window.SetSoftInputMode(SoftInput.AdjustNothing);

            // prepare icons for location / compass button
            var iconGenerator = new IconGenerator(this);
            iconGenerator.SetBackground(ResourcesCompat.GetDrawable(Resources, Resource.Drawable.ic_location, null));
            _iconUserLocation = iconGenerator.MakeIcon();
            iconGenerator.SetBackground(ResourcesCompat.GetDrawable(Resources, Resource.Drawable.ic_compass, null));
            _iconCompass = iconGenerator.MakeIcon();
            //var uiOptions = (int)this.Window.DecorView.SystemUiVisibility;
            //var newUiOptions = (int)uiOptions;
            //newUiOptions &= ~(int)SystemUiFlags.LowProfile;
            //newUiOptions &= ~(int)SystemUiFlags.Fullscreen;
            //newUiOptions &= ~(int)SystemUiFlags.HideNavigation;
            //newUiOptions &= ~(int)SystemUiFlags.Immersive;
            //newUiOptions |= (int)SystemUiFlags.ImmersiveSticky;
            //this.Window.DecorView.SystemUiVisibility = (StatusBarVisibility)newUiOptions;
            //Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);

            var toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);
            //toolbar.Background.SetAlpha(200);
            ViewCompat.SetElevation(toolbar, 6f);
            SetSupportActionBar(toolbar);

            //Enable support action bar to display hamburger and back arrow
            // http://stackoverflow.com/questions/28071763/toolbar-navigation-hamburger-icon-missing
            _drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            //_drawerToggle = new CustomActionBarDrawerToggle(this, _drawerLayout, toolbar, Resource.String.ApplicationName, Resource.String.ApplicationName);
            //_drawerToggle.DrawerIndicatorEnabled = true;
            _drawerLayout.SetDrawerListener(new CustomDrawerToggle(this));
            //Enable support action bar to display hamburger


            var burgerImage = FindViewById<ImageButton>(Resource.Id.burgerImage);
            burgerImage.SetOnClickListener(new HomeButtonClickListener(this));

            // SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            SupportActionBar.SetHomeButtonEnabled(false);
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);
            SupportActionBar.SetDisplayShowCustomEnabled(false);

            navigationView = FindViewById<NavigationView>(Resource.Id.nav_view);
            navigationView.SetNavigationItemSelectedListener(new NavigationItemSelectedListener(this));

            _bikesButton = FindViewById<FloatingActionButton>(Resource.Id.bikesButton);
            _bikesButton.BackgroundTintList = ColorStateList.ValueOf(Resources.GetColor(Resource.Color.primary_light));
            _bikesButton.Click += BikesButton_Click;

            _parkingButton = FindViewById<FloatingActionButton>(Resource.Id.parkingButton);
            _parkingButton.BackgroundTintList = ColorStateList.ValueOf(Resources.GetColor(Resource.Color.primary_light));
            _parkingButton.Click += ParkingButton_Click;

            _locationButton = FindViewById<FloatingActionButton>(Resource.Id.locationButton);
            _locationButton.BackgroundTintList = ColorStateList.ValueOf(Color.White);
            _locationButton.SetColorFilter(Color.Gray);

            _searchProgressBar = FindViewById<ProgressBar>(Resource.Id.searchProgressBar);

            // Doesn't work on Kitkat 4.4, use SetColorFilter instead
            //_locationButton.ImageTintList = ColorStateList.ValueOf(Color.Black);
            _locationButton.Click += LocationButton_Click;

            _tileButton = FindViewById<FloatingActionButton>(Resource.Id.tileButton);
            _tileButton.BackgroundTintList = ColorStateList.ValueOf(Color.White);
            _tileButton.SetColorFilter(Color.DarkGray);
            _tileButton.Click += TileButton_Click;
            var parent = (View)_tileButton.Parent;

            // Gets the parent view and posts a Runnable on the UI thread. 
            // This ensures that the parent lays out its children before calling the getHitRect() method.
            // The getHitRect() method gets the child's hit rectangle (touchable area) in the parent's coordinates.
            parent.Post(() =>
            {
                var touchRect = new Rect();
                _tileButton.GetHitRect(touchRect);
                touchRect.Top -= 200;
                touchRect.Left -= 200;
                touchRect.Bottom += 200;
                touchRect.Right += 200;


                parent.TouchDelegate = new TouchDelegate(touchRect, _tileButton);
            });

            _currentTileName = FindViewById<TextView>(Resource.Id.currentTileName);
            _currentTileNameAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.placeholder);
            _disappearTileNameAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.disappearAnimation);
            _currentTileNameAnimation.AnimationEnd += _currentTileNameAnimation_AnimationEnd;

            UnStickUserLocation();

            AutoCompleteSearchPlaceTextView = FindViewById<AutoCompleteTextView>(Resource.Id.autoCompleteSearchPlaceTextView);
            AutoCompleteSearchPlaceTextView.ItemClick += AutoCompleteSearchPlaceTextView_ItemClick;
            googlePlacesAutocompleteAdapter = new GooglePlacesAutocompleteAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line);
            AutoCompleteSearchPlaceTextView.Adapter = googlePlacesAutocompleteAdapter;


            Observable.FromEventPattern(AutoCompleteSearchPlaceTextView, "TextChanged")
                .Throttle(TimeSpan.FromMilliseconds(300))
                .Where(x => AutoCompleteSearchPlaceTextView.Text.Length >= 2)
                .Subscribe(async x =>
                {
                    try
                    {
                        RunOnUiThread(() =>
                        {
                            _searchProgressBar.Visibility = ViewStates.Visible;
                        });

                        using (var client = new HttpClient(new NativeMessageHandler()))
                        {
                            var response = await client.GetAsync(strAutoCompleteGoogleApi + AutoCompleteSearchPlaceTextView.Text + "&key=" + strGoogleApiKey).ConfigureAwait(false);
                            var responseBodyAsText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
                            var predictions = JsonConvert.DeserializeObject<PlaceApiModel>(responseBodyAsText).predictions.ToList();
                            googlePlacesAutocompleteAdapter.Results = predictions;
                            if (AutoCompleteSearchPlaceTextView.Text.Length >= 2)
                            {
                                RunOnUiThread(() =>
                                {
                                    googlePlacesAutocompleteAdapter.NotifyDataSetChanged();
                                    EndPlacesSearch();
                                });
                            }
                        }
                    }
                    catch
                    {
                        RunOnUiThread(() =>
                        {
                            EndPlacesSearch();
                        });
                    }
                });


            //navigationView.NavigationItemSelected += (sender, e) =>
            //{
            //    e.MenuItem.SetChecked(true);
            //    //react to click here and swap fragments or navigate
            //    drawerLayout.CloseDrawers();
            //};

            // trigger the creation of the injected dependencies
            _settingsService = SimpleIoc.Default.GetInstance<ISettingsService>();
            _favoritesService = SimpleIoc.Default.GetInstance<IFavoritesService>();
        }
 public RecyclerScrollListener(FloatingActionButton fab, int scrollOffset)
 {
     this.fab = fab;
     this.scrollOffset = scrollOffset;
 }
Пример #51
0
        /// <summary>
        /// Called when the activity is first created; we wouldn't create a
        /// layout in the case where we have the file and are moving to another
        /// activity without downloading.
        /// </summary>
        /// <param name="savedInstanceState">
        /// The saved instance state.
        /// </param>
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (Env.Release)
            {
                // Register HockeyApp
                CrashManager.Register(this, "089a6ee65f4242b89c51eab36a4e0ed2");
                MetricsManager.Register(this, Application, "089a6ee65f4242b89c51eab36a4e0ed2");
            }

            RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;

            // Init start screen
            SetContentView(Resource.Layout.Main);
            Title = "";
            SetSupportActionBar(this.FindViewById<Toolbar>(Resource.Id.toolbar));

            initText = this.FindViewById<TextView>(Resource.Id.initText);
            startButton = this.FindViewById<FloatingActionButton>(Resource.Id.btnStart);
            startButton.Click += StartButton_Click;

            await TryCreateAppAsync();
        }
Пример #52
0
 public SignUpAdapter(AppCompatActivity activity, ViewPager pager, FloatingActionButton finish, ProgressBar progress)
     : base(activity, pager, finish, progress)
 {
 }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.floating_menus_activity);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            FloatingActionMenu menu1 = FindViewById<FloatingActionMenu>(Resource.Id.menu1);
            FloatingActionMenu menu2 = FindViewById<FloatingActionMenu>(Resource.Id.menu2);
            FloatingActionMenu menu3 = FindViewById<FloatingActionMenu>(Resource.Id.menu3);
            FloatingActionMenu menu4 = FindViewById<FloatingActionMenu>(Resource.Id.menu4);
            FloatingActionMenu menuDown = FindViewById<FloatingActionMenu>(Resource.Id.menu_down);
            FloatingActionMenu menuLabelsRight = FindViewById<FloatingActionMenu>(Resource.Id.menu_labels_right);

            FloatingActionButton programFab1 = new FloatingActionButton(this);

            programFab1.ButtonSize = FloatingActionButton.SizeMini;
            programFab1.LabelText = "Programmatically added button";
            programFab1.SetImageResource(Resource.Drawable.ic_edit);
            menu1.AddMenuButton(programFab1);

            ContextThemeWrapper context = new ContextThemeWrapper(this, Resource.Style.MenuButtonsStyle);
            FloatingActionButton programFab2 = new FloatingActionButton(context);
            programFab2.LabelText = "Programmatically added button";
            programFab2.SetImageResource(Resource.Drawable.ic_edit);
            menu2.AddMenuButton(programFab2);

            menus.Add(menuDown);
            menus.Add(menu1);
            menus.Add(menu2);
            menus.Add(menu3);
            menus.Add(menu4);
            menus.Add(menuLabelsRight);

            menuDown.HideMenuButton(false);
            menu1.HideMenuButton(false);
            menu2.HideMenuButton(false);
            menu3.HideMenuButton(false);
            menu4.HideMenuButton(false);
            menuLabelsRight.HideMenuButton(false);


            int delay = 400;
            foreach (var menu in menus)
            {
                mUiHandler.PostDelayed(() => menu.ShowMenuButton(true), delay);
                delay += 150;
            }
                

            menu1.SetOnMenuButtonClickListener(this);
            menu1.SetClosedOnTouchOutside(true);

            menu4.IconAnimated = false;

            menu2.MenuToggle += (object sender, FloatingActionMenu.MenuToggleEventArgs e) => 
                {
                    String text = (e.Opened ? "Menu opened":"Menu closed");
                    Toast.MakeText(this, text, ToastLength.Short).Show();
                };

            fab1 = FindViewById<FloatingActionButton>(Resource.Id.fab1);
            fab2 = FindViewById<FloatingActionButton>(Resource.Id.fab2);
            fab3 = FindViewById<FloatingActionButton>(Resource.Id.fab3);

            fab12 = FindViewById<FloatingActionButton>(Resource.Id.fab12);
            fab22 = FindViewById<FloatingActionButton>(Resource.Id.fab22);
            fab32 = FindViewById<FloatingActionButton>(Resource.Id.fab32);

            fab1.Click += ActionButton_Click;
            fab2.Click += ActionButton_Click;
            fab3.Click += ActionButton_Click;

            fab12.Click += ActionButton_Click;
            fab22.Click += ActionButton_Click;
            fab32.Click += ActionButton_Click;

            fab1.Enabled = false;

            FloatingActionButton fabEdit = FindViewById<FloatingActionButton>(Resource.Id.fab_edit);
            fabEdit.SetShowAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.scale_up));
            fabEdit.SetHideAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.scale_down));

            new Handler().PostDelayed(() => fabEdit.Show(true), delay + 150);

            fabEdit.Click += EditButton_Click;

            CreateCustomAnimation();
        }
 private void IncreaseProgress(FloatingActionButton fab, int i) 
 {
     if (i <= this.maxProgress)
     {
         fab.SetProgress(i, false);
         int progress = ++i;
         this.uiHandler.PostDelayed(()=>IncreaseProgress(fab, progress), 30);
     }
     else
     {
         this.uiHandler.PostDelayed(()=>fab.HideProgress(), 200);
         this.progressTypes.AddLast(ProgressType.ProgressNoAnimation);
     }
 }