Search in sources :

Example 36 with RelativeLayout

use of android.widget.RelativeLayout in project SmartAndroidSource by jaychou2012.

the class PopoverView method initPopoverView.

/**
	 * Init the popover view
	 * 
	 * @param viewToEnclose
	 *            The view we wan to insert inside the popover
	 */
private void initPopoverView(View viewToEnclose) {
    // Configure self
    setBackgroundColor(0x00000000);
    // setOnClickListener(this);
    setOnTouchListener(this);
    // Set initial drawables
    popoverBackgroundDrawable = PopoverView.defaultPopoverBackgroundDrawable;
    popoverArrowUpDrawable = PopoverView.defaultPopoverArrowUpDrawable;
    popoverArrowDownDrawable = PopoverView.defaultPopoverArrowDownDrawable;
    popoverArrowLeftDrawable = PopoverView.defaultPopoverArrowLeftDrawable;
    popoverArrowRightDrawable = PopoverView.defaultPopoverArrowRightDrawable;
    // Init the relative layout
    popoverView = new RelativeLayout(getContext());
    popoverView.setBackgroundDrawable(getResources().getDrawable(popoverBackgroundDrawable));
    popoverView.addView(viewToEnclose, LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
}
Also used : RelativeLayout(android.widget.RelativeLayout)

Example 37 with RelativeLayout

use of android.widget.RelativeLayout in project SmartAndroidSource by jaychou2012.

the class AutoLoading method setDefaultViews.

private void setDefaultViews() {
    View mLayoutInternetOff = initView(mContext.getResources().getIdentifier("exception_no_internet", "layout", mContext.getPackageName()), TAG_INTERNET_OFF, TITLE_NO_INTERNET, MESSAGE_NO_INTERNET);
    // View mLayoutInternetOff =
    // initView(R.layout.exception_no_internet,TAG_INTERNET_OFF,TITLE_NO_INTERNET,MESSAGE_NO_INTERNET);
    View mLayoutLoadingContent = initView(mContext.getResources().getIdentifier("exception_loading_content", "layout", mContext.getPackageName()), TAG_LOADING_CONTENT, TITLE_LOADING, MESSAGE_LOADING);
    // View mLayoutLoadingContent =
    // initView(R.layout.exception_loading_content,TAG_LOADING_CONTENT,TITLE_LOADING,MESSAGE_LOADING);
    View mLayoutOther = initView(mContext.getResources().getIdentifier("exception_failure", "layout", mContext.getPackageName()), TAG_OTHER_EXCEPTION, TITLE_FAILURE, MESSAGE_FAILURE);
    // View mLayoutOther =
    // initView(R.layout.exception_failure,TAG_OTHER_EXCEPTION,TITLE_FAILURE,MESSAGE_FAILURE);
    mDefaultViews.add(0, mLayoutInternetOff);
    mDefaultViews.add(1, mLayoutLoadingContent);
    mDefaultViews.add(2, mLayoutOther);
    // Hide all layouts at first initialization
    mLayoutInternetOff.setVisibility(View.GONE);
    mLayoutLoadingContent.setVisibility(View.GONE);
    mLayoutOther.setVisibility(View.GONE);
    // init Layout params
    RelativeLayout.LayoutParams containerParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    containerParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
    containerParams.addRule(RelativeLayout.CENTER_VERTICAL);
    // init new RelativeLayout Wrapper
    mContainer.setLayoutParams(containerParams);
    // Add default views
    mContainer.addView(mLayoutLoadingContent);
    mContainer.addView(mLayoutInternetOff);
    mContainer.addView(mLayoutOther);
}
Also used : LayoutParams(android.widget.LinearLayout.LayoutParams) RelativeLayout(android.widget.RelativeLayout) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) View(android.view.View)

Example 38 with RelativeLayout

use of android.widget.RelativeLayout in project android-common by Trinea.

the class ViewUtils method setSearchViewOnClickListener.

/**
     * set SearchView OnClickListener
     * 
     * @param v
     * @param listener
     */
public static void setSearchViewOnClickListener(View v, OnClickListener listener) {
    if (v instanceof ViewGroup) {
        ViewGroup group = (ViewGroup) v;
        int count = group.getChildCount();
        for (int i = 0; i < count; i++) {
            View child = group.getChildAt(i);
            if (child instanceof LinearLayout || child instanceof RelativeLayout) {
                setSearchViewOnClickListener(child, listener);
            }
            if (child instanceof TextView) {
                TextView text = (TextView) child;
                text.setFocusable(false);
            }
            child.setOnClickListener(listener);
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) GridView(android.widget.GridView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) View(android.view.View) ListView(android.widget.ListView) LinearLayout(android.widget.LinearLayout)

Example 39 with RelativeLayout

use of android.widget.RelativeLayout in project Fairphone by Kwamecorp.

the class EdgeSwipeAppMenuHelper method setupCurrentDisplay.

private void setupCurrentDisplay(float pointerX, float pointerY) {
    // setup the size
    mMenuWidth = menuContent.getWidth();
    mMenuHeight = menuContent.getHeight();
    // setup the center of the menu
    mCenterX = pointerX;
    mCenterY = pointerY;
    // setup the icon size
    RelativeLayout v = (RelativeLayout) menuContent.findViewById(R.id.icon1);
    mIconHeight = v.getHeight();
    mIconWidth = v.getWidth();
}
Also used : RelativeLayout(android.widget.RelativeLayout)

Example 40 with RelativeLayout

use of android.widget.RelativeLayout in project Fairphone by Kwamecorp.

the class OOBEActivity method setupTheVideo.

private void setupTheVideo() {
    RelativeLayout rl = (RelativeLayout) findViewById(R.id.oobeVideoViewGroup);
    rl.setVisibility(View.VISIBLE);
    mVideo = (VideoView) findViewById(R.id.fp_oobe_video);
    Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.fp_buy_a_phone_start_a_movement);
    mVideo.setMediaController(null);
    mVideo.requestFocus();
    mVideo.setVideoURI(uri);
    mVideo.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }
    });
    mVideo.start();
    mVideo.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mp) {
            stopIntroVideo();
        }
    });
    // button
    mSkipVideoButton = (Button) findViewById(R.id.fp_oobe_video_skip_button);
    mSkipVideoButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            stopIntroVideo();
        }
    });
}
Also used : OnTouchListener(android.view.View.OnTouchListener) RelativeLayout(android.widget.RelativeLayout) OnClickListener(android.view.View.OnClickListener) Uri(android.net.Uri) View(android.view.View) VideoView(android.widget.VideoView) MotionEvent(android.view.MotionEvent) MediaPlayer(android.media.MediaPlayer)

Aggregations

RelativeLayout (android.widget.RelativeLayout)201 TextView (android.widget.TextView)89 View (android.view.View)84 ImageView (android.widget.ImageView)51 LinearLayout (android.widget.LinearLayout)37 ViewGroup (android.view.ViewGroup)32 ScrollView (android.widget.ScrollView)16 Intent (android.content.Intent)14 OnClickListener (android.view.View.OnClickListener)14 FrameLayout (android.widget.FrameLayout)13 SuppressLint (android.annotation.SuppressLint)12 LayoutInflater (android.view.LayoutInflater)12 ListView (android.widget.ListView)12 ImageButton (android.widget.ImageButton)11 Resources (android.content.res.Resources)10 Bundle (android.os.Bundle)10 Button (android.widget.Button)10 DialogInterface (android.content.DialogInterface)9 DisplayMetrics (android.util.DisplayMetrics)8 Builder (android.app.AlertDialog.Builder)7