Java Code Examples for android.widget.LinearLayout.setTranslationY()

The following are Jave code examples for showing how to use setTranslationY() of the android.widget.LinearLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: EasyTransition   File: DetailActivity.java   View Source Code Vote up 7 votes
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);
}
 
Example 2
Project: TinyPlanetMaker   File: FloatingActionButtonBehavior.java   View Source Code Vote up 3 votes
@Override
    public boolean onDependentViewChanged(CoordinatorLayout parent, LinearLayout child, View dependency) {

        float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
        child.setTranslationY(translationY);

//        child.setY(dependency.getHeight()-dependency.getTranslationY());

        return true;

    }