VISIBLE源码实例Demo

android.view.View#VISIBLE源码实例Demo

下面列出了android.view.View#VISIBLE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: APlayer   文件: PlayerActivity.java
@Override
public void run() {
  while (mIsForeground) {
    //音量
    if (mVolumeSeekbar.getVisibility() == View.VISIBLE) {
      final int max = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
      final int current = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
      runOnUiThread(() -> mVolumeSeekbar.setProgress((int) (current * 1.0 / max * 100)));
    }
    if (!MusicServiceRemote.isPlaying()) {
      continue;
    }
    int progress = MusicServiceRemote.getProgress();
    if (progress > 0 && progress < mDuration) {
      mCurrentTime = progress;
      mHandler.sendEmptyMessage(UPDATE_TIME_ALL);
      try {
        //1000ms时间有点长
        sleep(500);
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
}
 
源代码2 项目: ucar-weex-core   文件: WXViewUtils.java
public static boolean onScreenArea(View view) {
  if (view == null || view.getVisibility() != View.VISIBLE) {
    return false;
  }

  int[] p = new int[2];
  view.getLocationOnScreen(p);
  LayoutParams lp = view.getLayoutParams();
  int viewH = 0;
  if (lp != null) {
    viewH = lp.height;
  } else {
    viewH = view.getHeight();
  }

  return (p[1] > 0 && (p[1] - WXViewUtils.getScreenHeight(WXEnvironment.sApplication) < 0))
         || (viewH + p[1] > 0 && p[1] <= 0);
}
 
源代码3 项目: AndroidAutoClick   文件: MainActivity.java
@Override
public void onBackPressed() {
	//原生控件点击后退关闭
	if (mNativeAdLayout != null && mNativeAdLayout.getVisibility() == View.VISIBLE) {
		mNativeAdLayout.removeAllViews();
		mNativeAdLayout.setVisibility(View.GONE);
		return;
	}
	// 如果有需要,可以点击后退关闭插播广告。
	if (!SpotManager.getInstance(mContext).disMiss()) {
		super.onBackPressed();
	}
}
 
@Override
public void onPageFinishedLoading(String url) {
    LOG.d(TAG, "onPageFinished(" + url + ")");

    clearLoadTimeoutTimer();

    // Broadcast message that page has loaded
    pluginManager.postMessage("onPageFinished", url);

    // Make app visible after 2 sec in case there was a JS error and Cordova JS never initialized correctly
    if (engine.getView().getVisibility() != View.VISIBLE) {
        Thread t = new Thread(new Runnable() {
            public void run() {
                try {
                    Thread.sleep(2000);
                    cordova.getActivity().runOnUiThread(new Runnable() {
                        public void run() {
                            pluginManager.postMessage("spinner", "stop");
                        }
                    });
                } catch (InterruptedException e) {
                }
            }
        });
        t.start();
    }

    // Shutdown if blank loaded
    if (url.equals("about:blank")) {
        pluginManager.postMessage("exit", null);
    }
}
 
源代码5 项目: weex   文件: ViewUtil.java
private static boolean isHittable(View view) {
  if (view.getVisibility() != View.VISIBLE) {
    return false;
  }

  if (ViewCompat.getInstance().getAlpha(view) < 0.001f) {
    return false;
  }

  return true;
}
 
源代码6 项目: ListItemFold   文件: DetailAnimViewGroup.java
private void updateVisibility() {
    if (this.topFoldFactor == DEFAULT_BACKOFF_MULT && this.bottomFoldFactor == DEFAULT_BACKOFF_MULT) {
        if (getVisibility() != View.GONE) {
            setVisibility(View.GONE);
        }
    } else if (getVisibility() != View.VISIBLE) {
        setVisibility(View.VISIBLE);
    }
}
 
源代码7 项目: AndroidBase   文件: IndicatorLayout.java
public final boolean isVisible() {
	Animation currentAnim = getAnimation();
	if (null != currentAnim) {
		return mInAnim == currentAnim;
	}

	return getVisibility() == View.VISIBLE;
}
 
源代码8 项目: SkyTube   文件: SubscriptionsFeedFragment.java
/**
 * Set up the UI depending to the total number of channel the user is subscribed to.
 *
 * @param totalSubbedChannels   Total number of channel the user is subscribed to.
 */
private void setupUiAccordingToNumOfSubbedChannels(int totalSubbedChannels) {
	if (totalSubbedChannels <= 0) {
		swipeRefreshLayout.setVisibility(View.GONE);
		noSubscriptionsText.setVisibility(View.VISIBLE);
	} else {
		if (swipeRefreshLayout.getVisibility() != View.VISIBLE) {
			swipeRefreshLayout.setVisibility(View.VISIBLE);
			noSubscriptionsText.setVisibility(View.GONE);
		}
	}
}
 
源代码9 项目: Jockey   文件: RuleViewModel.java
private void setupValueAdapter() {
    if (mValueSubscription != null) {
        mValueSubscription.unsubscribe();
    }

    if (getValueSpinnerVisibility() != View.VISIBLE) {
        return;
    }

    mValueAdapter = null;
    switch (mFactory.getType()) {
        case AutoPlaylistRule.SONG:
            setupSongAdapter();
            break;
        case AutoPlaylistRule.ARTIST:
            setupArtistAdapter();
            break;
        case AutoPlaylistRule.ALBUM:
            setupAlbumAdapter();
            break;
        case AutoPlaylistRule.GENRE:
            setupGenreAdapter();
            break;
        case AutoPlaylistRule.PLAYLIST:
            setupPlaylistAdapter();
            break;
    }

    notifyPropertyChanged(BR.valueAdapter);
}
 
源代码10 项目: EosCommander   文件: CreateEosAccountDialog.java
@Override
public String getSelectedWalletName() {
    if ( mWalletSpinner.getVisibility() != View.VISIBLE ) {
        return null;
    }

    if ( mWalletSpinner.getSelectedItemPosition() == WALLET_SPINNER_SELECT_NOTICE_INDEX) { // select wallet notice
        return null;
    }

    return mWalletSpinner.getSelectedItem().toString();
}
 
源代码11 项目: yandex-money-sdk-android   文件: MoreViewActions.java
public WaitVisibilityChange(long duration, int visibility) {
    super(duration);
    if (visibility != View.GONE && visibility != View.INVISIBLE &&
            visibility != View.VISIBLE) {
        throw new IllegalArgumentException("wrong visibility: " + visibility);
    }
    this.visibility = visibility;
}
 
源代码12 项目: VideoOS-Android-SDK   文件: LVImageView.java
@Override
protected void onWindowVisibilityChanged(int visibility) {
    super.onWindowVisibilityChanged(visibility);

    if (visibility == View.VISIBLE) {
        registerSensorManager();
    } else {
        unregisterSensorManager();
    }
}
 
源代码13 项目: HypFacebook   文件: PickerFragment.java
@Override
void updateCheckboxState(CheckBox checkBox, boolean graphObjectSelected) {
    checkBox.setChecked(graphObjectSelected);
    int visible = (graphObjectSelected || selectionStrategy
            .shouldShowCheckBoxIfUnselected()) ? View.VISIBLE : View.GONE;
    checkBox.setVisibility(visible);
}
 
源代码14 项目: Paginize   文件: BasePage.java
protected boolean isContentViewVisible() {
  return mLayoutContainer.getVisibility() == View.VISIBLE;
}
 
源代码15 项目: TelePlus-Android   文件: LocationActivity.java
private void updateClipView(int firstVisibleItem) {
    if (firstVisibleItem == RecyclerView.NO_POSITION) {
        return;
    }
    int height = 0;
    int top = 0;
    View child = listView.getChildAt(0);
    if (child != null) {
        if (firstVisibleItem == 0) {
            top = child.getTop();
            height = overScrollHeight + (top < 0 ? top : 0);
        }
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mapViewClip.getLayoutParams();
        if (layoutParams != null) {
            if (height <= 0) {
                if (mapView.getVisibility() == View.VISIBLE) {
                    mapView.setVisibility(View.INVISIBLE);
                    mapViewClip.setVisibility(View.INVISIBLE);
                }
            } else {
                if (mapView.getVisibility() == View.INVISIBLE) {
                    mapView.setVisibility(View.VISIBLE);
                    mapViewClip.setVisibility(View.VISIBLE);
                }
            }

            mapViewClip.setTranslationY(Math.min(0, top));
            mapView.setTranslationY(Math.max(0, -top / 2));
            if (markerImageView != null) {
                markerImageView.setTranslationY(markerTop = -top - AndroidUtilities.dp(42) + height / 2);
                markerXImageView.setTranslationY(-top - AndroidUtilities.dp(7) + height / 2);
            }
            if (routeButton != null) {
                routeButton.setTranslationY(top);
            }
            layoutParams = (FrameLayout.LayoutParams) mapView.getLayoutParams();
            if (layoutParams != null && layoutParams.height != overScrollHeight + AndroidUtilities.dp(10)) {
                layoutParams.height = overScrollHeight + AndroidUtilities.dp(10);
                if (googleMap != null) {
                    googleMap.setPadding(AndroidUtilities.dp(70), 0, AndroidUtilities.dp(70), AndroidUtilities.dp(10));
                }
                mapView.setLayoutParams(layoutParams);
            }
        }
    }
}
 
private void setItemViewVisibilityById(int id, boolean visible) {
    int visible_value = visible ? View.VISIBLE : View.GONE;
    itemView.findViewById(id).setVisibility(visible_value);
}
 
/**
 * 点击触摸显示和隐藏逻辑
 */
@Override
protected void onClickUiToggle() {
    if (mIfCurrentIsFullscreen && mLockCurScreen && mNeedLockFull) {
        setViewShowState(mLockScreen, VISIBLE);
        return;
    }
    if (mCurrentState == CURRENT_STATE_PREPAREING) {
        if (mBottomContainer != null) {
            if (mBottomContainer.getVisibility() == View.VISIBLE) {
                changeUiToPrepareingClear();
            } else {
                changeUiToPreparingShow();
            }
        }
    } else if (mCurrentState == CURRENT_STATE_PLAYING) {
        if (mBottomContainer != null) {
            if (mBottomContainer.getVisibility() == View.VISIBLE) {
                changeUiToPlayingClear();
            } else {
                changeUiToPlayingShow();
            }
        }
    } else if (mCurrentState == CURRENT_STATE_PAUSE) {
        if (mBottomContainer != null) {
            if (mBottomContainer.getVisibility() == View.VISIBLE) {
                changeUiToPauseClear();
            } else {
                changeUiToPauseShow();
            }
        }
    } else if (mCurrentState == CURRENT_STATE_AUTO_COMPLETE) {
        if (mBottomContainer != null) {
            if (mBottomContainer.getVisibility() == View.VISIBLE) {
                changeUiToCompleteClear();
            } else {
                changeUiToCompleteShow();
            }
        }
    } else if (mCurrentState == CURRENT_STATE_PLAYING_BUFFERING_START) {
        if (mBottomContainer != null) {
            if (mBottomContainer.getVisibility() == View.VISIBLE) {
                changeUiToPlayingBufferingClear();
            } else {
                changeUiToPlayingBufferingShow();
            }
        }
    }
}
 
源代码18 项目: LaunchEnr   文件: DeepShortcutView.java
public boolean willDrawIcon() {
    return mIconView.getVisibility() == View.VISIBLE;
}
 
源代码19 项目: zen4android   文件: ActionBarImpl.java
public boolean isShowing() {
    return mContainerView.getVisibility() == View.VISIBLE;
}
 
源代码20 项目: kognitivo   文件: LoginButton.java
private void showToolTipPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String toolTipString = settings.getNuxContent();
        displayToolTip(toolTipString);
    }
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 方法所在类
 同类方法