android.widget.LinearLayout#setTranslationY ( )源码实例Demo

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

源代码1 项目: EasyTransition   文件: DetailActivity.java
private void initOtherViews() {
    layoutAbout = (LinearLayout) findViewById(R.id.layout_about);
    layoutAbout.setVisibility(View.VISIBLE);
    layoutAbout.setAlpha(0);
    layoutAbout.setTranslationY(-30);
    layoutAbout.animate()
            .setDuration(300)
            .alpha(1)
            .translationY(0);

    ivAdd = (ImageView) findViewById(R.id.iv_add);
    ivAdd.setVisibility(View.VISIBLE);
    ivAdd.setScaleX(0);
    ivAdd.setScaleY(0);
    ivAdd.animate()
            .setDuration(200)
            .scaleX(1)
            .scaleY(1);
}
 
源代码2 项目: RecyclerViewSyncDemo   文件: PushBehavior.java
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
public boolean onDependentViewChanged(@NonNull final CoordinatorLayout parent, @NonNull final LinearLayout child, @NonNull final View dependency) {
    final Boolean apiCompatible = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
    if (apiCompatible) {
        final Float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
        child.setTranslationY(translationY);
    }
    return apiCompatible;
}
 
源代码3 项目: ViewInspector   文件: ProfileProgressbar.java
@Override protected void onAttachedToWindow() {
  super.onAttachedToWindow();
  LinearLayout progressbarLayout = (LinearLayout) findViewById(R.id.progressbar_layout);
  progressbarLayout.setTranslationY(-mLayoutHeight);
  progressbarLayout.setVisibility(VISIBLE);
  ObjectAnimator animator =
      ObjectAnimator.ofFloat(progressbarLayout, "translationY", -mLayoutHeight, 0);
  animator.setInterpolator(new DecelerateInterpolator());
  animator.setDuration(500);
  animator.start();
}
 
源代码4 项目: NotificationPeekPort   文件: NotificationLayout.java
private void showNotificationContent() {
    if (mContentShowing) {
        // Content is already showing.
        return;
    }
    mContentShowing = true;
    StatusBarNotification selectedNotification =
            (StatusBarNotification) mNotificationPeek.getNotificationView().getTag();

    View contentView = PeekLayoutFactory
            .createPeekLayout(getContext(), PeekLayoutFactory.LAYOUT_TYPE_CONTENT,
                    selectedNotification);
    contentView.setId(R.id.notification_content);
    RelativeLayout.LayoutParams params =
            new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.MATCH_PARENT);
    params.addRule(RelativeLayout.ABOVE, R.id.notification_layout);
    contentView.setLayoutParams(params);

    // Animations.
    LinearLayout contentTextLayout =
            (LinearLayout) contentView.findViewById(R.id.content_layout);
    contentTextLayout.setTranslationY(50);
    contentView.setAlpha(0);
    ((ViewGroup)getParent()).addView(contentView);

    contentView.animate().alpha(1f).setInterpolator(new DecelerateInterpolator()).start();
    contentTextLayout.animate().translationY(0).setInterpolator(new DecelerateInterpolator())
            .start();

    // Send broadcast to NotificationPeekActivity and let it hide the other components
    // when the content is displayed.
    Intent intent =
            new Intent(NotificationPeekActivity.NotificationPeekReceiver.ACTION_SHOW_CONTENT);
    getContext().sendBroadcast(intent);
}
 
源代码5 项目: youqu_master   文件: MoveUpBehaviour.java
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, LinearLayout child, View dependency) {
    float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
    child.setTranslationY(translationY);
    return true;
}
 
源代码6 项目: AsteroidOSSync   文件: MoveUpBehaviour.java
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, LinearLayout child, View dependency) {
    float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
    child.setTranslationY(translationY);
    return true;
}
 
源代码7 项目: material-intro-screen   文件: MoveUpBehaviour.java
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, LinearLayout child, View dependency) {
    float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
    child.setTranslationY(translationY);
    return true;
}
 
源代码8 项目: AndroidLinkup   文件: TopActivity.java
private void hideSearchPad() {
    LinearLayout rltSearch = (LinearLayout) findViewById(R.id.lltSearch);
    rltSearch.setTranslationY(size.y);
}