protected override void OnCreate(Bundle savedInstance)
      {
         base.OnCreate(savedInstance);

         SetContentView(R.Layouts.sign_in_activity);

         mSignInFragment = PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);

         FindViewById(R.Ids.sign_in_button).SetOnClickListener(this);
         FindViewById(R.Ids.sign_out_button).SetOnClickListener(this);
         FindViewById(R.Ids.revoke_access_button).SetOnClickListener(this);
         mSignInStatus = (TextView)FindViewById(R.Ids.sign_in_status);
      }
 override protected void OnCreate(Bundle savedInstanceState)
 {
    base.OnCreate(savedInstanceState);
    SetContentView(R.Layouts.share_activity);
    mSendButton = (Button)FindViewById(R.Ids.send_interactive_button);
    mSendButton.SetOnClickListener(this);
    mSendButton.SetEnabled(true);
    mEditSendText = (EditText)FindViewById(R.Ids.share_prefill_edit);
    mPlusClientFragment =
            PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);
    mSharing =
            savedInstanceState != null && savedInstanceState.GetBoolean(STATE_SHARING, false);
 }
Example #3
0
 override protected void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(R.Layouts.share_activity);
     mSendButton = (Button)FindViewById(R.Ids.send_interactive_button);
     mSendButton.SetOnClickListener(this);
     mSendButton.SetEnabled(true);
     mEditSendText       = (EditText)FindViewById(R.Ids.share_prefill_edit);
     mPlusClientFragment =
         PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);
     mSharing =
         savedInstanceState != null && savedInstanceState.GetBoolean(STATE_SHARING, false);
 }
Example #4
0
        protected override void OnCreate(Bundle savedInstance)
        {
            base.OnCreate(savedInstance);

            SetContentView(R.Layouts.sign_in_activity);

            mSignInFragment = PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);

            FindViewById(R.Ids.sign_in_button).SetOnClickListener(this);
            FindViewById(R.Ids.sign_out_button).SetOnClickListener(this);
            FindViewById(R.Ids.revoke_access_button).SetOnClickListener(this);
            mSignInStatus = (TextView)FindViewById(R.Ids.sign_in_status);
        }
Example #5
0
        override protected void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layouts.person_list_activity);

            mListItems   = new ArrayList <String>();
            mListAdapter = new ArrayAdapter <String>(this, Android.R.Layout.Simple_list_item_1,
                                                     mListItems);
            mPersonListView = (ListView)FindViewById(R.Ids.person_list);
            mPersonListView.SetAdapter(mListAdapter);
            mPlusClientFragment = PlusClientFragment.GetPlusClientFragment(this,
                                                                           MomentUtil.VISIBLE_ACTIVITIES);
        }
      override protected void OnCreate(Bundle savedInstanceState)
      {
         base.OnCreate(savedInstanceState);
         SetContentView(R.Layouts.person_list_activity);

         mListItems = new ArrayList<String>();
         mListAdapter = new ArrayAdapter<String>(this, Android.R.Layout.Simple_list_item_1,
                 mListItems);
         mPersonListView = (ListView)FindViewById(R.Ids.person_list);
         mPersonListView.SetAdapter(mListAdapter);
         mPlusClientFragment = PlusClientFragment.GetPlusClientFragment(this,
                 MomentUtil.VISIBLE_ACTIVITIES);
      }
Example #7
0
        override protected void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(R.Layouts.multi_moment_activity);

            mPlusClientFragment =
                PlusClientFragment.GetPlusClientFragment(this, MomentUtil.VISIBLE_ACTIVITIES);
            mListAdapter = new ArrayAdapter <String>(
                this, Android.R.Layout.Simple_list_item_1, MomentUtil.MOMENT_LIST);
            mMomentListView = (ListView)FindViewById(R.Ids.moment_list);
            mMomentListView.SetOnItemClickListener(this);
            mMomentListView.SetAdapter(mListAdapter);
            mPendingMoments = new ArrayList <IMoment>();
        }
Example #8
0
        // Attach a PlusClient managing fragment to you activity.
        public static PlusClientFragment GetPlusClientFragment(
            FragmentActivity activity, String[] visibleActivities)
        {
            if (!(activity is OnSignedInListener))
            {
                throw new ArgumentException(
                          "The activity must implement OnSignedInListener to receive callbacks.");
            }

            // Check if the fragment is already attached.
            FragmentManager fragmentManager = activity.GetSupportFragmentManager();
            Fragment        fragment        = fragmentManager.FindFragmentByTag(TAG_PLUS_CLIENT);

            if (fragment is PlusClientFragment)
            {
                // The fragment is attached.  If it has the right visible activities, return it.
                if (Arrays.Equals(visibleActivities,
                                  fragment.GetArguments().GetStringArray(ARG_VISIBLE_ACTIVITIES)))
                {
                    return((PlusClientFragment)fragment);
                }
            }

            FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();

            // If a fragment was already attached, remove it to clean up.
            if (fragment != null)
            {
                fragmentTransaction.Remove(fragment);
            }

            // Create a new fragment and attach it to the fragment manager.
            Bundle arguments = new Bundle();

            arguments.PutStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
            PlusClientFragment signInFragment = new PlusClientFragment();

            signInFragment.SetArguments(arguments);
            fragmentTransaction.Add(signInFragment, TAG_PLUS_CLIENT);
            fragmentTransaction.Commit();
            return(signInFragment);
        }
Example #9
0
 public PlusClientFragmentHandler(PlusClientFragment fragment)
     : base(Looper.GetMainLooper())
 {
     mFragment = fragment;
 }
      // Attach a PlusClient managing fragment to you activity.
      public static PlusClientFragment GetPlusClientFragment(
              FragmentActivity activity, String[] visibleActivities)
      {
         if (!(activity is OnSignedInListener))
         {
            throw new ArgumentException(
                    "The activity must implement OnSignedInListener to receive callbacks.");
         }

         // Check if the fragment is already attached.
         FragmentManager fragmentManager = activity.GetSupportFragmentManager();
         Fragment fragment = fragmentManager.FindFragmentByTag(TAG_PLUS_CLIENT);
         if (fragment is PlusClientFragment)
         {
            // The fragment is attached.  If it has the right visible activities, return it.
            if (Arrays.Equals(visibleActivities,
                    fragment.GetArguments().GetStringArray(ARG_VISIBLE_ACTIVITIES)))
            {
               return (PlusClientFragment)fragment;
            }
         }

         FragmentTransaction fragmentTransaction = fragmentManager.BeginTransaction();
         // If a fragment was already attached, remove it to clean up.
         if (fragment != null)
         {
            fragmentTransaction.Remove(fragment);
         }

         // Create a new fragment and attach it to the fragment manager.
         Bundle arguments = new Bundle();
         arguments.PutStringArray(ARG_VISIBLE_ACTIVITIES, visibleActivities);
         PlusClientFragment signInFragment = new PlusClientFragment();
         signInFragment.SetArguments(arguments);
         fragmentTransaction.Add(signInFragment, TAG_PLUS_CLIENT);
         fragmentTransaction.Commit();
         return signInFragment;
      }
 public PlusClientFragmentHandler(PlusClientFragment fragment)
    : base(Looper.GetMainLooper())
 {
    mFragment = fragment;
 }