Esempio n. 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            int poss = positionImg;

            if (container == null)
            {
                return(null);
            }

            LinearLayout l = (LinearLayout)inflater.Inflate(Resource.Layout.mf, container, false);


            //string p = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "photo1.jpg");

            //Bitmap bitmap = BitmapFactory.DecodeFile(p);
            //ResizeImage("p");


            int pos = this.Arguments.GetInt("pos");

            LinearLayout root = (LinearLayout)l.FindViewById(Resource.Id.root);
            ImageView    img  = (ImageView)l.FindViewById(Resource.Id.content);

            // seul la premiere image a une taille normale. les autres sont à l'échele 0.7
            if (pos != MainActivity.FIRST_PAGE)
            {
                ViewHelper.SetScaleX(root, MainActivity.SMALL_SCALE);
                ViewHelper.SetScaleY(root, MainActivity.SMALL_SCALE);
            }
            else
            {
                ViewHelper.SetScaleX(root, MainActivity.BIG_SCALE);
                ViewHelper.SetScaleY(root, MainActivity.BIG_SCALE);
            }

            img.Click += img_Click;


            int resourceId = (int)typeof(Resource.Drawable).GetField("photo" + pos).GetVa‌​lue(null);

            img.SetImageResource(resourceId);

            float scale    = this.Arguments.GetFloat("scale");
            bool  isBlured = this.Arguments.GetBoolean("IsBlured");

            if (isBlured)
            {
                ViewHelper.SetAlpha(root, MyPagerAdapter.getMinAlpha());
                ViewHelper.SetRotationY(root, MyPagerAdapter.getMinDegree());
            }
            return(l);
        }