Esempio n. 1
0
 /// <summary>
 /// Constructor for the
 /// <see cref="ZoomButtonsController">ZoomButtonsController</see>
 /// .
 /// </summary>
 /// <param name="ownerView">
 /// The view that is being zoomed by the zoom controls. The
 /// zoom controls will be displayed aligned with this view.
 /// </param>
 public ZoomButtonsController(android.view.View ownerView)
 {
     mConfigurationChangedReceiver = new _BroadcastReceiver_150(this);
     mHandler       = new _Handler_170(this);
     mContext       = ownerView.getContext();
     mWindowManager = (android.view.WindowManager)mContext.getSystemService(android.content.Context
                                                                            .WINDOW_SERVICE);
     mOwnerView            = ownerView;
     mTouchPaddingScaledSq = (int)(ZOOM_CONTROLS_TOUCH_PADDING * mContext.getResources
                                       ().getDisplayMetrics().density);
     mTouchPaddingScaledSq *= mTouchPaddingScaledSq;
     mContainer             = createContainer();
 }
Esempio n. 2
0
 /// <summary><p>Call setup() before adding tabs if loading TabHost using findViewById().
 ///     </summary>
 /// <remarks>
 /// <p>Call setup() before adding tabs if loading TabHost using findViewById().
 /// <i><b>However</i></b>: You do not need to call setup() after getTabHost()
 /// in
 /// <see cref="android.app.TabActivity">TabActivity</see>
 /// .
 /// Example:</p>
 /// <pre>mTabHost = (TabHost)findViewById(R.id.tabhost);
 /// mTabHost.setup();
 /// mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
 /// </remarks>
 public virtual void setup()
 {
     mTabWidget = (android.widget.TabWidget)findViewById([email protected]);
     if (mTabWidget == null)
     {
         throw new java.lang.RuntimeException("Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'"
                                              );
     }
     mTabKeyListener = new _OnKeyListener_130(this);
     mTabWidget.setTabSelectionListener(new _OnTabSelectionChanged_148(this));
     mTabContent = (android.widget.FrameLayout)findViewById([email protected]
                                                            );
     if (mTabContent == null)
     {
         throw new java.lang.RuntimeException("Your TabHost must have a FrameLayout whose id attribute is "
                                              + "'android.R.id.tabcontent'");
     }
 }
Esempio n. 3
0
 /// <summary>Create a new instance.</summary>
 /// <remarks>Create a new instance.</remarks>
 /// <param name="context">The application environment.</param>
 /// <param name="attrs">A collection of attributes.</param>
 /// <param name="defStyle">The default style to apply to this view.</param>
 public ActivityChooserView(android.content.Context context, android.util.AttributeSet
                            attrs, int defStyle) : base(context, attrs, defStyle)
 {
     mModelDataSetOberver    = new _DataSetObserver_118(this);
     mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
     android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
                                                                                     , [email protected], defStyle, 0);
     mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
                                                    , android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
                                                    );
     android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
                                                                               .getDrawable([email protected]_expandActivityOverflowButtonDrawable
                                                                                            );
     attributesArray.recycle();
     android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
     inflater.inflate([email protected]_chooser_view, this, true);
     mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
     mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
                                                                         .id.activity_chooser_view_content);
     mActivityChooserContentBackground = mActivityChooserContent.getBackground();
     mDefaultActivityButton            = (android.widget.FrameLayout)findViewById([email protected]
                                                                                  .id.default_activity_button);
     mDefaultActivityButton.setOnClickListener(mCallbacks);
     mDefaultActivityButton.setOnLongClickListener(mCallbacks);
     mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
                                       ([email protected]);
     mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
                                                                              .id.expand_activities_button);
     mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
     mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
                                          .findViewById([email protected]);
     mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
                                                         );
     mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
                                                                                  );
     mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
     android.content.res.Resources resources = context.getResources();
     mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels /
                                          2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
                                                                             ));
 }
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_writingbuddy_viewgroup;

            FrameLayout fl = (FrameLayout)findViewById(R.id.input);

            mOutputTextView = (TextView)findViewById(R.id.text_output);

            mWritingBuddy = new SlookWritingBuddy(fl);

            mWritingBuddy.TextWritingListener = new TextWritingListenerAnonymousInnerClassHelper(this);

            Button enableButton = (Button)findViewById(R.id.btn_enable);

            enableButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

            Button typeButton = (Button)findViewById(R.id.btn_type);

            typeButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper2(this);
        }
Esempio n. 5
0
		/// <summary>Create a new instance.</summary>
		/// <remarks>Create a new instance.</remarks>
		/// <param name="context">The application environment.</param>
		/// <param name="attrs">A collection of attributes.</param>
		/// <param name="defStyle">The default style to apply to this view.</param>
		public ActivityChooserView(android.content.Context context, android.util.AttributeSet
			 attrs, int defStyle) : base(context, attrs, defStyle)
		{
			mModelDataSetOberver = new _DataSetObserver_118(this);
			mOnGlobalLayoutListener = new _OnGlobalLayoutListener_132(this);
			android.content.res.TypedArray attributesArray = context.obtainStyledAttributes(attrs
				, [email protected], defStyle, 0);
			mInitialActivityCount = attributesArray.getInt([email protected]_initialActivityCount
				, android.widget.ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_DEFAULT
				);
			android.graphics.drawable.Drawable expandActivityOverflowButtonDrawable = attributesArray
				.getDrawable([email protected]_expandActivityOverflowButtonDrawable
				);
			attributesArray.recycle();
			android.view.LayoutInflater inflater = android.view.LayoutInflater.from(mContext);
			inflater.inflate([email protected]_chooser_view, this, true);
			mCallbacks = new android.widget.ActivityChooserView.Callbacks(this);
			mActivityChooserContent = (android.widget.LinearLayout)findViewById([email protected]
				.id.activity_chooser_view_content);
			mActivityChooserContentBackground = mActivityChooserContent.getBackground();
			mDefaultActivityButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.default_activity_button);
			mDefaultActivityButton.setOnClickListener(mCallbacks);
			mDefaultActivityButton.setOnLongClickListener(mCallbacks);
			mDefaultActivityButtonImage = (android.widget.ImageView)mDefaultActivityButton.findViewById
				([email protected]);
			mExpandActivityOverflowButton = (android.widget.FrameLayout)findViewById([email protected]
				.id.expand_activities_button);
			mExpandActivityOverflowButton.setOnClickListener(mCallbacks);
			mExpandActivityOverflowButtonImage = (android.widget.ImageView)mExpandActivityOverflowButton
				.findViewById([email protected]);
			mExpandActivityOverflowButtonImage.setImageDrawable(expandActivityOverflowButtonDrawable
				);
			mAdapter = new android.widget.ActivityChooserView.ActivityChooserViewAdapter(this
				);
			mAdapter.registerDataSetObserver(new _DataSetObserver_239(this));
			android.content.res.Resources resources = context.getResources();
			mListPopupMaxWidth = System.Math.Max(resources.getDisplayMetrics().widthPixels / 
				2, resources.getDimensionPixelSize([email protected]_prefDialogWidth
				));
		}
Esempio n. 6
0
        private void setupView()
        {
            android.widget.LinearLayout contentPanel = (android.widget.LinearLayout)mWindow.findViewById
                                                           ([email protected]);
            setupContent(contentPanel);
            bool hasButtons = setupButtons();

            android.widget.LinearLayout topPanel = (android.widget.LinearLayout)mWindow.findViewById
                                                       ([email protected]);
            android.content.res.TypedArray a = mContext.obtainStyledAttributes(null, [email protected]
                                                                               .styleable.AlertDialog, [email protected], 0);
            bool hasTitle = setupTitle(topPanel);

            android.view.View buttonPanel = mWindow.findViewById([email protected]
                                                                 );
            if (!hasButtons)
            {
                buttonPanel.setVisibility(android.view.View.GONE);
                mWindow.setCloseOnTouchOutsideIfNotSet(true);
            }
            android.widget.FrameLayout customPanel = null;
            if (mView != null)
            {
                customPanel = (android.widget.FrameLayout)mWindow.findViewById([email protected]
                                                                               .id.customPanel);
                android.widget.FrameLayout custom = (android.widget.FrameLayout)mWindow.findViewById
                                                        ([email protected]);
                custom.addView(mView, new android.view.ViewGroup.LayoutParams(android.view.ViewGroup
                                                                              .LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
                if (mViewSpacingSpecified)
                {
                    custom.setPadding(mViewSpacingLeft, mViewSpacingTop, mViewSpacingRight, mViewSpacingBottom
                                      );
                }
                if (mListView != null)
                {
                    ((android.widget.LinearLayout.LayoutParams)customPanel.getLayoutParams()).weight
                        = 0;
                }
            }
            else
            {
                mWindow.findViewById([email protected]).setVisibility(android.view.View
                                                                                       .GONE);
            }
            if (hasTitle)
            {
                android.view.View divider = null;
                if (mMessage != null || mView != null || mListView != null)
                {
                    divider = mWindow.findViewById([email protected]);
                }
                else
                {
                    divider = mWindow.findViewById([email protected]);
                }
                if (divider != null)
                {
                    divider.setVisibility(android.view.View.VISIBLE);
                }
            }
            setBackground(topPanel, contentPanel, customPanel, hasButtons, a, hasTitle, buttonPanel
                          );
            a.recycle();
        }
Esempio n. 7
0
		/// <summary>
		/// Constructor for the
		/// <see cref="ZoomButtonsController">ZoomButtonsController</see>
		/// .
		/// </summary>
		/// <param name="ownerView">
		/// The view that is being zoomed by the zoom controls. The
		/// zoom controls will be displayed aligned with this view.
		/// </param>
		public ZoomButtonsController(android.view.View ownerView)
		{
			mConfigurationChangedReceiver = new _BroadcastReceiver_150(this);
			mHandler = new _Handler_170(this);
			mContext = ownerView.getContext();
			mWindowManager = (android.view.WindowManager)mContext.getSystemService(android.content.Context
				.WINDOW_SERVICE);
			mOwnerView = ownerView;
			mTouchPaddingScaledSq = (int)(ZOOM_CONTROLS_TOUCH_PADDING * mContext.getResources
				().getDisplayMetrics().density);
			mTouchPaddingScaledSq *= mTouchPaddingScaledSq;
			mContainer = createContainer();
		}
Esempio n. 8
0
		/// <summary><p>Call setup() before adding tabs if loading TabHost using findViewById().
		/// 	</summary>
		/// <remarks>
		/// <p>Call setup() before adding tabs if loading TabHost using findViewById().
		/// <i><b>However</i></b>: You do not need to call setup() after getTabHost()
		/// in
		/// <see cref="android.app.TabActivity">TabActivity</see>
		/// .
		/// Example:</p>
		/// <pre>mTabHost = (TabHost)findViewById(R.id.tabhost);
		/// mTabHost.setup();
		/// mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1");
		/// </remarks>
		public virtual void setup()
		{
			mTabWidget = (android.widget.TabWidget)findViewById([email protected]);
			if (mTabWidget == null)
			{
				throw new java.lang.RuntimeException("Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'"
					);
			}
			mTabKeyListener = new _OnKeyListener_130(this);
			mTabWidget.setTabSelectionListener(new _OnTabSelectionChanged_148(this));
			mTabContent = (android.widget.FrameLayout)findViewById([email protected]
				);
			if (mTabContent == null)
			{
				throw new java.lang.RuntimeException("Your TabHost must have a FrameLayout whose id attribute is "
					 + "'android.R.id.tabcontent'");
			}
		}