android.widget.TextView.getAlpha()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中android.widget.TextView.getAlpha()方法的一些代码示例,展示了TextView.getAlpha()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getAlpha()方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getAlpha

TextView.getAlpha介绍

暂无

代码示例

代码示例来源:origin: Ramotion/cardslider-android

private void setCountryText(String text, boolean left2right) {
  final TextView invisibleText;
  final TextView visibleText;
  if (country1TextView.getAlpha() > country2TextView.getAlpha()) {
    visibleText = country1TextView;
    invisibleText = country2TextView;
  } else {
    visibleText = country2TextView;
    invisibleText = country1TextView;
  }
  final int vOffset;
  if (left2right) {
    invisibleText.setX(0);
    vOffset = countryOffset2;
  } else {
    invisibleText.setX(countryOffset2);
    vOffset = 0;
  }
  invisibleText.setText(text);
  final ObjectAnimator iAlpha = ObjectAnimator.ofFloat(invisibleText, "alpha", 1f);
  final ObjectAnimator vAlpha = ObjectAnimator.ofFloat(visibleText, "alpha", 0f);
  final ObjectAnimator iX = ObjectAnimator.ofFloat(invisibleText, "x", countryOffset1);
  final ObjectAnimator vX = ObjectAnimator.ofFloat(visibleText, "x", vOffset);
  final AnimatorSet animSet = new AnimatorSet();
  animSet.playTogether(iAlpha, vAlpha, iX, vX);
  animSet.setDuration(countryAnimDuration);
  animSet.start();
}

代码示例来源:origin: roughike/BottomBar

@Test
@UiThreadTest
public void setActiveAlpha_UpdatesAlpha() {
  BottomBarTab activeTab = bottomBar.getCurrentTab();
  float previousAlpha = activeTab.getActiveAlpha();
  float testAlpha = 0.69f;
  assertNotEquals(testAlpha, previousAlpha);
  assertNotEquals(testAlpha, activeTab.getIconView().getAlpha());
  assertNotEquals(testAlpha, activeTab.getTitleView().getAlpha());
  bottomBar.setActiveTabAlpha(testAlpha);
  assertEquals(testAlpha, activeTab.getActiveAlpha(), 0);
  assertEquals(testAlpha, activeTab.getIconView().getAlpha(), 0);
  assertEquals(testAlpha, activeTab.getTitleView().getAlpha(), 0);
}

代码示例来源:origin: roughike/BottomBar

@Test
@UiThreadTest
public void setInActiveAlpha_UpdatesAlpha() {
  BottomBarTab inActiveTab = bottomBar.getTabAtPosition(1);
  assertNotEquals(bottomBar.getCurrentTab(), inActiveTab);
  float previousAlpha = inActiveTab.getInActiveAlpha();
  float testAlpha = 0.1f;
  assertNotEquals(testAlpha, previousAlpha);
  assertNotEquals(testAlpha, inActiveTab.getIconView().getAlpha());
  assertNotEquals(testAlpha, inActiveTab.getTitleView().getAlpha());
  bottomBar.setInActiveTabAlpha(testAlpha);
  assertEquals(testAlpha, inActiveTab.getInActiveAlpha(), 0);
  assertEquals(testAlpha, inActiveTab.getIconView().getAlpha(), 0);
  assertEquals(testAlpha, inActiveTab.getTitleView().getAlpha(), 0);
}

代码示例来源:origin: google/santa-tracker-android

currentScoreAlpha = currentScore.getAlpha();
currentScore.post(
    new Runnable() {

代码示例来源:origin: ywwynm/EverythingDone

@Override
  public boolean handleMessage(Message message) {
    if (message.what == 96) {
      mTvInfinity.animate().setDuration(3600).alpha(1 - mTvInfinity.getAlpha());
      mInfinityHandler.sendEmptyMessageDelayed(96, 3600);
    }
    return false;
  }
});

代码示例来源:origin: WeAreFairphone/FP2-Launcher

private boolean startEditButtonAnimation()
  if (isTimeToShow && mEditButton != null && (mEditButton.getAlpha() == 0) && mEdgeSwipeHolder.getVisibility() == View.VISIBLE)

代码示例来源:origin: werbhelius/MyCalendarDemo

ObjectAnimator animatorTxtAlphaIn = ObjectAnimator.ofFloat(mTxtMonth, "alpha", mTxtMonth.getAlpha(), 1f);
ObjectAnimator animatorBackgroundAlphaIn = ObjectAnimator.ofFloat(mMonthBackground, "alpha", mMonthBackground.getAlpha(), 1f);
ObjectAnimator animatorTxtAlphaOut = ObjectAnimator.ofFloat(mTxtMonth, "alpha", mTxtMonth.getAlpha(), 0f);
ObjectAnimator animatorBackgroundAlphaOut = ObjectAnimator.ofFloat(mMonthBackground, "alpha", mMonthBackground.getAlpha(), 0f);
animatorSetFadeOut.playTogether(

代码示例来源:origin: quaap/LaunchTime

if (categoryTab.getAlpha()<.89f) {
  categoryTab.setAlpha(.9f);

代码示例来源:origin: marcouberti/american_sunsets_watch_face

@Override
public void onNonCenterPosition(boolean animate) {
  if (animate) {
    mExpandAnimator.cancel();
    if (!mShrinkAnimator.isRunning()) {
      mShrinkCircleAnimator.setFloatValues(mColor.getCircleRadius(), mShrinkCircleRadius);
      mShrinkLabelAnimator.setFloatValues(mLabel.getAlpha(), SHRINK_LABEL_ALPHA);
      mShrinkAnimator.start();
    }
  } else {
    mShrinkAnimator.cancel();
    mColor.setCircleRadius(mShrinkCircleRadius);
    mLabel.setAlpha(SHRINK_LABEL_ALPHA);
  }
}

代码示例来源:origin: marcouberti/american_sunsets_watch_face

@Override
public void onNonCenterPosition(boolean animate) {
  if (animate) {
    mExpandAnimator.cancel();
    if (!mShrinkAnimator.isRunning()) {
      mShrinkCircleAnimator.setFloatValues(mColor.getCircleRadius(), mShrinkCircleRadius);
      mShrinkLabelAnimator.setFloatValues(mLabel.getAlpha(), SHRINK_LABEL_ALPHA);
      mShrinkAnimator.start();
    }
  } else {
    mShrinkAnimator.cancel();
    mColor.setCircleRadius(mShrinkCircleRadius);
    mLabel.setAlpha(SHRINK_LABEL_ALPHA);
  }
}

代码示例来源:origin: googlesamples/android-WatchFace

@Override
public void onCenterPosition(boolean animate) {
  if (animate) {
    mShrinkAnimator.cancel();
    if (!mExpandAnimator.isRunning()) {
      mExpandCircleAnimator.setFloatValues(mColor.getCircleRadius(), mExpandCircleRadius);
      mExpandLabelAnimator.setFloatValues(mLabel.getAlpha(), EXPAND_LABEL_ALPHA);
      mExpandAnimator.start();
    }
  } else {
    mExpandAnimator.cancel();
    mColor.setCircleRadius(mExpandCircleRadius);
    mLabel.setAlpha(EXPAND_LABEL_ALPHA);
  }
}

代码示例来源:origin: googlesamples/android-WatchFace

@Override
public void onNonCenterPosition(boolean animate) {
  if (animate) {
    mExpandAnimator.cancel();
    if (!mShrinkAnimator.isRunning()) {
      mShrinkCircleAnimator.setFloatValues(mColor.getCircleRadius(), mShrinkCircleRadius);
      mShrinkLabelAnimator.setFloatValues(mLabel.getAlpha(), SHRINK_LABEL_ALPHA);
      mShrinkAnimator.start();
    }
  } else {
    mShrinkAnimator.cancel();
    mColor.setCircleRadius(mShrinkCircleRadius);
    mLabel.setAlpha(SHRINK_LABEL_ALPHA);
  }
}

代码示例来源:origin: marcouberti/american_sunsets_watch_face

@Override
public void onCenterPosition(boolean animate) {
  if (animate) {
    mShrinkAnimator.cancel();
    if (!mExpandAnimator.isRunning()) {
      mExpandCircleAnimator.setFloatValues(mColor.getCircleRadius(), mExpandCircleRadius);
      mExpandLabelAnimator.setFloatValues(mLabel.getAlpha(), EXPAND_LABEL_ALPHA);
      mExpandAnimator.start();
    }
  } else {
    mExpandAnimator.cancel();
    mColor.setCircleRadius(mExpandCircleRadius);
    mLabel.setAlpha(EXPAND_LABEL_ALPHA);
  }
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

@Override
public void onCenterPosition(final boolean animate) {
  if (animate) {
    mShrinkAnimator.cancel();
    if (!mExpandAnimator.isRunning()) {
      mExpandCircleAnimator.setFloatValues(mIcon.getCircleRadius(), mExpandCircleRadius);
      mFadeInLabelAnimator.setFloatValues(mName.getAlpha(), EXPAND_LABEL_ALPHA);
      mExpandAnimator.start();
    }
  } else {
    mExpandAnimator.cancel();
    mIcon.setCircleRadius(mExpandCircleRadius);
    mName.setAlpha(EXPAND_LABEL_ALPHA);
  }
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

@Override
  public void onNonCenterPosition(final boolean animate) {
    if (animate) {
      mExpandAnimator.cancel();
      if (!mShrinkAnimator.isRunning()) {
        mShrinkCircleAnimator.setFloatValues(mIcon.getCircleRadius(), mShrinkCircleRadius);
        mFadeOutLabelAnimator.setFloatValues(mName.getAlpha(), SHRINK_LABEL_ALPHA);
        mShrinkAnimator.start();
      }
    } else {
      mShrinkAnimator.cancel();
      mIcon.setCircleRadius(mShrinkCircleRadius);
      mName.setAlpha(SHRINK_LABEL_ALPHA);
    }
  }
}

代码示例来源:origin: marcouberti/american_sunsets_watch_face

@Override
public void onCenterPosition(boolean animate) {
  if (animate) {
    mShrinkAnimator.cancel();
    if (!mExpandAnimator.isRunning()) {
      mExpandCircleAnimator.setFloatValues(mColor.getCircleRadius(), mExpandCircleRadius);
      mExpandLabelAnimator.setFloatValues(mLabel.getAlpha(), EXPAND_LABEL_ALPHA);
      mExpandAnimator.start();
    }
  } else {
    mExpandAnimator.cancel();
    mColor.setCircleRadius(mExpandCircleRadius);
    mLabel.setAlpha(EXPAND_LABEL_ALPHA);
  }
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

@Override
public void onCenterPosition(final boolean animate) {
  if (animate) {
    mShrinkAnimator.cancel();
    if (!mExpandAnimator.isRunning()) {
      mExpandCircleAnimator.setFloatValues(mIcon.getCircleRadius(), mExpandCircleRadius);
      mFadeInLabelAnimator.setFloatValues(mName.getAlpha(), EXPAND_LABEL_ALPHA);
      mExpandAnimator.start();
    }
  } else {
    mExpandAnimator.cancel();
    mIcon.setCircleRadius(mExpandCircleRadius);
    mName.setAlpha(EXPAND_LABEL_ALPHA);
  }
  mIcon.setEnabled(true);
}

代码示例来源:origin: NordicSemiconductor/Android-nRF-Toolbox

@Override
  public void onNonCenterPosition(final boolean animate) {
    if (animate) {
      mExpandAnimator.cancel();
      if (!mShrinkAnimator.isRunning()) {
        mShrinkCircleAnimator.setFloatValues(mIcon.getCircleRadius(), mShrinkCircleRadius);
        mFadeOutLabelAnimator.setFloatValues(mName.getAlpha(), SHRINK_LABEL_ALPHA);
        mShrinkAnimator.start();
      }
    } else {
      mShrinkAnimator.cancel();
      mIcon.setCircleRadius(mShrinkCircleRadius);
      mName.setAlpha(SHRINK_LABEL_ALPHA);
    }
    mIcon.setEnabled(false);
  }
}

代码示例来源:origin: stackoverflow.com

if (!mExpandAnimator.isRunning()) {
  mExpandCircleAnimator.setFloatValues(mImage.getCircleRadius(), mExpandCircleRadius);
  mExpandLabelAnimator.setFloatValues(mTextView.getAlpha(), EXPAND_LABEL_ALPHA);
  mExpandIconAnimator.setFloatValues(mImage.getAlpha(), EXPAND_LABEL_ALPHA);
  mExpandAnimator.start();
if (!mShrinkAnimator.isRunning()) {
  mShrinkCircleAnimator.setFloatValues(mImage.getCircleRadius(), mShrinkCircleRadius);
  mShrinkLabelAnimator.setFloatValues(mTextView.getAlpha(), SHRINK_LABEL_ALPHA);
  mShrinkLabelAnimator.setFloatValues(mImage.getAlpha(), SHRINK_LABEL_ALPHA);
  mShrinkAnimator.start();

相关文章

TextView类方法