android.support.v17.leanback.widget.SearchOrbView Java Examples

The following examples show how to use android.support.v17.leanback.widget.SearchOrbView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #2
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #3
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #4
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #5
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #6
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #7
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}
 
Example #8
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
}
 
Example #9
Source File: TVDemoActivity.java    From BuildingForAndroidTV with MIT License 5 votes vote down vote up
@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();
}
 
Example #10
Source File: MainActivity.java    From BuildingForAndroidTV with MIT License 4 votes vote down vote up
/**
 * 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();
}
 
Example #11
Source File: VerticalGridSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * 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));
}
 
Example #12
Source File: BrowseFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * 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));
}
 
Example #13
Source File: BrowseSupportFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * 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));
}
 
Example #14
Source File: VerticalGridFragment.java    From adt-leanback-support with Apache License 2.0 2 votes vote down vote up
/**
 * 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));
}