Java Code Examples for android.widget.ScrollView#scrollTo()
The following examples show how to use
android.widget.ScrollView#scrollTo() .
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: ShareFileFragment.java From Cirrus_depricated with GNU General Public License v2.0 | 5 votes |
private void updateListOfUserGroups() { // Update list of users/groups // TODO Refactoring: create a new {@link ShareUserListAdapter} instance with every call should not be needed mUserGroupsAdapter = new ShareUserListAdapter( getActivity(), R.layout.share_user_item, mPrivateShares, this ); // Show data TextView noShares = (TextView) getView().findViewById(R.id.shareNoUsers); ListView usersList = (ListView) getView().findViewById(R.id.shareUsersList); if (mPrivateShares.size() > 0) { noShares.setVisibility(View.GONE); usersList.setVisibility(View.VISIBLE); usersList.setAdapter(mUserGroupsAdapter); setListViewHeightBasedOnChildren(usersList); } else { noShares.setVisibility(View.VISIBLE); usersList.setVisibility(View.GONE); } // Set Scroll to initial position ScrollView scrollView = (ScrollView) getView().findViewById(R.id.shareScroll); scrollView.scrollTo(0, 0); }
Example 2
Source File: TypefaceInfoActivity.java From Tehreer-Android with Apache License 2.0 | 5 votes |
private void loadTypeface(Typeface typeface) { if (typeface != mTypeface) { mTypeface = typeface; NameTable nameTable = new NameTable(mTypeface); configureName(R.id.layout_copyright, nameTable, COPYRIGHT); configureName(R.id.layout_font_family, nameTable, FONT_FAMILY); configureName(R.id.layout_font_subfamily, nameTable, FONT_SUBFAMILY); configureName(R.id.layout_unique_id, nameTable, UNIQUE_ID); configureName(R.id.layout_full_name, nameTable, FULL_NAME); configureName(R.id.layout_version, nameTable, VERSION); configureName(R.id.layout_postscript_name, nameTable, POST_SCRIPT_NAME); configureName(R.id.layout_trademark, nameTable, TRADEMARK); configureName(R.id.layout_manufacturer, nameTable, MANUFACTURER); configureName(R.id.layout_designer, nameTable, DESIGNER); configureName(R.id.layout_description, nameTable, DESCRIPTION); configureName(R.id.layout_vendor_url, nameTable, VENDOR_URL); configureName(R.id.layout_designer_url, nameTable, DESIGNER_URL); configureName(R.id.layout_license, nameTable, LICENSE); configureName(R.id.layout_license_url, nameTable, LICENSE_URL); configureName(R.id.layout_typographic_family, nameTable, TYPOGRAPHIC_FAMILY); configureName(R.id.layout_typographic_subfamily, nameTable, TYPOGRAPHIC_SUBFAMILY); configureName(R.id.layout_mac_full_name, nameTable, MAC_FULL_NAME); configureName(R.id.layout_sample_text, nameTable, SAMPLE_TEXT); configureName(R.id.layout_postscript_cid_findfont_name, nameTable, POST_SCRIPT_CID_FIND_FONT_NAME); configureName(R.id.layout_wws_family, nameTable, WWS_FAMILY); configureName(R.id.layout_wws_subfamily, nameTable, WWS_SUBFAMILY); configureName(R.id.layout_light_background_palette, nameTable, LIGHT_BACKGROUND_PALETTE); configureName(R.id.layout_dark_background_palette, nameTable, DARK_BACKGROUND_PALETTE); configureName(R.id.layout_variations_postscript_name_prefix, nameTable, VARIATIONS_POST_SCRIPT_NAME_PREFIX); ScrollView scrollView = findViewById(R.id.scroll_view_font_info); scrollView.invalidate(); scrollView.scrollTo(0, 0); } }
Example 3
Source File: DrawerView.java From material-drawer with MIT License | 4 votes |
@Override public void set(ScrollView object, Integer value) { object.scrollTo(0, value); }