void init(View view) { mContainer = view.FindViewById <LinearLayout>(Resource.Id.linearLayout1); mTvTitle = view.FindViewById <TextView>(Resource.Id.textView1); mTvDiscription = view.FindViewById <TextView>(Resource.Id.textView2); mAnimationLTR = AnimationUtils.LoadAnimation(Activity, Resource.Animation.left_to_right); mAnimationRTL = AnimationUtils.LoadAnimation(Activity, Resource.Animation.right_to_left); // رویداد کلیک روی عنوان mTvTitle.Click += delegate { RunAction(); }; //رویداد کلیک روی توضیحات عکس mTvDiscription.Click += delegate { RunAction(); }; mAdapter = new AdapterPagerSlide(Activity.SupportFragmentManager, mSlides); mPager = view.FindViewById <ViewPager>(Resource.Id.pager); mPager.Adapter = mAdapter; mPager.AddOnPageChangeListener(this); CirclePageIndicator indicator = view.FindViewById <CirclePageIndicator>(Resource.Id.indicator); mIndicator = indicator; indicator.SetViewPager(mPager); indicator.SetBackgroundColor(Android.Graphics.Color.Transparent); SetConfig(mConfig); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.simple_circles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById <ViewPager>(Resource.Id.pager); mPager.Adapter = mAdapter; CirclePageIndicator indicator = FindViewById <CirclePageIndicator>(Resource.Id.indicator); mIndicator = indicator; indicator.SetViewPager(mPager); float density = Resources.DisplayMetrics.Density; indicator.SetBackgroundColor(Android.Graphics.Color.ParseColor("#ffcccccc")); indicator.Radius = 10 * density; indicator.PageColor = Color.ParseColor("#880000FF"); indicator.FillColor = Color.ParseColor("#FF888888"); indicator.StrokeColor = Color.ParseColor("#FF000000"); indicator.StrokeWidth = 2 * density; }