protected internal override void onCreate(android.os.Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			android.os.Bundle extras = getIntent().getExtras();
			if (extras == null)
			{
				finish();
				return;
			}
			mNumDeletes = extras.getLong("numDeletes");
			mAccount = (android.accounts.Account)extras.getParcelable("account");
			mAuthority = extras.getString("authority");
			mProvider = extras.getString("provider");
			// the order of these must match up with the constants for position used in onItemClick
			java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources().
				getText([email protected][email protected]_really_delete), getResources().getText(
				[email protected][email protected]_undo_deletes), getResources().getText([email protected]
				[email protected]_do_nothing) };
			android.widget.ListAdapter adapter = new android.widget.ArrayAdapter<java.lang.CharSequence
				>(this, android.R.layout.simple_list_item_1, android.R.id.text1, options);
			android.widget.ListView listView = new android.widget.ListView(this);
			listView.setAdapter(adapter);
			listView.setItemsCanFocus(true);
			listView.setOnItemClickListener(this);
			android.widget.TextView textView = new android.widget.TextView(this);
			java.lang.CharSequence tooManyDeletesDescFormat = getResources().getText([email protected]
				[email protected]_too_many_deletes_desc);
			textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat
				.ToString(), mNumDeletes, mProvider, mAccount.name)));
			android.widget.LinearLayout ll = new android.widget.LinearLayout(this);
			ll.setOrientation(android.widget.LinearLayout.VERTICAL);
			android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
				(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams
				.WRAP_CONTENT, 0);
			ll.addView(textView, lp);
			ll.addView(listView, lp);
			// TODO: consider displaying the icon of the account type
			//        AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes();
			//        for (AuthenticatorDescription desc : descs) {
			//            if (desc.type.equals(mAccount.type)) {
			//                try {
			//                    final Context authContext = createPackageContext(desc.packageName, 0);
			//                    ImageView imageView = new ImageView(this);
			//                    imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId));
			//                    ll.addView(imageView, lp);
			//                } catch (PackageManager.NameNotFoundException e) {
			//                }
			//                break;
			//            }
			//        }
			setContentView(ll);
		}
 protected internal override void onCreate(android.os.Bundle savedInstanceState)
 {
     base.onCreate(savedInstanceState);
     android.os.Bundle extras = getIntent().getExtras();
     if (extras == null)
     {
         finish();
         return;
     }
     mNumDeletes = extras.getLong("numDeletes");
     mAccount    = (android.accounts.Account)extras.getParcelable("account");
     mAuthority  = extras.getString("authority");
     mProvider   = extras.getString("provider");
     // the order of these must match up with the constants for position used in onItemClick
     java.lang.CharSequence[] options = new java.lang.CharSequence[] { getResources().
                                                                       getText([email protected][email protected]_really_delete), getResources().getText(
                                                                           [email protected][email protected]_undo_deletes), getResources().getText([email protected]
                                                                                                                                                  [email protected]_do_nothing) };
     android.widget.ListAdapter adapter = new android.widget.ArrayAdapter <java.lang.CharSequence
                                                                           >(this, android.R.layout.simple_list_item_1, android.R.id.text1, options);
     android.widget.ListView listView = new android.widget.ListView(this);
     listView.setAdapter(adapter);
     listView.setItemsCanFocus(true);
     listView.setOnItemClickListener(this);
     android.widget.TextView textView = new android.widget.TextView(this);
     java.lang.CharSequence  tooManyDeletesDescFormat = getResources().getText([email protected]
                                                                               [email protected]_too_many_deletes_desc);
     textView.setText(java.lang.CharSequenceProxy.Wrap(string.Format(tooManyDeletesDescFormat
                                                                     .ToString(), mNumDeletes, mProvider, mAccount.name)));
     android.widget.LinearLayout ll = new android.widget.LinearLayout(this);
     ll.setOrientation(android.widget.LinearLayout.VERTICAL);
     android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                       (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams
                                                       .WRAP_CONTENT, 0);
     ll.addView(textView, lp);
     ll.addView(listView, lp);
     // TODO: consider displaying the icon of the account type
     //        AuthenticatorDescription[] descs = AccountManager.get(this).getAuthenticatorTypes();
     //        for (AuthenticatorDescription desc : descs) {
     //            if (desc.type.equals(mAccount.type)) {
     //                try {
     //                    final Context authContext = createPackageContext(desc.packageName, 0);
     //                    ImageView imageView = new ImageView(this);
     //                    imageView.setImageDrawable(authContext.getResources().getDrawable(desc.iconId));
     //                    ll.addView(imageView, lp);
     //                } catch (PackageManager.NameNotFoundException e) {
     //                }
     //                break;
     //            }
     //        }
     setContentView(ll);
 }
Beispiel #3
0
 private void setupContent(android.widget.LinearLayout contentPanel)
 {
     mScrollView = (android.widget.ScrollView)mWindow.findViewById([email protected]
                                                                   .id.scrollView);
     mScrollView.setFocusable(false);
     // Special case for users that only want to display a String
     mMessageView = (android.widget.TextView)mWindow.findViewById([email protected].
                                                                  id.message);
     if (mMessageView == null)
     {
         return;
     }
     if (mMessage != null)
     {
         mMessageView.setText(mMessage);
     }
     else
     {
         mMessageView.setVisibility(android.view.View.GONE);
         mScrollView.removeView(mMessageView);
         if (mListView != null)
         {
             contentPanel.removeView(mWindow.findViewById([email protected]));
             contentPanel.addView(mListView, new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
                                                                                          .LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
             contentPanel.setLayoutParams(new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
                                                                                       .LayoutParams.MATCH_PARENT, 0, 1.0f));
         }
         else
         {
             contentPanel.setVisibility(android.view.View.GONE);
         }
     }
 }
Beispiel #4
0
        private bool setupTitle(android.widget.LinearLayout topPanel)
        {
            bool hasTitle = true;

            if (mCustomTitleView != null)
            {
                // Add the custom title view directly to the topPanel layout
                android.widget.LinearLayout.LayoutParams lp = new android.widget.LinearLayout.LayoutParams
                                                                  (android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams
                                                                  .WRAP_CONTENT);
                topPanel.addView(mCustomTitleView, 0, lp);
                // Hide the title template
                android.view.View titleTemplate = mWindow.findViewById([email protected]_template
                                                                       );
                titleTemplate.setVisibility(android.view.View.GONE);
            }
            else
            {
                bool hasTextTitle = !android.text.TextUtils.isEmpty(mTitle);
                mIconView = (android.widget.ImageView)mWindow.findViewById([email protected]
                                                                           .icon);
                if (hasTextTitle)
                {
                    mTitleView = (android.widget.TextView)mWindow.findViewById([email protected]
                                                                               .alertTitle);
                    mTitleView.setText(mTitle);
                    if (mIconId > 0)
                    {
                        mIconView.setImageResource(mIconId);
                    }
                    else
                    {
                        if (mIcon != null)
                        {
                            mIconView.setImageDrawable(mIcon);
                        }
                        else
                        {
                            if (mIconId == 0)
                            {
                                mTitleView.setPadding(mIconView.getPaddingLeft(), mIconView.getPaddingTop(), mIconView
                                                      .getPaddingRight(), mIconView.getPaddingBottom());
                                mIconView.setVisibility(android.view.View.GONE);
                            }
                        }
                    }
                }
                else
                {
                    // Hide the title template
                    android.view.View titleTemplate = mWindow.findViewById([email protected]_template
                                                                           );
                    titleTemplate.setVisibility(android.view.View.GONE);
                    mIconView.setVisibility(android.view.View.GONE);
                    topPanel.setVisibility(android.view.View.GONE);
                    hasTitle = false;
                }
            }
            return(hasTitle);
        }
Beispiel #5
0
        protected internal override void onResume()
        {
            base.onResume();
            if (mChartView == null)
            {
                LinearLayout layout = (LinearLayout)findViewById(R.id.chart);
                // mChartView = ChartFactory.getLineChartView(this, mDataset, mRenderer);
                // mChartView = ChartFactory.getBarChartView(this, mDataset, mRenderer,
                // Type.DEFAULT);
                mChartView = ChartFactory.getScatterChartView(this, mDataset, mRenderer);

                // enable the chart click events
                mRenderer.ClickEnabled     = true;
                mRenderer.SelectableBuffer = 100;
                mChartView.OnClickListener = new OnClickListenerAnonymousInnerClassHelper3(this);
                // an example of handling the zoom events on the chart
                mChartView.addZoomListener(new ZoomListenerAnonymousInnerClassHelper(this), true, true);
                // an example of handling the pan events on the chart
                mChartView.addPanListener(new PanListenerAnonymousInnerClassHelper(this));
                layout.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
                bool enabled = mDataset.SeriesCount > 0;
                SeriesWidgetsEnabled = enabled;
            }
            else
            {
                mChartView.repaint();
            }
        }
        private void showStatus(string txt)
        {
            Log.i(TAG, txt);
            TextView tv = new TextView(this);

            tv.Text = txt;
            rootLayout.addView(tv);
        }
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_information;

            Slook        slook = new Slook();
            LinearLayout l     = (LinearLayout)findViewById(R.id.information);

            try
            {
                slook.initialize(this);
            }
            catch (SsdkUnsupportedException e)
            {
                l.addView(createTextView(e.ToString()));
                return;
            }

            l.addView(createTextView("*VersionCode:" + slook.VersionCode));
            l.addView(createTextView("*Feature"));
            l.addView(createTextView("   - AirButton:" + slook.isFeatureEnabled(Slook.AIRBUTTON)));
            l.addView(createTextView("   - PointerIcon:" + slook.isFeatureEnabled(Slook.SPEN_HOVER_ICON)));
            l.addView(createTextView("   - SmartClip:" + slook.isFeatureEnabled(Slook.SMARTCLIP)));
            l.addView(createTextView("   - WritingBuddy:" + slook.isFeatureEnabled(Slook.WRITINGBUDDY)));
        }
 protected internal override void onResume()
 {
     base.onResume();
     if (mChartView == null)
     {
         LinearLayout layout = (LinearLayout)findViewById(R.id.chart);
         mChartView                 = ChartFactory.getPieChartView(this, mSeries, mRenderer);
         mRenderer.ClickEnabled     = true;
         mChartView.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
         layout.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
     }
     else
     {
         mChartView.repaint();
     }
 }
 protected internal override void onResume()
 {
     base.onResume();
     if (mChartView == null)
     {
         LinearLayout layout = (LinearLayout)findViewById(R.id.chart);
         mChartView = ChartFactory.getLineChartView(this, mDataset, mRenderer);
         // enable the chart click events
         mRenderer.ClickEnabled     = true;
         mRenderer.SelectableBuffer = 10;
         mChartView.OnClickListener = new OnClickListenerAnonymousInnerClassHelper3(this);
         layout.addView(mChartView, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
         bool enabled = mDataset.SeriesCount > 0;
         SeriesWidgetsEnabled = enabled;
     }
     else
     {
         mChartView.repaint();
     }
 }
 /// <summary>
 /// Utility method that displays permissions from a map containing group name and
 /// list of permission descriptions.
 /// </summary>
 /// <remarks>
 /// Utility method that displays permissions from a map containing group name and
 /// list of permission descriptions.
 /// </remarks>
 private void displayPermissions(bool dangerous)
 {
     java.util.Map <string, string> permInfoMap  = dangerous ? mDangerousMap : mNormalMap;
     android.widget.LinearLayout    permListView = dangerous ? mDangerousList : mNonDangerousList;
     permListView.removeAllViews();
     java.util.Set <string> permInfoStrSet = permInfoMap.keySet();
     foreach (string loopPermGrpInfoStr in Sharpen.IterableProxy.Create(permInfoStrSet
                                                                        ))
     {
         java.lang.CharSequence grpLabel = getGroupLabel(loopPermGrpInfoStr);
         //guaranteed that grpLabel wont be null since permissions without groups
         //will belong to the default group
         if (localLOGV)
         {
             android.util.Log.i(TAG, "Adding view group:" + grpLabel + ", desc:" + permInfoMap
                                .get(loopPermGrpInfoStr));
         }
         permListView.addView(getPermissionItemView(grpLabel, java.lang.CharSequenceProxy.Wrap
                                                        (permInfoMap.get(loopPermGrpInfoStr)), dangerous));
     }
 }
Beispiel #11
0
		/// <summary>
		/// <p>Builds the popup window's content and returns the height the popup
		/// should have.
		/// </summary>
		/// <remarks>
		/// <p>Builds the popup window's content and returns the height the popup
		/// should have. Returns -1 when the content already exists.</p>
		/// </remarks>
		/// <returns>the content's height or -1 if content already exists</returns>
		private int buildDropDown()
		{
			android.view.ViewGroup dropDownView;
			int otherHeights = 0;
			if (mDropDownList == null)
			{
				android.content.Context context = mContext;
				mShowDropDownRunnable = new _Runnable_976(this);
				mDropDownList = new android.widget.ListPopupWindow.DropDownListView(context, !mModal
					);
				if (mDropDownListHighlight != null)
				{
					mDropDownList.setSelector(mDropDownListHighlight);
				}
				mDropDownList.setAdapter(mAdapter);
				mDropDownList.setOnItemClickListener(mItemClickListener);
				mDropDownList.setFocusable(true);
				mDropDownList.setFocusableInTouchMode(true);
				mDropDownList.setOnItemSelectedListener(new _OnItemSelectedListener_994(this));
				mDropDownList.setOnScrollListener(mScrollListener);
				if (mItemSelectedListener != null)
				{
					mDropDownList.setOnItemSelectedListener(mItemSelectedListener);
				}
				dropDownView = mDropDownList;
				android.view.View hintView = mPromptView;
				if (hintView != null)
				{
					// if an hint has been specified, we accomodate more space for it and
					// add a text view in the drop down menu, at the bottom of the list
					android.widget.LinearLayout hintContainer = new android.widget.LinearLayout(context
						);
					hintContainer.setOrientation(android.widget.LinearLayout.VERTICAL);
					android.widget.LinearLayout.LayoutParams hintParams = new android.widget.LinearLayout
						.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, 0, 1.0f);
					switch (mPromptPosition)
					{
						case POSITION_PROMPT_BELOW:
						{
							hintContainer.addView(dropDownView, hintParams);
							hintContainer.addView(hintView);
							break;
						}

						case POSITION_PROMPT_ABOVE:
						{
							hintContainer.addView(hintView);
							hintContainer.addView(dropDownView, hintParams);
							break;
						}

						default:
						{
							android.util.Log.e(TAG, "Invalid hint position " + mPromptPosition);
							break;
						}
					}
					// measure the hint's height to find how much more vertical space
					// we need to add to the drop down's height
					int widthSpec = android.view.View.MeasureSpec.makeMeasureSpec(mDropDownWidth, android.view.View
						.MeasureSpec.AT_MOST);
					int heightSpec = android.view.View.MeasureSpec.UNSPECIFIED;
					hintView.measure(widthSpec, heightSpec);
					hintParams = (android.widget.LinearLayout.LayoutParams)hintView.getLayoutParams();
					otherHeights = hintView.getMeasuredHeight() + hintParams.topMargin + hintParams.bottomMargin;
					dropDownView = hintContainer;
				}
				mPopup.setContentView(dropDownView);
			}
			else
			{
				dropDownView = (android.view.ViewGroup)mPopup.getContentView();
				android.view.View view = mPromptView;
				if (view != null)
				{
					android.widget.LinearLayout.LayoutParams hintParams = (android.widget.LinearLayout
						.LayoutParams)view.getLayoutParams();
					otherHeights = view.getMeasuredHeight() + hintParams.topMargin + hintParams.bottomMargin;
				}
			}
			// getMaxAvailableHeight() subtracts the padding, so we put it back
			// to get the available height for the whole window
			int padding = 0;
			android.graphics.drawable.Drawable background = mPopup.getBackground();
			if (background != null)
			{
				background.getPadding(mTempRect);
				padding = mTempRect.top + mTempRect.bottom;
				// If we don't have an explicit vertical offset, determine one from the window
				// background so that content will line up.
				if (!mDropDownVerticalOffsetSet)
				{
					mDropDownVerticalOffset = -mTempRect.top;
				}
			}
			// Max height available on the screen for a popup.
			bool ignoreBottomDecorations = mPopup.getInputMethodMode() == android.widget.PopupWindow
				.INPUT_METHOD_NOT_NEEDED;
			int maxHeight = mPopup.getMaxAvailableHeight(getAnchorView(), mDropDownVerticalOffset
				, ignoreBottomDecorations);
			if (mDropDownAlwaysVisible || mDropDownHeight == android.view.ViewGroup.LayoutParams
				.MATCH_PARENT)
			{
				return maxHeight + padding;
			}
			int listContent = mDropDownList.measureHeightOfChildren(android.view.View.MeasureSpec
				.UNSPECIFIED, 0, android.widget.ListView.NO_POSITION, maxHeight - otherHeights, 
				-1);
			// add padding only if the list has items in it, that way we don't show
			// the popup if it is not needed
			if (listContent > 0)
			{
				otherHeights += padding;
			}
			return listContent + otherHeights;
		}