Bu dersimizle beraber material design da animasyonlar konusuna giriş yapıyoruz.
Öncelikle teorik olarak androidde hangi animasyonlar var, transition çeşitleri, neleri nerde kullanabiliriz ondan bahsediyoruz. Ayrıca bazı animasyonların farklı çeşitleri mevcut, bu özelliklerden ve de onları nasıl kişiselleştirebileceğimizden bahsediyoruz.
Bunları yaparken bazen sadece xml ile bazen ise java ile gerçekleştireceğiz.
Bu derste yazılan uygulamanın kodları aşağıdaki gibidir, tüm projeyi INDIRMEK ICIN TIKLAYIN….
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" tools:context="com.example.emrealtunbilek.materialanimation.MainActivity"> <TextView android:text="Ripple Effect with Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tvRippleEffectwithBorder" android:background="?android:attr/selectableItemBackground" android:layout_marginBottom="10dp" android:textSize="22sp" /> <TextView android:text="Ripple Effect without Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tvRippleEffectwithoutBorder" android:background="?android:attr/selectableItemBackgroundBorderless" android:layout_marginBottom="10dp" android:textSize="22sp" /> <TextView android:text="Custom Ripple with Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:textSize="22sp" android:background="@drawable/ripple_with_border" android:id="@+id/tvCustomRippleWithBorder" /> <TextView android:text="Custom ripple without Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:textSize="22sp" android:background="@drawable/ripple_without_border" android:id="@+id/tvCustomRippleWithoutBorder" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="EXPLODE JAVA" android:layout_weight="1" android:id="@+id/btnExplodeJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="EXPLODE XML" android:layout_marginRight="10dp" android:id="@+id/btnExplodeXML" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="SLIDE JAVA" android:layout_weight="1" android:id="@+id/btnSlideJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="SLIDE XML" android:layout_marginRight="10dp" android:id="@+id/btnSlideXML" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="FADE JAVA" android:layout_weight="1" android:id="@+id/btnFadeJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Fade XML" android:layout_marginRight="10dp" android:id="@+id/btnFadeXML" /> </LinearLayout> </LinearLayout> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="10dp" android:layout_marginLeft="10dp" android:layout_marginTop="10dp" tools:context="com.example.emrealtunbilek.materialanimation.MainActivity"> <TextView android:text="Ripple Effect with Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tvRippleEffectwithBorder" android:background="?android:attr/selectableItemBackground" android:layout_marginBottom="10dp" android:textSize="22sp" /> <TextView android:text="Ripple Effect without Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/tvRippleEffectwithoutBorder" android:background="?android:attr/selectableItemBackgroundBorderless" android:layout_marginBottom="10dp" android:textSize="22sp" /> <TextView android:text="Custom Ripple with Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:textSize="22sp" android:background="@drawable/ripple_with_border" android:id="@+id/tvCustomRippleWithBorder" /> <TextView android:text="Custom ripple without Border" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:textSize="22sp" android:background="@drawable/ripple_without_border" android:id="@+id/tvCustomRippleWithoutBorder" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="EXPLODE JAVA" android:layout_weight="1" android:id="@+id/btnExplodeJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="EXPLODE XML" android:layout_marginRight="10dp" android:id="@+id/btnExplodeXML" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="SLIDE JAVA" android:layout_weight="1" android:id="@+id/btnSlideJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="SLIDE XML" android:layout_marginRight="10dp" android:id="@+id/btnSlideXML" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="FADE JAVA" android:layout_weight="1" android:id="@+id/btnFadeJava" android:layout_marginRight="10dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="Fade XML" android:layout_marginRight="10dp" android:id="@+id/btnFadeXML" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margin="20dp" android:gravity="center" android:id="@+id/shared_element_layout"> <ImageView android:layout_width="50dp" android:layout_height="50dp" android:layout_gravity="center" android:layout_margin="10dp" android:id="@+id/ivStar" android:tint="@android:color/holo_blue_dark" android:src="@drawable/star"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="30sp" android:id="@+id/tvSharedElement" android:text="Shared Element"/> </LinearLayout> </LinearLayout> |
1 2 3 4 5 6 7 |
<?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@android:color/holo_orange_dark"> <item android:id="@android:id/mask" android:drawable="@android:color/white"/> </ripple> |
1 2 3 4 5 6 |
<?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@android:color/holo_orange_dark"> </ripple> |