🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / Android RMOS / Animation animasyon oluşturma

1-) Android RMOS - Animation animasyon oluşturma

 

android:animateLayoutChanges="true"

 

private int lastPosition = -1;

 

holder.linearTL.setOnClickListener(new View.OnClickListener() {
    
@Override
    
public void onClick(View view) {
                
lastPosition = -1;

setAnimation(holder.cardviewUrun, position);


    }
});



private void setAnimation(View viewToAnimate, int position) {
    
// If the bound view wasn't previously displayed on screen, it's animated
    
if (position > lastPosition) {
        Animation animation = AnimationUtils.
loadAnimation(context, android.R.anim.slide_in_left);

                 ViewCompat.setTranslationZ(viewToAnimate,90); // brintofront yapar animasyonu arkadan gitmez bu sayede

        viewToAnimate.startAnimation(animation);
        
lastPosition = position;
    }
}

 

 

1-) Android RMOS - titrettirme

 

<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
    
android:duration="100"
    
android:fromDegrees="-5"
    
android:pivotX="50%"
    
android:pivotY="50%"
    
android:repeatCount="infinite"
    
android:repeatMode="reverse"
    
android:toDegrees="5" />

 

1-) Android RMOS - res->anim->animation1.xml dosya konumu

 

<translate xmlns:android="http://schemas.android.com/apk/res/android"
    
android:duration="500"
    
android:fillAfter="true"
    
android:fromYDelta="0%p"
    
android:toYDelta="84%p"

/>

 

1-) Android RMOS - res->anim->animation1.xml dosya konumu

 

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"

    
>

    
<!--    <translate android:duration="150"-->
    <!--        android:fromXDelta="-10%"-->
    <!--        android:repeatCount="5"-->
    <!--        android:repeatMode="reverse"-->
    <!--        android:toXDelta="10%"-->

    <!--        />

    -->

    
<rotate
        
android:fromDegrees="90"
        
android:toDegrees="100"
        
android:pivotX="50%"
        
android:pivotY="50%"
        
>

    </
rotate>

    <
translate xmlns:android="http://schemas.android.com/apk/res/android"
        
android:duration="500"
        
android:fillAfter="true"
        
android:fromXDelta="-10%"
        
android:fromYDelta="0%p"


        
android:repeatCount="1"
        
android:repeatMode="reverse"
        
android:toXDelta="90%"
        
android:toYDelta="90%p" />


</
set>

 

 

1-) Android RMOS - res->anim->animation1.xml dosya konumu SON YAPTIĞIM

 

<?xml version="1.0" encoding="utf-8"?>
<set>
    <
rotate xmlns:android="http://schemas.android.com/apk/res/android"
        
android:duration="100"
        
android:fromDegrees="-1"
        
android:pivotX="50%"
        
android:pivotY="50%"
        
android:repeatCount="3"
        
android:repeatMode="reverse"
        
android:toDegrees="1" />

        <
translate xmlns:android="http://schemas.android.com/apk/res/android"
            
android:duration="400"
            
android:fillAfter="true"
            
android:fromYDelta="0%p"
            
android:toYDelta="70%p"
        
/>
</
set>



kaynak : https://stackoverflow.com/questions/6759279/how-to-bring-view-in-front-of-everything/8728610#8728610

 

 2021 Mart 11 Perşembe
 563