本文整理汇总了Java中android.support.wearable.view.CircledImageView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java CircledImageView.setVisibility方法的具体用法?Java CircledImageView.setVisibility怎么用?Java CircledImageView.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.wearable.view.CircledImageView
的用法示例。
在下文中一共展示了CircledImageView.setVisibility方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
activity = ((MainActivity) getActivity());
onGalleryIconClick = new onGalleryIconClick();
onMoreIconClick = new onMoreIconClick();
onHomeIconClick = new onHomeIconClick();
onPageChangeSelected = new onPageChangeSelected();
downAnimationListener = new DownAnimationListener();
upAnimationListener = new UpAnimationListener();
iconUpAnimationListener = new IconUpAnimationListener();
iconDownAnimationListener = new IconDownAnimationListener();
phone = getResources().getBoolean(R.bool.portrait_only);
scale = getResources().getDisplayMetrics().density;
if (phone) {
hideThreshold = (int) (-105 * scale);
minThreshold = (int) (-49 * scale);
} else {
hideThreshold = (int) (-100 * scale);
minThreshold = (int) (-42 * scale);
}
if (currentId != this.getArguments().getInt("id") || this.timeOut == 1) {
rootView = inflater.inflate(R.layout.tvdetails, container, false);
spinner = (ProgressBar) rootView.findViewById(R.id.progressBar);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.bringToFront();
homeIcon.setVisibility(View.INVISIBLE);
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.bringToFront();
galleryIcon.setVisibility(View.INVISIBLE);
// Highest Z-index has to be declared last
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
}
moreIcon.setOnClickListener(onMoreIconClick);
return rootView;
}
示例2: showHideImages
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Fired from the on More Icon click listeners. Updates the visibility of the gallery and homePage icon.
* And creates animation for them also.
*
* @param visibility visibility value
* @param homeIcon first icon
* @param galleryIcon second icon
*/
public void showHideImages(int visibility, CircledImageView homeIcon, CircledImageView galleryIcon) {
float dy[] = {0.7f, 56.7f};
float infoTabDy[] = {-2.4f, 53.5f};
int currDy = 0;
int delay = 100;
int iconCount[] = {homeIconCheck, galleryIconCheck};
ArrayList<CircledImageView> circledImageViews = new ArrayList<>();
circledImageViews.add(homeIcon);
circledImageViews.add(galleryIcon);
if (visibility == View.VISIBLE) {
if (currPos != 0)
updateIconDownPos();
else
updateIconDownPosInInfoTab();
} else {
if (currPos != 0)
updateIconUpPos();
else
updateIconUpPosInInfoTab();
}
for (int i = 0; i < iconCount.length; i++) {
if (iconCount[i] == 1)
circledImageViews.get(circledImageViews.size() - 1).setVisibility(View.INVISIBLE);
else {
CircledImageView temp = circledImageViews.get(0);
if (visibility == View.VISIBLE) {
if (currPos == 0)
createIconUpAnimation(infoTabDy[currDy], delay);
else
createIconUpAnimation(dy[currDy], delay);
temp.startAnimation(iconUpAnimation);
} else {
if (currPos == 0)
createIconDownAnimation(infoTabDy[currDy]);
else
createIconDownAnimation(dy[currDy]);
temp.startAnimation(iconDownAnimation);
}
currDy++;
delay -= 50;
temp.setVisibility(visibility);
circledImageViews.remove(0);
}
}
}
示例3: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
rootView = inflater.inflate(R.layout.moviedetailsinfo, container, false);
activity = ((MainActivity) getActivity());
backDropPath = (ImageView) rootView.findViewById(R.id.backDropPath);
titleText = (TextView) rootView.findViewById(R.id.title);
releaseDate = (TextView) rootView.findViewById(R.id.releaseDate);
posterPath = (ImageView) rootView.findViewById(R.id.posterPath);
tagline = (TextView) rootView.findViewById(R.id.tagline);
statusText = (TextView) rootView.findViewById(R.id.status);
runtime = (TextView) rootView.findViewById(R.id.runtime);
genres = (TextView) rootView.findViewById(R.id.genres);
countries = (TextView) rootView.findViewById(R.id.countries);
companies = (TextView) rootView.findViewById(R.id.companies);
ratingBar = (RatingBar) rootView.findViewById(R.id.ratingBar);
voteCount = (TextView) rootView.findViewById(R.id.voteCount);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.setVisibility(View.INVISIBLE);
homeIcon.bringToFront();
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.setVisibility(View.INVISIBLE);
galleryIcon.bringToFront();
trailerIcon = (CircledImageView) rootView.findViewById(R.id.trailerIcon);
trailerIcon.setVisibility(View.INVISIBLE);
trailerIcon.bringToFront();
// Highest Z-index has to be declared last
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
movieDetailsSimilarGrid = (GridView) rootView.findViewById(R.id.movieDetailsSimilarGrid);
similarHolder = rootView.findViewById(R.id.similarHolder);
scrollView = (ObservableParallaxScrollView) rootView.findViewById(R.id.moviedetailsinfo);
View detailsLayout = rootView.findViewById(R.id.detailsLayout);
ViewCompat.setElevation(detailsLayout, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(moreIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(homeIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(galleryIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(trailerIcon, 2 * getResources().getDisplayMetrics().density);
// Prevent event bubbling else if you touch on the details layout when the info tab is scrolled it will open gallery view
detailsLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
return rootView;
}
示例4: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
rootView = inflater.inflate(R.layout.castdetailsinfo, container, false);
activity = ((MainActivity) getActivity());
name = (TextView) rootView.findViewById(R.id.name);
profilePath = (ImageView) rootView.findViewById(R.id.profilePath);
birthInfo = (TextView) rootView.findViewById(R.id.birthInfo);
alsoKnownAs = (TextView) rootView.findViewById(R.id.alsoKnownAs);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.setVisibility(View.INVISIBLE);
homeIcon.bringToFront();
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.setVisibility(View.INVISIBLE);
galleryIcon.bringToFront();
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
scrollView = (ObservableParallaxScrollView) rootView.findViewById(R.id.castdetailsinfo);
castDetailsKnownGrid = (GridView) rootView.findViewById(R.id.castDetailsKnownGrid);
knownHolder = rootView.findViewById(R.id.knownHolder);
showMoreButton = (Button) rootView.findViewById(R.id.showMoreButton);
showMoreButton.setOnClickListener(this);
View detailsLayout = rootView.findViewById(R.id.detailsLayout);
ViewCompat.setElevation(detailsLayout, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(moreIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(homeIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(galleryIcon, 2 * getResources().getDisplayMetrics().density);
// Prevent event bubbling else if you touch on the details layout when the info tab is scrolled it will open gallery view
detailsLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
return rootView;
}
示例5: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
rootView = inflater.inflate(R.layout.tvdetailsinfo, container, false);
activity = ((MainActivity) getActivity());
backDropPath = (ImageView) rootView.findViewById(R.id.backDropPath);
title = (TextView) rootView.findViewById(R.id.title);
posterPath = (ImageView) rootView.findViewById(R.id.posterPath);
statusText = (TextView) rootView.findViewById(R.id.status);
typeText = (TextView) rootView.findViewById(R.id.type);
episodeRuntime = (TextView) rootView.findViewById(R.id.episodeRuntime);
numberOfEpisodesText = (TextView) rootView.findViewById(R.id.numberOfEpisodes);
numberOfSeasonsText = (TextView) rootView.findViewById(R.id.numberOfSeasons);
firstAirDateText = (TextView) rootView.findViewById(R.id.firstAirDate);
lastAirDateText = (TextView) rootView.findViewById(R.id.lastAirDate);
genres = (TextView) rootView.findViewById(R.id.genres);
countries = (TextView) rootView.findViewById(R.id.countries);
companies = (TextView) rootView.findViewById(R.id.companies);
ratingBar = (RatingBar) rootView.findViewById(R.id.ratingBar);
voteCount = (TextView) rootView.findViewById(R.id.voteCount);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.setVisibility(View.INVISIBLE);
homeIcon.bringToFront();
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.setVisibility(View.INVISIBLE);
galleryIcon.bringToFront();
// Highest Z-index has to be declared last
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
scrollView = (ObservableParallaxScrollView) rootView.findViewById(R.id.tvdetailsinfo);
tvDetailsSimilarGrid = (GridView) rootView.findViewById(R.id.tvDetailsSimilarGrid);
similarHolder = rootView.findViewById(R.id.similarHolder);
View detailsLayout = rootView.findViewById(R.id.detailsLayout);
ViewCompat.setElevation(detailsLayout, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(moreIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(homeIcon, 2 * getResources().getDisplayMetrics().density);
ViewCompat.setElevation(galleryIcon, 2 * getResources().getDisplayMetrics().density);
// Prevent event bubbling else if you touch on the details layout when the info tab is scrolled it will open gallery view
detailsLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
return rootView;
}
示例6: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
activity = ((MainActivity) getActivity());
movieModel = new MovieModel();
onGalleryIconClick = new onGalleryIconClick();
onMoreIconClick = new onMoreIconClick();
onHomeIconClick = new onHomeIconClick();
onPageChangeSelected = new onPageChangeSelected();
downAnimationListener = new DownAnimationListener();
upAnimationListener = new UpAnimationListener();
iconUpAnimationListener = new IconUpAnimationListener();
iconDownAnimationListener = new IconDownAnimationListener();
phone = getResources().getBoolean(R.bool.portrait_only);
scale = getResources().getDisplayMetrics().density;
if (phone) {
hideThreshold = (int) (-105 * scale);
minThreshold = (int) (-49 * scale);
} else {
hideThreshold = (int) (-100 * scale);
minThreshold = (int) (-42 * scale);
}
if (currentId != this.getArguments().getInt("id") || this.timeOut == 1) {
rootView = inflater.inflate(R.layout.castdetails, container, false);
spinner = (ProgressBar) rootView.findViewById(R.id.progressBar);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.bringToFront();
homeIcon.setVisibility(View.INVISIBLE);
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.bringToFront();
galleryIcon.setVisibility(View.INVISIBLE);
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
}
moreIcon.setOnClickListener(onMoreIconClick);
return rootView;
}
示例7: onCreateView
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Called to have the fragment instantiate its user interface view.
*
* @param inflater sets the layout for the current view.
* @param container the container which holds the current view.
* @param savedInstanceState If non-null, this fragment is being re-constructed from a previous saved state as given here.
* Return the View for the fragment's UI, or null.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
activity = ((MainActivity) getActivity());
onGalleryIconClick = new onGalleryIconClick();
onTrailerIconClick = new onTrailerIconClick();
onMoreIconClick = new onMoreIconClick();
onHomeIconClick = new onHomeIconClick();
onPageChangeSelected = new onPageChangeSelected();
downAnimationListener = new DownAnimationListener();
upAnimationListener = new UpAnimationListener();
iconUpAnimationListener = new IconUpAnimationListener();
iconDownAnimationListener = new IconDownAnimationListener();
phone = getResources().getBoolean(R.bool.portrait_only);
scale = getResources().getDisplayMetrics().density;
if (phone) {
hideThreshold = (int) (-105 * scale);
minThreshold = (int) (-49 * scale);
} else {
hideThreshold = (int) (-100 * scale);
minThreshold = (int) (-42 * scale);
}
if (currentId != this.getArguments().getInt("id") || this.timeOut == 1) {
rootView = inflater.inflate(R.layout.moviedetails, container, false);
spinner = (ProgressBar) rootView.findViewById(R.id.progressBar);
homeIcon = (CircledImageView) rootView.findViewById(R.id.homeIcon);
homeIcon.bringToFront();
homeIcon.setVisibility(View.INVISIBLE);
galleryIcon = (CircledImageView) rootView.findViewById(R.id.galleryIcon);
galleryIcon.bringToFront();
galleryIcon.setVisibility(View.INVISIBLE);
trailerIcon = (CircledImageView) rootView.findViewById(R.id.trailerIcon);
trailerIcon.bringToFront();
trailerIcon.setVisibility(View.INVISIBLE);
// Highest Z-index has to be declared last
moreIcon = (CircledImageView) rootView.findViewById(R.id.moreIcon);
moreIcon.bringToFront();
}
moreIcon.setOnClickListener(onMoreIconClick);
return rootView;
}
示例8: showHideImages
import android.support.wearable.view.CircledImageView; //导入方法依赖的package包/类
/**
* Fired from the on More Icon click listeners. Updates the visibility of the gallery and homePage icon.
* And creates animation for them also.
*
* @param visibility visibility value
* @param homeIcon first icon
* @param galleryIcon second icon
*/
public void showHideImages(int visibility, CircledImageView homeIcon, CircledImageView trailerIcon, CircledImageView galleryIcon) {
float dy[] = {0.7f, 56.7f, 112.5f};
float infoTabDy[] = {-2.4f, 53.5f, 109.25f};
int currDy = 0;
int delay = 100;
int iconCount[] = {homeIconCheck, trailerIconCheck, galleryIconCheck};
ArrayList<CircledImageView> circledImageViews = new ArrayList<>();
circledImageViews.add(homeIcon);
circledImageViews.add(trailerIcon);
circledImageViews.add(galleryIcon);
if (visibility == View.VISIBLE) {
if (currPos != 0)
updateIconDownPos();
else
updateIconDownPosInInfoTab();
} else {
if (currPos != 0)
updateIconUpPos();
else
updateIconUpPosInInfoTab();
}
for (int i = 0; i < iconCount.length; i++) {
if (iconCount[i] == 1)
circledImageViews.get(circledImageViews.size() - 1).setVisibility(View.INVISIBLE);
else {
CircledImageView temp = circledImageViews.get(0);
if (visibility == View.VISIBLE) {
if (currPos == 0)
createIconUpAnimation(infoTabDy[currDy], delay);
else
createIconUpAnimation(dy[currDy], delay);
temp.startAnimation(iconUpAnimation);
} else {
if (currPos == 0)
createIconDownAnimation(infoTabDy[currDy]);
else
createIconDownAnimation(dy[currDy]);
temp.startAnimation(iconDownAnimation);
}
currDy++;
delay -= 50;
temp.setVisibility(visibility);
circledImageViews.remove(0);
}
}
}