public ReceivedMessageHolder(View itemView) : base(itemView) { base.ItemView = itemView; messageText = itemView.FindViewById <TextView>(Resource.Id.text_message_body); timeText = itemView.FindViewById <TextView>(Resource.Id.text_message_time); nameText = itemView.FindViewById <TextView>(Resource.Id.text_message_name); profileImage = itemView.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.image_message_profile); }
public HeaderViewHolder(View itemView, Context context, Action followersAction, Action followingAction, Action balanceAction, Action followAction) : base(itemView) { _context = context; _name = itemView.FindViewById <TextView>(Resource.Id.profile_name); _place = itemView.FindViewById <TextView>(Resource.Id.place); _description = itemView.FindViewById <TextView>(Resource.Id.description); _site = itemView.FindViewById <TextView>(Resource.Id.site); _photosCount = itemView.FindViewById <TextView>(Resource.Id.photos_count); _photosTitle = itemView.FindViewById <TextView>(Resource.Id.photos_title); _followingCount = itemView.FindViewById <TextView>(Resource.Id.following_count); _followingTitle = itemView.FindViewById <TextView>(Resource.Id.following_title); _followersCount = itemView.FindViewById <TextView>(Resource.Id.followers_count); _followersTitle = itemView.FindViewById <TextView>(Resource.Id.followers_title); _balanceText = itemView.FindViewById <TextView>(Resource.Id.balance_text); _balance = itemView.FindViewById <TextView>(Resource.Id.balance); _votingPower = itemView.FindViewById <VotingPowerFrame>(Resource.Id.voting_power); _votingPowerText = itemView.FindViewById <TextView>(Resource.Id.voting_power_message); _profileImage = itemView.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.profile_image); _followingBtn = itemView.FindViewById <LinearLayout>(Resource.Id.following_btn); _followersBtn = itemView.FindViewById <LinearLayout>(Resource.Id.followers_btn); _balanceContainer = itemView.FindViewById <RelativeLayout>(Resource.Id.balance_container); _followButton = itemView.FindViewById <Button>(Resource.Id.follow_button); _loadingSpinner = itemView.FindViewById <ProgressBar>(Resource.Id.loading_spinner); _photosTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Photos); _followingTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Following); _followersTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Followers); _balanceText.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.AccountBalance); _name.Typeface = Style.Semibold; _place.Typeface = Style.Regular; _description.Typeface = Style.Regular; _site.Typeface = Style.Regular; _photosCount.Typeface = Style.Semibold; _photosTitle.Typeface = Style.Regular; _followingCount.Typeface = Style.Semibold; _followingTitle.Typeface = Style.Regular; _followersCount.Typeface = Style.Semibold; _followersTitle.Typeface = Style.Regular; _balanceText.Typeface = Style.Regular; _balance.Typeface = Style.Regular; _votingPowerText.Typeface = Style.Regular; _followersAction = followersAction; _followingAction = followingAction; _balanceAction = balanceAction; _followAction = followAction; _followingBtn.Click += OnFollowingBtnOnClick; _followersBtn.Click += OnFollowersBtnOnClick; _balanceContainer.Click += OnBalanceContainerOnClick; _followButton.Click += OnFollowButtonOnClick; _profileImage.Click += ProfileImageOnClick; }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == 0) { View row = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.TournamentCard, parent, false); TextView EventTitle = row.FindViewById <TextView>(Resource.Id.EventTitle); TextView EventFirstTeam = row.FindViewById <TextView>(Resource.Id.EventFirstTeam); TextView EventSecondaryTeam = row.FindViewById <TextView>(Resource.Id.EventSecondaryTeam); TextView EventDate = row.FindViewById <TextView>(Resource.Id.EventDate); TextView EventGame = row.FindViewById <TextView>(Resource.Id.EventGame); Refractored.Controls.CircleImageView platform = row.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.EventPlatformIcon); LinearLayout colorLi = row.FindViewById <LinearLayout>(Resource.Id.colorLayoutWydarzenia); //li.SetBackgroundColor(Android.Graphics.Color.Red); MyView view = new MyView(row) { ETitle = EventTitle, EFTeam = EventFirstTeam, ESTeam = EventSecondaryTeam, EDate = EventDate, EGame = EventGame, mLayout = colorLi }; return(view); } else { View row = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.QuickgameCard, parent, false); row.Click += (sender, e) => { Context context = row.Context; Intent intent = new Intent(context, typeof(QuickgameDetail)); context.StartActivity(intent); }; TextView EventTitle = row.FindViewById <TextView>(Resource.Id.EventTitle); TextView Description = row.FindViewById <TextView>(Resource.Id.desc); TextView EventDate = row.FindViewById <TextView>(Resource.Id.EventDate); TextView EventGame = row.FindViewById <TextView>(Resource.Id.EventGame); Refractored.Controls.CircleImageView platform = row.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.EventPlatformIcon); LinearLayout colorLi = row.FindViewById <LinearLayout>(Resource.Id.colorLayoutWydarzenia); //li.SetBackgroundColor(Android.Graphics.Color.Red); MyView view = new MyView(row) { ETitle = EventTitle, Description = Description, EDate = EventDate, EGame = EventGame, mLayout = colorLi }; return(view); } }
private void InitComponents() { toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); toolbar.SetNavigationOnClickListener(this); SetSupportActionBar(toolbar); if (SupportActionBar != null) { SupportActionBar.Title = string.Empty; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_action_back); for (int i = 0; i < toolbar.ChildCount; i++) { View child = toolbar.GetChildAt(i); if (child is TextView toolbarTitle) { toolbarTitle.SetTypeface(FontUtils.GetBoldFont(this), Android.Graphics.TypefaceStyle.Normal); break; } } } collapsingToolbar = FindViewById <Android.Support.Design.Widget.CollapsingToolbarLayout>(Resource.Id.collapsingtoolbar_layout); collapsingToolbar.SetExpandedTitleTextAppearance(Resource.Style.ExpandedAppBar); collapsingToolbar.SetCollapsedTitleTextAppearance(Resource.Style.CollapsedAppBar); likeButton = FindViewById <LikeButton>(Resource.Id.likeButton); likeButton.SetOnLikeListener(this); if (ViewModel.MovieDetails.IsFavorite) { likeButton.SetLiked(Java.Lang.Boolean.True); } var chipGroup = FindViewById <ChipGroup>(Resource.Id.genre_chipGroup); AddGenreChips(chipGroup); var writeareview = FindViewById <Button>(Resource.Id.writeareview_button); writeareview.SetTypeface(FontUtils.GetNormalFont(this), TypefaceStyle.Normal); attachmentImageView = FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.attachment_imageView); if (ViewModel.CurrentMovieReview != null) { AddAttachment(); } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { View row = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.QuickgameCard, parent, false); TextView EventTitle = row.FindViewById <TextView>(Resource.Id.EventTitle); TextView Description = row.FindViewById <TextView>(Resource.Id.desc); TextView EventDate = row.FindViewById <TextView>(Resource.Id.EventDate); TextView EventGame = row.FindViewById <TextView>(Resource.Id.EventGame); Refractored.Controls.CircleImageView platform = row.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.EventPlatformIcon); LinearLayout colorLi = row.FindViewById <LinearLayout>(Resource.Id.colorLayoutWydarzenia); //li.SetBackgroundColor(Android.Graphics.Color.Red); MyView view = new MyView(row) { ETitle = EventTitle, Description = Description, EDate = EventDate, EGame = EventGame, mLayout = colorLi }; return(view); }
internal override void InitViews() { editTitle = FindViewById <EditText>(Resource.Id.editTitle); cv_userprofile = FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.cv_userprofile); horizontal_recycler_view = FindViewById <RecyclerView>(Resource.Id.horizontal_recycler_view); img_event1 = FindViewById <ImageView>(Resource.Id.img_event1); tv_username = FindViewById <TextView>(Resource.Id.tv_username); ll_back = (LinearLayout)FindViewById(Resource.Id.ll_back); ll_post = (LinearLayout)FindViewById(Resource.Id.ll_post); ll_photovideo = (LinearLayout)FindViewById(Resource.Id.ll_photovideo); ll_tag_friends = (LinearLayout)FindViewById(Resource.Id.ll_tag_friends); ll_camera = (LinearLayout)FindViewById(Resource.Id.ll_camera); LinearLayoutManager mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false); horizontal_recycler_view.SetLayoutManager(mLayoutManager); imagesList.Clear(); addUpdateImageAdapter = new AddUpdateImageAdapter(this, imagesList); horizontal_recycler_view.SetAdapter(addUpdateImageAdapter); tv_username.Text = Settings.UserFirstNameSettings + " " + Settings.UserMiddleNameSettings + " " + Settings.UserLastNameSettings; BasicUtils.GetInstance().SetImageFromUrl(this, this, Settings.UserImageUrlSettings, cv_userprofile, showMessageObject, false); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); OneSignal.Current.StartInit("aaf605c7-a2fc-401e-b9db-ea54f324f69c").EndInit(); pref = GetSharedPreferences("login", FileCreationMode.Private); edit = pref.Edit(); username = pref.GetString("username", String.Empty); profilepath = pref.GetString("profilePath", String.Empty); userid = pref.GetInt("userid", 0); StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); StrictMode.SetVmPolicy(builder.Build()); StrictMode.ThreadPolicy.Builder builder1 = new StrictMode.ThreadPolicy.Builder().PermitAll(); StrictMode.SetThreadPolicy(builder1.Build()); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); // toolbar.SetNavigationIcon(Resource.Drawable.login_image); // SupportActionBar.SetDisplayHomeAsUpEnabled(true); //// SetSupportActionBar(toolbar); //// toolbar.SetNavigationIcon((Resource.Drawable.notification_icon_background)); if (toolbar != null) { //toolbar.SetNavigationIcon((Resource.Drawable.home1)); SetSupportActionBar(toolbar); //SupportActionBar.SetDisplayHomeAsUpEnabled(true); //SupportActionBar.SetHomeButtonEnabled(true); } //if (SetSupportActionBar(toolbar) != null) //{ // SetSupportActionBar(toolbar).SetDisplayShowHomeEnabled(true); // SetSupportActionBar(toolbar)SsetDisplayHomeAsUpEnabled(true); //} // FloatingActionButton fab = FindViewById<FloatingActionButton>(Resource.Id.fab); // fab.Click += FabOnClick; DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); LayoutInflater mInflater = (LayoutInflater)GetSystemService(Context.LayoutInflaterService); View header = navigationView.GetHeaderView(0); txtdisplay = header.FindViewById <TextView>(Resource.Id.usernametext); profileimage = header.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.profile); if (username.Length > 0) { txtdisplay.Text = username; var imageBitmap = GetImageBitmapFromUrl(profilepath); profileimage.SetImageBitmap(imageBitmap); } toggle.SyncState(); navigationView.SetNavigationItemSelectedListener(this); var bottomBar = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation); RemoveShiftMode(bottomBar); SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.content_frame, new Home(), "Home") .Commit(); bottomBar.NavigationItemSelected += (s, a) => { LoadFragment(a.Item.ItemId); }; }
protected override void OnCreate(Bundle bundle) { try { base.OnCreate(bundle); SetContentView(Resource.Layout.activity_maincontent); mToolbar = FindViewById <SupportToolbar>(Resource.Id.m_toolbar); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.m_drawer_layout); mLeftDrawer = FindViewById <ListView>(Resource.Id.m_left_drawer); dashboardFragment = new DashboardFragment(); myFarmDashboardFragment = new MyFarmDashboardFragment(); myProfileFragment = new MyProfileFragment(); addActivityFragment = new AddActivityFragment(); activityViewerFragment = new ActivityViewerFragment(); askAggieFragment = new AskAggieFragment(); settingsFragment = new SettingsFragment(); contactFragment = new ContactFragment(); chatbotFragment = new ChatbotFragment(); chatListManagerFragment = new ChatListManagerFragment(); mStackFragments = new Stack <SupportFragment>(); mLeftDrawer.Tag = 0; SetSupportActionBar(mToolbar); mLeftDataSet = new List <string>(); mLeftDataSet.Add("My Dashboard"); mLeftDataSet.Add("My Farm"); mLeftDataSet.Add("My Profile"); mLeftDataSet.Add("Add Activitiy"); mLeftDataSet.Add("View Activities"); /*mLeftDataSet.Add("Ask an Aggie");*/ /*mLeftDataSet.Add("Settings");*/ var objdbTemp = new DBaseOperations(); var lstux = objdbTemp.selectTable(); if (lstux != null && lstux.Count > default(int)) { var uobj = lstux.FirstOrDefault(); if (uobj != null && uobj.IsAdmin > default(int)) { mLeftDataSet.Add("Chat Management"); } else { mLeftDataSet.Add("Ask an Aggie"); } } else { mLeftDataSet.Add("Ask an Aggie"); } mLeftDataSet.Add("Contact Us"); mLeftAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet); mLeftDrawer.Adapter = mLeftAdapter; mLeftDrawer.ItemClick += MenuListView_ItemClick; mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, Resource.String.openDrawer, Resource.String.closeDrawer); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowTitleEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); mDrawerToggle.SyncState(); if (bundle != null) { if (bundle.GetString("DrawerState") == "Opened") { SupportActionBar.SetTitle(Resource.String.openDrawer); } else { SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else { SupportActionBar.SetTitle(Resource.String.closeDrawer); } try { string mStringLoginInfo = string.Empty; string mStringSessionToken = string.Empty; string mStringGoodName = string.Empty; circular_imageViewLogo = this.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.circular_imageViewLogo); imageViewLogo = this.FindViewById <ImageView>(Resource.Id.imageViewLogo); textView = this.FindViewById <TextView>(Resource.Id.textView); 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; mStringGoodName = uobj.GoodName; _profilepicbase64 = uobj.ProfilePicture; } } catch { } if (!string.IsNullOrEmpty(_profilepicbase64)) { var btmpimg = BitmapHelpers.Base64ToBitmap(_profilepicbase64); circular_imageViewLogo.Visibility = ViewStates.Visible; imageViewLogo.Visibility = ViewStates.Gone; textView.Text = string.Format("Hello, {0}", mStringGoodName); circular_imageViewLogo.RecycleBitmap(); circular_imageViewLogo.SetImageBitmap(btmpimg); } else { circular_imageViewLogo.Visibility = ViewStates.Gone; imageViewLogo.Visibility = ViewStates.Visible; textView.Text = !string.IsNullOrEmpty(mStringGoodName) ? string.Format("Hello, {0}", mStringGoodName) : ""; } } catch { } IList <Android.Support.V4.App.Fragment> fragmentsarray = SupportFragmentManager.Fragments; if (fragmentsarray != null && fragmentsarray.Count > default(int)) { foreach (Android.Support.V4.App.Fragment fragment in fragmentsarray) { string tag = fragment.Tag; Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction(); tx.Replace(Resource.Id.m_main, fragment, fragment.Tag); tx.Commit(); break; } } else { Android.Support.V4.App.FragmentTransaction tx = SupportFragmentManager.BeginTransaction(); tx.Replace(Resource.Id.m_main, dashboardFragment, Constants.dashboard); tx.Commit(); } } catch (Exception ex) { this.RunOnUiThread(() => { Android.App.AlertDialog.Builder alertDiag = new Android.App.AlertDialog.Builder(this); alertDiag.SetTitle(Resource.String.DialogHeaderError); alertDiag.SetMessage(ex.Message); alertDiag.SetIcon(Resource.Drawable.alert); alertDiag.SetPositiveButton(Resource.String.DialogButtonOk, (senderAlert, args) => { Intent intent = new Intent(this, typeof(MainActivity)); StartActivity(intent); this.Finish(); }); Dialog diag = alertDiag.Create(); diag.Show(); diag.SetCanceledOnTouchOutside(false); }); } }
public HeaderViewHolder(View itemView, Context context, Action <ActionType> profileAction) : base(itemView) { _context = context; _name = itemView.FindViewById <TextView>(Resource.Id.profile_name); _place = itemView.FindViewById <TextView>(Resource.Id.place); _description = itemView.FindViewById <TextView>(Resource.Id.description); _site = itemView.FindViewById <AutoLinkTextView>(Resource.Id.site); _photosCount = itemView.FindViewById <TextView>(Resource.Id.photos_count); _photosTitle = itemView.FindViewById <TextView>(Resource.Id.photos_title); _followingCount = itemView.FindViewById <TextView>(Resource.Id.following_count); _followingTitle = itemView.FindViewById <TextView>(Resource.Id.following_title); _followersCount = itemView.FindViewById <TextView>(Resource.Id.followers_count); _followersTitle = itemView.FindViewById <TextView>(Resource.Id.followers_title); _balanceText = itemView.FindViewById <TextView>(Resource.Id.balance_text); _balance = itemView.FindViewById <TextView>(Resource.Id.balance); _votingPower = itemView.FindViewById <VotingPowerFrame>(Resource.Id.voting_power); _votingPowerText = itemView.FindViewById <TextView>(Resource.Id.voting_power_message); _profileImage = itemView.FindViewById <Refractored.Controls.CircleImageView>(Resource.Id.profile_image); _followingBtn = itemView.FindViewById <LinearLayout>(Resource.Id.following_btn); _followersBtn = itemView.FindViewById <LinearLayout>(Resource.Id.followers_btn); _balanceContainer = itemView.FindViewById <RelativeLayout>(Resource.Id.balance_container); _followContainer = itemView.FindViewById <RelativeLayout>(Resource.Id.follow_container); _followButton = itemView.FindViewById <Button>(Resource.Id.follow_button); _transferButton = itemView.FindViewById <Button>(Resource.Id.transfer_button); _loadingSpinner = itemView.FindViewById <ProgressBar>(Resource.Id.loading_spinner); _photosTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Photos); _followingTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Following); _followersTitle.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.Followers); _balanceText.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.AccountBalance); _transferButton.Text = AppSettings.LocalizationManager.GetText(LocalizationKeys.SendTokens); _name.Typeface = Style.Semibold; _place.Typeface = Style.Regular; _description.Typeface = Style.Regular; _site.Typeface = Style.Regular; _photosCount.Typeface = Style.Semibold; _photosTitle.Typeface = Style.Regular; _followingCount.Typeface = Style.Semibold; _followingTitle.Typeface = Style.Regular; _followersCount.Typeface = Style.Semibold; _followersTitle.Typeface = Style.Regular; _balanceText.Typeface = Style.Regular; _balance.Typeface = Style.Regular; _votingPowerText.Typeface = Style.Regular; _transferButton.Typeface = Style.Semibold; _followBtnBackground = new GradientDrawable(); _followBtnBackground.SetCornerRadius(TypedValue.ApplyDimension(ComplexUnitType.Dip, 25, itemView.Context.Resources.DisplayMetrics)); _followButton.Background = _followBtnBackground; _site.Flags = (int)AutoLinkType.Url; _profileAction = profileAction; _followingBtn.Click += OnFollowingBtnOnClick; _followersBtn.Click += OnFollowersBtnOnClick; _balanceContainer.Click += OnBalanceContainerOnClick; _followButton.Click += OnFollowButtonOnClick; _transferButton.Click += OnTransferButtonOnClick; _profileImage.Click += ProfileImageOnClick; _site.LinkClick += LinkClick; }