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);
		}
        private void resetPaddings()
        {
            if (!(Parent is LinearLayout))
            {
                return;
            }
            LinearLayout parent = (LinearLayout)Parent.Parent;

            if (parent.Orientation == LinearLayout.HORIZONTAL && parent.LayoutDirection == LAYOUT_DIRECTION_LTR)
            {
                base.setPadding(mFloatingPaddingLeft, mFloatingPaddingTop, mFloatingPaddingRight, mFloatingPaddingBottom);
            }
            else if (parent.Orientation == LinearLayout.HORIZONTAL)
            {
                base.setPadding(mFloatingPaddingRight, mFloatingPaddingTop, mFloatingPaddingLeft, mFloatingPaddingBottom);
            }
            if (parent.Orientation == LinearLayout.VERTICAL && parent.LayoutDirection == LAYOUT_DIRECTION_RTL)
            {
                base.setPadding(mFloatingPaddingBottom, mFloatingPaddingRight, mFloatingPaddingTop, mFloatingPaddingLeft);
            }
            else if (parent.Orientation == LinearLayout.VERTICAL)
            {
                base.setPadding(mFloatingPaddingBottom, mFloatingPaddingLeft, mFloatingPaddingTop, mFloatingPaddingRight);
            }
            invalidate();
        }
Example #3
0
        private void initTitle()
        {
            if (mTitleLayout == null)
            {
                android.view.LayoutInflater inflater = android.view.LayoutInflater.from(getContext
                                                                                            ());
                inflater.inflate([email protected]_bar_title_item, this);
                mTitleLayout = (android.widget.LinearLayout)getChildAt(getChildCount() - 1);
                mTitleView   = (android.widget.TextView)mTitleLayout.findViewById([email protected]
                                                                                  .id.action_bar_title);
                mSubtitleView = (android.widget.TextView)mTitleLayout.findViewById([email protected]
                                                                                   .id.action_bar_subtitle);
                if (mTitleStyleRes != 0)
                {
                    mTitleView.setTextAppearance(mContext, mTitleStyleRes);
                }
                if (mSubtitleStyleRes != 0)
                {
                    mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes);
                }
            }
            mTitleView.setText(mTitle);
            mSubtitleView.setText(mSubtitle);
            bool hasTitle    = !android.text.TextUtils.isEmpty(mTitle);
            bool hasSubtitle = !android.text.TextUtils.isEmpty(mSubtitle);

            mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE);
            mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE);
            if (mTitleLayout.getParent() == null)
            {
                addView(mTitleLayout);
            }
        }
        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)));
        }
Example #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();
            }
        }
Example #6
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);
        }
Example #7
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);
         }
     }
 }
 private android.widget.LinearLayout createTabLayout()
 {
     android.widget.LinearLayout tabLayout = new android.widget.LinearLayout(getContext
                                                                                 (), null, [email protected]);
     tabLayout.setMeasureWithLargestChildEnabled(true);
     tabLayout.setLayoutParams(new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
                                                                            .LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
     return(tabLayout);
 }
Example #9
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(R.layout.fragment_asynctask, container, false);

            logsView                = (LinearLayout)rootView.findViewById(R.id.logs);
            progressView            = (ProgressBar)rootView.findViewById(R.id.progressBar);
            progressView.Visibility = View.GONE;
            rootView.findViewById(R.id.start_button).OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);

            return(rootView);
        }
 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);
 }
		public ScrollingTabContainerView(android.content.Context context) : base(context)
		{
			mVisAnimListener = new android.widget.@internal.ScrollingTabContainerView.VisibilityAnimListener
				(this);
			setHorizontalScrollBarEnabled(false);
			android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected]
				.styleable.ActionBar, [email protected], 0);
			setContentHeight(a.getLayoutDimension([email protected]_height
				, 0));
			a.recycle();
			mTabLayout = createTabLayout();
			addView(mTabLayout, new android.view.ViewGroup.LayoutParams(android.view.ViewGroup
				.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
		}
 public ScrollingTabContainerView(android.content.Context context) : base(context)
 {
     mVisAnimListener = new android.widget.@internal.ScrollingTabContainerView.VisibilityAnimListener
                            (this);
     setHorizontalScrollBarEnabled(false);
     android.content.res.TypedArray a = getContext().obtainStyledAttributes(null, [email protected]
                                                                            .styleable.ActionBar, [email protected], 0);
     setContentHeight(a.getLayoutDimension([email protected]_height
                                           , 0));
     a.recycle();
     mTabLayout = createTabLayout();
     addView(mTabLayout, new android.view.ViewGroup.LayoutParams(android.view.ViewGroup
                                                                 .LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
 }
Example #13
0
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_custom_capturer;

            localMedia   = LocalMedia.create(this);
            capturedView = (LinearLayout)findViewById(R.id.captured_view);
            videoView    = (VideoView)findViewById(R.id.video_view);
            timerView    = (Chronometer)findViewById(R.id.timer_view);
            timerView.start();

            // Once added we should see our linear layout rendered live below
            localVideoTrack = localMedia.addVideoTrack(true, new ViewCapturer(capturedView));
            localVideoTrack.addRenderer(videoView);
        }
		public override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_custom_capturer;

			localMedia = LocalMedia.create(this);
			capturedView = (LinearLayout) findViewById(R.id.captured_view);
			videoView = (VideoView) findViewById(R.id.video_view);
			timerView = (Chronometer) findViewById(R.id.timer_view);
			timerView.start();

			// Once added we should see our linear layout rendered live below
			localVideoTrack = localMedia.addVideoTrack(true, new ViewCapturer(capturedView));
			localVideoTrack.addRenderer(videoView);
		}
 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();
     }
 }
Example #16
0
 public virtual void setCustomView(android.view.View view)
 {
     if (mCustomView != null)
     {
         removeView(mCustomView);
     }
     mCustomView = view;
     if (mTitleLayout != null)
     {
         removeView(mTitleLayout);
         mTitleLayout = null;
     }
     if (view != null)
     {
         addView(view);
     }
     requestLayout();
 }
 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();
     }
 }
Example #18
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
                                                                             ));
 }
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_realm_basic_example;
            rootLayout  = ((LinearLayout)findViewById(R.id.container));
            rootLayout.removeAllViews();

            // These operations are small enough that
            // we can generally safely run them on the UI thread.

            // Open the default realm for the UI thread.
            realm = Realm.getInstance(this);

            basicCRUD(realm);
            basicQuery(realm);
            basicLinkQuery(realm);

            // More complex operations can be executed on another thread.
            new AsyncTaskAnonymousInnerClassHelper(this)
            .execute();
        }
 /// <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));
     }
 }
 public virtual android.view.View getPermissionsView()
 {
     mInflater = (android.view.LayoutInflater)mContext.getSystemService(android.content.Context
                                                                        .LAYOUT_INFLATER_SERVICE);
     mPermsView = (android.widget.LinearLayout)mInflater.inflate([email protected]
                                                                 .app_perms_summary, null);
     mShowMore     = mPermsView.findViewById([email protected]_more);
     mShowMoreIcon = (android.widget.ImageView)mShowMore.findViewById([email protected]
                                                                      .id.show_more_icon);
     mShowMoreText = (android.widget.TextView)mShowMore.findViewById([email protected]
                                                                     .id.show_more_text);
     mDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                           .id.dangerous_perms_list);
     mNonDangerousList = (android.widget.LinearLayout)mPermsView.findViewById([email protected]
                                                                              .id.non_dangerous_perms_list);
     mNoPermsView = mPermsView.findViewById([email protected]_permissions);
     // Set up the LinearLayout that acts like a list item.
     mShowMore.setClickable(true);
     mShowMore.setOnClickListener(this);
     mShowMore.setFocusable(true);
     // Pick up from framework resources instead.
     mDefaultGrpLabel = mContext.getString([email protected][email protected]_permission_group
                                           );
     mPermFormat = mContext.getString([email protected][email protected]_format);
     mNormalIcon = mContext.getResources().getDrawable([email protected]_text_dot
                                                       );
     mDangerousIcon = mContext.getResources().getDrawable([email protected]
                                                          .ic_bullet_key_permission);
     mShowMaxIcon = mContext.getResources().getDrawable([email protected]_close_holo_dark
                                                        );
     mShowMinIcon = mContext.getResources().getDrawable([email protected]_open_holo_dark
                                                        );
     // Set permissions view
     setPermissions(mPermsList);
     return(mPermsView);
 }
Example #22
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
				));
		}
Example #23
0
        private void setBackground(android.widget.LinearLayout topPanel, android.widget.LinearLayout
                                   contentPanel, android.view.View customPanel, bool hasButtons, android.content.res.TypedArray
                                   a, bool hasTitle, android.view.View buttonPanel)
        {
            int fullDark = a.getResourceId([email protected]_fullDark
                                           , [email protected]_full_dark);
            int topDark = a.getResourceId([email protected]_topDark,
                                          [email protected]_top_dark);
            int centerDark = a.getResourceId([email protected]_centerDark
                                             , [email protected]_center_dark);
            int bottomDark = a.getResourceId([email protected]_bottomDark
                                             , [email protected]_bottom_dark);
            int fullBright = a.getResourceId([email protected]_fullBright
                                             , [email protected]_full_bright);
            int topBright = a.getResourceId([email protected]_topBright
                                            , [email protected]_top_bright);
            int centerBright = a.getResourceId([email protected]_centerBright
                                               , [email protected]_center_bright);
            int bottomBright = a.getResourceId([email protected]_bottomBright
                                               , [email protected]_bottom_bright);
            int bottomMedium = a.getResourceId([email protected]_bottomMedium
                                               , [email protected]_bottom_medium);

            android.view.View[] views  = new android.view.View[4];
            bool[]            light    = new bool[4];
            android.view.View lastView = null;
            bool lastLight             = false;
            int  pos = 0;

            if (hasTitle)
            {
                views[pos] = topPanel;
                light[pos] = false;
                pos++;
            }
            views[pos] = (contentPanel.getVisibility() == android.view.View.GONE) ? null : contentPanel;
            light[pos] = mListView != null;
            pos++;
            if (customPanel != null)
            {
                views[pos] = customPanel;
                light[pos] = mForceInverseBackground;
                pos++;
            }
            if (hasButtons)
            {
                views[pos] = buttonPanel;
                light[pos] = true;
            }
            bool setView_1 = false;

            for (pos = 0; pos < views.Length; pos++)
            {
                android.view.View v = views[pos];
                if (v == null)
                {
                    continue;
                }
                if (lastView != null)
                {
                    if (!setView_1)
                    {
                        lastView.setBackgroundResource(lastLight ? topBright : topDark);
                    }
                    else
                    {
                        lastView.setBackgroundResource(lastLight ? centerBright : centerDark);
                    }
                    setView_1 = true;
                }
                lastView  = v;
                lastLight = light[pos];
            }
            if (lastView != null)
            {
                if (setView_1)
                {
                    lastView.setBackgroundResource(lastLight ? (hasButtons ? bottomMedium : bottomBright
                                                                ) : bottomDark);
                }
                else
                {
                    lastView.setBackgroundResource(lastLight ? fullBright : fullDark);
                }
            }
            //        if (hasButtons && (mListView != null)) {
            //        }
            if ((mListView != null) && (mAdapter != null))
            {
                mListView.setAdapter(mAdapter);
                if (mCheckedItem > -1)
                {
                    mListView.setItemChecked(mCheckedItem, true);
                    mListView.setSelection(mCheckedItem);
                }
            }
        }
Example #24
0
		private void initTitle()
		{
			if (mTitleLayout == null)
			{
				android.view.LayoutInflater inflater = android.view.LayoutInflater.from(getContext
					());
				inflater.inflate([email protected]_bar_title_item, this);
				mTitleLayout = (android.widget.LinearLayout)getChildAt(getChildCount() - 1);
				mTitleView = (android.widget.TextView)mTitleLayout.findViewById([email protected]
					.id.action_bar_title);
				mSubtitleView = (android.widget.TextView)mTitleLayout.findViewById([email protected]
					.id.action_bar_subtitle);
				if (mTitleStyleRes != 0)
				{
					mTitleView.setTextAppearance(mContext, mTitleStyleRes);
				}
				if (mSubtitleStyleRes != 0)
				{
					mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes);
				}
			}
			mTitleView.setText(mTitle);
			mSubtitleView.setText(mSubtitle);
			bool hasTitle = !android.text.TextUtils.isEmpty(mTitle);
			bool hasSubtitle = !android.text.TextUtils.isEmpty(mSubtitle);
			mSubtitleView.setVisibility(hasSubtitle ? VISIBLE : GONE);
			mTitleLayout.setVisibility(hasTitle || hasSubtitle ? VISIBLE : GONE);
			if (mTitleLayout.getParent() == null)
			{
				addView(mTitleLayout);
			}
		}
		private android.widget.LinearLayout createTabLayout()
		{
			android.widget.LinearLayout tabLayout = new android.widget.LinearLayout(getContext
				(), null, [email protected]);
			tabLayout.setMeasureWithLargestChildEnabled(true);
			tabLayout.setLayoutParams(new android.widget.LinearLayout.LayoutParams(android.view.ViewGroup
				.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT));
			return tabLayout;
		}
Example #26
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();
        }
Example #27
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;
		}
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_modules_example;
            rootLayout  = ((LinearLayout)findViewById(R.id.container));
            rootLayout.removeAllViews();

            // The default Realm instance implicitly knows about all classes in the realmModuleAppExample Android Studio
            // module. This does not include the classes from the realmModuleLibraryExample AS module so a Realm using this
            // configuration would know about the following classes: { Cow, Pig, Snake, Spider }
            RealmConfiguration defaultConfig = (new RealmConfiguration.Builder(this)).build();

            // It is possible to extend the default schema by adding additional Realm modules using setModule(). This can
            // also be Realm modules from libraries. The below Realm contains the following classes: { Cow, Pig, Snake,
            // Spider, Cat, Dog }
            RealmConfiguration farmAnimalsConfig = (new RealmConfiguration.Builder(this)).name("farm.realm").setModules(Realm.DefaultModule, new DomesticAnimalsModule()).build();

            // Or you can completely replace the default schema.
            // This Realm contains the following classes: { Elephant, Lion, Zebra, Snake, Spider }
            RealmConfiguration exoticAnimalsConfig = (new RealmConfiguration.Builder(this)).name("exotic.realm").setModules(new ZooAnimalsModule(), new CreepyAnimalsModule()).build();

            // Multiple Realms can be open at the same time
            showStatus("Opening multiple Realms");
            Realm defaultRealm = Realm.getInstance(defaultConfig);
            Realm farmRealm    = Realm.getInstance(farmAnimalsConfig);
            Realm exoticRealm  = Realm.getInstance(exoticAnimalsConfig);

            // Objects can be added to each Realm independantly
            showStatus("Create objects in the default Realm");
            defaultRealm.executeTransaction(new TransactionAnonymousInnerClassHelper(this));

            showStatus("Create objects in the farm Realm");
            farmRealm.executeTransaction(new TransactionAnonymousInnerClassHelper2(this));

            showStatus("Create objects in the exotic Realm");
            exoticRealm.executeTransaction(new TransactionAnonymousInnerClassHelper3(this));

            // You can copy objects between Realms
            showStatus("Copy objects between Realms");
            showStatus("Number of pigs on the farm : " + farmRealm.@where(typeof(Pig)).count());
            showStatus("Copy pig from defaultRealm to farmRealm");
            Pig defaultPig = defaultRealm.@where(typeof(Pig)).findFirst();

            farmRealm.beginTransaction();
            farmRealm.copyToRealm(defaultPig);
            farmRealm.commitTransaction();
            showStatus("Number of pigs on the farm : " + farmRealm.@where(typeof(Pig)).count());

            // Each Realm is restricted to only accept the classes in their schema.
            showStatus("Trying to add an unsupported class");
            defaultRealm.beginTransaction();
            try
            {
                defaultRealm.createObject(typeof(Elephant));
            }
            catch (RealmException expected)
            {
                showStatus("This throws a :" + expected.ToString());
            }
            finally
            {
                defaultRealm.cancelTransaction();
            }

            // And Realms in library projects are independent from Realms in the app code
            showStatus("Interacting with library code that uses Realm internally");
            int animals    = 5;
            Zoo libraryZoo = new Zoo(this);

            libraryZoo.open();
            showStatus("Adding animals: " + animals);
            libraryZoo.addAnimals(5);
            showStatus("Number of animals in the library Realm:" + libraryZoo.NoOfAnimals);
            libraryZoo.close();

            // Remember to close all open Realms
            defaultRealm.close();
            farmRealm.close();
            exoticRealm.close();
        }
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_modules_example;
			rootLayout = ((LinearLayout) findViewById(R.id.container));
			rootLayout.removeAllViews();

			// The default Realm instance implicitly knows about all classes in the realmModuleAppExample Android Studio
			// module. This does not include the classes from the realmModuleLibraryExample AS module so a Realm using this
			// configuration would know about the following classes: { Cow, Pig, Snake, Spider }
			RealmConfiguration defaultConfig = (new RealmConfiguration.Builder(this)).build();

			// It is possible to extend the default schema by adding additional Realm modules using setModule(). This can
			// also be Realm modules from libraries. The below Realm contains the following classes: { Cow, Pig, Snake,
			// Spider, Cat, Dog }
			RealmConfiguration farmAnimalsConfig = (new RealmConfiguration.Builder(this)).name("farm.realm").setModules(Realm.DefaultModule, new DomesticAnimalsModule()).build();

			// Or you can completely replace the default schema.
			// This Realm contains the following classes: { Elephant, Lion, Zebra, Snake, Spider }
			RealmConfiguration exoticAnimalsConfig = (new RealmConfiguration.Builder(this)).name("exotic.realm").setModules(new ZooAnimalsModule(), new CreepyAnimalsModule()).build();

			// Multiple Realms can be open at the same time
			showStatus("Opening multiple Realms");
			Realm defaultRealm = Realm.getInstance(defaultConfig);
			Realm farmRealm = Realm.getInstance(farmAnimalsConfig);
			Realm exoticRealm = Realm.getInstance(exoticAnimalsConfig);

			// Objects can be added to each Realm independantly
			showStatus("Create objects in the default Realm");
			defaultRealm.executeTransaction(new TransactionAnonymousInnerClassHelper(this));

			showStatus("Create objects in the farm Realm");
			farmRealm.executeTransaction(new TransactionAnonymousInnerClassHelper2(this));

			showStatus("Create objects in the exotic Realm");
			exoticRealm.executeTransaction(new TransactionAnonymousInnerClassHelper3(this));

			// You can copy objects between Realms
			showStatus("Copy objects between Realms");
			showStatus("Number of pigs on the farm : " + farmRealm.@where(typeof(Pig)).count());
			showStatus("Copy pig from defaultRealm to farmRealm");
			Pig defaultPig = defaultRealm.@where(typeof(Pig)).findFirst();
			farmRealm.beginTransaction();
			farmRealm.copyToRealm(defaultPig);
			farmRealm.commitTransaction();
			showStatus("Number of pigs on the farm : " + farmRealm.@where(typeof(Pig)).count());

			// Each Realm is restricted to only accept the classes in their schema.
			showStatus("Trying to add an unsupported class");
			defaultRealm.beginTransaction();
			try
			{
				defaultRealm.createObject(typeof(Elephant));
			}
			catch (RealmException expected)
			{
				showStatus("This throws a :" + expected.ToString());
			}
			finally
			{
				defaultRealm.cancelTransaction();
			}

			// And Realms in library projects are independent from Realms in the app code
			showStatus("Interacting with library code that uses Realm internally");
			int animals = 5;
			Zoo libraryZoo = new Zoo(this);
			libraryZoo.open();
			showStatus("Adding animals: " + animals);
			libraryZoo.addAnimals(5);
			showStatus("Number of animals in the library Realm:" + libraryZoo.NoOfAnimals);
			libraryZoo.close();

			// Remember to close all open Realms
			defaultRealm.close();
			farmRealm.close();
			exoticRealm.close();
		}
Example #30
0
		public virtual void setCustomView(android.view.View view)
		{
			if (mCustomView != null)
			{
				removeView(mCustomView);
			}
			mCustomView = view;
			if (mTitleLayout != null)
			{
				removeView(mTitleLayout);
				mTitleLayout = null;
			}
			if (view != null)
			{
				addView(view);
			}
			requestLayout();
		}