Example usage for android.view ViewGroup setBackgroundColor

List of usage examples for android.view ViewGroup setBackgroundColor

Introduction

In this page you can find the example usage for android.view ViewGroup setBackgroundColor.

Prototype

@RemotableViewMethod
public void setBackgroundColor(@ColorInt int color) 

Source Link

Document

Sets the background color for this view.

Usage

From source file:edu.vuum.mocca.ui.tags.EditTagsFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.tags_edit_fragment, container, false);
    container.setBackgroundColor(Color.GRAY);
    return view;/*from w w  w  .  j a  va2 s .  c om*/
}

From source file:com.jmstudios.redmoon.fragment.ShadesFragment.java

private void showHelpSnackbar() {
    mHelpSnackbar = Snackbar.make(mView, getActivity().getString(R.string.help_snackbar_text),
            Snackbar.LENGTH_INDEFINITE);

    if (((ShadesActivity) getActivity()).getSettingsModel().getDarkThemeFlag()) {
        ViewGroup group = (ViewGroup) mHelpSnackbar.getView();
        group.setBackgroundColor(getActivity().getResources().getColor(R.color.snackbar_color_dark_theme));

        int snackbarTextId = android.support.design.R.id.snackbar_text;
        TextView textView = (TextView) group.findViewById(snackbarTextId);
        textView.setTextColor(getActivity().getResources().getColor(R.color.text_color_dark_theme));
    }//from w  ww. j  a  va 2  s .c  o  m

    mHelpSnackbar.show();
}

From source file:info.papdt.blacklight.ui.common.AbsActivity.java

@TargetApi(21)
private void swipeInit() {
    // Replace the view first
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    SlidingPaneLayout v = (SlidingPaneLayout) inflater.inflate(R.layout.swipe_decor_wrapper, null);
    final ViewGroup frame = (ViewGroup) v.findViewById(R.id.swipe_container);
    View swipeView = getSwipeView();
    ViewGroup decor = (ViewGroup) swipeView.getParent();
    ViewGroup.LayoutParams params = swipeView.getLayoutParams();
    decor.removeView(swipeView);/* w  ww. j  a  va2s.c  o  m*/
    frame.addView(swipeView);
    decor.addView(v, params);
    decor.setBackgroundColor(0);

    // Elevation
    if (Build.VERSION.SDK_INT >= 21) {
        frame.setElevation(11.8f);
    } else {
        v.setShadowResource(R.drawable.panel_shadow);
    }

    // Swipe gesture configurations
    v.setSliderFadeColor(0);
    v.setPanelSlideListener(new SlidingPaneLayout.PanelSlideListener() {

        @Override
        public void onPanelSlide(View v, float percent) {
            getWindow().getDecorView().setAlpha(1.0f - percent);
        }

        @Override
        public void onPanelOpened(View p1) {
            finish();
        }

        @Override
        public void onPanelClosed(View p1) {
        }
    });

    // Adjust window color
    getWindow().setBackgroundDrawable(new ColorDrawable(0));
}

From source file:com.ariesmcrae.mymemories.ui.story.StoryViewFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.story_view_fragment, container, false);
    container.setBackgroundColor(Color.GRAY);
    return view;/*from   ww w .j  a  va2 s .  c om*/
}

From source file:com.ariesmcrae.mymemories.ui.story.EditStoryFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.story_edit_fragment, container, false);
    container.setBackgroundColor(Color.GRAY);
    return view;//from w  ww  . ja  v a 2 s . com
}

From source file:de.da_sense.moses.client.HistoryFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Log.d(TAG, "onCreateView about to inflate View");
    View historyFragmentView = inflater.inflate(R.layout.tab_history, container, false);
    container.setBackgroundColor(getResources().getColor(android.R.color.background_light));

    return historyFragmentView;
}

From source file:com.ariesmcrae.mymemories.ui.story.CreateStoryFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.story_creation_fragment, container, false);
    container.setBackgroundColor(Color.GRAY);
    return view;//from w  w w.j  a  va2 s  .  co m
}

From source file:org.chromium.chrome.browser.media.remote.ExpandedControllerActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    MediaNotificationUma.recordClickSource(getIntent());

    mMediaRouteController = RemoteMediaPlayerController.instance().getCurrentlyPlayingMediaRouteController();

    if (mMediaRouteController == null || mMediaRouteController.routeIsDefaultRoute()) {
        // We don't want to do anything for the default (local) route
        finish();// w  w w .  j ava  2  s  .c o  m
        return;
    }

    // Make the activity full screen.
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

    // requestWindowFeature must be called before adding content.
    setContentView(R.layout.expanded_cast_controller);
    mHandler = new Handler();

    ViewGroup rootView = (ViewGroup) findViewById(android.R.id.content);
    rootView.setBackgroundColor(Color.BLACK);

    mMediaRouteController.addUiListener(this);

    // Create transport controller to control video, giving the callback
    // interface to receive actions from.
    mTransportMediator = new TransportMediator(this, mTransportPerformer);

    // Create and initialize the media control UI.
    mMediaController = (MediaController) findViewById(R.id.cast_media_controller);
    mMediaController.setMediaPlayer(mTransportMediator);

    View button = getLayoutInflater().inflate(R.layout.cast_controller_media_route_button, rootView, false);

    if (button instanceof FullscreenMediaRouteButton) {
        mMediaRouteButton = (FullscreenMediaRouteButton) button;
        rootView.addView(mMediaRouteButton);
        mMediaRouteButton.bringToFront();
        mMediaRouteButton.initialize(mMediaRouteController);
    } else {
        mMediaRouteButton = null;
    }

    // Initialize the video info.
    setVideoInfo(new RemoteVideoInfo(null, 0, RemoteVideoInfo.PlayerState.STOPPED, 0, null));

    mMediaController.refresh();

    scheduleProgressUpdate();
}

From source file:de.da_sense.moses.client.RunningFragment.java

/**
 * Inflate the layout of the APK list./*from www.j av  a2 s .co m*/
 */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Log.d(LOG_TAG, "onCreateView about to inflate View");
    View runnningFragmentView = inflater.inflate(R.layout.tab_running, container, false);
    container.setBackgroundColor(getResources().getColor(android.R.color.background_light));

    return runnningFragmentView;
}

From source file:com.rubengees.introduction.IntroductionFragment.java

@NonNull
private View initViews(@NonNull LayoutInflater inflater, @NonNull ViewGroup container) {
    ViewGroup root = (ViewGroup) inflater.inflate(R.layout.introduction_fragment, container, false);
    ViewGroup contentContainer = (ViewGroup) root.findViewById(R.id.introduction_fragment_content_container);

    if (slide.getCustomViewBuilder() == null) {
        contentContainer.addView(initDefaultViews(inflater, container));
    } else {/*from   www  . j a va  2 s .  c o m*/
        contentContainer.addView(initCustomViews(inflater, container));
    }

    root.setBackgroundColor(slide.getColor());
    root.setTag(slide.getPosition());

    return root;
}