[Android General] Albe96:
Custom Animation GIF For TW Oreo!

Me And [MENTION=4596062]asc1977[/MENTION] Were Working On The Implementation For GIF Animation Support For Oreo.And Here We Finally Made It!.The Works Are Same As Before We Done In Nougat.But The Method Locations Has Changed And An Invoke Has Been Added.So Here The Fixed Guide Goes.

Thanks To:
[MENTION=8168590]keki7[/MENTION] - For His Great Assistance And Testing
[MENTION=4596062]asc1977[/MENTION] - For The Idea About Missing Invoke

1.Decompile SystemUI.apk

2.Open "status_bar_expanded.xml"

3.Search For This Line:

<TextView android:textAppearance="@style/TextAppearance.StatusBar.Expanded.CarrierLabel"

4.Before Above Line Add This Code:

<LinearLayout android:layout_gravity="bottom|center" android:orientation="vertical" android:id="@id/gif_animation" android:layout_width="wrap_content" android:layout_height="wrap_content">
<com.ther.statusbar.GifPlayer android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>

5.Open "ids.xml"

6.Added This Line:

<item type="id" name="gif_animation">false</item>

6.Now Open SystemUI\smali\com\android\systemui\statusbar\phone\StatusBar.smali

7.Search For This Method:

.method updateDisplaySize()V

8.Below That Add This Method:

.method updateGifAnimationView()V
.locals 9

iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "asc4_show_gif_animation"

const/4 v3, 0x0

invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

if-nez v1, :cond_0

const v3, 0x8

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const-string v8, "gif_animation"

const-string v7, "id"

invoke-static {v8, v7}, Lcom/android/wubydax/GearUtils;->getIdentifier(Ljava/lang/String;Ljava/lang/String;)I

move-result v6

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

goto/16 :goto_0

:cond_0
const v3, 0x3

iget-object v5, p0, Lcom/android/systemui/statusbar/phone/StatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;

const-string v8, "gif_animation"

const-string v7, "id"

invoke-static {v8, v7}, Lcom/android/wubydax/GearUtils;->getIdentifier(Ljava/lang/String;Ljava/lang/String;)I

move-result v6

invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V

:goto_0
return-void
.end method

9.Now Search For This Method:

.method public setBarState(I)V

10.Before "return-void" Add The Folling Lines:

invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBar;->updateGifAnimationView()V

11.Now Download The Attached Zip And Copy "SystemUI" Files To SystemUI.apk

12.Recompile The SystemUI.Test And Enjoy! ;)

Rom Control V2:

1.Copy RC Files To Your ROM Control.

2.Add In RomControl\res\xml:

<PreferenceCategory android:title="GIFAnimations">
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:title="GIF Animation" android:key="asc4_show_gif_animation" android:summaryOn="enabled" android:summaryOff="disabled" app:packageNameToKill="com.android.systemui" app:isSilent="false" />
<com.wubydax.romcontrol.v2.prefs.ThumbnailListPreference android:title="Selecting Animations" android:key="gif_image_style" android:defaultValue="0" app:packageNameToKill="com.android.systemui" app:isSilent="false" app:drawableArray="@array/gif_animation_drawable" app:entryList="@array/gif_animation_entries" app:entryValuesList="@array/gif_animation_entries_values" />
</PreferenceCategory>

2.In Arrays.xml Add:

<array name="gif_animation_drawable">
<item>@drawable/a1</item>
<item>@drawable/a2</item>
<item>@drawable/a3</item>
<item>@drawable/a4</item>
<item>@drawable/a5</item>
<item>@drawable/a6</item>
<item>@drawable/a7</item>
<item>@drawable/a8</item>
<item>@drawable/a9</item>
<item>@drawable/a10</item>
<item>@drawable/a11</item>
<item>@drawable/a12</item>
<item>@drawable/a13</item>
<item>@drawable/a14</item>
<item>@drawable/a15</item>
<item>@drawable/a16</item>
<item>@drawable/a17</item>
<item>@drawable/a18</item>
<item>@drawable/a19</item>
<item>@drawable/a20</item>
<item>@drawable/a21</item>
<item>@drawable/a22</item>
<item>@drawable/a23</item>
<item>@drawable/a24</item>
<item>@drawable/a25</item>
<item>@drawable/a26</item>
<item>@drawable/a27</item>
<item>@drawable/a28</item>
<item>@drawable/a29</item>
<item>@drawable/a30</item>
<item>@drawable/a31</item>
<item>@drawable/a32</item>
<item>@drawable/a33</item>
</array>
<string-array name="gif_animation_entries">
<item>Abstract</item>
<item>A Cube</item>
<item>Alien Twerking</item>
<item>Bad Kool Aid</item>
<item>Bad Skeleton</item>
<item>Battle Stance</item>
<item>Bic Lighter</item>
<item>Bird</item>
<item>Boob Shoots</item>
<item>Brian Peanut Butter Jely Time</item>
<item>Butterfly</item>
<item>Butt Shake</item>
<item>Cats</item>
<item>Chester Cheto</item>
<item>Cool A Pe</item>
<item>Dancing Elsa</item>
<item>Double Meaning</item>
<item>Eyeball</item>
<item>M M</item>
<item>Skeleton Cutting Food</item>
<item>Skeleton No Ice Cream</item>
<item>Skeleton Wave</item>
<item>Skelton Eating Chetos</item>
<item>Stitch</item>
<item>Stitch Bra Head</item>
<item>Stitch Drop</item>
<item>Waiting Skeleton</item>
<item>Walking Dead Birth</item>
<item>Walking Wolf</item>
<item>Waving Froven</item>
</string-array>
<string-array name="gif_animation_entries_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
</string-array>

​