コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            SetTitle(Resource.String.app_name);

            mGetActivePromos = (Button)FindViewById(Resource.Id.getActivePromos);
            mGetActivePromos.SetOnClickListener(this);

            mAchievementId = (EditText)FindViewById(Resource.Id.achievementId);
            mAchievementId.SetOnEditorActionListener(this);
            mAchievementId.ImeOptions = ImeAction.Done;
            mLeaderboardId            = (EditText)FindViewById(Resource.Id.leaderboardId);
            mLeaderboardId.SetOnEditorActionListener(this);
            mLeaderboardId.ImeOptions = ImeAction.Done;

            mUnlockAchievement = (Button)FindViewById(Resource.Id.unlockAchievement);
            mUnlockAchievement.SetOnClickListener(this);

            mSaveLeaderboard = (Button)FindViewById(Resource.Id.saveLeaderboard);
            mSaveLeaderboard.SetOnClickListener(this);

            mShowNotification = (Button)FindViewById(Resource.Id.showNotification);
            mShowNotification.SetOnClickListener(this);

            mShowFullscreen = (Button)FindViewById(Resource.Id.showFullscreen);
            mShowFullscreen.SetOnClickListener(this);

            mRewardActionToggle = (ToggleButton)FindViewById(Resource.Id.rewardActionToggle);
            mPositionToggle     = (ToggleButton)FindViewById(Resource.Id.positionToggle);

            mNewActivity = (Button)FindViewById(Resource.Id.newActivity);
            mNewActivity.SetOnClickListener(this);

            if (bundle != null)
            {
                // Restore EditText fields
                mAchievementId.Text = bundle.GetString("achievement_id");
                mLeaderboardId.Text = bundle.GetString("leaderboard_id");
            }
            else
            {
                mAchievementId.Text = "com.jmawebtechnologies.gemfindermt.beatgame";
                mLeaderboardId.Text = "com.jmawebtechnologies.gemfindermt.leaderboard.onethousand";
            }

            mActivePromosListener = new ActivePromosRequestListener(this);
            mRewardsListener      = new RewardRequestListener(this);
        }
コード例 #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            SetTitle(Resource.String.app_name);

            mGetActivePromos = (Button)FindViewById(Resource.Id.getActivePromos);
            mGetActivePromos.SetOnClickListener(this);

            mAchievementId = (EditText)FindViewById(Resource.Id.achievementId);
            mAchievementId.SetOnEditorActionListener(this);
            mAchievementId.ImeOptions = ImeAction.Done;
            mLeaderboardId = (EditText)FindViewById(Resource.Id.leaderboardId);
            mLeaderboardId.SetOnEditorActionListener(this);
            mLeaderboardId.ImeOptions = ImeAction.Done;

            mUnlockAchievement = (Button)FindViewById(Resource.Id.unlockAchievement);
            mUnlockAchievement.SetOnClickListener(this);

            mSaveLeaderboard = (Button)FindViewById(Resource.Id.saveLeaderboard);
            mSaveLeaderboard.SetOnClickListener(this);

            mShowNotification = (Button)FindViewById(Resource.Id.showNotification);
            mShowNotification.SetOnClickListener(this);

            mShowFullscreen = (Button)FindViewById(Resource.Id.showFullscreen);
            mShowFullscreen.SetOnClickListener(this);

            mRewardActionToggle = (ToggleButton)FindViewById(Resource.Id.rewardActionToggle);
            mPositionToggle = (ToggleButton)FindViewById(Resource.Id.positionToggle);

            mNewActivity = (Button)FindViewById(Resource.Id.newActivity);
            mNewActivity.SetOnClickListener(this);

            if (bundle != null)
            {
                // Restore EditText fields
                mAchievementId.Text = bundle.GetString("achievement_id");
                mLeaderboardId.Text = bundle.GetString("leaderboard_id");
            }
            else
            {
                mAchievementId.Text = "com.jmawebtechnologies.gemfindermt.beatgame";
                mLeaderboardId.Text = "com.jmawebtechnologies.gemfindermt.leaderboard.onethousand";
            }

            mActivePromosListener = new ActivePromosRequestListener(this);
            mRewardsListener = new RewardRequestListener(this);
        }