private void GetCompanyInfo() { ISharedPreferences app = Application.Context.GetSharedPreferences("AppData", FileCreationMode.Private); var company = app.GetString("Company", string.Empty); var location = app.GetString("Location", string.Empty); var phone1 = app.GetString("Phone1", string.Empty); var phone2 = app.GetString("Phone2", string.Empty); var email = app.GetString("Email", string.Empty); var thumbnail = app.GetString("Thumbnail", string.Empty); mCompany.Text = company; mLocation.Text = location; mPhoneNo1.Text = phone1; mPhoneNo2.Text = phone2; mEmail.Text = email; Glide.With(this).Load(thumbnail) .Apply(RequestOptions.OverrideOf(600, 600).FitCenter()) .Apply(RequestOptions.PlaceholderOf(Resource.Drawable.placeholder).FitCenter()) .Transition(DrawableTransitionOptions.WithCrossFade()) .Into(mImageThumb); mFab.Click += (o, s) => { CallUs(phone1, phone2); }; }
public void GetDataBind() { products = new Products(); products.SellerID = Intent.GetStringExtra("SellerID"); products.ProductID = Intent.GetStringExtra("ProductID"); products.Product = Intent.GetStringExtra("Product"); products.Price = Intent.GetDoubleExtra("Price", 0); products.Buy_Price = Intent.GetDoubleExtra("Buy_Price", 0); products.Offer_Price = Intent.GetDoubleExtra("Offer", 0); products.OfferEnds = Intent.GetStringExtra("EndDate"); products.Condition = Intent.GetStringExtra("Condition"); products.Thumbnail_1 = Intent.GetStringExtra("Thumbnail_1"); products.Thumbnail_2 = Intent.GetStringExtra("Thumbnail_2"); products.Thumbnail_3 = Intent.GetStringExtra("Thumbnail_3"); products.Sizes = Intent.GetStringExtra("Sizes"); products.Description = Intent.GetStringExtra("Description"); ImageView mImg = FindViewById <ImageView>(Resource.Id.productSlider); //TextView mCost = FindViewById<TextView>(Resource.Id.txtPrice); //var mOffPrice = FindViewById<TextView>(Resource.Id.txtOff); //mProduct.Text = products.Product; if (products.Offer_Price > 0 && ValidateOffer(products.OfferEnds)) { //mCost.Text = "TSh " + ThousandsSeparator(products.Offer_Price.ToString()); //mOffPrice.Text = "TSh " + ThousandsSeparator(products.Price.ToString()); //mOffPrice.PaintFlags = (mOffPrice.PaintFlags | PaintFlags.StrikeThruText); //mOffPrice.Visibility = ViewStates.Visible; } else { //mTotalPrice.Text = "TSh " + ThousandsSeparator(products.Price.ToString()); //mOffPrice.Visibility = ViewStates.Gone; //mCost.Text = "TSh " + ThousandsSeparator(products.Price.ToString()); } Glide.With(this).Load(Intent.GetStringExtra("Thumbnail_1")).Apply(RequestOptions.OverrideOf(500, 500).CenterInside()).Into(mImg); }
/// <summary> /// Method which binds data from models to views based on position /// /// </summary> /// <param name="holder">Custom ViewHolder</param> /// <param name="position">Position on which recyclerview is</param> public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { LightModel lightModel = this.lightModelList[position]; LightItemViewHolder lightItemViewHolder = (LightItemViewHolder)holder; lightItemViewHolder.textViewLightName.Text = lightModel.Name; // Set main layout click listener and delegate it to the event. lightItemViewHolder.linearLayoutLampMain.Click += (sender, e) => OnItemClick(this, this.lightModelList[position]); // Change the lamp icon based on it's status (if it's enabled or not). Glide.With(this.context).Load(lightModel.Status ? Resource.Mipmap.ic_lamp_on : Resource.Mipmap.ic_lamp_off).Apply(RequestOptions.OverrideOf(60, 60)).Into(lightItemViewHolder.imageViewLightStatus); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment View view = inflater.Inflate(Resource.Layout.order_done, container, false); Button mFAQ = view.FindViewById <Button>(Resource.Id.btnfaq); Button mInfo = view.FindViewById <Button>(Resource.Id.btnInfo); ImageView mPayInfo = view.FindViewById <ImageView>(Resource.Id.imageView); Button mMore = view.FindViewById <Button>(Resource.Id.btnReadMore); mMore.Click += MMore_Click; mPayInfo.SetScaleType(ImageView.ScaleType.FitXy); Glide.With(this).Load(Thumbnail) .Apply(RequestOptions.OverrideOf(400, 400).FitCenter()) .Apply(RequestOptions.PlaceholderOf(Resource.Drawable.placeholder).FitCenter()) .Transition(DrawableTransitionOptions.WithCrossFade()) .Into(mPayInfo); mFAQ.Click += (o, s) => { FAQ(); }; mInfo.Click += (o, s) => { Information(); }; CircleImageView mPesa = view.FindViewById <CircleImageView>(Resource.Id.mpesa); CircleImageView mTigoPesa = view.FindViewById <CircleImageView>(Resource.Id.tigopesa); CircleImageView mHalopesa = view.FindViewById <CircleImageView>(Resource.Id.halopesa); CircleImageView mAirtel = view.FindViewById <CircleImageView>(Resource.Id.airtelmoney); CircleImageView mTpesa = view.FindViewById <CircleImageView>(Resource.Id.tpesa); CircleImageView mZantel = view.FindViewById <CircleImageView>(Resource.Id.zantel); Glide.With(this).Load(Resource.Drawable.mpesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mPesa); Glide.With(this).Load(Resource.Drawable.tigopesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mTigoPesa); Glide.With(this).Load(Resource.Drawable.halopesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mHalopesa); Glide.With(this).Load(Resource.Drawable.airtelmoney).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mAirtel); Glide.With(this).Load(Resource.Drawable.tpesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mTpesa); Glide.With(this).Load(Resource.Drawable.easymoney).Apply(RequestOptions.OverrideOf(90, 150).CenterInside()).Into(mZantel); mPesa.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; mTigoPesa.Click += (o, s) => { string telephone = "*150*011#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; mHalopesa.Click += (o, s) => { string telephone = "*150*88#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; mAirtel.Click += (o, s) => { string telephone = "*150*60#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; mTpesa.Click += (o, s) => { string telephone = "*150*71#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; mZantel.Click += (o, s) => { string telephone = "*150*02#"; var phone = new Intent(Intent.ActionCall, Android.Net.Uri.Parse(string.Format("tel:{0}", Android.Net.Uri.Encode(telephone)))); StartActivity(phone); }; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { ISharedPreferences app = Application.Context.GetSharedPreferences("AppData", FileCreationMode.Private); _lang = app.GetString("Language", "en"); Thumbnail = app.GetString("Payment", string.Empty); ChangeLanguage(_lang); base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.order_done); Button mFAQ = FindViewById <Button>(Resource.Id.btnfaq); Button mInfo = FindViewById <Button>(Resource.Id.btnInfo); ImageView mPayInfo = FindViewById <ImageView>(Resource.Id.imageView); Button mMore = FindViewById <Button>(Resource.Id.btnReadMore); mMore.Click += MMore_Click; Glide.With(this).Load(Thumbnail) .Apply(RequestOptions.OverrideOf(400, 400).FitCenter()) .Apply(RequestOptions.PlaceholderOf(Resource.Drawable.placeholder).FitCenter()) .Transition(DrawableTransitionOptions.WithCrossFade()) .Into(mPayInfo); mFAQ.Click += (o, s) => { FAQ(); }; mInfo.Click += (o, s) => { Information(); }; CircleImageView mPesa = FindViewById <CircleImageView>(Resource.Id.mpesa); CircleImageView mTigoPesa = FindViewById <CircleImageView>(Resource.Id.tigopesa); CircleImageView mHalopesa = FindViewById <CircleImageView>(Resource.Id.halopesa); CircleImageView mAirtel = FindViewById <CircleImageView>(Resource.Id.airtelmoney); CircleImageView mTpesa = FindViewById <CircleImageView>(Resource.Id.tpesa); CircleImageView mZantel = FindViewById <CircleImageView>(Resource.Id.zantel); Glide.With(this).Load(Resource.Drawable.mpesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mPesa); Glide.With(this).Load(Resource.Drawable.tigopesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mTigoPesa); Glide.With(this).Load(Resource.Drawable.halopesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mHalopesa); Glide.With(this).Load(Resource.Drawable.airtelmoney).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mAirtel); Glide.With(this).Load(Resource.Drawable.tpesa).Apply(RequestOptions.OverrideOf(90, 90).CenterInside()).Into(mTpesa); Glide.With(this).Load(Resource.Drawable.easymoney).Apply(RequestOptions.OverrideOf(90, 150).CenterInside()).Into(mZantel); mPesa.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; mTigoPesa.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; mHalopesa.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; mAirtel.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; mTpesa.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; mZantel.Click += (o, s) => { string telephone = "*150*00#"; var phone = new Intent(Intent.ActionView, Android.Net.Uri.Parse(string.Format("tel:{0}", telephone))); StartActivity(phone); }; }