Search in sources :

Example 21 with RelativeLayout

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);
}
Also used : FrameLayout(android.widget.FrameLayout) RelativeLayout(android.widget.RelativeLayout)

Example 22 with RelativeLayout

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;
}
Also used : RelativeLayout(android.widget.RelativeLayout) ViewPager(android.support.v4.view.ViewPager)

Example 23 with RelativeLayout

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();
    }
}
Also used : ListView(android.widget.ListView) RelativeLayout(android.widget.RelativeLayout) ArtistSearchAdapter(org.musicbrainz.mobile.adapter.list.ArtistSearchAdapter) TextView(android.widget.TextView)

Example 24 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 25 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)

Aggregations

RelativeLayout (android.widget.RelativeLayout)189 TextView (android.widget.TextView)87 View (android.view.View)75 ImageView (android.widget.ImageView)47 LinearLayout (android.widget.LinearLayout)37 ViewGroup (android.view.ViewGroup)30 OnClickListener (android.view.View.OnClickListener)14 Intent (android.content.Intent)13 LayoutInflater (android.view.LayoutInflater)12 FrameLayout (android.widget.FrameLayout)12 ListView (android.widget.ListView)12 ScrollView (android.widget.ScrollView)12 Bundle (android.os.Bundle)11 ImageButton (android.widget.ImageButton)11 SuppressLint (android.annotation.SuppressLint)10 Resources (android.content.res.Resources)10 Button (android.widget.Button)10 DialogInterface (android.content.DialogInterface)9 LayoutParams (android.view.ViewGroup.LayoutParams)9 DisplayMetrics (android.util.DisplayMetrics)8