private float GetChartPopupLayoutWidth(int imageWidth, int count) { var margins = (DimensHelper.GetDimensById(Resource.Dimension.points_margin) * count); var width = Android.Content.Res.Resources.System.DisplayMetrics.WidthPixels - (imageWidth + margins); return(width); }
public void OnScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { parallaxImage.SetY(parallaxImage.Top - scrollY / 3); var imageParams = parallaxImage.LayoutParameters; imageParams.Width = DimensHelper.GetScreenWidth() + scrollY / 4; parallaxImage.LayoutParameters = imageParams; }
public override int CalculateDtToFit(int viewStart, int viewEnd, int boxStart, int boxEnd, int snapPreference) { //return base.CalculateDtToFit(viewStart, viewEnd, boxStart, boxEnd, snapPreference); int dimen = (int)System.Math.Round(DimensHelper.GetDimensById(Resource.Dimension.challenges_collection_unselected_side) / DimensHelper.GetScreenDensity()); var positionX = (boxStart + (boxEnd - boxStart) / 2) - (viewStart + (viewEnd - viewStart) / 2) + dimen; return(positionX); }
public void ChangeBackgroundCollectionHeight(bool isShowed) { var aspectSpace = Math.Round(topLayoutConstantAspect * DimensHelper.GetScreenWidth()); var margins = (DimensHelper.GetDimensById(Resource.Dimension.points_margin)); var topHeight = aspectSpace + margins; PointsHeightHelper.UpdateBackgroundCollectionViewHeight(collectionBackgroundView, isShowed, topHeight); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = base.GetView(position, convertView, parent); var cellsHeight = (int)Math.Round((double)DimensHelper.GetDimensById(Resource.Dimension.leaderboard_item_height) + DimensHelper.GetDimensById(Resource.Dimension.divider_height)) * ItemsSource.Cast <PointsSummaryLocalModel>().Count(); UpdateTableHeight(cellsHeight); UpdateControls(view); return(view); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = base.GetView(position, convertView, parent); (context as Activity).RunOnUiThread(() => { UpdateTableHeight((DimensHelper.GetDimensById(Resource.Dimension.points_tabs_height)) * ItemsSource.Cast <LocalChallengeAnswerModel>().Count()); }); UpdateControls(view); return(view); }
public void ChangeBackgroundCollectionHeight(bool isShowed) { var aspectSpace = Math.Round(topLayoutConstantAspect * DimensHelper.GetScreenWidth()); var margins = (DimensHelper.GetDimensById(Resource.Dimension.points_margin)); var topHeight = aspectSpace + margins; if (collectionBackgroundView == null) { view = this.BindingInflate(FragmentId, null, true); collectionBackgroundView = view.FindViewById <View>(Resource.Id.collection_background_view); } PointsHeightHelper.UpdateBackgroundCollectionViewHeight(collectionBackgroundView, isShowed, topHeight); }
private int GetHeightForList() { var aspectSpace = Math.Round(topLayoutConstantAspect * DimensHelper.GetScreenWidth()); var margins = (DimensHelper.GetDimensById(Resource.Dimension.leaderboard_image_margin) + DimensHelper.GetDimensById(Resource.Dimension.points_margin)); tvOverall.Measure(0, 0); tvRanked.Measure(0, 0); var stageHeight = DimensHelper.GetScreenHeight() - (DimensHelper.GetDimensById(Resource.Dimension.toolbar_height) + DimensHelper.GetDimensById(Resource.Dimension.divider_height) * 2 + DimensHelper.GetDimensById(Resource.Dimension.tabbar_height) + DimensHelper.GetDimensById(Resource.Dimension.points_tabs_height)); var textHeight = tvOverall.MeasuredHeight + tvRanked.MeasuredHeight; var topHeight = aspectSpace + margins + textHeight; var listHeight = stageHeight - topHeight; return((int)listHeight); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = base.GetView(position, convertView, parent); (context as Activity).RunOnUiThread(() => { var cellsHeight = (int)Math.Round((double)DimensHelper.GetDimensById(Resource.Dimension.leaderboard_item_height)) * ItemsSource.Cast <TransactionsLocalModel>().Count(); UpdateTableHeight(cellsHeight); UpdateBackgroundViewHeight(cellsHeight, bottomBackgroundView, 5); }); view.FindViewById <ImageView>(Resource.Id.icon).SetColorFilter(new Color(ContextCompat.GetColor(context, Resource.Color.areas_description_tex_color)), PorterDuff.Mode.SrcIn); UpdateControls(view); return(view); }
public static void Create(Activity activity, View parentView, Action completeAnimation = null) { var container = parentView.FindViewById <RelativeLayout>(Resource.Id.circle_view_container); var rewardsCircleView = new ImageView(activity); rewardsCircleView.Id = new ViewIdGenerator(activity).FindFreeId(); var animSize = DimensHelper.GetScreenHeight() * 2; rewardsCircleView.SetImageResource(Resource.Drawable.reward_circle_background); RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(animSize, animSize); param.AddRule(LayoutRules.AlignParentBottom); param.AddRule(LayoutRules.AlignParentRight); param.RightMargin = (int)Math.Round(-animSize * 0.333f); param.BottomMargin = (int)Math.Round(-animSize * 0.445f); param.TopMargin = (int)Math.Round(-animSize * 0.168f); param.LeftMargin = (int)Math.Round(-animSize * 0.16f); rewardsCircleView.LayoutParameters = param; container.AddView(rewardsCircleView); AnimateCircle(activity, rewardsCircleView, completeAnimation); }
public void SetTableHeight(int cellsHeight) { UpdateTableHeight(cellsHeight); VisibleItemsCount = (int)Math.Round(cellsHeight / (double)DimensHelper.GetDimensById(Resource.Dimension.leaderboard_item_height)); }