Example usage for android.widget FrameLayout setForeground

List of usage examples for android.widget FrameLayout setForeground

Introduction

In this page you can find the example usage for android.widget FrameLayout setForeground.

Prototype

public void setForeground(Drawable foreground) 

Source Link

Document

Supply a Drawable that is to be rendered on top of all of the content in the view.

Usage

From source file:org.xbmc.android.remote.presentation.activity.MovieLibraryActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.movielibrary);

    // remove nasty top fading edge
    FrameLayout topFrame = (FrameLayout) findViewById(android.R.id.content);
    topFrame.setForeground(null);

    mTabHost = getTabHost();//from  w  w  w.j ava  2 s  . co m

    // add the tabs
    mTabHost.addTab(mTabHost.newTabSpec("tab_movies", "Movies", R.drawable.st_movie_on, R.drawable.st_movie_off)
            .setBigIcon(R.drawable.st_movie_over).setContent(R.id.movielist_outer_layout));
    mTabHost.addTab(mTabHost.newTabSpec("tab_actors", "Actors", R.drawable.st_actor_on, R.drawable.st_actor_off)
            .setBigIcon(R.drawable.st_actor_over).setContent(R.id.actorlist_outer_layout));
    mTabHost.addTab(mTabHost.newTabSpec("tab_genres", "Genres", R.drawable.st_genre_on, R.drawable.st_genre_off)
            .setBigIcon(R.drawable.st_genre_over).setContent(R.id.genrelist_outer_layout));
    mTabHost.addTab(
            mTabHost.newTabSpec("tab_files", "File Mode", R.drawable.st_filemode_on, R.drawable.st_filemode_off)
                    .setBigIcon(R.drawable.st_filemode_over).setContent(R.id.filelist_outer_layout));
    mTabHost.addTab(mTabHost.newTabSpec("tab_screen", "Screen Mode", R.drawable.st_tv_on, R.drawable.st_tv_off)
            .setBigIcon(R.drawable.st_tv_over).setContent(R.id.screenmovielist_outer_layout));

    mTabHost.getViewTreeObserver().addOnGlobalLayoutListener(this);

    // assign the gui logic to each tab
    mHandler = new Handler();
    mMovieController = new MovieListController();
    mMovieController.findTitleView(findViewById(R.id.movielist_outer_layout));
    mMovieController.findMessageView(findViewById(R.id.movielist_outer_layout));

    mActorController = new ActorListController(ActorListController.TYPE_MOVIE);
    mActorController.findTitleView(findViewById(R.id.actorlist_outer_layout));
    mActorController.findMessageView(findViewById(R.id.actorlist_outer_layout));

    mGenresController = new MovieGenreListController(MovieGenreListController.TYPE_MOVIE);
    mGenresController.findTitleView(findViewById(R.id.genrelist_outer_layout));
    mGenresController.findMessageView(findViewById(R.id.genrelist_outer_layout));

    mFileController = new FileListController(MediaType.VIDEO);
    mFileController.findTitleView(findViewById(R.id.filelist_outer_layout));
    mFileController.findMessageView(findViewById(R.id.filelist_outer_layout));

    mMoviePosterWrapController = new MoviePosterWrapController();
    mMoviePosterWrapController.findTitleView(findViewById(R.id.screenmovielist_outer_layout));
    mMoviePosterWrapController.findMessageView(findViewById(R.id.screenmovielist_outer_layout));

    mTabHost.setOnTabChangedListener(new OnTabChangeListener() {
        public void onTabChanged(String tabId) {

            initTab(tabId);

            final SharedPreferences prefs = PreferenceManager
                    .getDefaultSharedPreferences(getApplicationContext());
            if (prefs.getBoolean(PREF_REMEMBER_TAB, false)) {
                getSharedPreferences("global", Context.MODE_PRIVATE).edit().putString(LAST_MOVIE_TAB_ID, tabId)
                        .commit();
            }
        }
    });
    mConfigurationManager = ConfigurationManager.getInstance(this);
}

From source file:com.apptentive.android.sdk.module.engagement.interaction.fragment.ApptentiveBaseFragment.java

private void showToolbarElevationPreLollipop(boolean visible) {
    if (!isAdded()) {
        return;/*from w  ww  .  java 2s. c  o m*/
    }

    FrameLayout pager = (FrameLayout) getActivity().findViewById(R.id.apptentive_vp_container);

    if (pager != null) {
        if (visible) {
            Drawable shadow = ContextCompat.getDrawable(getContext(),
                    R.drawable.apptentive_actionbar_compat_shadow);
            pager.setForeground(shadow);
        } else {
            pager.setForeground(new ColorDrawable(0));
        }
    }

}

From source file:com.trailbehind.android.iburn.map.MapActivity.java

/**
 * Setup views.//  w  w w . jav a 2 s.  c  o  m
 */
private void setupViews() {
    setContentView(R.layout.map);
    final FrameLayout contentView = (FrameLayout) findViewById(android.R.id.content);
    if (contentView != null) {
        contentView.setBackgroundDrawable(null);
        contentView.setForeground(null);
    }

    // setup top panel
    setupHeaderPanel();

    // setup map component
    setupMapComponent();

    // create map view now
    setupMapView();

    // setup loc source
    mActivityHandler.sendMessageDelayed(
            mActivityHandler.obtainMessage(ActivityHandler.MESSAGE_INIT_LOCATION_SOURCE_N_MAP_LISTENER), 1000);

    // create zoom controls
    setupZoomControls();
}