Android Open Source - MediaRouter-Cast-Button-android Custom Media Route Controller Dialog






From Project

Back to project page MediaRouter-Cast-Button-android.

License

The source code is released under:

Apache License

If you think the Android project MediaRouter-Cast-Button-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2014 Google Inc. All Rights Reserved. 
 *//from w  w  w. ja  va2s .c o m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

package com.example.mediarouter.mediaroutedialog;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.MediaRouteControllerDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.example.mediarouter.R;

/**
 * This class extends {@link MediaRouteControllerDialog}, and provides a
 * user-defined media route controller dialog.
 */
public class CustomMediaRouteControllerDialog extends
    MediaRouteControllerDialog {

  private TextView mTextView;

  public CustomMediaRouteControllerDialog(Context context) {
    super(context);
  }

  @Override
  public View onCreateMediaControlView(Bundle savedInstanceState) {
    LayoutInflater inflater = getLayoutInflater();
    View customView = inflater.inflate(
        R.layout.custom_media_router_controller_dialog_fragment, null);
    mTextView = (TextView) customView.findViewById(R.id.title);
    mTextView.setText(R.string.custom_media_router_control_dialog_text);
    return customView;
  }

}




Java Source Code List

com.example.mediarouter.MainActivity.java
com.example.mediarouter.MediaRouterActionBarButtonActivity.java
com.example.mediarouter.MediaRouterButtonActivity.java
com.example.mediarouter.MediaRouterCustomDialogActivity.java
com.example.mediarouter.MediaRouterDiscoveryActivity.java
com.example.mediarouter.mediaroutedialog.CustomMediaRouteControllerDialogFragment.java
com.example.mediarouter.mediaroutedialog.CustomMediaRouteControllerDialog.java
com.example.mediarouter.mediaroutedialog.CustomMediaRouteDialogFactory.java