Exemplo n.º 1
0
 private void CreateFont(string fontName)
 {
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("fonts/" + fontName + ".ttf")
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   .Build());
 }
Exemplo n.º 2
0
        public override void OnCreate()
        {
            base.OnCreate();

            //SetupTracker();

            //AppCenter.Start("28a1a4e1-b729-456f-b514-257b4e7e8333",
            //       typeof(Analytics), typeof(Crashes));

            //PrintKeyHash();

            //RegisterActivityLifecycleCallbacks(this);

            //EnableStrictMode();

            //InitImageLoader();

            //UpdateLanguage(this);

            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/Poppins-SemiBold.ttf")
                                          //.SetFontAttrId(Resource.Attribute.fontPath)
                                          // Adding a custom view that support adding a typeFace
                                          // .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                          // Adding a custom style
                                          // .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                          .Build()
                                          );

            //AndroidEnvironment.UnhandledExceptionRaiser += (sender, args) =>
            //{
            //    args.Handled = true;
            //};
        }
Exemplo n.º 3
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("fonts/IndieFlower.ttf")
                                   .Build());
 }
Exemplo n.º 4
0
        public override void OnCreate()
        {
            try
            {
                base.OnCreate();

                //insantiate the hockey application insights
                InitHockeyInsights();
                // Initialize the Parse client with your Application ID and .NET Key
                //ParseClient.Initialize(AppId, NetKey);
                //log out any current user
                //initialize image loader
                InitImageLoader(ApplicationContext);

                //initialize font across the entire application
                CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                              .SetDefaultFontPath("fonts/bgothm.ttf")
                                              //this will be the default typeface, similar to that of the IOS version
                                              .SetFontAttrId(Resource.Attribute.fontPath)
                                              .Build());

                //@TODO check connectivity
                var connected = CrossConnectivity.Current.IsConnected ? "Connected" : "No Connection";
            }
            catch (Exception ex)
            {
                Console.WriteLine(String.Format("Error initalizing application {0} {1}", ex.Message, ex.StackTrace));
                MetricsManager.TrackEvent(String.Format("Error initalizing application {0} {1}", ex.Message,
                                                        ex.StackTrace));
            }
        }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/gtw.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .DisablePrivateFactoryInjection()
                                          // Adding a custom view that support adding a typeFace
                                          // .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                          // Adding a custom style
                                          // .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                          .Build());

            //var originalInflater = LayoutInflater.From(this);
            //var newInflater = originalInflater.CloneInContext(originalInflater.Context);
            //newInflater.Factory = myCustomFactory;
            //Setin

            //var mvxFactory = LayoutInflaterCompat.GetFactory(LayoutInflater);
            //var myViewFactory = new MyViewFactory(mvxFactory);
            //LayoutInflaterCompat.SetFactory(LayoutInflater, myViewFactory);

            SetContentView(Resource.Layout.FirstView);
        }
Exemplo n.º 6
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("fonts/npcc_font.ttf")
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   .Build());
 }
Exemplo n.º 7
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   .Build());
     RegisterActivityLifecycleCallbacks(this);
 }
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("Fonts/Avenir.ttc")
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   .Build());
 }
Exemplo n.º 9
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     // Set our view from the "main" layout resource
     SetContentView(Resource.Layout.activity_main);
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("Fonts/GlacialIndifference-Regular.ttf")
                                   .SetFontAttrId(Resource.Attribute.fontPath).Build());
 }
Exemplo n.º 10
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(
         new CalligraphyConfig.Builder()
         .SetDefaultFontPath("MontserratAlternates_Regular.ttf")
         .SetFontAttrId(Resource.Attribute.fontPath)
         .Build()
         );
 }
Exemplo n.º 11
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     SetContentView(Resource.Layout.Main);
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("fonts/antipasto.otf")
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   .Build());
     Componentsinit();
     DictionaryCreate();
 }
Exemplo n.º 12
0
        /// <inheritdoc />
        public override void OnCreate()
        {
            base.OnCreate();
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()

                                          .SetDefaultFontPath("fonts/gtw.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                          .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                          .Build()
                                          );
        }
        public override void OnCreate()
        {
            base.OnCreate();

            //Set Exo2_Bold.otf fontFamily for the entire application
            CalligraphyConfig.InitDefault(
                new CalligraphyConfig.Builder()
                .SetDefaultFontPath("fonts/Exo2_Bold.otf")
                .SetFontAttrId(Resource.Attribute.fontPath)
                .Build()
                );
        }
Exemplo n.º 14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Initializing calligraphy, build font atribute.
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("font/GlacialIndifference-Regular.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());

            SetContentView(Resource.Layout.activity_main);

            SupportActionBar.Title = "MONEY APP";
        }
Exemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/Righteous-Regular.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          // Adding a custom view that support adding a typeFace
                                          // .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                          // Adding a custom style
                                          // .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                          .Build()
                                          );
            Forms.SetFlags("CollectionView_Experimental");
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            FormsMaterial.Init(this, savedInstanceState);


            LoadApplication(new App(this));


            #region Registering Xamarin Essentials on android;
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            #endregion

            ServicePointManager.ServerCertificateValidationCallback += (o, cert, chain, errors) => true;
            #region Firebase disabled
            //FirebasePushNotificationManager.ProcessIntent(this, Intent);
            #endregion
            #region call firebase

            FirebaseMessaging.Instance.SubscribeToTopic("admin");
            var FirebaseID = Firebase.Iid.FirebaseInstanceId.Instance.Token;

            #endregion
            #region watch => phone communication
            new Task(() =>
            {
                cmm = new Communicator(this);
                cmm.SendMessage("FromPhone" + DateTime.Now.ToString("T"));
                cmm.DataReceived += DeviceReceived;
            });

            //cmm.DataReceived

            #endregion
            StartService(new Intent(this, Class));
        }
Exemplo n.º 16
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            CalligraphyConfig.InitDefault(
                new CalligraphyConfig.Builder()
                .SetDefaultFontPath("fonts/Roboto-Bold.ttf")
                .SetFontAttrId(Resource.Attribute.fontPath)
                .Build()
                );
            // Get our button from the layout resource,
            // and attach an event to it
        }
Exemplo n.º 17
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                   .SetDefaultFontPath("fonts/azbuka.ttf")
                                   .SetFontAttrId(Resource.Attribute.fontPath)
                                   // Adding a custom view that support adding a typeFace
                                   // .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                   // Adding a custom style
                                   // .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                   .Build()
                                   );
     RegisterActivityLifecycleCallbacks(this);
     Android.Support.V7.App.AppCompatDelegate.CompatVectorFromResourcesEnabled = true;
 }
Exemplo n.º 18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/Quantico-Regular.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .DisablePrivateFactoryInjection()
                                          // Adding a custom view that support adding a typeFace
                                          // .AddCustomViewWithSetTypeface(Java.Lang.Class.FromType(typeof(CustomViewWithTypefaceSupport)))
                                          // Adding a custom style
                                          // .AddCustomStyle(Java.Lang.Class.FromType(typeof(TextField)), Resource.Attribute.textFieldStyle)
                                          .Build());

            SetContentView(Resource.Layout.FirstView);
        }
Exemplo n.º 19
0
        public override void OnCreate()
        {
            base.OnCreate();

            RegisterActivityLifecycleCallbacks(this);
            //A great place to initialize Xamarin.Insights and Dependency Servicesvar config =

            var config =
                new CalligraphyConfig.Builder().SetDefaultFontPath("fonts/Lato-Regular.ttf")
                .SetFontAttrId(Resource.Attribute.fontPath)
                .Build();

            CalligraphyConfig.InitDefault(config);

            UserDialogs.Init(this);
        }
Exemplo n.º 20
0
        public async override void OnCreate()
        {
            base.OnCreate();

            //SetupTracker();

            //AppCenter.Start("28a1a4e1-b729-456f-b514-257b4e7e8333",
            //       typeof(Analytics), typeof(Crashes));

            await Repository.InitializeDatabase();

            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/Poppins-SemiBold.ttf")
                                          .Build()
                                          );
        }
Exemplo n.º 21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Auth);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/antipasto.otf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());

            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            _loginFragment    = new LoginFragment();
            _registerFragment = new RegisterFragment();
            SetUpViewPager();
        }
Exemplo n.º 22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetTheme(Resource.Style.ShindyFriendsTheme);
            SetContentView(Resource.Layout.Navigation);
            CalligraphyConfig.InitDefault(
                new CalligraphyConfig.Builder()
                .SetDefaultFontPath("fonts/Roboto-Light.ttf")
                .SetFontAttrId(Resource.Attribute.fontPath)
                .Build()
                );
            var trans = SupportFragmentManager.BeginTransaction();

            inviteFriends_fragment = new InviteFriends_fragment();
            trans.Replace(Resource.Id.fragment_container, inviteFriends_fragment);
            trans.Commit();
        }
Exemplo n.º 23
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetTheme(Resource.Style.ShindyTheme);
            SetContentView(Resource.Layout.Navigation);
            var trans = SupportFragmentManager.BeginTransaction();

            home_fragment = new Home_fragment();
            trans.Replace(Resource.Id.fragment_container, home_fragment);
            trans.Commit();
            NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            CalligraphyConfig.InitDefault(
                new CalligraphyConfig.Builder()
                .SetDefaultFontPath("fonts/Roboto-Regular.ttf")
                .SetFontAttrId(Resource.Attribute.fontPath)
                .Build()
                );
        }
Exemplo n.º 24
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Setting);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("Fonts/HELR45W.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());

            Button btn = (Button)FindViewById(Resource.Id.item_1);

            btn.Click += delegate {
                Log.Info(TAG, "press");
                Intent settingSpeech = new Intent(this, typeof(Setting_Speech));
                StartActivity(settingSpeech);
            };

            //         Spinner spinner = (Spinner)FindViewById(Resource.Id.spinner1);
            //// Create your application here
            //string[] ITEMS = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6" };
            //var adapter = new ArrayAdapter<String>(this, Android.Resource.Layout.SimpleSpinnerItem, ITEMS);
            //spinner.Adapter = adapter;
        }
Exemplo n.º 25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Admin);

            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/antipasto.otf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());

            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            var textView = FindViewById <TextView>(Resource.Id.testTv);
            var i        = 0;

            textView.Click += delegate
            {
                i++;
            };
        }
Exemplo n.º 26
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("Estedad.ttf").Build());
            SetContentView(Resource.Layout.layoutEditMyEvent);
            var font = Typeface.CreateFromAsset(Assets, "Estedad.ttf");

            editmyeventtxtviewCaptionCost          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewCaptionCost);
            editmyeventtxtviewCaptionCost.Typeface = font;
            editmyeventimgviewback        = FindViewById <ImageView>(Resource.Id.editmyeventimgviewback);
            editmyeventimgviewback.Click += delegate { Finish(); };

            editmyeventButtonBack          = FindViewById <Button>(Resource.Id.editmyeventButtonBack);
            editmyeventButtonBack.Typeface = font;
            editmyeventButtonBack.Click   += delegate { Finish(); };

            editmyeventbuttoncaption          = FindViewById <Button>(Resource.Id.editmyeventbuttoncaption);
            editmyeventbuttoncaption.Typeface = font;
            editmyeventbuttoncaption.Click   += delegate {
                Controller.Fragment.Captionvent fdlg = new Fragment.Captionvent(this);
                fdlg.Show(this.FragmentManager, "ebrahimeditfragment1");
                fdlg.OnGetCurrentItem += Fdlg_OnGetCurrentItem;
            };

            editmyeventtxtviewcaption          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewcaption);
            editmyeventtxtviewcaption.Typeface = font;


            editeventedittextHelpCaption = FindViewById <TextView>(Resource.Id.editmyeventtxtviewcaptionevent);

            editeventedittextHelpCaption.Click += delegate {
                ValueToast = "تیتر اصلی رویداد خود را شفاف و جذاب درج کنید";

                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };

            editmyeventeditTextCaption          = FindViewById <EditText>(Resource.Id.editmyeventeditTextCaption);
            editmyeventeditTextCaption.Typeface = font;

            //   editmyeventeditTextCaption.RequestFocus();

            editmyeventtxtviewcaptionevent          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewcaptionevent);
            editmyeventtxtviewcaptionevent.Typeface = font;

            editmyeventbuttonLocal          = FindViewById <Button>(Resource.Id.editmyeventbuttonLocal);
            editmyeventbuttonLocal.Typeface = font;

            editmyeventbuttonLocal.Click += delegate {
                Fragment.EnterPlace fdlg = new Fragment.EnterPlace(this);
                fdlg.ShowsDialog = true;
                fdlg.Show(this.FragmentManager, "ebrahimfragmentfdlg");
                fdlg.OnGetPlaceEvent += delegate(object sender, GetPlaceEvent e)
                {
                    if (e.GetPlace.Count > 1)
                    {
                        ValueToast   = "بیشتر از یک مکان برای رویداد انتخاب شده است";
                        view         = LayoutInflater.Inflate(Resource.Layout.layoutToast, null);
                        txt          = view.FindViewById <TextView>(Resource.Id.toasttxtviewtoast);
                        txt.Typeface = font;
                        txt.Text     = ValueToast;
                        toast        = new Toast(this)
                        {
                            Duration = ToastLength.Long,

                            View = view
                        };
                        toast.SetGravity(GravityFlags.Center, 0, 0);
                        toast.Show();
                        return;
                    }
                    else
                    {
                        if (e.GetPlace.Count == 0)
                        {
                            return;
                        }

                        editmyeventbuttonLocal.Text = "";
                        foreach (var item in e.GetPlace)
                        {
                            editmyeventbuttonLocal.Text += item.itemplace;
                        }
                        //  editmyeventbuttonshiraz.Visibility = ViewStates.Invisible;
                    }
                };
            };
            editmyeventbuttonshiraz          = FindViewById <Button>(Resource.Id.editmyeventbuttonshiraz);
            editmyeventbuttonshiraz.Typeface = font;


            editmyeventtxtviewplace          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewplace);
            editmyeventtxtviewplace.Typeface = font;


            editmyeventedittextHelpAddress        = FindViewById <EditText>(Resource.Id.editmyeventedittextHelpAddress);
            editmyeventedittextHelpAddress.Click += delegate
            {
                ValueToast = "می توانید آدرس  محل رویداد خود را در اینجا بنویسید";
                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };



            FindViewById <EditText>(Resource.Id.editmyeventeditexthelpcost).Click += delegate {
                Drawable errorIcon = Resources.GetDrawable(Resource.Drawable.academicblack32);



                FindViewById <EditText>(Resource.Id.editmyeventeditexthelpcost).SetError(Android.Text.Html.FromHtml("<font color='White'>منظور از هزینه رویداد میزان هرینه ای است که از مخاطب بابت شرکت در رویداد خود دریافت می نمایید یکی از گزینه های درج شده را انتخاب نمایید</font>"), errorIcon);
            };



            editmyeventeditTextAddres          = FindViewById <EditText>(Resource.Id.editmyeventeditTextAddres);
            editmyeventeditTextAddres.Typeface = font;

            string editTextAddres     = editmyeventeditTextAddres.Hint;
            string numberdigittAddres = editTextAddres.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventeditTextAddres.Hint = numberdigittAddres;

            string editTextAddresText     = editmyeventeditTextAddres.Text;
            string numberdigittAddresText = editTextAddresText.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventeditTextAddres.Text = numberdigittAddresText;


            editmyeventtxtviewaddres          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewaddres);
            editmyeventtxtviewaddres.Typeface = font;

            editmyeventeditexthelpTime        = FindViewById <EditText>(Resource.Id.editmyeventeditexthelpTime);
            editmyeventeditexthelpTime.Click += delegate
            {
                ValueToast = "بازه زمان برگزاری رویداد خود را مشخص کنید در صورتی که رویداد شما یک روزه است تاریخ شروع و پایان را یکسان انتخاب نمایید";
                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };


            editmyeventbuttotnTo          = FindViewById <Button>(Resource.Id.editmyeventbuttotnTo);
            editmyeventbuttotnTo.Typeface = font;

            string buttotnTo        = editmyeventbuttotnTo.Text;
            string myeventbuttotnTo = buttotnTo.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventbuttotnTo.Text = myeventbuttotnTo;



            editmyeventbuttotnTo.Click += delegate {
                a = 2;

                Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog p = new Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog();
                Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog d = Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog.NewInstance(this, p.SelectedDay.Year, p.SelectedDay.Month, p.SelectedDay.Day);
                d.Show(FragmentManager, "ebrahimeditfragmnetto");
            };
            editmyeventtxtviewto          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewto);
            editmyeventtxtviewto.Typeface = font;

            editmyeventbuttonFrom          = FindViewById <Button>(Resource.Id.editmyeventbuttonFrom);
            editmyeventbuttonFrom.Typeface = font;

            string buttonFrom        = editmyeventbuttonFrom.Text;
            string myeventbuttonFrom = buttonFrom.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventbuttonFrom.Text = myeventbuttonFrom;



            editmyeventbuttonFrom.Click += delegate {
                // a = 1;
                Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog p = new Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog();
                Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog d = Com.Mohamadamin.Persianmaterialdatetimepicker.Date.DatePickerDialog.NewInstance(this, p.SelectedDay.Year, p.SelectedDay.Month, p.SelectedDay.Day);
                d.Show(FragmentManager, "ebrahimeditfragmentdate");
            };
            editmyeventtxtviewfrom          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewfrom);
            editmyeventtxtviewfrom.Typeface = font;


            editmyeventtxtviewtime          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewtime);
            editmyeventtxtviewtime.Typeface = font;


            editmyeventbuttoncost        = FindViewById <Button>(Resource.Id.editmyeventbuttoncost);
            editmyeventbuttoncost.Click += delegate
            {
                PanelCostFragment Pcost = new PanelCostFragment(this);
                Pcost.Show(this.FragmentManager, "ebrahimeditfragmentcost");
                Pcost.OnGetCurrentcost += delegate(object sender, GetAllItemCheckd e)
                {
                    if (e.GetCost != string.Empty)
                    {
                        editmyeventbuttoncost.Text = e.GetCost;
                    }
                };
            };

            editmyeventtxtviewCaptionCost.Click += delegate {
                if (editmyeventtxtviewCaptionCost.Text == string.Empty)
                {
                    return;
                }
                else
                {
                    Entercost fdialog = new Entercost(this);
                    fdialog.Show(this.FragmentManager, "ebrahimfragment3");


                    fdialog.OnGetCurrentItem += delegate(object sende1r, GetCostItem getcost)
                    {
                        this.Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
                        int    valuenumber = Convert.ToInt32(getcost.GetCost);
                        string num         = valuenumber.ToString("N0");


                        string digitpersiannumber = num.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

                        editmyeventtxtviewCaptionCost.Text = digitpersiannumber + "تومان";

                        editmyeventtxtviewCaptionCost.SetTextColor(Android.Graphics.Color.ParseColor("#311b92"));
                        editmyeventtxtviewCaptionCost.Typeface = font;
                        editmyeventtxtviewCaptionCost.Gravity  = GravityFlags.Center;
                        editmyeventtxtviewCaptionCost.RequestFocus();
                    };
                }
            };

            editmyeventtxtviewcost          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewcost);
            editmyeventtxtviewcost.Typeface = font;

            editmyeventedittexthelptel        = FindViewById <EditText>(Resource.Id.enteteventedittexthelptel);
            editmyeventedittexthelptel.Click += delegate {
                ValueToast = ".شماره همراه جهت پاسخگویی به مخاطبین رویداد را درج نمایید.  پس از  ثبت رویداد در ایونتو پیامکی حاوی کد تایید به این شماره ارسال خواهد شد";
                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };
            EditText editmteventedittextHelpCaption;

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

            editmteventedittextHelpCaption        = FindViewById <EditText>(Resource.Id.editmteventedittextHelpCaption);
            editmteventedittextHelpCaption.Click += delegate {
                ValueToast = "تیتر اصلی رویداد خود را شفاف و جذاب درج کنید";

                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };


            editmyeventeditTextTel          = FindViewById <EditText>(Resource.Id.editmyeventeditTextTel);
            editmyeventeditTextTel.Typeface = font;

            string editTextTel    = editmyeventeditTextTel.Hint;
            string numberdigitTel = editTextTel.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventeditTextTel.Hint = numberdigitTel;

            string editTextTelText    = editmyeventeditTextTel.Text;
            string numberdigitTelText = editTextTelText.Replace("0", "٠").Replace("1", "١").Replace("2", "٢").Replace("3", "٣").Replace("4", "٤").Replace("5", "٥").Replace("6", "٦").Replace("7", "٧").Replace("8", "٨").Replace("9", "٩");

            editmyeventeditTextTel.Text = numberdigitTelText;



            editmyeventtxtviewtel          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewtel);
            editmyeventtxtviewtel.Typeface = font;

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

            editmyeventeditexthelpurl.Click += delegate {
                ValueToast = "در این قسمت میتوانید آدرس وب سایت یا شبکه های اجتماعی خود را درج نمایید";
                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };



            editmyeventeditTextUrl          = FindViewById <EditText>(Resource.Id.editmyeventeditTextUrl);
            editmyeventeditTextUrl.Typeface = font;

            editmyeventtxtviewurl          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewurl);
            editmyeventtxtviewurl.Typeface = font;


            editmyeventeditexthelpdescription        = FindViewById <EditText>(Resource.Id.editmyeventeditexthelpdescription);
            editmyeventeditexthelpdescription.Click += delegate {
                ValueToast = "اطلاعات تکمیلی رویداد خود از جمله شرایط هزینه را بطور کامل و شفاف ارایه دهید از درج هر گونه آدرس اینترنتی در این قسمت خودداری نمایید";
                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };


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


            FindViewById <EditText>(Resource.Id.editmyeventedttexthelpcamera).Click += delegate {
                ValueToast = "  تصاویر مرتیط با رویداد خود را بار گذاری کنید.تصاویر مناسب باعث بیشتر دیده شدن رویداد شما خواهد شد" + ".";

                Controller.Fragment.ShowWarning fdlg = new Fragment.ShowWarning(this, ValueToast);
                fdlg.Show(this.FragmentManager, "ebrahimfragment1");
            };
            //



            editmyeventeditTextdesc          = FindViewById <EditText>(Resource.Id.editmyeventeditTextdesc);
            editmyeventeditTextdesc.Typeface = font;

            editmyeventtxtviewdescription          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewdescription);
            editmyeventtxtviewdescription.Typeface = font;



            editmyeventbuttoncamera          = FindViewById <Button>(Resource.Id.editmyeventbuttoncamera);
            editmyeventbuttoncamera.Typeface = font;
            editmyeventbuttoncamera.Click   += delegate {
                var intentbrowserimage = new Intent();
                intentbrowserimage.SetAction(Intent.ActionGetContent);
                intentbrowserimage.SetType("image/*");
                StartActivityForResult(intentbrowserimage, 100);
            };

            editmyeventtxtviewphoto          = FindViewById <TextView>(Resource.Id.editmyeventtxtviewphoto);
            editmyeventtxtviewphoto.Typeface = font;


            editmyeventlinearLayoutcamera = FindViewById <LinearLayout>(Resource.Id.editmyeventlinearLayoutcamera);


            editmyeventimageviewSend        = FindViewById <ImageView>(Resource.Id.editmyeventimageviewSend);
            editmyeventimageviewSend.Click += delegate {
                if (editmyeventbuttoncaption.Text == "انتخاب شود")
                {
                    ValueToast = "موضوع رویداد اجباری می باشد";



                    editmyeventbuttoncaption.Error = ValueToast;



                    return;
                }
                if (editmyeventeditTextCaption.Text == string.Empty)
                {
                    ValueToast = "عنوان رویداد اجباری می باشد";

                    editmyeventeditTextCaption.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttonLocal.Text == "محله")
                {
                    ValueToast = "  انتخاب محله اجباری می باشد";

                    editmyeventbuttonLocal.Error = ValueToast;



                    return;
                }
                if (editmyeventeditTextAddres.Text == string.Empty)
                {
                    ValueToast = "آدرس رویداد اجباری می باشد";
                    //Drawable icon = Resources.GetDrawable(Resource.Drawable.warning32);
                    //if (icon != null)
                    //{
                    //    icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight);
                    //}
                    editmyeventeditTextAddres.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttonFrom.Text == "تاریخ شروع")
                {
                    ValueToast = "تاریخ شروع اجباری می باشد";

                    editmyeventbuttonFrom.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttotnTo.Text == "تاریخ پایان")
                {
                    ValueToast = "تاریخ پایان اجباری می باشد";

                    editmyeventbuttotnTo.Error = ValueToast;
                    return;
                }
                if (editmyeventeditTextTel.Text == "تلفن تماس")
                {
                    ValueToast = "تلفن تماس اجباری می باشد";

                    editmyeventeditTextTel.Error = ValueToast;
                    return;
                }
                if (editmyeventeditTextdesc.Text.Length > 400)
                {
                    ValueToast = "توضیحات باید کمتر از 400 کاراکتر باشد";
                    //Drawable icon = Resources.GetDrawable(Resource.Drawable.warning32);
                    //if (icon != null)
                    //{
                    //    icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight);
                    //}
                    editmyeventeditTextdesc.Error = ValueToast;
                    return;
                }



                else
                {
                    ValueToast = "تغییرات رویداد با موفقیت انجام شد";


                    Snackbar snackBar = Snackbar.Make(editmyeventbuttonSend, ValueToast, Snackbar.LengthIndefinite).SetAction("تایید", (v) =>
                    {
                        Finish();
                    });

                    //set  action button text color
                    snackBar.SetActionTextColor(Android.Graphics.Color.Green);

                    snackBar.Show();
                    //Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);


                    //alert.SetTitle("تایید رویداد");
                    //alert.SetIcon(Resource.Drawable.alert24);
                    //alert.SetMessage(ValueToast);
                    //alert.SetPositiveButton("باشه", (senderAlert, args) => {
                    //    Finish();

                    //});



                    //Dialog dialog = alert.Create();
                    //dialog.Show();
                }
            };
            editmyeventbuttonSend          = FindViewById <Button>(Resource.Id.editmyeventbuttonSend);
            editmyeventbuttonSend.Typeface = font;
            editmyeventbuttonSend.Click   += delegate {
                if (editmyeventbuttoncaption.Text == "انتخاب شود")
                {
                    ValueToast = "موضوع رویداد اجباری می باشد";



                    editmyeventbuttoncaption.Error = ValueToast;



                    return;
                }
                if (editmyeventeditTextCaption.Text == string.Empty)
                {
                    ValueToast = "عنوان رویداد اجباری می باشد";

                    editmyeventeditTextCaption.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttonLocal.Text == "محله")
                {
                    ValueToast = "  انتخاب محله اجباری می باشد";

                    editmyeventbuttonLocal.Error = ValueToast;



                    return;
                }
                if (editmyeventeditTextAddres.Text == string.Empty)
                {
                    ValueToast = "آدرس رویداد اجباری می باشد";
                    //Drawable icon = Resources.GetDrawable(Resource.Drawable.warning32);
                    //if (icon != null)
                    //{
                    //    icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight);
                    //}
                    editmyeventeditTextAddres.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttonFrom.Text == "تاریخ شروع")
                {
                    ValueToast = "تاریخ شروع اجباری می باشد";

                    editmyeventbuttonFrom.Error = ValueToast;
                    return;
                }
                if (editmyeventbuttotnTo.Text == "تاریخ پایان")
                {
                    ValueToast = "تاریخ پایان اجباری می باشد";

                    editmyeventbuttotnTo.Error = ValueToast;
                    return;
                }
                if (editmyeventeditTextTel.Text == "تلفن تماس")
                {
                    ValueToast = "تلفن تماس اجباری می باشد";

                    editmyeventeditTextTel.Error = ValueToast;
                    return;
                }
                if (editmyeventeditTextdesc.Text.Length > 400)
                {
                    ValueToast = "توضیحات باید کمتر از 400 کاراکتر باشد";
                    //Drawable icon = Resources.GetDrawable(Resource.Drawable.warning32);
                    //if (icon != null)
                    //{
                    //    icon.SetBounds(0, 0, icon.IntrinsicWidth, icon.IntrinsicHeight);
                    //}
                    editmyeventeditTextdesc.Error = ValueToast;
                    return;
                }



                else
                {
                    ValueToast = "تغییرات رویداد با موفقیت انجام شد";


                    Snackbar snackBar = Snackbar.Make(editmyeventbuttonSend, ValueToast, Snackbar.LengthIndefinite).SetAction("تایید", (v) =>
                    {
                        Finish();
                    });

                    //set  action button text color
                    snackBar.SetActionTextColor(Android.Graphics.Color.Green);

                    snackBar.Show();
                    //Android.App.AlertDialog.Builder alert = new Android.App.AlertDialog.Builder(this);


                    //alert.SetTitle("تایید رویداد");
                    //alert.SetIcon(Resource.Drawable.alert24);
                    //alert.SetMessage(ValueToast);
                    //alert.SetPositiveButton("باشه", (senderAlert, args) => {
                    //    Finish();

                    //});



                    //Dialog dialog = alert.Create();
                    //dialog.Show();
                }
            };

            editmyeventbuttondelete          = FindViewById <Button>(Resource.Id.editmyeventbuttondelete);
            editmyeventbuttondelete.Typeface = font;

            editmyeventbuttondelete.Text   = "صرف نظر";
            editmyeventbuttondelete.Click += delegate {
                Finish();
            };



            editmyeventimageviewclose        = FindViewById <ImageView>(Resource.Id.editmyeventimageviewclose);
            editmyeventimageviewclose.Click += delegate {
                Finish();
            };
        }
Exemplo n.º 27
0
 public override void OnCreate()
 {
     base.OnCreate();
     CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder().SetDefaultFontPath("fonts/BKamranBold.ttf").SetFontAttrId(2130771968).Build());
 }
Exemplo n.º 28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Tour_Detail);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/HelveticaNeueLight")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());

            string   path = "fonts/HelveticaNeueLight.ttf";
            Typeface tf   = Typeface.CreateFromAsset(Assets, path);

            recordExistsInWhishlist = false;

            fragmentManager    = this.FragmentManager;
            loginOrRegFragment = new Fragments.LoginOrRegistrationFragment();

            string text  = Intent.GetStringExtra("Title");
            string price = Intent.GetStringExtra("Price");

            imageUrl = Intent.GetStringExtra("ImageUrl");
            string    description_tour = Intent.GetStringExtra("Description");
            string    location         = Intent.GetStringExtra("Location");
            string    duration         = Intent.GetStringExtra("Duration");
            string    min_capacity     = Intent.GetStringExtra("Min_capacity");
            string    max_capacity     = Intent.GetStringExtra("Max_capacity");
            string    lat          = Intent.GetStringExtra("Lat");
            string    lng          = Intent.GetStringExtra("Lng");
            TextView  title        = FindViewById <TextView>(Resource.Id.Title);
            ImageView image        = FindViewById <ImageView>(Resource.Id.image);
            TextView  price_text   = FindViewById <TextView>(Resource.Id.price);
            TextView  descript     = FindViewById <TextView>(Resource.Id.description);
            TextView  location_val = FindViewById <TextView>(Resource.Id.location_value);
            TextView  duration_val = FindViewById <TextView>(Resource.Id.duration_value);
            TextView  capacity     = FindViewById <TextView>(Resource.Id.capacity_value);

            title.Typeface        = tf;
            price_text.Typeface   = tf;
            descript.Typeface     = tf;
            location_val.Typeface = tf;
            duration_val.Typeface = tf;
            capacity.Typeface     = tf;

            var scrollView = FindViewById <com.refractored.fab.ObservableScrollView>(Resource.Id.scrollViewDetail);
            var likeBn     = FindViewById <ImageButton>(Resource.Id.likeBn);

            likeBn.SetBackgroundResource(Resource.Drawable.likeWhite);
            likeBn.Click += delegate
            {
                if (MainActivity.isLogined == true)
                {
                    Toast.MakeText(this, "Your experience added to wishlist", ToastLength.Short).Show();
                    likeBn.SetBackgroundResource(Resource.Drawable.likeRed);

                    //creating wishlist table
                    dbr.CreateWishlistTable();

                    //declaring path for RETRIEVING DATA
                    string dbPath         = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormdemo.db3");
                    var    db             = new SQLiteConnection(dbPath);
                    var    wishlist_table = db.Table <Wishlist>();
                    //declaring path for RETRIEVING DATA ENDED
                    count_data_rows_in_users_table = 0;
                    //checking if the place of interest exists
                    foreach (var item in wishlist_table)
                    {
                        count_data_rows_in_users_table = 1;
                        if (item.name == title.Text && item.price == price)
                        {
                            recordExistsInWhishlist = true;
                            break;
                        }
                        else if (item.name != title.Text && item.price != price)
                        {
                            recordExistsInWhishlist = false;
                        }
                    }
                    //if table is empty we insert a record
                    if (count_data_rows_in_users_table == 0)
                    {
                        /*inserting
                         * IMAGE AS memStream.ToArray()
                         * and other fields to database*/
                        dbr.InsertWhishlistRecord(
                            title.Text, Tours_detail.current_experience_id, price, imageUrl, description_tour, location, duration, min_capacity, max_capacity, lat, lng, false);
                    }

                    if (recordExistsInWhishlist == false && count_data_rows_in_users_table != 0)
                    {
                        /*inserting
                         * IMAGE AS memStream.ToArray()
                         * and other fields to database*/
                        dbr.InsertWhishlistRecord(
                            title.Text, Tours_detail.current_experience_id, price, imageUrl, description_tour, location, duration, min_capacity, max_capacity, lat, lng, false);
                    }
                }
                else
                {
                    loginOrRegFragment.Show(fragmentManager, "fragmentManager");
                }
            };

            if (searchOrMovieAdapterIndicator == "MovieAdapter")
            {
                Glide.With(Application.Context)
                .Load(MovieAdapter.CurrentImageURL)//url)
                .Into(image);
            }
            else if (searchOrMovieAdapterIndicator == "SearchAdapter")
            {
                Glide.With(Application.Context)
                .Load(SearchAdapter.CurrentImageURL)//url)
                .Into(image);
            }


            title.Text        = text;
            price_text.Text   = "$" + price;
            descript.Text     = description_tour;
            location_val.Text = location;
            duration_val.Text = duration + " hours";
            capacity.Text     = min_capacity + " - " + max_capacity;

            ImageButton back = FindViewById <ImageButton>(Resource.Id.back);

            back.Click += delegate
            {
                OnBackPressed();
            };
            Button book = FindViewById <Button>(Resource.Id.bookbutton);

            book.Click += delegate
            {
                Tours_detail.image_url_static = imageUrl;
                StartActivity(typeof(MainActivity));
            };


            book.Typeface = tf;
            book.Click   += delegate
            {
                var activity = new Intent(this, typeof(SelectAvialability));
                //activity.PutExtra("Title", title.Text);
                titleStatic = title.Text;
                StartActivity(activity);
            };
        }
Exemplo n.º 29
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //Load Font
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("Fonts/HELR45W.ttf")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());
            SetContentView(Resource.Layout.Speech);
            _changeEngine = false;
            _tts          = TextToSpeechLib.Instance();
            _config       = Config.Instance();
            // Create your application here
            Button btn_engine = FindViewById <Button>(Resource.Id.item_1);
            Button btn_test   = FindViewById <Button>(Resource.Id.item_3);
            Button btn_ok     = FindViewById <Button>(Resource.Id.item_4);

            spn_eng  = FindViewById <Spinner>(Resource.Id.spinner_engine);
            spn_lang = FindViewById <Spinner>(Resource.Id.spinner_lang);

            btn_engine.Click += async delegate {
                await BtnEngineClick();

                //GetLangSTT();
            };

            btn_test.Click += async delegate {
                var locale = new Locale(_config.GetTtsLang());
                if (_changeEngine)
                {
                    await _tts.GetTTS(this);
                }
                _changeEngine = false;
                //await SampleText();

                /*TODO
                 * ADD funtion get messenger sample for test tts config
                 */

                _tts.SetLang(locale);
                _config.RunningSMSHandle = false;
                var k = await _tts.SpeakMessenger("this is messenger test");
            };

            spn_eng.ItemSelected += async(object sender, AdapterView.ItemSelectedEventArgs e) =>
            {
                Log.Info(TAG, "Select Engine");
                _changeEngine        = true;
                _selectEngine        = _listEngine[(int)e.Id];
                _listLangDisplayName = new List <string>();
                _listLangCode        = new List <string>();
                _listLangCollect     = await _tts.GetLanguageSupportByEngineAsync(this, _selectEngine);

                foreach (var it in _listLangCollect)
                {
                    tmp = it;
                    _listLangDisplayName.Add(it.DisplayName);
                    _listLangCode.Add(it.ISO3Language);
                }
                var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerDropDownItem, _listLangDisplayName);
                spn_lang.Adapter = adapter;
            };

            spn_lang.ItemSelected += (object sender, AdapterView.ItemSelectedEventArgs e) =>
            {
                _selectLang = _listLangCode[(int)e.Id];
            };
            btn_ok.Click += delegate {
                _config.SetTtsLang(_selectLang);
                _config.SetTtsEngine(_selectEngine);
                _config.UpdateConfig = true;
                _config.WriteConfig  = true;
            };
        }
Exemplo n.º 30
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //declaring mainLayout
            mainLayout = FindViewById <LinearLayout>(Resource.Id.mainLayout);
            CalligraphyConfig.InitDefault(new CalligraphyConfig.Builder()
                                          .SetDefaultFontPath("fonts/HelveticaNeueLight")
                                          .SetFontAttrId(Resource.Attribute.fontPath)
                                          .Build());
            //declaring mainLayout
            mainLayout = FindViewById <LinearLayout>(Resource.Id.mainLayout);

            recyclerView      = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator);
            TextView experienceTitleTV = FindViewById <TextView>(Resource.Id.experienceTitleTV);

            activityIndicator.Visibility = Android.Views.ViewStates.Gone;

            layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false);

            recyclerView.SetLayoutManager(layoutManager);

            string   path = "fonts/HelveticaNeueLight.ttf";
            Typeface tf   = Typeface.CreateFromAsset(Assets, path);

            experienceTitleTV.Typeface = tf;

            experienceTitleTV.Text = "Search results";

            //here we create DB
            dbr.CreateDB();
            //here we create table
            dbr.CreateUsersTable();

            //declaring path for RETRIEVING DATA
            string dbPath     = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "ormdemo.db3");
            var    db         = new SQLiteConnection(dbPath);
            var    user_table = db.Table <ORM.UsersDataTable>();

            MainActivity.isLogined = false;
            //clearing table
            foreach (var item in user_table)
            {
                MainActivity.isLogined = true;
            }

            //left drawer
            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar);
            SetSupportActionBar(mToolBar);
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            mLeftDrawer   = FindViewById <ListView>(Resource.Id.left_drawer);
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Profile"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Experiences"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Map"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Wishlist"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Shopping Cart"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("My Experiences"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("Help & Contact"));
            leftDrawerList.Add(new Resources.LeftMenuFolder.LeftMenu("About"));

            ListView leftDrawerLV = FindViewById <ListView>(Resource.Id.left_drawer);

            leftDrawerLV.Adapter = new Resources.LeftMenuFolder.LeftMenuAdapter(this, leftDrawerList);

            leftDrawerLV.ItemClick += LeftDrawerLV_ItemClick;

            //button to open/close Left Drawer
            FindViewById <Button>(Resource.Id.leftDrawerBN).Click += delegate
            {
                if (mDrawerLayout.IsDrawerOpen(mLeftDrawer))
                {
                    mDrawerLayout.CloseDrawer(mLeftDrawer);
                }
                else
                {
                    mDrawerLayout.OpenDrawer(mLeftDrawer);
                }
            };
            //left drawer ENDED

            //button to show context menu
            FindViewById <Button>(Resource.Id.contextMenuBn).Click += MainActivity_Click;
            //button to show context menu ENDED

            var responseSearch = JsonConvert.DeserializeObject <RootObjectSearchByWord>(Fragments.SearchFragment.content);

            //THIS CONSTRUCTION IS TO DISPLAY ITEMS FROM REVERSE
            List <Experience> tmpReverseList = new List <Experience>();

            for (int i = responseSearch.experiences.Count - 1; i >= 0; i--)
            {
                tmpReverseList.Add(new Experience
                {
                    id                 = responseSearch.experiences[i].id,
                    title              = responseSearch.experiences[i].title,
                    description        = responseSearch.experiences[i].description,
                    owner_id           = responseSearch.experiences[i].owner_id,
                    price              = responseSearch.experiences[i].price,
                    min_capacity       = responseSearch.experiences[i].min_capacity,
                    max_capacity       = responseSearch.experiences[i].max_capacity,
                    location           = responseSearch.experiences[i].location,
                    created_at         = responseSearch.experiences[i].created_at,
                    updated_at         = responseSearch.experiences[i].updated_at,
                    price_rate         = responseSearch.experiences[i].price_rate,
                    duration           = responseSearch.experiences[i].duration,
                    duration_type      = responseSearch.experiences[i].duration_type,
                    video_url          = responseSearch.experiences[i].video_url,
                    alien_video_id     = responseSearch.experiences[i].alien_video_id,
                    video_source       = responseSearch.experiences[i].video_source,
                    has_cover          = responseSearch.experiences[i].has_cover,
                    status             = responseSearch.experiences[i].status,
                    publish_date       = responseSearch.experiences[i].publish_date,
                    meet_place_address = responseSearch.experiences[i].meet_place_address,
                    meet_place_city    = responseSearch.experiences[i].meet_place_city,
                    meet_place_country = responseSearch.experiences[i].meet_place_country,
                    nearby_landmarks   = responseSearch.experiences[i].nearby_landmarks,
                    must_have          = responseSearch.experiences[i].must_have,
                    instructions       = responseSearch.experiences[i].instructions,
                    approved           = responseSearch.experiences[i].approved,
                    approved_by        = responseSearch.experiences[i].approved_by,
                    approve_date       = responseSearch.experiences[i].approve_date,
                    lat                = responseSearch.experiences[i].lat,
                    lng                = responseSearch.experiences[i].lng,
                    cover_image        = responseSearch.experiences[i].cover_image
                });
            }
            var searchAdapter = new SearchAdapter(tmpReverseList, this);

            //THIS CONSTRUCTION IS TO DISPLAY ITEMS FROM REVERSE ENDED

            recyclerView.SetAdapter(searchAdapter);

            fragmentManager    = this.FragmentManager;
            loginOrRegFragment = new Fragments.LoginOrRegistrationFragment();
            searchFragment     = new Fragments.SearchFragment();
            loadingMapFragment = new Fragments.LoadingMyExperiencesAndGettingWishlistFrom_DB_ForMapFragment();

            FindViewById <Button>(Resource.Id.searchBn).Click += delegate
            {
                searchFragment.Show(fragmentManager, "fragmentManager");
            };

            mainLayout.SetBackgroundResource(Resource.Drawable.NoTours);
        }