public FollowersViewHolder(View itemView, Action <UserFriend> followAction, Action <UserFriend> userAction, Context context) : base(itemView) { _context = context; _friendAvatar = itemView.FindViewById <CircleImageView>(Resource.Id.friend_avatar); _friendLogin = itemView.FindViewById <TextView>(Resource.Id.username); _friendName = itemView.FindViewById <TextView>(Resource.Id.name); _sbdAmount = itemView.FindViewById <TextView>(Resource.Id.sbd_amount); _followButton = itemView.FindViewById <Button>(Resource.Id.follow_button); _loader = itemView.FindViewById <ProgressBar>(Resource.Id.loading_spinner); _friendLogin.Typeface = Style.Semibold; _friendName.Typeface = Style.Regular; _sbdAmount.Typeface = Style.Regular; _followAction = followAction; _userAction = userAction; _followButton.Click += Follow_Click; _friendName.Click += User_Click; _friendLogin.Click += User_Click; _friendAvatar.Click += User_Click; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_main_registration, null); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.SetVmPolicy(builder.Build()); input_fname = root.FindViewById <EditText>(Resource.Id.input_fname); input_lname = root.FindViewById <EditText>(Resource.Id.input_lname); input_userpassword = root.FindViewById <EditText>(Resource.Id.input_userpassword); input_userconfpassword = root.FindViewById <EditText>(Resource.Id.input_userconfpassword); input_useremail = root.FindViewById <EditText>(Resource.Id.input_useremail); btn_rgster = root.FindViewById <Button>(Resource.Id.btn_rgster); btn_rgster.Click += (sndr, argus) => Register_Clicked(sndr, argus, this.Activity); if (Build.VERSION.SdkInt >= Build.VERSION_CODES.M) { if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this.Activity, Manifest.Permission.Camera) != (int)Permission.Granted || Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this.Activity, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) { Android.Support.V4.App.ActivityCompat.RequestPermissions(this.Activity, new string[] { Manifest.Permission.Camera, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage }, 54); /*FragmentManager.FindFragmentById(Resource.Layout.fragment_content_addproduct).RequestPermissions(new string[] * { * Manifest.Permission.Camera, Manifest.Permission.WriteExternalStorage, * Manifest.Permission.ReadExternalStorage * }, 54);*/ } } if (IsThereAnAppToTakePictures()) { CreateDirectoryForPictures(); profile_image = root.FindViewById <CircleImageView>(Resource.Id.profile_image); iv_camera = root.FindViewById <CircleImageView>(Resource.Id.iv_camera); iv_camera.Click += (sndr, argus) => Camera_Clicked(sndr, argus, this.Activity); } return(root); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Manhole1); Manhole1_radiobtn1 = (RadioButton)FindViewById(Resource.Id.Manhole1_radiobtn1); Manhole1_radiobtn1.Click += Manhole1_radiobtn1_Click; Manhole1_radiobtn2 = (RadioButton)FindViewById(Resource.Id.Manhole1_radiobtn2); Manhole1_radiobtn2.Click += Manhole1_radiobtn2_Click; Manhole1_radio1 = (ImageView)FindViewById(Resource.Id.iconIssue1); Manhole1_radio1.Click += Manhole1_radio1_Click; Manhole1_radio2 = (ImageView)FindViewById(Resource.Id.iconIssue2); Manhole1_radio2.Click += Manhole1_radio2_Click; back = (ImageView)FindViewById(Resource.Id.btnback); back.Click += Back_Click; circleImageView_Manhole1 = (CircleImageView)FindViewById(Resource.Id.circleImageView_Manhole1); Manhole1_next = (ImageView)FindViewById(Resource.Id.Manhole1_btnnext); Manhole1_next.Click += Manhole1_next_Click; Manhole1_tvusername = (TextView)FindViewById(Resource.Id.Manhole1_tvusername); Manhole1_tv = (TextView)FindViewById(Resource.Id.Manhole1_tv); tev1 = (TextView)FindViewById(Resource.Id.tev1); //runtime py profile change krna or name change krna //start char[] arr = Control.UserInfoHolder.User_name.ToCharArray(); Manhole1_tvusername.SetText(arr, 0, arr.Length); byte[] arra = Convert.FromBase64String(Control.UserInfoHolder.Profile_pic); ImageView img2 = FindViewById <ImageView>(Resource.Id.circleImageView_Manhole1); Android.Graphics.Bitmap bitmapp = BitmapFactory.DecodeByteArray(arra, 0, arra.Length); img2.SetImageBitmap(bitmapp); //end }
public override View GetView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.From(_context).Inflate(Resource.Layout.MomentView, null, false); } this.position = position; date = convertView.FindViewById <TextView>(Resource.Id.date); date.Text = "Дата: " + _moments[position].Date.ToString(); title = convertView.FindViewById <TextView>(Resource.Id.title); title.Text = "Заглавие: " + _moments[position].Title; description = convertView.FindViewById <TextView>(Resource.Id.description); description.Text = "Описание: " + _moments[position].Description; img = convertView.FindViewById <CircleImageView>(Resource.Id.img); img.SetImageBitmap(BitmapFactory.DecodeByteArray(_moments[position].Picture, 0, _moments[position].Picture.Length)); return(convertView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.Inflate(Resource.Layout.activity_main, container, false); refresh = rootView.FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh); TimeContainer = rootView.FindViewById <ConstraintLayout>(Resource.Id.constraintLayout); Hours = rootView.FindViewById <TextView>(Resource.Id.Hours); Minutes = rootView.FindViewById <TextView>(Resource.Id.Minutes); HoursText = rootView.FindViewById <TextView>(Resource.Id.HoursText); MinutesText = rootView.FindViewById <TextView>(Resource.Id.MinutesText); TimeContainer.Click += TimeContainer_Click; ActiveMemebersContainer = rootView.FindViewById <ConstraintLayout>(Resource.Id.constraintLayout3); FirstImg = rootView.FindViewById <CircleImageView>(Resource.Id.imageView9); SecondImg = rootView.FindViewById <CircleImageView>(Resource.Id.imageView10); ThirdImg = rootView.FindViewById <CircleImageView>(Resource.Id.imageView11); AcitiveMembersText = rootView.FindViewById <TextView>(Resource.Id.textView12); mRecyclerView = rootView.FindViewById <RecyclerView>(Resource.Id.RCMembers); mData = new MyList <MemberModel>(); mLayoutManager = new LinearLayoutManager(Activity); mRecyclerView.SetLayoutManager(mLayoutManager); mAdapter = new RecyclerAdapter(mData, mRecyclerView); mData.Adapter = mAdapter; mRecyclerView.SetAdapter(mAdapter); mData.Add(null); Task.Run(() => UpdateMemebers()); Task.Run(() => ShowActiveMembers()); refresh.Refresh += Refresh_Refresh; return(rootView); }
//CircleImageView userimage; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your fragment here SetContentView(Resource.Layout.Changeno); back = (ImageView)FindViewById(Resource.Id.imgbackgo); back.Click += Back_Click; edtCurrentPass = (EditText)FindViewById(Resource.Id.edtCurrentPass); edtNewPhno = (EditText)FindViewById(Resource.Id.edtNewMob); submit = (ImageView)FindViewById(Resource.Id.imgsubmitt); submit.Click += Submit_Click; //UserName and Profile Pic Username = (TextView)FindViewById(Resource.Id.username); //User Name user_image = (CircleImageView)FindViewById(Resource.Id.usericon); //user profile pic //Fetching user profile and name from UserInfoHolder Username.Text = Control.UserInfoHolder.User_name; byte[] arr = Convert.FromBase64String(Control.UserInfoHolder.Profile_pic); Bitmap UserImageBitmap = BitmapFactory.DecodeByteArray(arr, 0, arr.Length); user_image.SetImageBitmap(UserImageBitmap); // }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.PaylasimSayisiSecDialogFragment, container, false); //view.FindViewById<RelativeLayout>(Resource.Id.rootView).ClipToOutline = true; DevamEt = view.FindViewById <Button>(Resource.Id.button1); DevamEt.Click += DevamEt_Click; PlusCard = view.FindViewById <CardView>(Resource.Id.card_view1); GoldCard = view.FindViewById <CardView>(Resource.Id.card_view2); PlatinumCard = view.FindViewById <CardView>(Resource.Id.card_view3); IsletmeLogo = view.FindViewById <CircleImageView>(Resource.Id.profile_image); PlusCard.Tag = 0; GoldCard.Tag = 1; PlatinumCard.Tag = 2; PlusCard.Click += PlusCard_Click; GoldCard.Click += PlusCard_Click; PlatinumCard.Click += PlusCard_Click; MarginleriSifirla(1); var CompanyInfo = DataBase.COMPANY_INFORMATION_GETIR()[0]; new SetImageHelper().SetImage(this.Activity, IsletmeLogo, CompanyInfo.logoPath); //DataBase.YUKLENECEK_SABLON_TEMIZLE(); if (ContextCompat.CheckSelfPermission(this.Activity, Android.Manifest.Permission.ReadExternalStorage) == Permission.Granted && ContextCompat.CheckSelfPermission(this.Activity, Android.Manifest.Permission.WriteExternalStorage) == Permission.Granted && ContextCompat.CheckSelfPermission(this.Activity, Android.Manifest.Permission.Camera) == Permission.Granted) { var DevamEdenSablonVarmi = DataBase.YUKLENECEK_SABLON_GETIR(); if (DevamEdenSablonVarmi.Count > 0) { YuklenecekMediaCountHelper.Countt = DevamEdenSablonVarmi[0].maxMediaCount; this.Activity.StartActivity(typeof(YeniSablonOlusturBaseActivity)); } } return(view); }
public LastMessages_AdapterViewHolder(View itemView, Action <LastMessages_AdapterClickEventArgs> clickListener, Action <LastMessages_AdapterClickEventArgs> longClickListener) : base(itemView) { try { MainView = itemView; //Get values RelativeLayout_main = (RelativeLayout)MainView.FindViewById(Resource.Id.main); checkicon = (AppCompatTextView)MainView.FindViewById(Resource.Id.IconCheckRead); LastMessagesIcon = (AppCompatTextView)MainView.FindViewById(Resource.Id.LastMessages_icon); Txt_Username = (TextView)MainView.FindViewById(Resource.Id.Txt_Username); Txt_LastMessages = (TextView)MainView.FindViewById(Resource.Id.Txt_LastMessages); Txt_timestamp = (TextView)MainView.FindViewById(Resource.Id.Txt_timestamp); ImageAvatar = (ImageView)MainView.FindViewById(Resource.Id.ImageAvatar); ImageLastseen = (CircleImageView)MainView.FindViewById(Resource.Id.ImageLastseen); //Create an Event itemView.Click += (sender, e) => clickListener(new LastMessages_AdapterClickEventArgs { View = itemView, Position = AdapterPosition }); itemView.LongClick += (sender, e) => longClickListener(new LastMessages_AdapterClickEventArgs { View = itemView, Position = AdapterPosition }); //Dont Remove this code ##### FontController.SetFont(Txt_Username, 1); FontController.SetFont(Txt_LastMessages, 3); //##### ImageCacheLoader.LoadImage("no_profile_image.png", ImageAvatar, false, true); } catch (Exception e) { Console.WriteLine(e + "Error"); } }
//CircleImageView userimage; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Ads); // Create your fragment here back = (ImageView)FindViewById(Resource.Id.imgbackgo); back.Click += Back_Click; Username = (TextView)FindViewById(Resource.Id.username); userimage = (CircleImageView)FindViewById(Resource.Id.usericon); crtNewAd = (ImageView)FindViewById(Resource.Id.imgcrtnewads); crtNewAd.Click += CrtNewAd_Click; manageAds = (ImageView)FindViewById(Resource.Id.imgManageAds); manageAds.Click += ManageAds_Click; //runtime py name and user image change start char[] arr = UserInfoHolder.User_name.ToCharArray(); byte[] arra = Convert.FromBase64String(Control.UserInfoHolder.Profile_pic); Android.Graphics.Bitmap bitmapp = BitmapFactory.DecodeByteArray(arra, 0, arra.Length); userimage.SetImageBitmap(bitmapp); Username.SetText(arr, 0, arr.Length); //end }
private void InitUI() { FindViewById <Button>(Resource.Id.btn_closeit).SetOnClickListener(this); FindViewById <Button>(Resource.Id.btn_save).SetOnClickListener(this); ciwProfileImage = FindViewById <CircleImageView>(Resource.Id.profile_image); tvName = FindViewById <EditText>(Resource.Id.et_name); tvBirthDate = FindViewById <TextView>(Resource.Id.tv_birthdate); tvBirthDate.SetOnClickListener(this); etName = FindViewById <EditText>(Resource.Id.et_name); btnUploadImage = FindViewById <AppCompatButton>(Resource.Id.btn_upload); btnUploadImage.SetOnClickListener(this); btnLabelDiseases = FindViewById <TextView>(Resource.Id.tv_labelDiseases); btnChangeDiseases = FindViewById <AppCompatButton>(Resource.Id.btn_diseases); btnChangeDiseases.SetOnClickListener(this); const string permission = Manifest.Permission.ReadPhoneState; if (CheckSelfPermission(permission) != (int)Permission.Granted) { RequestPermissions(_permissionsArray, 0); } isSavedClick = false; }
private void InitComponent(View view) { try { MRecycler = (RecyclerView)view.FindViewById(Resource.Id.recyler); EmptyStateLayout = view.FindViewById <ViewStub>(Resource.Id.viewStub); SwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.swipeRefreshLayout); SwipeRefreshLayout.SetColorSchemeResources(Android.Resource.Color.HoloBlueLight, Android.Resource.Color.HoloGreenLight, Android.Resource.Color.HoloOrangeLight, Android.Resource.Color.HoloRedLight); SwipeRefreshLayout.Refreshing = true; SwipeRefreshLayout.Enabled = true; SwipeRefreshLayout.SetProgressBackgroundColorSchemeColor(AppSettings.SetTabDarkTheme ? Color.ParseColor("#424242") : Color.ParseColor("#f7f7f7")); SwipeRefreshLayout.Refresh += SwipeRefreshLayoutOnRefresh; LayoutGroupRequest = (RelativeLayout)view.FindViewById(Resource.Id.layout_friend_Request); TitGroupRequest = (TextView)view.FindViewById(Resource.Id.tv_Friends_connection); DesGroupRequest = (TextView)view.FindViewById(Resource.Id.tv_Friends); TitGroupRequest.Text = GetText(Resource.String.Lbl_GroupRequest); DesGroupRequest.Text = GetText(Resource.String.Lbl_ViewAllInviteRequest); GroupRequestImage1 = view.FindViewById <CircleImageView>(Resource.Id.image_page_1); GroupRequestImage2 = view.FindViewById <CircleImageView>(Resource.Id.image_page_2); GroupRequestImage3 = view.FindViewById <CircleImageView>(Resource.Id.image_page_3); LayoutGroupRequest.Click += LayoutGroupRequestOnClick; LayoutGroupRequest.Visibility = ViewStates.Gone; LinearLayout adContainer = view.FindViewById <LinearLayout>(Resource.Id.bannerContainer); BannerAd = AdsFacebook.InitAdView(Activity, adContainer); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = base.OnCreateView(inflater, container, savedInstanceState); var contactsFab = view.FindViewById <FloatingActionButton>(Resource.Id.goMessage); contactsFab.Click += ShowContactDialog; avatarView = view.FindViewById <CircleImageView>(Resource.Id.profileAvatar); if (ViewModel.User != null) { // if viewmodel's property has been updated before the bind // can be applied then update from viewmodel's property UpdateAvatar(ViewModel.User?.avatar); } else { var set = this.CreateBindingSet <OfferDetailsFragment, OfferDetailsViewModel>(); set.Bind(this).For(p => p.User).To(vm => vm.User); set.Apply(); } // screen size var display = Activity.WindowManager.DefaultDisplay; var size = new Point(); display.GetSize(size); var height = size.Y; var appbar = view.FindViewById <AppBarLayout>(Resource.Id.appbar); CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams)appbar.LayoutParameters; lp.Height = (int)(height / 2.5); return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); var view = inflater.Inflate(Resource.Layout.add_collegue_fragment, container, false); _editName = view.FindViewById <EditText>(Resource.Id.editName); _editDescription = view.FindViewById <EditText>(Resource.Id.editDescription); _saveBtn = view.FindViewById <Button>(Resource.Id.saveBtn); _captureBtn = view.FindViewById <Button>(Resource.Id.captureBtn); _position = view.FindViewById <EditText>(Resource.Id.editPosition); //Add _saveBtn.Click += _btnAdd_Click; _img = view.FindViewById <CircleImageView>(Resource.Id.capturedImg); //capture _captureBtn.Click += BtnCapture_Click; return(view); }
private void InitComponent() { try { MainView = FindViewById <CoordinatorLayout>(Resource.Id.main_content); SecondReactionButton = FindViewById <TextView>(Resource.Id.SecondReactionText); MainSectionButton = FindViewById <LinearLayout>(Resource.Id.linerSecondReaction); LikeButton = FindViewById <ReactButton>(Resource.Id.ReactButton); CommentCount = FindViewById <TextView>(Resource.Id.Commentcount); LikeCount = FindViewById <TextView>(Resource.Id.Likecount); TimeText = FindViewById <AppCompatTextView>(Resource.Id.time_text); PrivacyPostIcon = FindViewById <AppCompatTextView>(Resource.Id.privacyPost); MoreIcon = FindViewById <ImageView>(Resource.Id.moreicon); Username = FindViewById <TextViewWithImages>(Resource.Id.username); UserAvatar = FindViewById <CircleImageView>(Resource.Id.userAvatar); Description = FindViewById <SuperTextView>(Resource.Id.description); PostExtrasLayout = FindViewById <RelativeLayout>(Resource.Id.postExtras); ShareLinearLayout = FindViewById <LinearLayout>(Resource.Id.ShareLinearLayout); CommentLinearLayout = FindViewById <LinearLayout>(Resource.Id.CommentLinearLayout); SecondReactionLinearLayout = FindViewById <LinearLayout>(Resource.Id.SecondReactionLinearLayout); if (SecondReactionButton != null) { if (AppSettings.PostButton == PostButtonSystem.ReactionDefault || AppSettings.PostButton == PostButtonSystem.ReactionSubShine || AppSettings.PostButton == PostButtonSystem.Like) { MainSectionButton.WeightSum = 3; SecondReactionLinearLayout.Visibility = ViewStates.Gone; } else if (AppSettings.PostButton == PostButtonSystem.Wonder) { MainSectionButton.WeightSum = 4; SecondReactionLinearLayout.Visibility = ViewStates.Visible; SecondReactionButton.SetCompoundDrawablesWithIntrinsicBounds(Resource.Drawable.icon_post_wonder_vector, 0, 0, 0); SecondReactionButton.Text = Application.Context.GetText(Resource.String.Btn_Wonder); } else if (AppSettings.PostButton == PostButtonSystem.DisLike) { MainSectionButton.WeightSum = 4; SecondReactionLinearLayout.Visibility = ViewStates.Visible; SecondReactionButton.SetCompoundDrawablesWithIntrinsicBounds(Resource.Drawable.ic_action_dislike, 0, 0, 0); SecondReactionButton.Text = Application.Context.GetText(Resource.String.Btn_Dislike); } } LikeButton.SetTextColor(Color.White); //if (LikeButton?.GetCurrentReaction()?.GetReactType() == ReactConstants.Default) //{ // LikeButton.CompoundDrawableTintList = ColorStateList.ValueOf(Color.White); //} YouTubePlayerView youTubeView = new YouTubePlayerView(this); var youtubeView = FindViewById <FrameLayout>(Resource.Id.root); youtubeView.RemoveAllViews(); youtubeView.AddView(youTubeView); youTubeView.Initialize(AppSettings.YoutubeKey, this); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void InitFirstViewUi(View v) { _btnUpload = v.FindViewById <Button>(Resource.Id.btnUpload); _profileImage = v.FindViewById <CircleImageView>(Resource.Id.ProfileImage); }
public void UpdateData(Post post, Context context) { Post = post; if (post.NetLikes > 0) { _likes.Visibility = ViewStates.Visible; _likes.Text = AppSettings.LocalizationManager.GetText(Post.NetLikes == 1 ? LocalizationKeys.Like : LocalizationKeys.Likes, post.NetLikes); } else { _likes.Visibility = ViewStates.Gone; } if (post.NetFlags > 0) { _flags.Visibility = _flagsIcon.Visibility = ViewStates.Visible; _flags.Text = $"{post.NetFlags}"; } else { _flags.Visibility = _flagsIcon.Visibility = ViewStates.Gone; } if (post.TotalPayoutReward > 0) { _cost.Visibility = ViewStates.Visible; _cost.Text = BasePresenter.ToFormatedCurrencyString(post.TotalPayoutReward); } else { _cost.Visibility = ViewStates.Gone; } _time.Text = post.Created.ToPostTime(); _author.Text = post.Author; if (!string.IsNullOrEmpty(Post.Avatar)) { Picasso.With(Context).Load(Post.Avatar).Placeholder(Resource.Drawable.ic_holder).Resize(300, 0).Priority(Picasso.Priority.Low).Into(_avatar, null, OnPicassoError); } else { Picasso.With(context).Load(Resource.Drawable.ic_holder).Into(_avatar); } ((PostPhotosPagerAdapter)_photosViewPager.Adapter).UpdateData(PhotoPagerType, Post); _topLikers.RemoveAllViews(); var topLikersSize = (int)BitmapUtils.DpToPixel(24, Context.Resources); var topLikersMargin = (int)BitmapUtils.DpToPixel(6, Context.Resources); for (int i = 0; i < Post.TopLikersAvatars.Length; i++) { var topLikersAvatar = new CircleImageView(Context) { BorderColor = Color.White, BorderWidth = 3, FillColor = Color.White }; var layoutParams = new LinearLayout.LayoutParams(topLikersSize, topLikersSize); if (i != 0) { layoutParams.LeftMargin = -topLikersMargin; } _topLikers.AddView(topLikersAvatar, layoutParams); var avatarUrl = Post.TopLikersAvatars[i]; if (!string.IsNullOrEmpty(avatarUrl)) { Picasso.With(Context).Load(avatarUrl).Placeholder(Resource.Drawable.ic_holder).Resize(240, 0).Priority(Picasso.Priority.Low).Into(topLikersAvatar, null, () => { Picasso.With(context).Load(Resource.Drawable.ic_holder).Into(topLikersAvatar); }); } else { Picasso.With(context).Load(Resource.Drawable.ic_holder).Into(topLikersAvatar); } } _title.UpdateText(Post, TagToExclude, TagFormat, MaxLines, Post.IsExpanded || PhotoPagerType == PostPagerType.PostScreen); _commentSubtitle.Text = post.Children == 0 ? AppSettings.LocalizationManager.GetText(LocalizationKeys.PostFirstComment) : post.Children == 1 ? AppSettings.LocalizationManager.GetText(LocalizationKeys.SeeComment) : AppSettings.LocalizationManager.GetText(LocalizationKeys.ViewComments, post.Children); if (_isAnimationRuning && !post.VoteChanging) { _isAnimationRuning = false; _likeOrFlag.ScaleX = 1f; _likeOrFlag.ScaleY = 1f; } if (!BasePostPresenter.IsEnableVote) { if (post.VoteChanging && !_isAnimationRuning) { LikeSet(false); } else if (post.FlagChanging) { LikeSet(true); } } else { if (post.Vote || !post.Flag) { _likeOrFlag.SetImageResource(post.Vote ? Resource.Drawable.ic_new_like_filled : Resource.Drawable.ic_new_like_selected); } else { _likeOrFlag.SetImageResource(Resource.Drawable.ic_flag_active); } } _pagerTabLayout.Visibility = post.Media.Length > 1 ? ViewStates.Visible : ViewStates.Gone; SetNsfwMaskLayout(); if (Post.Flag && !Post.FlagNotificationWasShown) { NsfwMask.Visibility = ViewStates.Visible; _nsfwMaskCloseButton.Visibility = ViewStates.Visible; _nsfwMaskMessage.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.FlagMessage); NsfwMaskSubMessage.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.FlagSubMessage); _nsfwMaskActionButton.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.UnFlagPost); } else if (Post.ShowMask && (Post.IsLowRated || Post.IsNsfw)) { NsfwMask.Visibility = ViewStates.Visible; _nsfwMaskMessage.Text = AppSettings.LocalizationManager.GetText(Post.IsLowRated ? LocalizationKeys.LowRatedContent : LocalizationKeys.NsfwContent); NsfwMaskSubMessage.Text = AppSettings.LocalizationManager.GetText(Post.IsLowRated ? LocalizationKeys.LowRatedContentExplanation : LocalizationKeys.NsfwContentExplanation); _nsfwMaskActionButton.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.NsfwShow); } else { NsfwMask.Visibility = _nsfwMaskCloseButton.Visibility = ViewStates.Gone; } }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.ChatGroupMessagelayout); var requiredPermissions = new String[] { Manifest.Permission.Internet, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage, Manifest.Permission.Camera, Manifest.Permission.ReadContacts }; ActivityCompat.RequestPermissions(this, requiredPermissions, REQUEST_LOCATION); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar); SetSupportActionBar(toolbar); LinearLayout li_toolbarDetails = FindViewById <LinearLayout>(Resource.Id.li_toolbarDetails); CircleImageView IV_Grouplogo = FindViewById <CircleImageView>(Resource.Id.iv_customforGrouplogo); CircleImageView _IVarrow_back_white = FindViewById <CircleImageView>(Resource.Id.iv_arrow_back_white); TextView toolbar_title = FindViewById <TextView>(Resource.Id.toolbar_title); li_toolbarDetails.Click += Li_toolbarDetails_Click; IV_Grouplogo.Click += IV_Grouplogo_Click; toolbar_title.Click += Toolbar_title_Click; _IVarrow_back_white.Click += _IVarrow_back_white_Click; toolbar.Click += Toolbar_Click; GroupObject = JsonConvert.DeserializeObject <GroupModel>(Intent.GetStringExtra("GroupObject")); if (GroupObject != null) { toolbar_title.Text = GroupObject.GroupName; } if (!string.IsNullOrEmpty(GroupObject.GroupPictureUrl)) { Picasso.With(this) .Load(GroupObject.GroupPictureUrl) .Resize(100, 100) .CenterCrop().Placeholder(Resource.Mipmap.grouplist) .Into(IV_Grouplogo); } else { IV_Grouplogo.Visibility = ViewStates.Invisible; } txtChatSendMessage = FindViewById <EditText>(Resource.Id.txtSendMessage); mySwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh); var refreshListEvent = new SwipeRefreshLayoutGroupMessage(this); mySwipeRefreshLayout.SetOnRefreshListener(refreshListEvent); refreshListEvent.LoadMoreEvent += RefreshListEvent_LoadMoreEvent; mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); mRecyclerView.SetLayoutManager(mLayoutManager); btnAttachment = (Button)FindViewById(Resource.Id.btnextra_msg); btnSendButton = FindViewById <Button>(Resource.Id.btnsend_msg); btnCameraImage = FindViewById <ImageView>(Resource.Id.imgCamera_msg); ButtonLayout = FindViewById <LinearLayout>(Resource.Id.linearLayout3); txtChatSendMessage.TextChanged += TxtChatSendMessage_TextChanged; btnSendButton.Click += BtnSendButton_Click; btnAttachment.Click += BtnAttachment_Click; btnCameraImage.Click += BtnCameraImage_Click; } catch (Exception e) { Crashes.TrackError(e); } //loadGroupSignalR(); //LoadServerMessagesUpto(DateTime.Now); //loadLocalMessage(); }
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); }
private void InitComponent() { try { MainView = FindViewById <CoordinatorLayout>(Resource.Id.main_content); SecondReactionButton = FindViewById <TextView>(Resource.Id.SecondReactionText); MainSectionButton = FindViewById <LinearLayout>(Resource.Id.linerSecondReaction); LikeButton = FindViewById <ReactButton>(Resource.Id.beactButton); CommentCount = FindViewById <TextView>(Resource.Id.Commentcount); LikeCount = FindViewById <TextView>(Resource.Id.Likecount); TimeText = FindViewById <AppCompatTextView>(Resource.Id.time_text); PrivacyPostIcon = FindViewById <AppCompatTextView>(Resource.Id.privacyPost); MoreIcon = FindViewById <ImageView>(Resource.Id.moreicon); Username = FindViewById <TextViewWithImages>(Resource.Id.username); UserAvatar = FindViewById <CircleImageView>(Resource.Id.userAvatar); Description = FindViewById <SuperTextView>(Resource.Id.description); PostExtrasLayout = FindViewById <RelativeLayout>(Resource.Id.postExtras); ShareLinearLayout = FindViewById <LinearLayout>(Resource.Id.ShareLinearLayout); CommentLinearLayout = FindViewById <LinearLayout>(Resource.Id.CommentLinearLayout); SecondReactionLinearLayout = FindViewById <LinearLayout>(Resource.Id.SecondReactionLinearLayout); if (SecondReactionButton != null) { if (AppSettings.PostButton == PostButtonSystem.Reaction || AppSettings.PostButton == PostButtonSystem.Like) { MainSectionButton.WeightSum = 3; SecondReactionLinearLayout.Visibility = ViewStates.Gone; } else if (AppSettings.PostButton == PostButtonSystem.Wonder) { MainSectionButton.WeightSum = 4; SecondReactionLinearLayout.Visibility = ViewStates.Visible; SecondReactionButton.SetCompoundDrawablesWithIntrinsicBounds(Resource.Drawable.icon_post_wonder_vector, 0, 0, 0); SecondReactionButton.Text = Application.Context.GetText(Resource.String.Btn_Wonder); } else if (AppSettings.PostButton == PostButtonSystem.DisLike) { MainSectionButton.WeightSum = 4; SecondReactionLinearLayout.Visibility = ViewStates.Visible; SecondReactionButton.SetCompoundDrawablesWithIntrinsicBounds(Resource.Drawable.ic_action_dislike, 0, 0, 0); SecondReactionButton.Text = Application.Context.GetText(Resource.String.Btn_Dislike); } } LikeButton.SetTextColor(Color.White); if (LikeButton?.GetCurrentReaction()?.GetReactType() == ReactConstants.Default) { LikeButton.CompoundDrawableTintList = ColorStateList.ValueOf(Color.White); } YouTubeFragment = new YouTubePlayerSupportFragment(); SupportFragmentManager.BeginTransaction().Add(Resource.Id.root, YouTubeFragment, YouTubeFragment.Id.ToString() + DateTime.Now).Commit(); YouTubeFragment.Initialize(AppSettings.YoutubeKey, this); } catch (Exception e) { Console.WriteLine(e); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.fragment_completeRegistration, container, false); _toolbar = view.FindViewById <Toolbar>(Resource.Id.completeRegistrationToolbar); _profilePicImgView = view.FindViewById <CircleImageView>(Resource.Id.profilePictureCircularImgView); _fab = view.FindViewById <FloatingActionButton>(Resource.Id.selectProfileImageFab); _dataContainerRelativeLayout = view.FindViewById <RelativeLayout>(Resource.Id.relativeDataformContainer); _completeRegBtn = view.FindViewById <Button>(Resource.Id.completeRegistartionBtn); _progressBar = view.FindViewById <ProgressBar>(Resource.Id.progressBarInCircleImgView); //! Init Toolbar var activity = (AppCompatActivity)CrossCurrentActivity.Current.Activity; activity.SetSupportActionBar(_toolbar); activity.SupportActionBar.Title = "Edit Profile"; activity.SupportActionBar.SetDisplayHomeAsUpEnabled(false); //! Handle button Soft Keyboard // TODO: Find a more effective way to do this //! Already did activity.Window.SetSoftInputMode(SoftInput.MaskAdjust); //! select image an load into circle image view _fab.Click += (s, e) => { new BottomSheet.Builder(CrossCurrentActivity.Current.Activity, Resource.Style.SoarcnBottomSheet) .Sheet(Resource.Menu.bottomsheetmedia) .Grid() .Title("Select Image From") .Icon(Resource.Drawable.Camera_alt_24px) .Listener(this) .Show(); }; var dataFormParams2 = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); dataFormParams2.AddRule(LayoutRules.CenterHorizontal); dataFormParams2.Width = ViewGroup.LayoutParams.MatchParent; dataFormParams2.Height = ViewGroup.LayoutParams.WrapContent; _sfDataForm2 = new SfDataForm(Context.ApplicationContext); _sfDataForm2.DataObject = fullName; _sfDataForm2.LayoutManager = new DataFormLayoutManagerExt(_sfDataForm2); _sfDataForm2.LabelPosition = LabelPosition.Left; _sfDataForm2.Id = View.GenerateViewId(); _sfDataForm2.ValidationMode = ValidationMode.LostFocus; _sfDataForm2.CommitMode = CommitMode.LostFocus; _sfDataForm2.ColumnCount = 2; _dataContainerRelativeLayout.AddView(_sfDataForm2, dataFormParams2); var dataFormParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); dataFormParams.AddRule(LayoutRules.Below, _sfDataForm2.Id); dataFormParams.AddRule(LayoutRules.CenterHorizontal); dataFormParams.Width = ViewGroup.LayoutParams.MatchParent; dataFormParams.Height = ViewGroup.LayoutParams.WrapContent; _sfDataForm = new SfDataForm(Context.ApplicationContext); _sfDataForm.DataObject = _client; _sfDataForm.LayoutManager = new DataFormLayoutManagerExt(_sfDataForm); _sfDataForm.LabelPosition = LabelPosition.Left; _sfDataForm.Id = View.GenerateViewId(); _sfDataForm.ValidationMode = ValidationMode.LostFocus; _sfDataForm.CommitMode = CommitMode.LostFocus; _sfDataForm.ColumnCount = 1; _dataContainerRelativeLayout.AddView(_sfDataForm, dataFormParams); _completeRegBtn.Click += CompleteRegBtn_Click; return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.ViewStatus_Funds); var IssueObj = JsonConvert.DeserializeObject <Helper.Data>(Intent.GetStringExtra("issueobj")); working_started = (TextView)FindViewById(Resource.Id.tv_WorkingStatus); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); working_started.SetTypeface(tf, TypefaceStyle.Bold); resolved = (TextView)FindViewById(Resource.Id.tvResolvedStatus); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); resolved.SetTypeface(tf, TypefaceStyle.Bold); estimated_amount = (TextView)FindViewById(Resource.Id.textEstimated); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); estimated_amount.SetTypeface(tf, TypefaceStyle.Bold); collected_amount = (TextView)FindViewById(Resource.Id.textCollected); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); collected_amount.SetTypeface(tf, TypefaceStyle.Bold); Contributor_name = (TextView)FindViewById(Resource.Id.tvname); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); Contributor_name.SetTypeface(tf, TypefaceStyle.Bold); goback = FindViewById <ImageView>(Resource.Id.imggoback); goback.Click += Goback_Click; userimage = (CircleImageView)FindViewById(Resource.Id.imgProfile); issueImage = (ImageView)FindViewById(Resource.Id.imgissuev); close = (ImageView)FindViewById(Resource.Id.close); close.Click += Close_Click; if (IssueObj.isworkingstarted == 0) { working_started.Text = "No"; } else if (IssueObj.isworkingstarted == 1) { working_started.Text = "Yes"; } if (IssueObj.isResolved == 0) { resolved.Text = "No"; } else if (IssueObj.isResolved == 1) { resolved.Text = "Yes"; } estimated_amount.Text = IssueObj.estimatedCost.ToString(); if (IssueObj.amountCollected > IssueObj.estimatedCost) { collected_amount.Text = IssueObj.estimatedCost.ToString(); } else { collected_amount.Text = IssueObj.amountCollected.ToString(); } if (IssueObj.estimatedCost != 0) { Task.Run(async() => { var user = await GetTopContributer(IssueObj.IssueId); if (user != null) { byte[] arr = Convert.FromBase64String(user.profile_pic); Bitmap b1 = BitmapFactory.DecodeByteArray(arr, 0, arr.Length); MainThread.BeginInvokeOnMainThread(() => { userimage.SetImageBitmap(b1); Contributor_name.Text = user.name; }); } else { userimage.Visibility = Android.Views.ViewStates.Gone; Contributor_name.Text = "No Contributer yet"; } }); } else { userimage.Visibility = Android.Views.ViewStates.Gone; Contributor_name.Text = "No Contributer yet"; } byte[] arr1 = Convert.FromBase64String(IssueObj.IssueImage); Bitmap b2 = BitmapFactory.DecodeByteArray(arr1, 0, arr1.Length); issueImage.SetImageBitmap(b2); }
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); }; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_content_profile, null); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.SetVmPolicy(builder.Build()); txt_user_name = root.FindViewById <TextView>(Resource.Id.txt_user_name); txt_email = root.FindViewById <TextView>(Resource.Id.txt_email); try { if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this.Activity, Manifest.Permission.Camera) != (int)Permission.Granted || Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this.Activity, Manifest.Permission.WriteExternalStorage) != (int)Permission.Granted) { Android.Support.V4.App.ActivityCompat.RequestPermissions(this.Activity, new string[] { Manifest.Permission.Camera, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage }, 54); /*FragmentManager.FindFragmentById(Resource.Layout.fragment_content_addproduct).RequestPermissions(new string[] * { * Manifest.Permission.Camera, Manifest.Permission.WriteExternalStorage, * Manifest.Permission.ReadExternalStorage * }, 54);*/ } } catch { } try { string mStringLoginInfo = string.Empty; string mStringSessionToken = string.Empty; try { objdb = new DBaseOperations(); var lstu = objdb.selectTable(); if (lstu != null && lstu.Count > default(int)) { var uobj = lstu.FirstOrDefault(); if (uobj.Password == " ") { throw new Exception("Please login again"); } mStringLoginInfo = uobj.EmailId; mStringSessionToken = uobj.AuthToken; } } catch { } if (string.IsNullOrEmpty(mStringSessionToken)) { throw new Exception("Token does not exists"); } var client = new RestClient(Common.UrlBase); var request = new RestRequest("UserAccount/GetUserDetails", Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("TokenKey", mStringSessionToken); IRestResponse response = client.Execute(request); var content = response.Content; var responseObj = Newtonsoft.Json.JsonConvert.DeserializeObject <Account>(content); if (responseObj.Status == ResponseStatus.Successful && !string.IsNullOrEmpty(responseObj.EmailId)) { txt_user_name.Text = string.Format("{0} {1}", responseObj.FirstName, responseObj.LastName); txt_email.Text = responseObj.EmailId; } } catch (Exception ex) { Intent intent = new Intent(this.Activity, typeof(MainActivity)); StartActivity(intent); this.Activity.Finish(); } if (IsThereAnAppToTakePictures()) { CreateDirectoryForPictures(); profile_image0 = root.FindViewById <CircleImageView>(Resource.Id.profile_image0); iv_camera0 = root.FindViewById <CircleImageView>(Resource.Id.iv_camera0); iv_camera0.Click += (sndr, argus) => Camera_Clicked(sndr, argus, this.Activity); GetAndSetExistingProfilePic(profile_image0); } return(root); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = inflater.Inflate(Resource.Layout.profile_main, container, false); //mainActivity.LockDrawer(); sessionManager = SessionManager.GetInstance(); toolbar = (Android.Support.V7.Widget.Toolbar)view.FindViewById(Resource.Id.custom_toolbar); fbLoginBtn = (LoginButton)view.FindViewById(Resource.Id.fb_btn); fbLoginBtn.SetPermissions(new List <string> { "public_profile", "email" }); fbLoginBtn.Fragment = this; fbLoginBtn.RegisterCallback(callbackManager, this); homeRelative = (RelativeLayout)view.FindViewById(Resource.Id.add_home_rl); workRelative = (RelativeLayout)view.FindViewById(Resource.Id.add_work_rl); homeRelative.Click += HomeRelative_Click; workRelative.Click += WorkRelative_Click; Profile_img = (CircleImageView)view.FindViewById(Resource.Id.profile_ivew); var fbID = sessionManager.GetFbProfilePic(); LogOutBtn = (Button)view.FindViewById(Resource.Id.log_out_btn); LogOutBtn.Click += LogOutBtn_Click; profileRoot = (RelativeLayout)view.FindViewById(Resource.Id.profile_main_root); var firstname = sessionManager.GetFirstname(); var lastname = sessionManager.GetLastName(); var email = sessionManager.GetEmail(); var isLinked = sessionManager.IsProviderLinked(); var phone = (TextView)view.FindViewById(Resource.Id.profile_txt2); phone.Text = sessionManager.GetPhone(); var fullname = (TextView)view.FindViewById(Resource.Id.profile_txt1); fullname.Text = $"{firstname} {lastname}"; var rideReceiptTxt = (TextView)view.FindViewById(Resource.Id.textView_ride); var first = "Ride receipt will be sent to "; SpannableString str = new SpannableString(first + email); str.SetSpan(new StyleSpan(TypefaceStyle.Bold), first.Length, first.Length + email.Length, SpanTypes.ExclusiveExclusive); rideReceiptTxt.TextFormatted = str; menuBtn = (TextView)view.FindViewById(Resource.Id.edit_menu); menuBtn.Click += MenuBtn_Click; int logintype = sessionManager.GetLogintype(); switch (logintype) { case 0: Toast.MakeText(Application.Context, "Phone auth", ToastLength.Short).Show(); if (isLinked == true) { fbLoginBtn.Visibility = ViewStates.Invisible; } break; case 1: Toast.MakeText(Application.Context, "facebook auth", ToastLength.Short).Show(); mainActivity.RunOnUiThread(() => { fbLoginBtn.Visibility = ViewStates.Invisible; SetProfilePic(fbID, Profile_img); }); break; case 2: Toast.MakeText(Application.Context, "Google auth", ToastLength.Short).Show(); fbLoginBtn.Visibility = ViewStates.Invisible; break; default: Toast.MakeText(Application.Context, "No such data", ToastLength.Short).Show(); break; } return(view); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_smart_band_device); _lbBpm = FindViewById <TextView>(Resource.Id.lbBpm); _lbSleep = FindViewById <TextView>(Resource.Id.lbSleepTime); _lbSteps = FindViewById <TextView>(Resource.Id.lbsteps); _lbDisplayName = FindViewById <TextView>(Resource.Id.lbDisplayName); _lbFullName = FindViewById <TextView>(Resource.Id.lbFullName); _lbActivity = FindViewById <TextView>(Resource.Id.lbActivTime); _avatarImage = FindViewById <CircleImageView>(Resource.Id.FitBitprofileImage); _loadingScreen = FindViewById <ConstraintLayout>(Resource.Id.loading); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); var animationView = FindViewById <LottieAnimationView>(Resource.Id.animation_view); var filter = new SimpleColorFilter(ContextCompat.GetColor(this, Resource.Color.colorAccent)); animationView.AddValueCallback(new KeyPath("**"), LottieProperty.ColorFilter, new LottieValueCallback(filter)); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); toolbar.NavigationClick += delegate { OnBackPressed(); }; Title = "Profil de sanatate"; OnNewIntent(Intent); if (_url != null) { string code = _url.Substring(_url.IndexOf("&access_token", StringComparison.Ordinal) + 24).Replace("#_=_", string.Empty); await Task.Run(async() => { var dict = new Dictionary <string, string> { { "code", code }, { "grant_type", "authorization_code" }, { "redirect_uri", Constants.CallbackUrl } }; string response = await WebServices.WebServices.Post("https://api.fitbit.com/oauth2/token", dict); if (response != null) { var obj = new JSONObject(response); _token = obj.GetString("access_token"); string refreshToken = obj.GetString("refresh_token"); string userId = obj.GetString("user_id"); var bleDevicesRecords = await SqlHelper <BluetoothDeviceRecords> .CreateAsync(); await bleDevicesRecords.Insert( new BluetoothDeviceRecords { Name = "SmartBand", Address = _token, DeviceType = DeviceType.SmartBand }); Utils.SetDefaults(GetString(Resource.String.smartband_device), _token); Utils.SetDefaults("FitbitToken", _token); Utils.SetDefaults("FitbitRefreshToken", refreshToken); Utils.SetDefaults("FitbitUserId", userId); Utils.SetDefaults("FitbitAuthCode", code); } }); } else { RefreshToken(); _token = Utils.GetDefaults(GetString(Resource.String.smartband_device)); // Log.Error("TokenFromShared", _token); } _loadingScreen.Visibility = ViewStates.Visible; await Task.Run(async() => await PopulateFields()); _loadingScreen.Visibility = ViewStates.Gone; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.datoCliente_layout); #region Cazamiento de widgest edtNombre = FindViewById <EditText>(Resource.Id.edtNombre); edtApaterno = FindViewById <EditText>(Resource.Id.edtApaterno); edtAmaterno = FindViewById <EditText>(Resource.Id.edtAmaterno); edtTelefono = FindViewById <EditText>(Resource.Id.edtTelefono); edtCliente_sap = FindViewById <EditText>(Resource.Id.edtCliente_sap); edtNombre_fiscal = FindViewById <EditText>(Resource.Id.edtNombre_fiscal); edtRFC = FindViewById <EditText>(Resource.Id.edtRFC); edtContacto = FindViewById <EditText>(Resource.Id.edtContacto); edtReferencia = FindViewById <EditText>(Resource.Id.edtReferencia); edtContrasena = FindViewById <EditText>(Resource.Id.edtContrasena); edtContrasenaConfirmar = FindViewById <EditText>(Resource.Id.edtContrasenaConfirmar); cimgTomarFoto = FindViewById <CircleImageView>(Resource.Id.cimgTomarFoto); btnGuardar = FindViewById <Button>(Resource.Id.btnGuardar); lnPrincipal = FindViewById <LinearLayout>(Resource.Id.lnPrincipal); spnCedId = FindViewById <Spinner>(Resource.Id.spinEdo); #endregion #region Adaptador spinner spnCedId.SetPromptId(Resource.String.Seleccion_edo); spnCedId.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spin_ItemSelected); adapterSpinCedId = ArrayAdapter.CreateFromResource(this, Resource.Array.Estados, Android.Resource.Layout.SimpleSpinnerDropDownItem); adapterSpinCedId.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spnCedId.Adapter = adapterSpinCedId; #endregion #region Geo-Localizacion var location = CrossGeolocator.Current; location.DesiredAccuracy = 50;//50 metros var position = await location.GetPositionAsync(TimeSpan.FromSeconds(10), null, true); dbllatitud = position.Latitude; dbllongitud = position.Longitude; #endregion cimgTomarFoto.Click += delegate { intentImage = new Intent(MediaStore.ActionImageCapture); StartActivityForResult(intentImage, 0); }; btnGuardar.Click += async delegate { try { if (string.IsNullOrEmpty(edtNombre.Text)) { Toast.MakeText(this, Resource.String.Nombre_nulo, ToastLength.Short).Show(); edtNombre.Focusable = true; } else if (string.IsNullOrEmpty(edtApaterno.Text)) { Toast.MakeText(this, Resource.String.Apaterno_nulo, ToastLength.Short).Show(); edtAmaterno.Focusable = true; } else if (string.IsNullOrEmpty(edtAmaterno.Text)) { Toast.MakeText(this, Resource.String.Amaterno_nulo, ToastLength.Short).Show(); edtAmaterno.Focusable = true; } else if (string.IsNullOrEmpty(edtCliente_sap.Text)) { Toast.MakeText(this, Resource.String.Cliente_sap_nulo, ToastLength.Short).Show(); edtCliente_sap.Focusable = true; } else if (string.IsNullOrEmpty(edtNombre_fiscal.Text)) { Toast.MakeText(this, Resource.String.Nombre_fiscal_nulo, ToastLength.Short).Show(); edtNombre_fiscal.Focusable = true; } else if (string.IsNullOrEmpty(edtRFC.Text)) { Toast.MakeText(this, Resource.String.RFC_nulo, ToastLength.Short).Show(); edtRFC.Focusable = true; } else if (string.IsNullOrEmpty(edtContrasena.Text)) { Toast.MakeText(this, Resource.String.Contrasena_nulo, ToastLength.Short).Show(); edtContrasena.Focusable = true; } else if (string.IsNullOrEmpty(edtContrasenaConfirmar.Text)) { Toast.MakeText(this, Resource.String.Contrasena_nulo, ToastLength.Short).Show(); edtContrasenaConfirmar.Focusable = true; } else if (edtRFC.Text.Length != 13) { Toast.MakeText(this, Resource.String.Extencion_RFC, ToastLength.Short).Show(); edtRFC.Text = ""; edtRFC.Focusable = true; } else if (edtTelefono.Text.Length != 10) { Toast.MakeText(this, Resource.String.Extencion_Telefono, ToastLength.Short).Show(); edtTelefono.Text = ""; edtTelefono.Focusable = true; } else if (edtContrasena.Text != edtContrasenaConfirmar.Text) { Toast.MakeText(this, Resource.String.Error_contrasenas_iguales, ToastLength.Short).Show(); } else { List <Usuario> lstUsuario = new List <Usuario>(); lstUsuario.Add(new Usuario { Nombre = edtNombre.Text, A_paterno = edtApaterno.Text, A_materno = edtAmaterno.Text, Telefono = "+(52)" + edtTelefono.Text, Cliente_sap = int.Parse(edtCliente_sap.Text), Fecha_creacion = DateTime.Today, Nombre_fiscal = edtNombre_fiscal.Text, Rfc = edtRFC.Text, Contacto = edtContacto.Text, Cedild = strEdo, Longitud = dbllongitud, Latitud = dbllatitud, Contrasena = edtContrasena.Text, Referencia = edtReferencia.Text, Foto_local = strEncodingImage }); var jsonBody = JsonConvert.SerializeObject(lstUsuario[0]); if (blnEditar) { //Actualizar usuario service.ActualizarCuentaCompleted += (s, e) => { var intent = new Intent(this, typeof(detalleCliente_Activity)); RespuestasDelWebService(e.Result, intent); General general = new General(); general.GuardarXmlUsuario(lstUsuario[0]); }; service.ActualizarCuentaAsync(jsonBody); } else { //Crear usuario service.CrearCuentaCompleted += (s, e) => { var intent = new Intent(this, typeof(MainActivity)); RespuestasDelWebService(e.Result, intent); }; service.CrearCuentaAsync(jsonBody); } } } catch (Exception ex) { Toast.MakeText(this, Resource.String.Error_catch, ToastLength.Short).Show(); Console.WriteLine("Error: " + ex.Message); } }; }
protected override void OnCreate(Bundle savedInstanceState) { try { base.OnCreate(savedInstanceState); AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException; SetContentView(Resource.Layout.ChatMessagelayout); var requiredPermissions = new String[] { Manifest.Permission.Internet, Manifest.Permission.WriteExternalStorage, Manifest.Permission.ReadExternalStorage, Manifest.Permission.Camera, Manifest.Permission.ReadContacts }; ActivityCompat.RequestPermissions(this, requiredPermissions, REQUEST_LOCATION); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar); SetSupportActionBar(toolbar); //SupportActionBar.SetDisplayHomeAsUpEnabled(true); //SupportActionBar.SetHomeButtonEnabled(true); //SupportActionBar.SetDisplayUseLogoEnabled(true); ////SupportActionBar.SetIcon(Resource.Drawable.logo512_512); LinearLayout li_toolbarDetails = FindViewById <LinearLayout>(Resource.Id.li_toolbarDetails); CircleImageView IV_Userlogo = FindViewById <CircleImageView>(Resource.Id.iv_customforUserlogo); CircleImageView _IVarrow_back_white = FindViewById <CircleImageView>(Resource.Id.iv_arrow_back_white); TextView toolbar_title = FindViewById <TextView>(Resource.Id.toolbar_title); li_toolbarDetails.Click += Li_toolbarDetails_Click; IV_Userlogo.Click += IV_Userlogo_Click; toolbar_title.Click += Toolbar_title_Click; _IVarrow_back_white.Click += _IVarrow_back_white_Click; // Create your application here ContactObject = JsonConvert.DeserializeObject <ContactViewModel>(Intent.GetStringExtra("ContactObject")); if (ContactObject != null) { ContactName = ContactRepository.GetContactbyUserId(ContactObject.ContactId).name; contactId = ContactObject.ContactId; toolbar_title.Text = ContactName; } if (ContactObject.ProfileImageUrl != null && ContactObject.ProfileImageUrl != "") { Picasso.With(this) .Load(ContactObject.ProfileImageUrl) .Resize(100, 100) .CenterCrop().Placeholder(Resource.Drawable.default_profile) .Into(IV_Userlogo); } else { IV_Userlogo.SetBackgroundResource(Resource.Drawable.default_profile); } txtChatSendMessage = FindViewById <EditText>(Resource.Id.txtSendMessage); btnAttachment = (Button)FindViewById(Resource.Id.btnextra_msg); btnSendButton = FindViewById <Button>(Resource.Id.btnsend_msg); ButtonLayout = FindViewById <LinearLayout>(Resource.Id.linearLayout3); txtChatSendMessage.TextChanged += TxtChatSendMessage_TextChanged; mySwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swiperefresh); var refreshListEvent = new SwipeRefreshLayoutPrivateMessage(this); mySwipeRefreshLayout.SetOnRefreshListener(refreshListEvent); refreshListEvent.LoadMoreEvent += RefreshListEvent_LoadMoreEvent; mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); if (mRecyclerView != null) { mRecyclerView.HasFixedSize = true; var layoutManager = new LinearLayoutManager(this); mRecyclerView.SetLayoutManager(layoutManager); } imgCamera_msg = FindViewById <ImageView>(Resource.Id.imgCamera_msg); chatConversation = ChatConversationRepository.GetConversationbyContactId(ContactObject.ContactId); btnSendButton.Click += btnSendButton_Click; btnAttachment.Click += BtnAttachment_Click; imgCamera_msg.Click += ImgCamera_msg_Click; } catch (Exception e) { Crashes.TrackError(e); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.createissue2); issueImg = FindViewById <ImageView>(Resource.Id.imgbtn9); //to change with pp on runtime circleimageview2 = FindViewById <CircleImageView>(Resource.Id.circleImageView2); back = (ImageView)FindViewById(Resource.Id.backbtn6); back.Click += Back_Click; //to change on runtime with user name tvusername = (TextView)FindViewById(Resource.Id.tvusername); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); tvusername.SetTypeface(tf, TypefaceStyle.Bold); close = (ImageView)FindViewById(Resource.Id.close); close.Click += Close_Click; base64image = Bitmap_Transfere.ImageString; byte[] imageArray = Convert.FromBase64String(base64image); Android.Graphics.Bitmap bitmap = BitmapFactory.DecodeByteArray(imageArray, 0, imageArray.Length); issueImg.SetImageBitmap(bitmap); //runtime py profile change krna or name change krna //start char[] arr = UserInfoHolder.User_name.ToCharArray(); byte[] arra = Convert.FromBase64String(Control.UserInfoHolder.Profile_pic); Android.Graphics.Bitmap bitmapp = BitmapFactory.DecodeByteArray(arra, 0, arra.Length); circleimageview2.SetImageBitmap(bitmapp); tvusername.SetText(arr, 0, arr.Length); //end //runtime py profile change krna or name change krna next_imga2 = (ImageView)FindViewById(Resource.Id.imganext); next_imga2.Click += Next_imga2_Click; infoprob = (TextView)FindViewById(Resource.Id.tvinfoproblem); tf = Typeface.CreateFromAsset(Assets, "Quicksand-Bold.otf"); infoprob.SetTypeface(tf, TypefaceStyle.Bold); Potholeimgbtn1 = (ImageView)FindViewById(Resource.Id.imgbtn1); Potholeimgbtn1.Click += Potholeimgbtn1_Click; Manholeimgbtn2 = (ImageView)FindViewById(Resource.Id.imgbtn2); Manholeimgbtn2.Click += Manholeimgbtn2_Click; Debrisimgbtn3 = (ImageView)FindViewById(Resource.Id.imgbtn3); Debrisimgbtn3.Click += Debrisimgbtn3_Click; Garbageimgbtn4 = (ImageView)FindViewById(Resource.Id.imgbtn4); Garbageimgbtn4.Click += Garbageimgbtn4_Click; BrokenWiresimgbtn5 = (ImageView)FindViewById(Resource.Id.imgbtn5); BrokenWiresimgbtn5.Click += BrokenWiresimgbtn5_Click; Plantingimgbtn6 = (ImageView)FindViewById(Resource.Id.imgbtn6); Plantingimgbtn6.Click += Plantingimgbtn6_Click; MissingVehicleimgbtn7 = (ImageView)FindViewById(Resource.Id.imgbtn7); MissingVehicleimgbtn7.Click += MissingVehicleimgbtn7_Click; Rainwaterimgbtn8 = (ImageView)FindViewById(Resource.Id.imgbtn8); Rainwaterimgbtn8.Click += Rainwaterimgbtn8_Click; imgviewissue = (ImageView)FindViewById(Resource.Id.imgbtn9); radiobtn1 = (RadioButton)FindViewById(Resource.Id.radioButton1); radiobtn1.Click += Radiobtn1_Click; radiobtn2 = (RadioButton)FindViewById(Resource.Id.radioButton2); radiobtn2.Click += Radiobtn2_Click; radiobtn3 = (RadioButton)FindViewById(Resource.Id.radioButton3); radiobtn3.Click += Radiobtn3_Click; radiobtn4 = (RadioButton)FindViewById(Resource.Id.radioButton4); radiobtn4.Click += Radiobtn4_Click; radiobtn5 = (RadioButton)FindViewById(Resource.Id.radioButton5); radiobtn5.Click += Radiobtn5_Click; radiobtn6 = (RadioButton)FindViewById(Resource.Id.radioButton6); radiobtn6.Click += Radiobtn6_Click; radiobtn7 = (RadioButton)FindViewById(Resource.Id.radioButton7); radiobtn7.Click += Radiobtn7_Click; radiobtn8 = (RadioButton)FindViewById(Resource.Id.radioButton8); radiobtn8.Click += Radiobtn8_Click; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.NuevoCaballo); new ShareInside().CopyDocuments("RazasGender.sqlite", "RazasGender.db"); var txtHorseName = FindViewById <EditText>(Resource.Id.txtHorseName); Foto = FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.btnFoto); Foto.Click += delegate { var intent = new Intent(MediaStore.ActionImageCapture); intent.PutExtra(MediaStore.ExtraOutput, RutaArchivo); StartActivityForResult(intent, 1, savedInstanceState); }; var txtBirthDay = FindViewById <TextView>(Resource.Id.txtBirthDay); txtBirthDay.Click += delegate { Java.Util.Calendar calendar = Java.Util.Calendar.Instance; int year = calendar.Get(Java.Util.CalendarField.Year); int month = calendar.Get(Java.Util.CalendarField.Month); int day_of_month = calendar.Get(Java.Util.CalendarField.DayOfMonth); DatePickerDialog dialog; dialog = new DatePickerDialog(this, Resource.Style.ThemeOverlay_AppCompat_Dialog_Alert, onDateSetListener, year, month, day_of_month); dialog.Show(); }; onDateSetListener = new PickerDate(txtBirthDay); var txtGender = FindViewById <TextView>(Resource.Id.txtGender); txtGender.Click += delegate { Dialog alertar = new Dialog(this, Resource.Style.Theme_Dialog_Translucent); alertar.RequestWindowFeature(1); alertar.SetCancelable(true); alertar.SetContentView(Resource.Layout.DialogoGender); List <string> consulta = new List <string>() { GetText(Resource.String.Filly), GetText(Resource.String.Gelding), GetText(Resource.String.Mare), GetText(Resource.String.Stallion) }; textListView = alertar.FindViewById <ListView>(Resource.Id.Listagender); textListView.Adapter = new AdaptadorGender(this, consulta, alertar, txtGender); alertar.Show(); }; var txtBreed = FindViewById <TextView>(Resource.Id.txtBreed); txtBreed.Click += delegate { Dialog alertar = new Dialog(this, Resource.Style.Theme_Dialog_Translucent); alertar.RequestWindowFeature(1); alertar.SetCancelable(true); alertar.SetContentView(Resource.Layout.DialogoRazas); var con = new SQLiteConnection(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "RazasGender.sqlite")); var consulta = con.Query <Modelos.Razas>("select * from Razas", new Modelos.Razas().id_raza); textListView = alertar.FindViewById <ListView>(Resource.Id.ListaRazas); textListView.Adapter = new AdaptadorRazas(this, consulta, alertar, txtBreed); buscar = alertar.FindViewById <EditText>(Resource.Id.buscar); buscar.TextChanged += (object sender, TextChangedEventArgs e) => { var consulta2 = con.Query <Modelos.Razas>("select * from Razas where raza like '" + buscar.Text + "%'", new Modelos.Razas().id_raza); textListView.Adapter = new AdaptadorRazas(this, consulta2, alertar, txtBreed); }; alertar.Show(); }; var txtHeigth = FindViewById <EditText>(Resource.Id.txtHeigthHorse); var txtWeigth = FindViewById <EditText>(Resource.Id.txtWeigthHorse); var txtOat = FindViewById <EditText>(Resource.Id.txtOatHorse); var btnAtras = FindViewById <ImageView>(Resource.Id.btnAtras); btnAtras.Click += delegate { }; var btnGuardar = FindViewById <ImageView>(Resource.Id.btnGuardar); btnGuardar.Click += delegate { //if ( == "") //{ //} }; }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); Intent intent; SupportFragment newFragment = new Hub(); var trans = SupportFragmentManager.BeginTransaction(); trans.Add(Resource.Id.flContent, newFragment, "Hub"); trans.Commit(); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); View navheader = navigationView.GetHeaderView(0); CircleImageView iv = (CircleImageView)navheader.FindViewById(Resource.Id.imageCustomerIcon); iv.Click += delegate { intent = new Intent(this, typeof(Profile)); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); this.StartActivity(intent); }; await LoadAccount(); navigationView.NavigationItemSelected += (sender, e) => { SupportFragment frag; e.MenuItem.SetChecked(true); switch (e.MenuItem.ItemId) { case (Resource.Id.nav_hub): frag = (SupportFragment)SupportFragmentManager.FindFragmentByTag("Hub"); newFragment = new Hub(); trans = SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.flContent, newFragment, "Hub"); if (frag == null) { trans.AddToBackStack("Hub"); } trans.Commit(); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); break; case (Resource.Id.nav_tournament): frag = (SupportFragment)SupportFragmentManager.FindFragmentByTag("Turnieje"); newFragment = new Tournament(null, null, null, null, null); trans = SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.flContent, newFragment, "Turnieje"); if (frag == null) { trans.AddToBackStack("Turnieje"); } trans.Commit(); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); break; case (Resource.Id.nav_quickgame): frag = (SupportFragment)SupportFragmentManager.FindFragmentByTag("Szybka gra"); newFragment = new Quickgame(); trans = SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.flContent, newFragment, "Szybka gra"); if (frag == null) { trans.AddToBackStack("Szybka gra"); } trans.Commit(); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); break; case (Resource.Id.nav_findplayers): frag = (SupportFragment)SupportFragmentManager.FindFragmentByTag("Znajdz gracza"); newFragment = new Findplayers(); trans = SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.flContent, newFragment, "Znajdz gracza"); if (frag == null) { trans.AddToBackStack("Znajdz gracza"); } trans.Commit(); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); break; case (Resource.Id.nav_friends): frag = (SupportFragment)SupportFragmentManager.FindFragmentByTag("Znajomi"); newFragment = new FriendList(); trans = SupportFragmentManager.BeginTransaction(); trans.Replace(Resource.Id.flContent, newFragment, "Znajomi"); if (frag == null) { trans.AddToBackStack("Znajomi"); } trans.Commit(); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); break; case (Resource.Id.nav_profile): intent = new Intent(this, typeof(Profile)); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); this.StartActivity(intent); break; case (Resource.Id.nav_addQuickgame): intent = new Intent(this, typeof(AddQuickgame)); OverridePendingTransition(Resource.Animation.animRight, Resource.Animation.animRight2); this.StartActivity(intent); break; default: break; } mDrawerLayout.CloseDrawers(); }; pref = ((AppCompatActivity)this).GetSharedPreferences(Notyfication, FileCreationMode.Private); string noty = pref.GetString("Notification", ""); if (noty == "yes") { pref = ((AppCompatActivity)this).GetSharedPreferences(runActivity, FileCreationMode.Private); bool run = pref.GetBoolean("MainActivity", false); if (run) { Intent notint = new Intent(this, typeof(MainActivity)); notint.SetFlags(ActivityFlags.ClearTop); notint.SetFlags(ActivityFlags.NewTask); const int pendingIntentId = 0; PendingIntent pendingIntent = PendingIntent.GetActivity(this, pendingIntentId, notint, PendingIntentFlags.OneShot); var notification = new Notification.Builder(this); notification.SetContentIntent(pendingIntent); notification.SetContentText("Zaproszenie do gry"); notification.SetContentTitle("GameHub"); notification.SetSmallIcon(Resource.Drawable.Icon4); notification.SetAutoCancel(true); notification.SetDefaults(NotificationDefaults.Sound | NotificationDefaults.Vibrate); NotificationManager NotManager = (NotificationManager)GetSystemService(Context.NotificationService); NotManager.Notify(0, notification.Build()); } else { } } }