예제 #1
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(com.opentok.android.demo.opentoksamples.R.layout.layout_fragment_sub_control, container, false);

            mSubContainer = (RelativeLayout)openTokActivity.findViewById(com.opentok.android.demo.opentoksamples.R.id.fragment_sub_container);

            showSubscriberWidget(mSubscriberWidgetVisible, false);

            mSubscriberMute = (ImageButton)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.muteSubscriber);
            mSubscriberMute.OnClickListener = this;

            mSubscriberName = (TextView)rootView.findViewById(com.opentok.android.demo.opentoksamples.R.id.subscriberName);

            if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
            {
                RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams)container.LayoutParams;

                DisplayMetrics metrics = new DisplayMetrics();
                openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

                @params.width          = metrics.widthPixels - openTokActivity.dpToPx(48);
                container.LayoutParams = @params;
            }

            return(rootView);
        }
예제 #2
0
        public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.inflate(R.layout.layout_fragment_pub_status, container, false);

            mPubStatusContainer = (RelativeLayout)openTokActivity.findViewById(R.id.fragment_pub_status_container);
            archiving           = (ImageButton)rootView.findViewById(R.id.archiving);

            statusText = (TextView)rootView.findViewById(R.id.statusLabel);

            if (openTokActivity.Resources.Configuration.orientation == Configuration.ORIENTATION_LANDSCAPE)
            {
                RelativeLayout.LayoutParams @params = (RelativeLayout.LayoutParams)container.LayoutParams;

                DisplayMetrics metrics = new DisplayMetrics();
                openTokActivity.WindowManager.DefaultDisplay.getMetrics(metrics);

                @params.width          = metrics.widthPixels - openTokActivity.dpToPx(48);
                container.LayoutParams = @params;
            }

            return(rootView);
        }