use of android.widget.RelativeLayout in project SmartAndroidSource by jaychou2012.
the class WebDialog method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RelativeLayout layout = new RelativeLayout(getContext());
layout.setBackgroundColor(0xFFFFFFFF);
setupWebView(layout);
setupProgress(layout);
FrameLayout.LayoutParams FILL = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
addContentView(layout, FILL);
}
use of android.widget.RelativeLayout in project musicbrainz-android by jdamcd.
the class SearchPagerAdapter method instantiateItem.
@Override
public Object instantiateItem(View container, int position) {
switch(position) {
case 0:
RelativeLayout artists = (RelativeLayout) context.getLayoutInflater().inflate(R.layout.layout_search_artists, null);
((ViewPager) container).addView(artists, 0);
return artists;
case 1:
RelativeLayout releases = (RelativeLayout) context.getLayoutInflater().inflate(R.layout.layout_search_release_groups, null);
((ViewPager) container).addView(releases, 0);
return releases;
}
return null;
}
use of android.widget.RelativeLayout in project musicbrainz-android by jdamcd.
the class SearchActivity method displayArtistResultsView.
private void displayArtistResultsView() {
ListView artistResultsView = (ListView) findViewById(R.id.searchres_artist_list);
artistResultsView.setAdapter(new ArtistSearchAdapter(SearchActivity.this, artistSearchResults));
artistResultsView.setOnItemClickListener(new ArtistItemClickListener());
artistResultsView.setVisibility(View.VISIBLE);
if (artistSearchResults.isEmpty()) {
RelativeLayout artistResults = (RelativeLayout) findViewById(R.id.artist_results_container);
TextView noRes = (TextView) artistResults.findViewById(R.id.noresults);
noRes.setVisibility(View.VISIBLE);
} else {
saveQueryAsSuggestion();
}
}
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);
}
Aggregations