Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                var viewGroup = this.LayoutInflater.Inflate(Resource.Layout.YorshActionBar, null);
                var param = new ActionBar.LayoutParams(
                    ViewGroup.LayoutParams.MatchParent,
                    ViewGroup.LayoutParams.MatchParent);
                var title = viewGroup.FindViewById<TextView>(Resource.Id.titleText);
                title.Text = Title;
                AllowBackPressed = true;
                title.SetTypeface(Rep.FontManager.Get(Font.Bold), TypefaceStyle.Normal);
                ActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));
                ActionBar.SetDisplayShowTitleEnabled(false);
                ActionBar.SetDisplayShowCustomEnabled(true);
                ActionBar.SetCustomView(viewGroup, param);

                SetHomeButtonEnabled(true);
            }
            catch (Exception exception)
            {
                GaService.TrackAppException(this.Class, "SetHomeButtonEnabled", exception, false);
            }
        }
Esempio n. 2
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate (bundle);
     var viewGroup = (ViewGroup)LayoutInflater.Inflate (Resource.Layout.YorshActionBar,null);
     var param = new ActionBar.LayoutParams (
         ViewGroup.LayoutParams.MatchParent,
         ViewGroup.LayoutParams.MatchParent);
     var title = viewGroup.FindViewById<TextView> (Resource.Id.titleText);
     title.Text = Title;
     title.SetTypeface (this.MyriadProFont(MyriadPro.Bold),TypefaceStyle.Normal);
     ActionBar.SetIcon(new ColorDrawable(Resources.GetColor(Android.Resource.Color.Transparent)));
     ActionBar.SetDisplayShowTitleEnabled(false);
     ActionBar.SetDisplayShowCustomEnabled(true);
     ActionBar.SetCustomView(viewGroup, param);
     SetHomeButtonEnabled (true);
 }
Esempio n. 3
0
        protected override void OnCreateActivity (Bundle bundle)
        {
            base.OnCreateActivity (bundle);

            SetContentView (Resource.Layout.MainDrawerActivity);

            DrawerListView = FindViewById<ListView> (Resource.Id.DrawerListView);
            DrawerListView.Adapter = drawerAdapter = new DrawerListAdapter ();
            DrawerListView.ItemClick += OnDrawerListViewItemClick;

            DrawerLayout = FindViewById<DrawerLayout> (Resource.Id.DrawerLayout);
            DrawerToggle = new ActionBarDrawerToggle (this, DrawerLayout, Resource.Drawable.IcDrawer, Resource.String.EntryName, Resource.String.EntryName);

            DrawerLayout.SetDrawerShadow (Resource.Drawable.drawershadow, (int)GravityFlags.Start);
            DrawerLayout.SetDrawerListener (DrawerToggle);

            Timer.OnCreate (this);
            var lp = new ActionBar.LayoutParams (ActionBar.LayoutParams.WrapContent, ActionBar.LayoutParams.WrapContent);
            lp.Gravity = GravityFlags.Right | GravityFlags.CenterVertical;

            var bus = ServiceContainer.Resolve<MessageBus> ();
            drawerSyncStarted = bus.Subscribe<SyncStartedMessage> (SyncStarted);
            drawerSyncFinished = bus.Subscribe<SyncFinishedMessage> (SyncFinished);

            DrawerSyncView = FindViewById<FrameLayout> (Resource.Id.DrawerSyncStatus);

            syncRetryButton = DrawerSyncView.FindViewById<ImageButton> (Resource.Id.SyncRetryButton);
            syncRetryButton.Click += OnSyncRetryClick;

            syncStatusText = DrawerSyncView.FindViewById<TextView> (Resource.Id.SyncStatusText);

            ActionBar.SetCustomView (Timer.Root, lp);
            ActionBar.SetDisplayShowCustomEnabled (true);
            ActionBar.SetDisplayHomeAsUpEnabled (true);
            ActionBar.SetHomeButtonEnabled (true);

            if (bundle == null) {
                OpenPage (DrawerListAdapter.TimerPageId);
            } else {
                // Restore page stack
                pageStack.Clear ();
                var arr = bundle.GetIntArray (PageStackExtra);
                if (arr != null) {
                    pageStack.AddRange (arr);
                }
            }
        }
Esempio n. 4
0
        public static ActionBar SetTitle(Activity activity, int resourseId,string title,string gameName)
        {
            activ = activity;
            ActionBar mActionBar = activity.ActionBar;
            //mActionBar.SetIcon (Resource.Drawable.Icon);
            mActionBar.SetDisplayShowTitleEnabled(false);
            mActionBar.SetIcon(Android.Resource.Color.Transparent);
            mActionBar.SetDisplayShowCustomEnabled(true);
            //mActionBar.Title = "";

            LayoutInflater mInflater = LayoutInflater.From(activity);
            View mCustomView = mInflater.Inflate(resourseId, null);
            var textTitle = mCustomView.FindViewById<TextView> (Resource.Id.textTitleActionBar);
            textTitle.Text = title;
            var pb = mCustomView.FindViewById<ProgressBar> (Resource.Id.progressBar3);
            pb.Visibility= ViewStates.Gone;
            ActionBar.LayoutParams actionbarParams =
                new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent,ActionBar.LayoutParams.WrapContent);

            Button buttonGameChange = mCustomView.FindViewById<Button> (Resource.Id.buttonChangeGame);
            switch(gameName){
            case "DOTA2":
                buttonGameChange.SetBackgroundResource(Resource.Drawable.dota2_icon);
                break;
            case "CSGO":
                buttonGameChange.SetBackgroundResource(Resource.Drawable.csgo_icon);
                break;
            case "Hearthstone":
                buttonGameChange.SetBackgroundResource(Resource.Drawable.hearthsone_icon);
                break;
            }
            //var rr = activ.FindViewById<RelativeLayout> (Resource.Id.actionBarView);

            //pb.Visibility = ViewStates.Gone;
            mActionBar.SetCustomView(mCustomView,actionbarParams);

            //mActionBar.OnCreateOptionsMenu += OnCreateOptionsMenu;
            return mActionBar;
        }
Esempio n. 5
0
        private void Init()
        {
            // TODO Auto-generated method stub
            // 找到装载这个滚动TextView的LinearLayout
            llContainer = FindViewById<LinearLayout>(Resource.Id.ll_container);
            // 加载进入动画
            anim_in = AnimationUtils.LoadAnimation(this, Resource.Animation.anim_tv_marquee_in);
            // 加载移除动画
            anim_out = AnimationUtils.LoadAnimation(this, Resource.Animation.anim_tv_marquee_out);
            // 填充装文字的list
            List<string> list = new List<string>();
            for (int i = 0; i < 3; i++)
            {
                list.Add("滚动的文字" + i);
            }
            // 根据list的大小,动态创建同样个数的TextView
            for (int i = 0; i < list.Count; i++)
            {
                var tvTemp = new TextView(this);
                var lp = new ActionBar.LayoutParams(WindowManagerLayoutParams.WrapContent,
                        WindowManagerLayoutParams.WrapContent);
                lp.Gravity = GravityFlags.Center;
                tvTemp.Gravity = (GravityFlags.Center);
                tvTemp.Text = (list[i]);
                tvTemp.Id = (i + 10000);
                llContainer.AddView(tvTemp);
            }

            mHandler = new HandlerDemo(this.anim_in, this.anim_out);
        }
        private void CreateLayout()
        {
            #region UI for selecting parameter type and applying the renderer
            // Create a vertical layout for the page.
            LinearLayout mainLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Add some padding to the layout.
            mainLayout.SetPadding(20, 0, 0, 5);

            // Create a horizontal layout for the parameter type list and button to apply the renderer.
            LinearLayout parameterTypeLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };
            string[] stretchTypes = { "Min Max", "Percent Clip", "Standard Deviation" };
            ArrayAdapter <string> stretchTypesAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, stretchTypes);

            // Create the spinner control for choosing the stretch parameter input type and handle its ItemSelected event.
            _parameterInputTypeSpinner = new Spinner(this)
            {
                Adapter       = stretchTypesAdapter,
                DropDownWidth = 340
            };
            _parameterInputTypeSpinner.ItemSelected += ParameterInputTypeSpinner_ItemSelected;

            // Create the button that applies the renderer and handle its Click event.
            _applyRendererButton = new Button(this)
            {
                Text    = "Apply",
                Enabled = false
            };
            _applyRendererButton.Click += ApplyRendererButton_Click;

            // Add a label, parameter type spinner control, and the apply button.
            TextView parameterTypeTextView = new TextView(this)
            {
                Text = "Stretch type: "
            };
            parameterTypeLayout.AddView(parameterTypeTextView);
            parameterTypeLayout.AddView(_parameterInputTypeSpinner);
            parameterTypeLayout.AddView(_applyRendererButton);

            // Add the parameter UI choice controls to the main layout.
            mainLayout.AddView(parameterTypeLayout);
            #endregion

            #region UI for defining min/max RGB values
            // Create a horizontal layout for the min/max RGB inputs.
            _minMaxLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Create a range of values from 0-255 and an adapter to display them.
            int[] minMaxValues = Enumerable.Range(0, 256).ToArray();
            ArrayAdapter <int> minMaxValuesAdapter = new ArrayAdapter <int>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, minMaxValues);

            // Get the width of the current device (in pixels).
            int widthPixels = Resources.DisplayMetrics.WidthPixels;

            // Use 1/5 of the device width for the drop down.
            int dropDownWidth = widthPixels / 5;

            // Create controls for specifying the minimum and maximum red values (0-255).
            _minRedSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minRedSpinner.SetSelection(0);
            _maxRedSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxRedSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minRedSpinner.SetBackgroundColor(Android.Graphics.Color.DarkRed);
            _maxRedSpinner.SetBackgroundColor(Android.Graphics.Color.DarkRed);

            // Create controls for specifying the minimum and maximum green values (0-255).
            _minGreenSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minGreenSpinner.SetSelection(0);
            _maxGreenSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxGreenSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minGreenSpinner.SetBackgroundColor(Android.Graphics.Color.DarkGreen);
            _maxGreenSpinner.SetBackgroundColor(Android.Graphics.Color.DarkGreen);

            // Create controls for specifying the minimum and maximum blue values (0-255).
            _minBlueSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _minBlueSpinner.SetSelection(0);
            _maxBlueSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = minMaxValuesAdapter,
                DropDownWidth = dropDownWidth
            };
            _maxBlueSpinner.SetSelection(255);

            // Set the background color to indicate which values the inputs are for.
            _minBlueSpinner.SetBackgroundColor(Android.Graphics.Color.DarkBlue);
            _maxBlueSpinner.SetBackgroundColor(Android.Graphics.Color.DarkBlue);

            // Create vertical layouts for the color inputs (so they align properly).
            LinearLayout redInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };
            LinearLayout greenInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };
            LinearLayout blueInputsLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical
            };

            // Add the color inputs to their corresponding layout.
            redInputsLayout.AddView(_minRedSpinner);
            redInputsLayout.AddView(_maxRedSpinner);
            greenInputsLayout.AddView(_minGreenSpinner);
            greenInputsLayout.AddView(_maxGreenSpinner);
            blueInputsLayout.AddView(_minBlueSpinner);
            blueInputsLayout.AddView(_maxBlueSpinner);

            // Add the vertical color inputs to the horizontal parent layout.
            _minMaxLayout.SetPadding(50, 10, 0, 10);
            _minMaxLayout.AddView(redInputsLayout);
            _minMaxLayout.AddView(greenInputsLayout);
            _minMaxLayout.AddView(blueInputsLayout);

            // Add the UI layouts to the main layout
            mainLayout.AddView(_minMaxLayout);
            #endregion

            #region UI for defining percent clip values
            // Create a (hidden) vertical layout for the min/max percent clip sliders.
            _percentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical,
                Visibility  = Android.Views.ViewStates.Gone
            };

            // Apply some padding for the layout.
            _percentClipLayout.SetPadding(20, 5, 0, 20);

            // Create the minimum and maximum percent sliders (SeekBar).
            _minPercentClipSlider = new SeekBar(this)
            {
                Max      = 100,
                Progress = 0
            };
            _maxPercentClipSlider = new SeekBar(this)
            {
                Max      = 100,
                Progress = 0
            };

            // Set the SeekBar dimensions and a left margin.
            ActionBar.LayoutParams layoutParamsSeekBar = new ActionBar.LayoutParams(400, 30)
            {
                LeftMargin = 5
            };
            _minPercentClipSlider.LayoutParameters = layoutParamsSeekBar;
            _maxPercentClipSlider.LayoutParameters = layoutParamsSeekBar;

            // Create labels for minimum and maximum percent.
            TextView minimumSliderLabel = new TextView(this)
            {
                Text = "Min: "
            };
            TextView maximumSliderLabel = new TextView(this)
            {
                Text = "Max: "
            };

            // Create horizontal layouts for the minimum and maximum controls.
            LinearLayout minPercentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };
            LinearLayout maxPercentClipLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Add min and max percent controls to their corresponding layouts.
            minPercentClipLayout.AddView(minimumSliderLabel);
            minPercentClipLayout.AddView(_minPercentClipSlider);
            maxPercentClipLayout.AddView(maximumSliderLabel);
            maxPercentClipLayout.AddView(_maxPercentClipSlider);

            // Add the slider layouts to the percent clip layout.
            _percentClipLayout.AddView(minPercentClipLayout);
            _percentClipLayout.AddView(maxPercentClipLayout);

            // Add the percent clip UI to the main layout.
            mainLayout.AddView(_percentClipLayout);
            #endregion

            #region UI for defining standard deviation factor
            // Create a range of values from 0-5 (in 0.5 increments) and an adapter to display them.
            IEnumerable <int>     wholeStdDevs         = Enumerable.Range(1, 10);
            List <double>         halfStdDevs          = wholeStdDevs.Select(i => (double)i / 2).ToList();
            ArrayAdapter <double> stdDevFactorsAdapter = new ArrayAdapter <double>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, halfStdDevs);

            // Create a drop down (Spinner) control for specifying the standard deviation factor (0.0 - 5.0).
            _stdDeviationFactorSpinner = new Spinner(this, SpinnerMode.Dropdown)
            {
                Adapter       = stdDevFactorsAdapter,
                DropDownWidth = dropDownWidth
            };

            // Set the default selection to the 4th item (value of 2.0)
            _stdDeviationFactorSpinner.SetSelection(4);

            // Create a label (TextView) for the Spinner.
            TextView factorLabel = new TextView(this)
            {
                Text = "Factor: "
            };

            // Create a horizontal layout for the controls.
            LinearLayout stdDevFactorLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Horizontal
            };

            // Add the controls for selecting a standard deviation factor.
            stdDevFactorLayout.AddView(factorLabel);
            stdDevFactorLayout.AddView(_stdDeviationFactorSpinner);

            // Create the standard deviation factor layout and add the controls.
            _stdDeviationLayout = new LinearLayout(this)
            {
                Orientation = Orientation.Vertical,
                Visibility  = Android.Views.ViewStates.Gone
            };
            _stdDeviationLayout.SetPadding(50, 5, 0, 5);
            _stdDeviationLayout.AddView(stdDevFactorLayout);

            // Add the standard deviation layout to the main layout.
            mainLayout.AddView(_stdDeviationLayout);
            #endregion

            // Create the map view control.
            _myMapView = new MapView(this);

            // Add the map view to the layout.
            mainLayout.AddView(_myMapView);

            // Set the layout as the sample view.
            SetContentView(mainLayout);
        }
Esempio n. 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.UpdateCreditCard);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "View/Update Credit Card";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//


            Expire           = DateTime.Today;
            et_Expiry        = FindViewById <EditText>(Resource.Id.et_Expiry);
            et_Expiry.Click += delegate { ShowDialog(Start_DATE_DIALOG_ID); };

            et_CardNumber = FindViewById <EditText>(Resource.Id.et_CardNumber);


            bt_Continue        = FindViewById <Button>(Resource.Id.bt_Continue);
            bt_Continue.Click += Bt_Continue_Click;

            bt_Master        = FindViewById <ImageButton>(Resource.Id.bt_Master);
            bt_Master.Click += Bt_Master_Click;

            bt_Visa        = FindViewById <ImageButton>(Resource.Id.bt_Visa);
            bt_Visa.Click += bt_Visa_Click;

            err_Expiry     = FindViewById <TextView>(Resource.Id.err_Expiry);
            err_CardType   = FindViewById <TextView>(Resource.Id.err_CardType);
            err_CardNumber = FindViewById <TextView>(Resource.Id.err_CardNumber);

            //Andy Testing
            //this.et_Expire.Text = "07/2016";
            //this.et_CardNumber.Text = "4444333322221111";

            GetCardInfo();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetTheme(ActivityCommon.SelectedThemeId);
            base.OnCreate(savedInstanceState);

            if (savedInstanceState != null)
            {
                _activityRecreated = true;
                _instanceData      = GetInstanceState(savedInstanceState, _instanceData) as InstanceData;
            }

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowCustomEnabled(true);
            SetContentView(Resource.Layout.arg_assist_status);

            _imm         = (InputMethodManager)GetSystemService(InputMethodService);
            _contentView = FindViewById <View>(Android.Resource.Id.Content);

            _barView = LayoutInflater.Inflate(Resource.Layout.bar_arg_assist, null);
            ActionBar.LayoutParams barLayoutParams = new ActionBar.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.WrapContent);
            barLayoutParams.Gravity = barLayoutParams.Gravity &
                                      (int)(~(GravityFlags.HorizontalGravityMask | GravityFlags.VerticalGravityMask)) |
                                      (int)(GravityFlags.Left | GravityFlags.CenterVertical);
            SupportActionBar.SetCustomView(_barView, barLayoutParams);

            SetResult(Android.App.Result.Canceled);

            if (IntentSgFuncInfo == null)
            {
                Finish();
                return;
            }

            _serviceId = Intent.GetIntExtra(ExtraServiceId, -1);
            _offline   = Intent.GetBooleanExtra(ExtraOffline, false);
            if (!_activityRecreated && _instanceData != null)
            {
                _instanceData.Arguments = Intent.GetStringExtra(ExtraArguments);
            }

            _activityCommon = new ActivityCommon(this);

            _sgFuncInfoList = IntentSgFuncInfo;

            _buttonApply = _barView.FindViewById <Button>(Resource.Id.buttonApply);
            _buttonApply.SetOnTouchListener(this);
            _buttonApply.Click += (sender, args) =>
            {
                if (ArgsSelectCount() > 0 && UpdateResult())
                {
                    Finish();
                }
            };

            _buttonExecute = _barView.FindViewById <Button>(Resource.Id.buttonExecute);
            _buttonExecute.SetOnTouchListener(this);
            _buttonExecute.Click += (sender, args) =>
            {
                if (ArgsSelectCount() > 0 && UpdateResult(true))
                {
                    Finish();
                }
            };

            _radioButtonArgTypeArg = FindViewById <RadioButton>(Resource.Id.radioButtonArgTypeArg);
            _radioButtonArgTypeArg.CheckedChange += (sender, args) =>
            {
                UpdateArgList();
            };

            _radioButtonArgTypeId = FindViewById <RadioButton>(Resource.Id.radioButtonArgTypeId);
            _radioButtonArgTypeId.CheckedChange += (sender, args) =>
            {
                UpdateArgList();
            };

            _listViewArgs    = FindViewById <ListView>(Resource.Id.argList);
            _argsListAdapter = new EdiabasToolActivity.ResultSelectListAdapter(this);
            _argsListAdapter.CheckChanged += extraInfo =>
            {
                UpdateButtonState();
                CheckArgsAmount();
            };

            _listViewArgs.Adapter = _argsListAdapter;
            _listViewArgs.SetOnTouchListener(this);

            UpdateDisplay();
        }
Esempio n. 9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            if (savedInstanceState != null)
            {
                _instanceData = ActivityCommon.GetInstanceState(savedInstanceState, _instanceData) as InstanceData;
            }

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowCustomEnabled(true);
            SetContentView(Resource.Layout.can_adapter_config);

            _imm         = (InputMethodManager)GetSystemService(InputMethodService);
            _contentView = FindViewById <View>(Android.Resource.Id.Content);

            _barView = LayoutInflater.Inflate(Resource.Layout.bar_can_adapter, null);
            ActionBar.LayoutParams barLayoutParams = new ActionBar.LayoutParams(
                ViewGroup.LayoutParams.MatchParent,
                ViewGroup.LayoutParams.WrapContent);
            barLayoutParams.Gravity = barLayoutParams.Gravity &
                                      (int)(~(GravityFlags.HorizontalGravityMask | GravityFlags.VerticalGravityMask)) |
                                      (int)(GravityFlags.Left | GravityFlags.CenterVertical);
            SupportActionBar.SetCustomView(_barView, barLayoutParams);

            SetResult(Android.App.Result.Canceled);

            _deviceAddress = Intent.GetStringExtra(ExtraDeviceAddress);
            ActivityCommon.InterfaceType interfaceType = (ActivityCommon.InterfaceType)Intent.GetIntExtra(ExtraInterfaceType,
                                                                                                          (int)ActivityCommon.InterfaceType.Bluetooth);
            ViewStates visibility = interfaceType == ActivityCommon.InterfaceType.Bluetooth ? ViewStates.Visible : ViewStates.Gone;

            _buttonRead = _barView.FindViewById <Button>(Resource.Id.buttonAdapterRead);
            _buttonRead.SetOnTouchListener(this);
            _buttonRead.Click += (sender, args) =>
            {
                PerformRead();
            };
            _buttonRead.Visibility = visibility;

            _buttonWrite = _barView.FindViewById <Button>(Resource.Id.buttonAdapterWrite);
            _buttonWrite.SetOnTouchListener(this);
            _buttonWrite.Click += (sender, args) =>
            {
                PerformWrite();
            };

            _layoutCanAdapter = FindViewById <LinearLayout>(Resource.Id.layoutCanAdapter);
            _layoutCanAdapter.SetOnTouchListener(this);

            _spinnerCanAdapterMode = FindViewById <Spinner>(Resource.Id.spinnerCanAdapterMode);
            _spinnerCanAdapterMode.SetOnTouchListener(this);
            _spinnerCanAdapterModeAdapter  = new StringObjAdapter(this);
            _spinnerCanAdapterMode.Adapter = _spinnerCanAdapterModeAdapter;
            _spinnerCanAdapterModeAdapter.Items.Add(new StringObjType(GetString(Resource.String.button_can_adapter_can_500), AdapterMode.Can500));
            _spinnerCanAdapterModeAdapter.Items.Add(new StringObjType(GetString(Resource.String.button_can_adapter_can_100), AdapterMode.Can100));
            _spinnerCanAdapterModeAdapter.Items.Add(new StringObjType(GetString(Resource.String.button_can_adapter_can_off), AdapterMode.CanOff));
            _spinnerCanAdapterModeAdapter.NotifyDataSetChanged();

            _textViewCanAdapterSepTimeTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterSepTimeTitle);
            _textViewCanAdapterSepTimeTitle.Visibility = visibility;

            _spinnerCanAdapterSepTime = FindViewById <Spinner>(Resource.Id.spinnerCanAdapterSepTime);
            _spinnerCanAdapterSepTime.SetOnTouchListener(this);
            _spinnerCanAdapterSepTimeAdapter  = new StringAdapter(this);
            _spinnerCanAdapterSepTime.Adapter = _spinnerCanAdapterSepTimeAdapter;
            _spinnerCanAdapterSepTimeAdapter.Items.Add(GetString(Resource.String.can_adapter_text_off));
            for (int i = 1; i <= 2; i++)
            {
                _spinnerCanAdapterSepTimeAdapter.Items.Add(i.ToString());
            }
            _spinnerCanAdapterSepTimeAdapter.NotifyDataSetChanged();
            _spinnerCanAdapterSepTime.Visibility = visibility;

            _textViewCanAdapterBlockSizeTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterBlockSizeTitle);
            _textViewCanAdapterBlockSizeTitle.Visibility = visibility;

            _spinnerCanAdapterBlockSize = FindViewById <Spinner>(Resource.Id.spinnerCanAdapterBlockSize);
            _spinnerCanAdapterBlockSize.SetOnTouchListener(this);
            _spinnerCanAdapterBlockSizeAdapter  = new StringAdapter(this);
            _spinnerCanAdapterBlockSize.Adapter = _spinnerCanAdapterBlockSizeAdapter;
            _spinnerCanAdapterBlockSizeAdapter.Items.Add(GetString(Resource.String.can_adapter_text_off));
            for (int i = 0; i <= 15; i++)
            {
                _spinnerCanAdapterBlockSizeAdapter.Items.Add(i.ToString());
            }
            _spinnerCanAdapterBlockSizeAdapter.NotifyDataSetChanged();
            _spinnerCanAdapterBlockSize.Visibility = visibility;

            _textViewBtPinTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterBtPinTitle);
            _textViewBtPinTitle.Visibility = visibility;

            _editTextBtPin            = FindViewById <EditText>(Resource.Id.editTextBtPin);
            _editTextBtPin.Visibility = visibility;

            _textViewBtNameTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterBtNameTitle);
            _textViewBtNameTitle.Visibility = visibility;

            _editTextBtName            = FindViewById <EditText>(Resource.Id.editTextBtName);
            _editTextBtName.Visibility = visibility;

            _textViewCanAdapterIgnitionStateTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterIgnitionStateTitle);
            _textViewCanAdapterIgnitionStateTitle.Visibility = visibility;

            _textViewIgnitionState            = FindViewById <TextView>(Resource.Id.textViewCanAdapterIgnitionState);
            _textViewIgnitionState.Visibility = visibility;

            _textViewBatteryVoltageTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterBatVoltageTitle);
            _textViewBatteryVoltageTitle.Visibility = visibility;

            _textViewBatteryVoltage            = FindViewById <TextView>(Resource.Id.textViewCanAdapterBatVoltage);
            _textViewBatteryVoltage.Visibility = visibility;

            _textViewFwVersionTitle            = FindViewById <TextView>(Resource.Id.textViewCanAdapterFwVersionTitle);
            _textViewFwVersionTitle.Visibility = visibility;

            _textViewFwVersion            = FindViewById <TextView>(Resource.Id.textViewCanAdapterFwVersion);
            _textViewFwVersion.Visibility = visibility;

            _textViewSerNumTitle = FindViewById <TextView>(Resource.Id.textViewCanAdapterSerNumTitle);
            _textViewSerNum      = FindViewById <TextView>(Resource.Id.textViewCanAdapterSerNum);
#if DEBUG
            _textViewSerNumTitle.Visibility = visibility;
            _textViewSerNum.Visibility      = visibility;
#else
            _textViewSerNumTitle.Visibility = ViewStates.Gone;
            _textViewSerNum.Visibility      = ViewStates.Gone;
#endif
            _buttonFwUpdate            = FindViewById <Button>(Resource.Id.buttonCanAdapterFwUpdate);
            _buttonFwUpdate.Visibility = visibility;
            _buttonFwUpdate.Click     += (sender, args) =>
            {
                PerformUpdateMessage();
            };
            _checkBoxExpert            = FindViewById <CheckBox>(Resource.Id.checkBoxCanAdapterExpert);
            _checkBoxExpert.Visibility = visibility;
            _checkBoxExpert.Click     += (sender, args) =>
            {
                UpdateDisplay();
            };

            _activityCommon = new ActivityCommon(this)
            {
                SelectedInterface = interfaceType
            };

            UpdateDisplay();
            PerformRead();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);


            SetContentView(Resource.Layout.Summary);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            ActionBar.SetDisplayHomeAsUpEnabled(false);
            ActionBar.SetHomeButtonEnabled(false);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);


            //**************************************************//

            // Create your application here

            ll_receipt = FindViewById <LinearLayout>(Resource.Id.ll_receipt);
            ll_Body    = FindViewById <LinearLayout>(Resource.Id.ll_Body);


            tv_TransactionDescription = this.FindViewById <TextView>(Resource.Id.tv_TransactionDescription);
            tv_ReceiptNumber          = this.FindViewById <TextView>(Resource.Id.tv_ReceiptNumber);
            tv_Amount       = this.FindViewById <TextView>(Resource.Id.tv_Amount);
            tv_Time         = this.FindViewById <TextView>(Resource.Id.tv_Time);
            tv_Date         = this.FindViewById <TextView>(Resource.Id.tv_Date);
            tv_Name         = this.FindViewById <TextView>(Resource.Id.tv_Name);
            tv_Message      = this.FindViewById <TextView>(Resource.Id.tv_Message);
            tv_ReceiptLabel = this.FindViewById <TextView>(Resource.Id.tv_ReceiptLabel);



            //Load data from previous activity
            tv_TransactionDescription.Text = Intent.GetStringExtra("tv_TransactionDescription") ?? "";
            tv_ReceiptNumber.Text          = Intent.GetStringExtra("tv_ReceiptNumber") ?? "";
            tv_Amount.Text = Intent.GetStringExtra("tv_Amount") ?? "";
            tv_Time.Text   = Intent.GetStringExtra("tv_Time") ?? "";
            tv_Date.Text   = Intent.GetStringExtra("tv_Date") ?? "";
            tv_Name.Text   = Intent.GetStringExtra("tv_Name") ?? "";

            if (Settings.IsFuturePayment)
            {
                tv_Message.Text    = "Your payments will be processed according to the Future Payments schedule.";
                ll_Body.Visibility = ViewStates.Invisible;
            }
            else
            {
                tv_Message.Text = "Your payment has been processed against your account with Reference Number " + Settings.RefNumber + ". Please be aware, payments will appear on your statement as payment to 'Recoveriescorp'";
                paymentType     = Intent.GetIntExtra("PaymentType", 0);
                paymentMethod   = Intent.GetIntExtra("PaymentMethod", 0);
                if (paymentMethod == 1)
                {
                    //ActionBar.SetTitle(Resource.String.Receipt);
                    myTitle.Text = "Receipt";

                    this.title = "Receipt";
                }
                else
                {
                    //ActionBar.SetTitle(Resource.String.PaymentSummary);
                    myTitle.Text = "Payment Summary";

                    this.ll_receipt.Visibility = ViewStates.Invisible;
                    tv_ReceiptLabel.Text       = "Payment Summary";
                    this.title = "Payment summary";
                }

                paymentId = Intent.GetIntExtra("PaymentId", 0);
                FirstDebtorPaymentInstallmentId = Intent.GetIntExtra("FirstDebtorPaymentInstallmentId", 0);
                ClientName = Intent.GetStringExtra("ClientName") ?? "";


                bt_Email        = this.FindViewById <Button>(Resource.Id.bt_Email);
                bt_Email.Click += Bt_Email_Click;

                txtEmail           = new EditText(this);
                builder            = new AlertDialog.Builder(this);
                txtEmail.InputType = Android.Text.InputTypes.TextVariationWebEmailAddress;
            }

            bt_Finish        = this.FindViewById <Button>(Resource.Id.bt_Finish);
            bt_Finish.Click += Bt_Finish_Click;

            bt_Inbox        = this.FindViewById <Button>(Resource.Id.bt_Inbox);
            bt_Inbox.Click += bt_Inbox_Click;


            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.ActionBar);

            SetContentView(Resource.Layout.ScheduleCallback);

            //**************************************************//

            ActionBar.NavigationMode = ActionBarNavigationMode.Standard;

            var upArrow = Resources.GetDrawable(Resource.Drawable.abc_ic_ab_back_mtrl_am_alpha);

            upArrow.SetColorFilter(Color.ParseColor("#006571"), PorterDuff.Mode.SrcIn);
            ActionBar.SetHomeAsUpIndicator(upArrow);

            ActionBar.SetDisplayHomeAsUpEnabled(true);
            ActionBar.SetHomeButtonEnabled(true);

            LinearLayout lLayout = new LinearLayout(this);

            lLayout.SetGravity(GravityFlags.CenterVertical);
            LinearLayout.LayoutParams textViewParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent);
            textViewParameters.RightMargin = (int)(30 * this.Resources.DisplayMetrics.Density);

            TextView myTitle = new TextView(this);

            myTitle.Text     = "Schedule Callback";
            myTitle.TextSize = 20;
            myTitle.Gravity  = GravityFlags.Center;
            lLayout.AddView(myTitle, textViewParameters);

            ActionBar.LayoutParams actionbarParams = new ActionBar.LayoutParams(ActionBar.LayoutParams.MatchParent, ActionBar.LayoutParams.MatchParent);
            ActionBar.SetCustomView(lLayout, actionbarParams);
            ActionBar.SetDisplayShowCustomEnabled(true);

            //**************************************************//

            Date = DateTime.Now;

            et_Name          = FindViewById <EditText>(Resource.Id.et_Name);
            et_Phone         = FindViewById <EditText>(Resource.Id.et_Phone);
            et_Date          = FindViewById <EditText>(Resource.Id.et_Date);
            spinner_Callback = FindViewById <Spinner>(Resource.Id.spinner_Callback);

            et_Notes = FindViewById <EditText>(Resource.Id.et_Notes);


            et_Date.Click    += delegate { ShowDialog(Start_DATE_DIALOG_ID); };
            this.et_Date.Text = DateTime.Today.Date.ToShortDateString();
            LoadCallbackList(DateTime.Today);

            err_Name     = FindViewById <TextView>(Resource.Id.err_Name);
            err_Phone    = FindViewById <TextView>(Resource.Id.err_Phone);
            err_Date     = FindViewById <TextView>(Resource.Id.err_Date);
            err_TimeFrom = FindViewById <TextView>(Resource.Id.err_TimeFrom);

            bt_Continue        = FindViewById <Button>(Resource.Id.bt_Continue);
            bt_Continue.Click += Bt_Continue_Click;

            layout_button = FindViewById <LinearLayout>(Resource.Id.linearLayout_button);


            Keyboard.ShowKeyboard(this, this.et_Name);

            TrackingHelper.SendTracking("Open Schedule Callback");

            this.Window.SetSoftInputMode(SoftInput.AdjustResize);

            var metrics    = Resources.DisplayMetrics;
            var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);

            // Gets the layout params that will allow you to resize the layout
            ViewGroup.LayoutParams temp = layout_button.LayoutParameters;
            // Changes the height and width to the specified *pixels*
            temp.Height = ConvertDpToPixel(heightInDp - 400);
            layout_button.LayoutParameters = temp;
        }