Exemplo n.º 1
0
        private void InitToolbar()
        {
            try
            {
                Toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (Toolbar != null)
                {
                    Toolbar.Title = " ";
                    Toolbar.SetTitleTextColor(Color.White);
                    SetSupportActionBar(Toolbar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);
                }

                SearchView = FindViewById <AutoCompleteTextView>(Resource.Id.searchBox);
                SearchView.SetOnEditorActionListener(this);
                //SearchView.ClearFocus();

                //Change text colors
                SearchView.SetHintTextColor(Color.ParseColor("#efefef"));
                SearchView.SetTextColor(Color.White);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 2
0
        private void InitToolbar()
        {
            try
            {
                ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (ToolBar != null)
                {
                    ToolBar.Title = GetText(Resource.String.Lbl_Chats);
                    ToolBar.SetTitleTextColor(AppSettings.SetTabDarkTheme ? Color.White : Color.Black);
                    SetSupportActionBar(ToolBar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);

                    if (AppSettings.SetTabDarkTheme)
                    {
                        ToolBar.SetBackgroundResource(Resource.Drawable.linear_gradient_drawable_Dark);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 3
0
        /*
         *      private void OnButtonClick(object sender, EventArgs e)
         *      {
         *          if (sender is AppCompatImageButton imgButton)
         *              Toast.MakeText(this, (string)imgButton.Tag, ToastLength.Short).Show();
         *
         *      }
         */


        private void SetUpToolbar()
        {
            // Not having raised AppBar area, so don't set SupportActionBar
            //SetSupportActionBar(_toolbar);

            // Set the page Title - Required because of the way that Android sets up app asset names
            _toolbar.Title = null;  // using the custom title so it can be centered
            SetToolbarCustomTitle(ViewModel.Response.Name);
            // Set the subtitle
            //            SetToolbarCustomSubtitle("Subtitle");
            //            _toolbar.Subtitle = "Subtitle";
            var closeIcon = ResourcesCompat.GetDrawable(Resources, Resource.Drawable.lclose, null).Mutate();

            DrawableCompat.SetTint(closeIcon, Color.White);
            _toolbar.NavigationIcon = closeIcon;

            var toolbarColor = Constants.GetIconSettingsFromTitle(this, ViewModel.Response.Name).Item2;

            Window.SetStatusBarColor(toolbarColor);
            _toolbar.SetBackgroundColor(toolbarColor);

            // Set toolbar title colors
            _toolbar.SetTitleTextColor(Color.White);
            _toolbar.SetSubtitleTextColor(Color.White);
            SetToolbarCustomTitleColor(Color.White);
            SetToolbarCustomSubtitleColor(Color.White);
        }
Exemplo n.º 4
0
        void InitViews()
        {
            toolbar               = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.TbMain);
            radLvFoodiPlaces      = FindViewById <RadListView>(Resource.Id.radLvFoodiPlaces);
            txtAddressFoodiPlaces = FindViewById <TextView>(Resource.Id.txtAddressFoodiPlaces);
            txtNameFoodiPlaces    = FindViewById <TextView>(Resource.Id.txtNameFoodiPlaces);
            ratingBar             = FindViewById <SfRating>(Resource.Id.sfRatingTotal);
            foodiPlaces           = new List <Results>();
            txtScore              = FindViewById <TextView>(Resource.Id.txtScore);
            frReviews             = FindViewById <FrameLayout>(Resource.Id.frReviews);
            txtTopReviewsDate     = FindViewById <TextView>(Resource.Id.txtTopReviewsDate);
            txtTopReviewsDetail   = FindViewById <TextView>(Resource.Id.txtTopReviewsDetail);
            txtMore               = FindViewById <TextView>(Resource.Id.txtMore);
            sfRatingTopReview     = FindViewById <SfRating>(Resource.Id.sfRatingTopReview);
            lnReviewsTop          = FindViewById <LinearLayout>(Resource.Id.lnReviewsTop);
            lnMoreReviews         = FindViewById <LinearLayout>(Resource.Id.lnMoreReviews);
            radReviews            = FindViewById <RadListView>(Resource.Id.radReviews);


            SetSupportActionBar(toolbar);
            SupportActionBar.Title = "Foodi Places";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            toolbar.SetTitleTextColor(Color.White);
            LoadMapLayout();
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.Activity_SubCategory);
            act = this;

            string cheeseName = Intent.GetStringExtra(EXTRA_NAME);

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

            SetSupportActionBar(toolBar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            Title = "Invoice - " + cheeseName;
            toolBar.SetTitleTextColor(Color.White);

            context = this;
            var progressDialog = ProgressDialog.Show(this, "", "", true);

            new System.Threading.Thread(new System.Threading.ThreadStart(delegate
            {
                try
                {
                    RecyclerView recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerview);
                    //recyclerView.NestedScrollingEnabled = false;
                    recyclerView.HasFixedSize = true;
                    SetUpRecyclerView(recyclerView);


                    RecyclerView recyclerView1 = FindViewById <RecyclerView>(Resource.Id.recyclerview1);
                    //recyclerView.NestedScrollingEnabled = false;
                    recyclerView1.HasFixedSize = true;
                    SetUpRecyclerViewWMSItem(recyclerView1);

                    FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.Filter);
                    fab.Visibility           = ViewStates.Invisible;
                }
                catch (Exception ex)
                {
                }
                act.RunOnUiThread(() =>
                {
                    progressDialog.Cancel();
                });
            })).Start();
            _player = MediaPlayer.Create(this, Resource.Raw.scan);



            // Create your fragment here
        }
Exemplo n.º 6
0
        private View LoadMainContent(LayoutInflater inflater)
        {
            View result = inflater.Inflate(Resource.Layout.side_drawer_features_main_content, null);

            Spinner locationSpinner = (Spinner)result.FindViewById(Resource.Id.drawerLocationSpinner);
            ArrayAdapter <DrawerLocation> locationAdapter = new ArrayAdapter <DrawerLocation>(this.Activity, Android.Resource.Layout.SimpleListItem1, DrawerLocation.Values());

            locationSpinner.Adapter = locationAdapter;
            locationSpinner.OnItemSelectedListener = this;

            Spinner transitionsSpinner = (Spinner)result.FindViewById(Resource.Id.drawerTransitionsSpinner);

            transitions = new List <DrawerTransitionBase>();
            transitions.Add(new SlideInOnTopTransition());
            transitions.Add(new FallDownTransition());
            transitions.Add(new PushTransition());
            transitions.Add(new RevealTransition());
            transitions.Add(new ReverseSlideOutTransition());
            transitions.Add(new ScaleDownPusherTransition());
            transitions.Add(new ScaleUpTransition());
            transitions.Add(new SlideAlongTransition());
            ArrayAdapter <DrawerTransitionBase> transitionsAdapter = new ArrayAdapter <DrawerTransitionBase>(this.Activity, Android.Resource.Layout.SimpleListItem1, transitions);

            transitionsSpinner.Adapter = transitionsAdapter;
            transitionsSpinner.OnItemSelectedListener = this;

            CheckBox closeOnBackPress = (CheckBox)result.FindViewById(Resource.Id.drawerCloseOnBackPress);

            closeOnBackPress.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                drawer.CloseOnBackPress = e.IsChecked;
            };

            Android.Support.V7.Widget.Toolbar toolbar = (Android.Support.V7.Widget.Toolbar)result.FindViewById(Resource.Id.drawerToolbar);
            toolbar.SetTitleTextColor(Android.Graphics.Color.White);

            AppCompatActivity actionBarActivity = (AppCompatActivity)this.Activity;
            ActionBar         supportActionBar  = actionBarActivity.SupportActionBar;

            if (supportActionBar != null)
            {
                String title = (String)supportActionBar.Title;
                toolbar.Title = title;
                supportActionBar.Hide();
            }

            SideDrawerToggle drawerToggle = new SideDrawerToggle(drawer, toolbar);

            return(result);
        }
Exemplo n.º 7
0
        private void InitToolbar()
        {
            toolbar       = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.Title = "Quiz App";
            toolbar.SetTitleTextColor(Color.White.ToArgb());
            SetSupportActionBar(toolbar);

            var hamburgerDrawable = GetDrawable(Resource.Drawable.hamburger);

            hamburgerDrawable.SetTint(Color.White.ToArgb());

            var supportActionBar = SupportActionBar;

            supportActionBar.SetHomeAsUpIndicator(hamburgerDrawable);
            supportActionBar.SetDisplayHomeAsUpEnabled(true);
        }
Exemplo n.º 8
0
        private void My_sensors_ItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            selected = my_sensors.GetItemAtPosition(e.Position).ToString();
            Toast.MakeText(this, "Длинное нажатие", ToastLength.Short).Show();
            LinearLayout.LayoutParams toolBarParams = new LinearLayout.LayoutParams(V7ToolBar.LayoutParams.MatchParent, 150);
            LinearLayout.LayoutParams appBarParams  = new LinearLayout.LayoutParams(BarLayout.LayoutParams.MatchParent, Resource.Attribute.actionBarSize);
            toolBar = new V7ToolBar(this);

            toolBar.LayoutParameters = toolBarParams;
            toolBar.SetBackgroundColor(Color.Black);
            toolBar.SetTitle(Resource.String.my_sensors_toolbar_title);
            toolBar.SetTitleTextColor(Color.White);
            toolBar.Visibility = ViewStates.Visible;
            toolBar.PopupTheme = Resource.Style.AppTheme_PopupOverlay;
            barLayout.AddView(toolBar, 0);
            SetSupportActionBar(toolBar);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            PreserveCustomControls();
            Xamarin.Forms.Forms.Init(this, savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.my_toolbar);
            toolbar.SetTitleTextColor(Android.Graphics.Color.White);
            toolbar.Visibility = Android.Views.ViewStates.Gone;
            SetSupportActionBar(toolbar);
            SupportActionBar.SetHomeButtonEnabled(true);

            NavigateAsync("default");
        }
Exemplo n.º 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.offline);

            recyclerView = FindViewById <RecyclerView>(Resource.Id.offlineRecyclerView);
            recyclerView.SetLayoutManager(recyLayoutManager = new LinearLayoutManager(this, (int)Orientation.Vertical, false));
            recyclerView.SetAdapter(adapter = new RecyAdapter());
            adapter.OnItemClick            += Adapter_OnItemClick;

            toolbar       = FindViewById <widget.Toolbar>(Resource.Id.offlineToolbar);
            toolbar.Title = "Offline";
            toolbar.SetBackgroundColor(Android.Graphics.Color.ParseColor("#4CAF50"));
            toolbar.SetTitleTextColor(Android.Graphics.Color.ParseColor("#ffffff"));
            MyGlobal.ChangeStatusBarColor(Window, "#4CAF50");

            MyGlobal.database.GetAllOfflineArticalList(MyGlobal.UidGenerator(), this);
        }
Exemplo n.º 11
0
 private void InitToolbar()
 {
     try
     {
         TopChatToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
         if (TopChatToolBar != null)
         {
             TopChatToolBar.SetTitleTextColor(Color.White);
             SetSupportActionBar(TopChatToolBar);
             SupportActionBar.SetDisplayShowCustomEnabled(true);
             SupportActionBar.SetDisplayHomeAsUpEnabled(true);
             SupportActionBar.SetHomeButtonEnabled(true);
             SupportActionBar.SetDisplayShowHomeEnabled(true);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Exemplo n.º 12
0
        private void InitToolbar()
        {
            try
            {
                ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
                if (ToolBar != null)
                {
                    ToolBar.Title = "";
                    ToolBar.SetTitleTextColor(Color.White);
                    SetSupportActionBar(ToolBar);
                    SupportActionBar.SetDisplayShowCustomEnabled(true);
                    SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                    SupportActionBar.SetHomeButtonEnabled(true);
                    SupportActionBar.SetDisplayShowHomeEnabled(true);
                }

                SearchView = FindViewById <AutoCompleteTextView>(Resource.Id.searchBox);
                SearchView.SetOnEditorActionListener(this);
                //SearchView.SetQuery("", false);
                //SearchView.SetIconifiedByDefault(false);
                //SearchView.OnActionViewExpanded();
                //SearchView.Iconified = false;
                //SearchView.QueryTextChange += SearchViewOnQueryTextChange;
                //SearchView.QueryTextSubmit += SearchViewOnQueryTextSubmit;
                SearchView.ClearFocus();

                //Change text colors
                var editText = (EditText)SearchView.FindViewById(Resource.Id.search_src_text);
                editText.SetHintTextColor(Color.White);
                editText.SetTextColor(Color.White);

                //Remove Icon Search
                ImageView searchViewIcon         = (ImageView)SearchView.FindViewById(Resource.Id.search_mag_icon);
                ViewGroup linearLayoutSearchView = (ViewGroup)searchViewIcon.Parent;
                linearLayoutSearchView.RemoveView(searchViewIcon);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 13
0
 private void InitToolbar()
 {
     try
     {
         ToolBar = FindViewById <Toolbar>(Resource.Id.toolbar);
         if (ToolBar != null)
         {
             ToolBar.Title = GetText(Resource.String.Lbl_SelectGif);
             ToolBar.SetTitleTextColor(Color.White);
             SetSupportActionBar(ToolBar);
             SupportActionBar.SetDisplayShowCustomEnabled(true);
             SupportActionBar.SetDisplayHomeAsUpEnabled(true);
             SupportActionBar.SetHomeButtonEnabled(true);
             SupportActionBar.SetDisplayShowHomeEnabled(true);
         }
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
Exemplo n.º 14
0
/*
 *      private void OnButtonClick(object sender, EventArgs e)
 *      {
 *          if (sender is AppCompatImageButton imgButton)
 *              Toast.MakeText(this, (string)imgButton.Tag, ToastLength.Short).Show();
 *
 *      }
 */


        private void SetUpToolbar()
        {
            // Not having raised AppBar area, so don't set SupportActionBar
            //SetSupportActionBar(_toolbar);

            // Set the page Title - Required because of the way that Android sets up app asset names
            _toolbar.Title = null;  // using the custom title so it can be centered
            SetToolbarCustomTitle(Resources.GetString(Resource.String.app_name));
            // Set the subtitle
//            SetToolbarCustomSubtitle("Subtitle");
//            _toolbar.Subtitle = "Subtitle";

            //Set toolbar title colors
            Color col = new Color(ContextCompat.GetColor(this, Resource.Color.app_blue));

            _toolbar.SetTitleTextColor(col);
            _toolbar.SetSubtitleTextColor(col);
            SetToolbarCustomTitleColor(col);
            SetToolbarCustomSubtitleColor(col);

            // Manually add the menu to the toolbar and set the menu item click event(not done automatically because not setting SupportActionBar)
            OnCreateOptionsMenu(_toolbar.Menu);
        }
Exemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.Account_layout);



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

            SetSupportActionBar(toolBar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(false);

            toolBar.SetTitleTextColor(Color.Black);

            string cheeseName = Intent.GetStringExtra("Login");

            collapsingToolBar       = FindViewById <CollapsingToolbarLayout>(Resource.Id.collapsing_toolbar);
            collapsingToolBar.Title = cheeseName;
            // collapsingToolBar.SetCollapsedTitleTextColor(Color.Black);
            ImageView imageView1 = FindViewById <ImageView>(Resource.Id.imageView1);

            imageView1.Visibility = ViewStates.Invisible;

            LoadBackDrop();

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

            fab.Click += delegate
            {
                //floating action button to open settings
                StartActivity(typeof(Startup.SettingsActivity));
            };

            //get username and password ext ext

            TextView txtUsername     = FindViewById <TextView>(Resource.Id.txtUsername);
            TextView txtUserPassword = FindViewById <TextView>(Resource.Id.txtUserPass);
            TextView txtCompany      = FindViewById <TextView>(Resource.Id.txtCompany);
            TextView txtCompPass     = FindViewById <TextView>(Resource.Id.txtCompanyPass);

            try
            {
                /*Operator*/
                txtUsername.FocusChange += (sender, args) =>
                {
                    if (args.HasFocus == false)
                    {
                        /*Only way i could get event leave event to fire*/
                        new System.Threading.Thread(new System.Threading.ThreadStart(delegate
                        {
                            //NotificationSystem.ShowNotification(this);

                            try
                            {
                                string defaultCompany = Constants._service.Login_GetDefaultCompany(txtUsername.Text.TrimEnd());

                                RunOnUiThread(() =>
                                {
                                    txtCompany.Text = defaultCompany;
                                });
                                string defaultCompanyPasword = Constants._service.Login_GetDefaultCompanyPassword(defaultCompany);
                                RunOnUiThread(() =>
                                {
                                    txtCompPass.Text = defaultCompanyPasword;
                                });
                            }
                            catch (Exception ex)
                            {
                                ViewDialog alert = new ViewDialog();


                                RunOnUiThread(() => alert.showDialog(this, "Error Connecting to service\n" + ex.Message));
                            }
                        })).Start();

                        Operator = txtUsername.Text.TrimEnd();
                    }
                };

                /*Operator Password*/
                txtUserPassword.FocusChange += (sender, args) =>
                {
                    if (args.HasFocus == false)
                    {
                        /*Only way i could get event leave event to fire*/

                        OperatorPass = txtUserPassword.Text.TrimEnd();
                    }
                };

                /*Company*/
                txtCompany.FocusChange += (sender, args) =>
                {
                    if (args.HasFocus == false)
                    {
                        /*Only way i could get event leave event to fire*/

                        Company = txtCompany.Text.TrimEnd();
                    }
                };

                /*Company Pass*/
                txtCompPass.FocusChange += (sender, args) =>
                {
                    if (args.HasFocus == false)
                    {
                        /*Only way i could get event leave event to fire*/

                        CompanyPass = txtCompPass.Text.TrimEnd();
                    }
                };

                txtCompPass.KeyPress += TxtCompPass_KeyPress;

                context = this;

                try
                {
                    //_service = new ServiceWrapper();
                    if (Constants._service == new WMSScanner.WMSService())
                    {
                        OpenSettings();
                    }
                }
                catch (Exception ex)
                {
                    //we need to check if the URL is set if not open up the screen for preferences
                    //open url development
                    OpenSettings();
                }
            }
            catch (Exception ex)
            {
                ViewDialog alert = new ViewDialog();


                RunOnUiThread(() => alert.showDialog(this, "Error Connecting to service\n" + ex.Message));
            }
        }