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);
}
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);
}
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);
}
}
}
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();
}
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();
}
});
}
Aggregations