Java 类android.support.v17.leanback.widget.SearchOrbView 实例源码

项目:aos-Video    文件:MoviesByFragment.java   
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mOverlay = new Overlay(this);

    SearchOrbView searchOrbView = (SearchOrbView) getView().findViewById(R.id.title_orb);
    if (searchOrbView != null) {
        searchOrbView.setOrbIcon(getResources().getDrawable(R.drawable.orb_sort));
    } else {
        throw new IllegalArgumentException("Did not find R.id.title_orb in BrowseFragment! Need to update the orbview hack!");
    }

    ViewGroup container = (ViewGroup) getView().findViewById(R.id.browse_frame);
    if (container != null) {
        LayoutInflater.from(getActivity()).inflate(R.layout.leanback_empty_view, container, true);
        mEmptyView = (TextView) container.findViewById(R.id.empty_view);
        mEmptyView.setText(R.string.you_have_no_movies);
    } else {
        throw new IllegalArgumentException("Did not find R.id.browse_frame in BrowseFragment! Need to update the emptyview hack!");
    }
}
项目:aos-Video    文件:VideosByFragment.java   
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    mOverlay = new Overlay(this);

    SearchOrbView searchOrbView = (SearchOrbView) getView().findViewById(R.id.title_orb);
    if (searchOrbView != null) {
        searchOrbView.setOrbIcon(getResources().getDrawable(R.drawable.orb_sort));
    } else {
        throw new IllegalArgumentException("Did not find R.id.title_orb in BrowseFragment! Need to update the orbview hack!");
    }

    ViewGroup container = (ViewGroup) getView().findViewById(R.id.browse_frame);
    if (container != null) {
        LayoutInflater.from(getActivity()).inflate(R.layout.leanback_empty_view, container, true);
        mEmptyView = (TextView) container.findViewById(R.id.empty_view);
        mEmptyView.setText(R.string.you_have_no_movies);
    } else {
        throw new IllegalArgumentException("Did not find R.id.browse_frame in BrowseFragment! Need to update the emptyview hack!");
    }
}
项目:aos-Video    文件:VideosByListFragment.java   
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    setTitle(getString(R.string.video_lists));
    SearchOrbView searchOrbView = (SearchOrbView) getView().findViewById(R.id.title_orb);
    searchOrbView.setVisibility(View.INVISIBLE);
    setOnSearchClickedListener(null);
}
项目:aos-Video    文件:MyBrandedFragment.java   
/**
 * Sets the {@link android.support.v17.leanback.widget.SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchAffordanceColors = colors;
    mSearchAffordanceColorSet = true;
    if (mTitleView != null) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
}
项目:aos-Video    文件:MyBrandedFragment.java   
/**
 * Returns the {@link android.support.v17.leanback.widget.SearchOrbView.Colors}
 * used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    if (mSearchAffordanceColorSet) {
        return mSearchAffordanceColors;
    }
    if (mTitleView == null) {
        throw new IllegalStateException("Fragment views not yet created");
    }
    return mTitleView.getSearchAffordanceColors();
}
项目:aos-Video    文件:MyTitleView.java   
public MyTitleView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    LayoutInflater inflater = LayoutInflater.from(context);
    View rootView = inflater.inflate(R.layout.lb_my_title_view, this);

    mBadgeView = (ImageView) rootView.findViewById(R.id.title_badge);
    mTextView = (TextView) rootView.findViewById(R.id.title_text);
    mSearchOrbView = (SearchOrbView) rootView.findViewById(R.id.title_orb);
    mSearchOrbView2 = (SearchOrbView) rootView.findViewById(R.id.title_orb2); // ARCHOS added
    mSearchOrbView3 = (SearchOrbView) rootView.findViewById(R.id.title_orb3); // ARCHOS added
    mSearchOrbView4 = (SearchOrbView) rootView.findViewById(R.id.title_orb4); // ARCHOS added
    mSearchOrbView4.setVisibility(GONE);
    mHintView = (HintView) rootView.findViewById(R.id.hint_view); // ARCHOS added

    mOrb1Description = (TextView) rootView.findViewById(R.id.orb1_description); // ARCHOS added
    mOrb2Description = (TextView) rootView.findViewById(R.id.orb2_description); // ARCHOS added
    mOrb3Description = (TextView) rootView.findViewById(R.id.orb3_description); // ARCHOS added
    mOrb4Description = (TextView) rootView.findViewById(R.id.orb4_description); // ARCHOS added

    mSearchOrbView.setOnFocusChangeListener(mOrbsFocusListener);
    mSearchOrbView2.setOnFocusChangeListener(mOrbsFocusListener);
    mSearchOrbView3.setOnFocusChangeListener(mOrbsFocusListener);
    mSearchOrbView4.setOnFocusChangeListener(mOrbsFocusListener);

    setClipToPadding(false);
    setClipChildren(false);
}
项目:aos-Video    文件:MyTitleView.java   
/**
 * Sets the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchOrbView.setOrbColors(colors);
    mSearchOrbView2.setOrbColors(colors);
    mSearchOrbView3.setOrbColors(colors);
    mSearchOrbView4.setOrbColors(colors);
}
项目:RxBinding    文件:RxSearchBarTestActivity.java   
@Override protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  setContentView(R.layout.lb_search_fragment);

  searchBar = (SearchBar) findViewById(R.id.lb_search_bar);
  searchEditText = (SearchEditText) searchBar.findViewById(R.id.lb_search_text_editor);

  // reduce flakiness
  SearchOrbView searchOrbView = (SearchOrbView) searchBar.findViewById(R.id.lb_search_bar_speech_orb);
  searchOrbView.enableOrbColorAnimation(false);
  searchOrbView.setSoundEffectsEnabled(false);
  searchOrbView.clearAnimation();
}
项目:adt-leanback-support    文件:VerticalGridSupportFragment.java   
/**
 * Sets the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchAffordanceColors = colors;
    mSearchAffordanceColorSet = true;
    if (mTitleView != null) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
}
项目:adt-leanback-support    文件:VerticalGridSupportFragment.java   
/**
 * Returns the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    if (mSearchAffordanceColorSet) {
        return mSearchAffordanceColors;
    }
    if (mTitleView == null) {
        throw new IllegalStateException("Fragment views not yet created");
    }
    return mTitleView.getSearchAffordanceColors();
}
项目:adt-leanback-support    文件:BrowseFragment.java   
/**
 * Sets the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchAffordanceColors = colors;
    mSearchAffordanceColorSet = true;
    if (mTitleView != null) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
}
项目:adt-leanback-support    文件:BrowseFragment.java   
/**
 * Returns the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    if (mSearchAffordanceColorSet) {
        return mSearchAffordanceColors;
    }
    if (mTitleView == null) {
        throw new IllegalStateException("Fragment views not yet created");
    }
    return mTitleView.getSearchAffordanceColors();
}
项目:adt-leanback-support    文件:BrowseSupportFragment.java   
/**
 * Sets the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchAffordanceColors = colors;
    mSearchAffordanceColorSet = true;
    if (mTitleView != null) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
}
项目:adt-leanback-support    文件:BrowseSupportFragment.java   
/**
 * Returns the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    if (mSearchAffordanceColorSet) {
        return mSearchAffordanceColors;
    }
    if (mTitleView == null) {
        throw new IllegalStateException("Fragment views not yet created");
    }
    return mTitleView.getSearchAffordanceColors();
}
项目:adt-leanback-support    文件:VerticalGridFragment.java   
/**
 * Sets the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public void setSearchAffordanceColors(SearchOrbView.Colors colors) {
    mSearchAffordanceColors = colors;
    mSearchAffordanceColorSet = true;
    if (mTitleView != null) {
        mTitleView.setSearchAffordanceColors(mSearchAffordanceColors);
    }
}
项目:adt-leanback-support    文件:VerticalGridFragment.java   
/**
 * Returns the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    if (mSearchAffordanceColorSet) {
        return mSearchAffordanceColors;
    }
    if (mTitleView == null) {
        throw new IllegalStateException("Fragment views not yet created");
    }
    return mTitleView.getSearchAffordanceColors();
}
项目:BuildingForAndroidTV    文件:TVDemoActivity.java   
@Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_custom);

    orbView = (SearchOrbView) findViewById(R.id.custom_search_orb);
    orbView.setOrbColor(getResources().getColor(R.color.search_opaque));
    orbView.bringToFront();
    orbView.setOnOrbClickedListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(getApplicationContext(), TVSearchActivity.class);
            startActivity(intent);
        }
    });

    fragments = new LinkedHashMap<Integer, CustomRowsFragment>();

    for (int i = 0; i < CATEGORIES_NUMBER; i++) {
        CustomRowsFragment fragment = new CustomRowsFragment();
        fragments.put(i, fragment);
    }

    headersFragment = new CustomHeadersFragment();
    rowsFragment = fragments.get(0);

    customFrameLayout = (CustomFrameLayout) ((ViewGroup) this.findViewById(android.R.id.content)).getChildAt(0);
    setupCustomFrameLayout();

    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    transaction
        .replace(R.id.header_container, headersFragment, "CustomHeadersFragment")
        .replace(R.id.rows_container, rowsFragment, "CustomRowsFragment");
    transaction.commit();
}
项目:aos-Video    文件:MyTitleView.java   
/**
 * Returns the {@link SearchOrbView.Colors} used to draw the search affordance.
 */
public SearchOrbView.Colors getSearchAffordanceColors() {
    return mSearchOrbView.getOrbColors();
}
项目:BuildingForAndroidTV    文件:MainActivity.java   
/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    SharedPreferences prefs = getSharedPreferences(PREFS_ROOT, Context.MODE_PRIVATE);
    useStandardBrowseFragment = prefs.getBoolean(PREFS_USE_STANDARD_BROWSE_FRAGMENT, false);

    /*
     * This flag discriminates the use of the CustomBrowseFragment widget.
     */
    if (useStandardBrowseFragment) {
        setContentView(standardBrowseFragmentLayoutId);
        return;
    }

    setContentView(customBrowseFragmentLayoutId);

    orbView = (SearchOrbView) findViewById(R.id.custom_search_orb);
    orbView.setOrbColor(getResources().getColor(R.color.search_opaque));
    orbView.bringToFront();
    orbView.setOnOrbClickedListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = new Intent(getApplicationContext(), SearchActivity.class);
            startActivity(intent);
        }
    });

    rowsFragment = new CustomRowsFragment();
    headersFragment = new CustomHeadersFragment();
    moreSamplesFragment = new MoreSamplesFragment();

    fragments = new LinkedHashMap<Integer, Fragment>();
    fragments.put(0, rowsFragment);
    fragments.put(1, moreSamplesFragment);

    currentFragment = rowsFragment;

    customFrameLayout = (CustomFrameLayout) ((ViewGroup) this.findViewById(android.R.id.content)).getChildAt(0);
    setupCustomFrameLayout();

    FragmentManager fragmentManager = getFragmentManager();
    FragmentTransaction transaction = fragmentManager.beginTransaction();
    transaction
            .replace(R.id.header_container, headersFragment, "CustomHeadersFragment")
            .replace(R.id.rows_container, rowsFragment, "CustomRowsFragment");
    transaction.commit();
}
项目:aos-Video    文件:MyBrandedFragment.java   
/**
 * Sets the color used to draw the search affordance.
 * A default brighter color will be set by the framework.
 *
 * @param color The color to use for the search affordance.
 */
public void setSearchAffordanceColor(int color) {
    setSearchAffordanceColors(new SearchOrbView.Colors(color));
}
项目:adt-leanback-support    文件:VerticalGridSupportFragment.java   
/**
 * Sets the color used to draw the search affordance.
 * A default brighter color will be set by the framework.
 *
 * @param color The color to use for the search affordance.
 */
public void setSearchAffordanceColor(int color) {
    setSearchAffordanceColors(new SearchOrbView.Colors(color));
}
项目:adt-leanback-support    文件:BrowseFragment.java   
/**
 * Sets the color used to draw the search affordance.
 * A default brighter color will be set by the framework.
 *
 * @param color The color to use for the search affordance.
 */
public void setSearchAffordanceColor(int color) {
    setSearchAffordanceColors(new SearchOrbView.Colors(color));
}
项目:adt-leanback-support    文件:BrowseSupportFragment.java   
/**
 * Sets the color used to draw the search affordance.
 * A default brighter color will be set by the framework.
 *
 * @param color The color to use for the search affordance.
 */
public void setSearchAffordanceColor(int color) {
    setSearchAffordanceColors(new SearchOrbView.Colors(color));
}
项目:adt-leanback-support    文件:VerticalGridFragment.java   
/**
 * Sets the color used to draw the search affordance.
 * A default brighter color will be set by the framework.
 *
 * @param color The color to use for the search affordance.
 */
public void setSearchAffordanceColor(int color) {
    setSearchAffordanceColors(new SearchOrbView.Colors(color));
}