Ejemplo n.º 1
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            if (MainActivity.Activities.ContainsKey("UnderShopMapActivity"))
            {
                MainActivity.Activities["UnderShopMapActivity"].Finish();
                MainActivity.Activities.Remove("UnderShopMapActivity");
                MainActivity.Activities.Add("UnderShopMapActivity", this);
            }
            else
            {
                MainActivity.Activities.Add("UnderShopMapActivity", this);
            }
            // Create your application here
            SetContentView(Resource.Layout.ScaleImage);

            FrameLayout fr = FindViewById <FrameLayout>(Resource.Id.fr);

            local = Intent.GetStringExtra("Local");
            id    = Intent.GetStringExtra("SHOP_ID_NUMBER");

            image = FindViewById <ScaleImageView>(Resource.Id.AnimateImage);

            //foreach(var i in Data_ShopInfo.DIC_SHOP_XML_INFO_OVERALL_INFO)
            //{
            //    if (i.Value.IdentificationNumber.Equals(id))
            //    {
            //        iv = FindViewById<ImageView>(Resource.Id.iv);
            //        iv.SetImageResource(Resource.Drawable.directions9);
            //        iv.TranslationX = i.Value.ShopLocation.X;
            //        iv.TranslationY = i.Value.ShopLocation.Y - 10;
            //        iv.Tag = i.Value.IdentificationNumber;
            //    }
            //}

            TextView iv = null;

            shopNameList = new List <ShopNameLocation>();
            foreach (var i in Data_ShopInfo.DIC_SHOPINFO_OVERALL_INFO[local])
            {
                TextView tv = new TextView(this);
                tv.SetTextColor(Android.Graphics.Color.Black);
                if (i.Category.Equals(GetString(Resource.String.station)))
                {
                    tv.Text   = i.ShopName;
                    tv.Click += Tv_Subway_Click;
                    tv.Tag    = i.IdentificationNumber.Split(',')[0] + "," + i.EngCategory;
                    tv.SetTypeface(null, TypefaceStyle.Bold);
                    tv.SetTextColor(Color.White);
                }
                else if (i.Category.Equals(GetString(Resource.String.rest)))
                {
                    tv.SetBackgroundResource(Resource.Drawable.restroom16);
                    tv.Tag = i.IdentificationNumber + "," + i.EngCategory;
                }
                else if (i.Category.Equals(GetString(Resource.String.gateway)))
                {
                    tv.Text = i.ShopName;
                    tv.Tag  = i.IdentificationNumber + "," + i.EngCategory;
                }
                else if (i.Category.Equals(GetString(Resource.String.move)))
                {
                    tv.Text   = i.ShopName;
                    tv.Click += MapTransfer;
                    tv.SetTextColor(Color.White);
                    tv.Tag = i.IdentificationNumber.Split(',')[0] + "," + i.EngCategory;
                }
                else
                {
                    tv.Text   = i.ShopName;
                    tv.Click += Tv_Click;
                    tv.Tag    = i.IdentificationNumber + "," + i.EngCategory;

                    if (id != null)
                    {
                        if (id.Equals(i.IdentificationNumber))
                        {
                            iv = tv;
                            iv.SetBackgroundColor(Color.Red);
                            iv.SetTextColor(Color.White);
                        }
                    }
                }
                var lparam = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                          ViewGroup.LayoutParams.WrapContent);
                tv.LayoutParameters = lparam;
                ShopNameLocation snl = new ShopNameLocation()
                {
                    myView      = tv,
                    myLocationX = i.ShopLocation.X,
                    myLocationY = i.ShopLocation.Y
                };
                shopNameList.Add(snl);
                fr.AddView(tv);
            }
            image.LocalKey = local;
            try
            {
                BitmapResize          br      = new BitmapResize();
                BitmapFactory.Options options = await br.GetBitmapOptionsOfImageAsync(Resources, Data_ShopInfo.DIC_SHOPMAP[local]);

                bitmapToDisplay = await br.LoadScaledDownBitmapForDisplayAsync(Resources, Data_ShopInfo.DIC_SHOPMAP[local], options, 370, 370);

                if (iv != null)
                {
                    image.SetImageBitmapAndMarker(bitmapToDisplay, iv, iv.TranslationX, iv.TranslationY, shopNameList);
                }
                else
                {
                    image.SetImageBitmapAndMarker(bitmapToDisplay, shopNameList);
                }
            }
            catch
            {
            }


            TV_Categories = new TextView[] {
                FindViewById <TextView>(Resource.Id.TV_ALL),
                FindViewById <TextView>(Resource.Id.TV_FOOD),
                FindViewById <TextView>(Resource.Id.TV_FASHION),
                FindViewById <TextView>(Resource.Id.TV_CONVE),
                FindViewById <TextView>(Resource.Id.TV_INTERIOR),
                FindViewById <TextView>(Resource.Id.TV_BEAUTY),
                FindViewById <TextView>(Resource.Id.TV_OTHERS),
                FindViewById <TextView>(Resource.Id.TV_DIGITAL)
            };
            for (int i = 0; i < TV_Categories.Length; i++)
            {
                TV_Categories[i].Click += LEGEND_TV_CLICK;
            }
            Toast.MakeText(this, GetString(Resource.String.UnderMapComment), ToastLength.Short).Show();
        }
Ejemplo n.º 2
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            if (MainActivity.Activities.ContainsKey("LocalSelectActivity"))
            {
                MainActivity.Activities["LocalSelectActivity"].Finish();
                MainActivity.Activities.Remove("LocalSelectActivity");
                MainActivity.Activities.Add("LocalSelectActivity", this);
            }
            else
            {
                MainActivity.Activities.Add("LocalSelectActivity", this);
            }
            RequestWindowFeature(WindowFeatures.NoTitle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            //BitmapResize br = new BitmapResize();
            //BitmapFactory.Options options = await br.GetBitmapOptionsOfImageAsync(Resources, Resource.Drawable.MainImage2);
            //bitmapToDisplay = await br.LoadScaledDownBitmapForDisplayAsync(Resources, Resource.Drawable.MainImage2, options, 50, 50);

            //backgroundImg.SetImageBitmap(bitmapToDisplay);
            ImageView[] iv_regions =
            {
                FindViewById <ImageView>(Resource.Id.BTN_ULGIRO),
                FindViewById <ImageView>(Resource.Id.BTN_JONGRO),
                FindViewById <ImageView>(Resource.Id.BTN_MYENGDONG),
                FindViewById <ImageView>(Resource.Id.BTN_GANGNAM),
                FindViewById <ImageView>(Resource.Id.BTN_TERMINAL),
                FindViewById <ImageView>(Resource.Id.BTN_YEONGDEONGPO)
            };
            int[] regionImgs =
            {
                Resource.Drawable.ulgiroIcon,
                Resource.Drawable.JongroIcon,
                Resource.Drawable.MyeongdongIcon,
                Resource.Drawable.gangnamIcon,
                Resource.Drawable.TerminalIcon,
                Resource.Drawable.yeongIcon
            };
            btm_Regions = new Bitmap[iv_regions.Length];
            for (int i = 0; i < iv_regions.Length; i++)
            {
                RegisterForContextMenu(iv_regions[i]);
                iv_regions[i].Click += new EventHandler(OnButtonClick);

                BitmapResize          br2      = new BitmapResize();
                BitmapFactory.Options options2 = await br2.GetBitmapOptionsOfImageAsync(Resources, regionImgs[i]);

                btm_Regions[i] = await br2.LoadScaledDownBitmapForDisplayAsync(Resources, regionImgs[i], options2, 64, 64);

                //btm_Members[i] = BitmapFactory.DecodeResource(Resources, memberImgs[i]);
                iv_regions[i].SetImageBitmap(btm_Regions[i]);
            }
            //ImageView BTN_ULGIRO = FindViewById<ImageView>(Resource.Id.BTN_ULGIRO);
            //RegisterForContextMenu(BTN_ULGIRO);
            //BTN_ULGIRO.Click += new EventHandler(OnButtonClick);
            //ImageView BTN_JONGRO = FindViewById<ImageView>(Resource.Id.BTN_JONGRO);
            //RegisterForContextMenu(BTN_JONGRO);
            //BTN_JONGRO.Click += new EventHandler(OnButtonClick);
            //ImageView BTN_MYENGDONG = FindViewById<ImageView>(Resource.Id.BTN_MYENGDONG);
            //RegisterForContextMenu(BTN_MYENGDONG);
            //BTN_MYENGDONG.Click += new EventHandler(OnButtonClick);
            //ImageView BTN_GANGNAM = FindViewById<ImageView>(Resource.Id.BTN_GANGNAM);
            //RegisterForContextMenu(BTN_GANGNAM);
            //BTN_GANGNAM.Click += new EventHandler(OnButtonClick);
            //ImageView BTN_TERMINAL = FindViewById<ImageView>(Resource.Id.BTN_TERMINAL);
            //RegisterForContextMenu(BTN_TERMINAL);
            //BTN_TERMINAL.Click += new EventHandler(OnButtonClick);
            //ImageView BTN_YEONGDEONGPO = FindViewById<ImageView>(Resource.Id.BTN_YEONGDEONGPO);
            //RegisterForContextMenu(BTN_YEONGDEONGPO);
            //BTN_YEONGDEONGPO.Click += new EventHandler(OnButtonClick);


            LinearLayout1 = FindViewById <LinearLayout>(Resource.Id.LinearLayout1);

            Button BTN_SEARCH = FindViewById <Button>(Resource.Id.BTN_SEARCH);

            BTN_SEARCH.Click += OnSearchClick;

            LinearLayout BTN_BOOKMARK = FindViewById <LinearLayout>(Resource.Id.BTN_BOOKMARK);

            BTN_BOOKMARK.Click += BTN_BOOKMARK_Click;
            LinearLayout BTN_EVENT = FindViewById <LinearLayout>(Resource.Id.BTN_EVENT);

            BTN_EVENT.Click += BTN_EVENT_Click;
            LinearLayout BTN_DEVELOP = FindViewById <LinearLayout>(Resource.Id.BTN_DEVELOP);

            BTN_DEVELOP.Click += BTN_DEVELOP_Click;
        }
Ejemplo n.º 3
0
        //ImageView backgroundImg;
        //Bitmap bitmapToDisplay;

        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);


            if (MainActivity.Activities.ContainsKey("DevelopStoryActivity"))
            {
                MainActivity.Activities["DevelopStoryActivity"].Finish();
                MainActivity.Activities.Remove("DevelopStoryActivity");
                MainActivity.Activities.Add("DevelopStoryActivity", this);
            }
            else
            {
                MainActivity.Activities.Add("DevelopStoryActivity", this);
            }

            SetContentView(Resource.Layout.DevelopStoryLayout);

            //backgroundImg = FindViewById<ImageView>(Resource.Id.backgroundImg);
            //BitmapResize br = new BitmapResize();
            //BitmapFactory.Options options = await br.GetBitmapOptionsOfImageAsync(Resources, Resource.Drawable.blurUnderShop2);
            //bitmapToDisplay = await br.LoadScaledDownBitmapForDisplayAsync(Resources, Resource.Drawable.blurUnderShop2, options, 100, 100);
            //backgroundImg.SetImageBitmap(bitmapToDisplay);

            int[] memberImgs =
            {
                Resource.Drawable.Ahn,
                Resource.Drawable.kimchangwoo,
                Resource.Drawable.nakim,
                Resource.Drawable.yang,
                Resource.Drawable.joo
            };

            int[] toolImgs =
            {
                Resource.Drawable.visual_studio_logo,
                Resource.Drawable.xamarin_logo
            };

            int[] APIImgs =
            {
                Resource.Drawable.seoul_logo,
                Resource.Drawable.Google_logo
            };

            int belongImg = Resource.Drawable.hansei;

            ImageView[] iv_Members =
            {
                FindViewById <ImageView>(Resource.Id.iv_Member1),
                FindViewById <ImageView>(Resource.Id.iv_Member2),
                FindViewById <ImageView>(Resource.Id.iv_Member3),
                FindViewById <ImageView>(Resource.Id.iv_Member4),
                FindViewById <ImageView>(Resource.Id.iv_Member5)
            };

            ImageView[] iv_Tools =
            {
                FindViewById <ImageView>(Resource.Id.iv_VSC),
                FindViewById <ImageView>(Resource.Id.iv_Xamarin)
            };
            ImageView[] iv_APIs =
            {
                FindViewById <ImageView>(Resource.Id.iv_SeoulLogo),
                FindViewById <ImageView>(Resource.Id.iv_GoogleLogo)
            };
            ImageView iv_belong = FindViewById <ImageView>(Resource.Id.iv_belong);

            btm_Members = new Bitmap[5];
            for (int i = 0; i < btm_Members.Length; i++)
            {
                BitmapResize          br2      = new BitmapResize();
                BitmapFactory.Options options2 = await br2.GetBitmapOptionsOfImageAsync(Resources, memberImgs[i]);

                btm_Members[i] = await br2.LoadScaledDownBitmapForDisplayAsync(Resources, memberImgs[i], options2, 64, 64);

                //btm_Members[i] = BitmapFactory.DecodeResource(Resources, memberImgs[i]);
                iv_Members[i].SetImageBitmap(btm_Members[i]);
            }

            btm_Tools = new Bitmap[2];
            for (int i = 0; i < btm_Tools.Length; i++)
            {
                BitmapResize          br2      = new BitmapResize();
                BitmapFactory.Options options2 = await br2.GetBitmapOptionsOfImageAsync(Resources, toolImgs[i]);

                btm_Tools[i] = await br2.LoadScaledDownBitmapForDisplayAsync(Resources, toolImgs[i], options2, 48, 48);

                //btm_Tools[i] = BitmapFactory.DecodeResource(Resources, toolImgs[i]);
                iv_Tools[i].SetImageBitmap(btm_Tools[i]);
            }

            btm_APIs = new Bitmap[2];
            for (int i = 0; i < btm_APIs.Length; i++)
            {
                BitmapResize          br2      = new BitmapResize();
                BitmapFactory.Options options2 = await br2.GetBitmapOptionsOfImageAsync(Resources, APIImgs[i]);

                btm_APIs[i] = await br2.LoadScaledDownBitmapForDisplayAsync(Resources, APIImgs[i], options2, 32, 32);

                //btm_APIs[i] = BitmapFactory.DecodeResource(Resources, APIImgs[i]);
                iv_APIs[i].SetImageBitmap(btm_APIs[i]);
            }

            BitmapResize br3 = new BitmapResize();

            BitmapFactory.Options options3 = await br3.GetBitmapOptionsOfImageAsync(Resources, belongImg);

            btm_belong = await br3.LoadScaledDownBitmapForDisplayAsync(Resources, belongImg, options3, 32, 32);

            //btm_APIs[i] = BitmapFactory.DecodeResource(Resources, APIImgs[i]);
            iv_belong.SetImageBitmap(btm_belong);
        }