[MOD][PORT][CM11] How to add custom scrolling animation topic

SOCIALIZE IT ⇨

hi guys ,
I want to share a MOD that i ported from PAC man ROM..
This will give you ability to customize scroll on your phone.

This is one of the coolest features from PAC Man ROM. I want to remind you that this is NOT my work. I'M NOT what makes this feature.
all I do is port for CM11 to make them work :D
Anyone is able to use this mod, just please give proper credit to Devs of PAC Man ROM and me if you want ;)

Also I want to give a BIG THANKS to sir @ocoot - for very helpful hints, thanks um :o


So let's begin
first of all need some requirement for this MOD-GUIDE

REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk and JAR file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
( i use apktool 1.5.2 )


SETTINGS.APK

first DECOMPILE Settings.apk
- Download attached file and merge it to your decompiled Settings.apk
- Go to Settings.apk/res/values/
add this lines to end of it before </resources>

attrs.xml add these :

Code:


    <attr name="unitsLeft" format="reference|string" />
    <attr name="unitsRight" format="reference|string" />
    <attr name="interval" format="integer" />
    <attr name="minimum" format="integer" />
    <attr name="maximum" format="integer" />
</resources>


ids.xml add these :

Code:


    <item type="id" name="hex">false</item>
    <item type="id" name="enter">false</item>
    <item type="id" name="white_panel">false</item>
    <item type="id" name="black_panel">false</item>
    <item type="id" name="cyan_panel">false</item>
    <item type="id" name="red_panel">false</item>
    <item type="id" name="green_panel">false</item>
    <item type="id" name="yellow_panel">false</item>
    <item type="id" name="old_color_panel">false</item>
    <item type="id" name="new_color_panel">false</item>
    <item type="id" name="seek_bar">false</item>
    <item type="id" name="seekBarPrefUnitsRightCham">false</item>
    <item type="id" name="seekBarPrefValueCham">false</item>
    <item type="id" name="seekBarPrefUnitsLeftCham">false</item>
    <item type="id" name="seekBarPrefBarContainerCham">false</item>
</resources>


strings.xml add these:

Code:


    <string name="press_color_to_apply">Press on color below to apply</string>
    <string name="arrow_right">→</string>
    <string name="arrow_down">↓</string>
    <string name="hex">Hex:</string>
    <string name="hex_hint">\#ff000000</string>
    <string name="set">Set</string>
    <string name="reset">Reset</string>
    <string name="animation_settings_title">Custom animations</string>
    <string name="scrolling_title">Scrolling</string>
    <string name="animation_fling_velocity_title">Fling Velocity</string>
    <string name="animation_scroll_friction_title">Scroll Friction</string>
    <string name="animation_overscroll_distance_title">Overscroll Distance</string>
    <string name="animation_overfling_distance_title">Overfling Distance</string>
    <string name="animation_no_scroll_title">Customizing scroll</string>
    <string name="animation_no_scroll_summary_on">Enabled</string>
    <string name="animation_no_scroll_summary_off">Disabled</string>
    <string name="overscroll_glow_title">Overscroll Color</string>
    <string name="animation_settings_reset_message">Reset animations to default?</string>
</resources>


save...

- Now go to res/xml/display_settings.xml
put this line :

Code:


<PreferenceScreen android:title="@string/scrolling_title" android:key="interface_animation_scroll" android:fragment="com.android.settings.pac.animations.ScrollAnimationInterfaceSettings" />


Code:


<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/display_settings"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
    <com.android.settings.BrightnessPreference android:persistent="false" android:title="@string/brightness" />
    <PreferenceScreen android:title="@string/scrolling_title" android:key="interface_animation_scroll" android:fragment="com.android.settings.pac.animations.ScrollAnimationInterfaceSettings" />
    <PreferenceCategory android:title="@string/display_settings_title" android:key="display_prefs">
        <PreferenceScreen android:title="@string/display_rotation_title" android:key="display_rotation" android:fragment="com.android.settings.cyanogenmod.DisplayRotation" />
        <ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:entryValues="@array/screen_timeout_values" />
        <com.android.settings.FontDialogPreference android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" />
        <PreferenceScreen android:title="@string/screensaver_settings_title" android:key="screensaver" android:fragment="com.android.settings.DreamSettings" />
        <PreferenceScreen android:title="@string/wifi_display_settings_title" android:key="wifi_display" android:fragment="com.android.settings.wfd.WifiDisplaySettings" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/power_menu_expanded_desktop" android:key="expanded_desktop_category">
        <ListPreference android:persistent="false" android:entries="@array/expanded_desktop_entries" android:title="@string/expanded_desktop_style" android:key="expanded_desktop" android:entryValues="@array/expanded_desktop_values" />
        <CheckBoxPreference android:persistent="true" android:title="@string/power_menu_expanded_desktop" android:key="expanded_desktop_no_navbar" />
        <com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/expanded_desktop_system_bars_visibility" android:key="expanded_desktop_system_bars_visibility" android:summary="@string/expanded_desktop_system_bars_visibility_summary" android:defaultValue="false" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/lights_category_title" android:key="lights_prefs">
        <PreferenceScreen android:title="@string/notification_light_title" android:key="notification_pulse" android:fragment="com.android.settings.notificationlight.NotificationLightSettings" />
        <PreferenceScreen android:title="@string/battery_light_title" android:key="battery_light" android:fragment="com.android.settings.notificationlight.BatteryLightSettings" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/advanced_settings" android:key="advanced_display_prefs">
        <CheckBoxPreference android:title="@string/adaptive_backlight_title" android:key="adaptive_backlight" android:summary="@string/adaptive_backlight_summary" android:defaultValue="true" />
        <CheckBoxPreference android:title="@string/sunlight_enhancement_title" android:key="sunlight_enhancement" android:summary="@string/sunlight_enhancement_summary" android:defaultValue="true" />
        <CheckBoxPreference android:title="@string/color_enhancement_title" android:key="color_enhancement" android:summary="@string/color_enhancement_summary" android:defaultValue="true" />
        <com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/double_tap_to_sleep_title" android:key="double_tap_sleep_gesture" android:summary="@string/double_tap_to_sleep_summary" android:defaultValue="false" />
        <CheckBoxPreference android:title="@string/double_tap_to_wake_title" android:key="double_tap_wake_gesture" />
        <com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/proximity_wake_title" android:key="proximity_on_wake" android:summary="@string/proximity_wake_summary" android:defaultValue="true" />
        <CheckBoxPreference android:title="@string/wake_when_plugged_or_unplugged_title" android:key="wake_when_plugged_or_unplugged" android:summary="@string/wake_when_plugged_or_unplugged_summary" android:defaultValue="false" />
        <com.android.settings.cyanogenmod.SystemSettingCheckBoxPreference android:title="@string/screen_animation_off_title" android:key="screen_off_animation" android:defaultValue="true" />
        <ListPreference android:entries="@array/screen_animation_style_entries" android:title="@string/screen_animation_style_title" android:key="screen_animation_style" android:entryValues="@array/screen_animation_style_values" />
        <PreferenceScreen android:title="@string/lcd_density_title" android:key="lcd_density_setup" android:fragment="com.android.settings.interface.fragments.DensityChanger" />
        <com.android.settings.hardware.DisplayColor android:persistent="false" android:title="@string/color_calibration_title" android:key="color_calibration" android:summary="@string/color_calibration_summary" android:dialogTitle="@string/color_calibration_title" />
        <com.android.settings.hardware.DisplayGamma android:persistent="false" android:title="@string/gamma_tuning_title_head" android:key="gamma_tuning" android:summary="@string/gamma_tuning_summary_head" android:dialogTitle="@string/gamma_tuning_title_head" />
        <PreferenceScreen android:persistent="false" android:title="@string/screencolor" android:key="screencolor_settings">
        <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.ScreenColorSettings" />
        </PreferenceScreen>
        <Preference android:title="@string/radio_controls_title" android:key="advanced_display_settings">
        <intent android:targetPackage="com.cyanogenmod.settings.device" android:action="com.cyanogenmod.action.LAUNCH_DEVICE_SETTINGS" android:targetClass="com.cyanogenmod.settings.device.DisplaySettings" />
        </Preference>
    </PreferenceCategory>
</PreferenceScreen>


but you can put the line whereever you like,. ;)


- Recompile your Settings.apk

- Decompile the newly recompiled APK again
go to your secondly decompiled Settings.apk/res/values/public.xml and keep it open

Pay attention to this 0x7f?????? !!!

- Go to Settings.apk/smali/net/margaritov/preference/color picker/ColorPickerDialog.smali
search this -> const v2, 0x7f040103

1. change this -> 0x7f040103 , according to the value you got in your own public.xml

Code:


<public type="layout" name="dialog_color_picker" id="0x7f??????" />

do it too to all lines below, in the smali

2. const v2, 0x7f080c3c

Code:


<public type="string" name="dialog_color_picker" id="0x7f?????? />

3. const v2, 0x7f0d00c5

Code:


<public type="id" name="color_picker_view" id="0x7f?????? />

4. const v2, 0x7f0d0324

Code:


<public type="id" name="old_color_panel" id="0x7f?????? />

5. const v2, 0x7f0d0325

Code:


<public type="id" name="new_color_panel" id="0x7f?????? />

6. const v2, 0x7f0d031e

Code:


<public type="id" name="white_panel" id="0x7f?????? />

7. const v2, 0x7f0d031f

Code:


<public type="id" name="black_panel" id="0x7f?????? />

8. const v2, 0x7f0d0320

Code:


<public type="id" name="cyan_panel" id="0x7f?????? />

9. const v2, 0x7f0d0321

Code:


<public type="id" name="red_panel" id="0x7f?????? />

10. const v2, 0x7f0d0322

Code:


<public type="id" name="green_panel" id="0x7f?????? />

11. const v2, 0x7f0d0323

Code:


<public type="id" name="yellow_panel" id="0x7f?????? />

12. const v2, 0x7f0d031c

Code:


<public type="id" name="hex" id="0x7f?????? />

13. const v2, 0x7f0d031d

Code:


<public type="id" name="enter" id="0x7f?????? />

14. const v1, 0x7f0d0325

Code:


<public type="id" name="new_color_panel" id="0x7f?????? />


- Go to Settings.apk/smali/com/android/settings/pac/SeekBarPreferenceCham.smali
search this -> const v3, 0x7f0d032f

1. change this -> 0x7f0d032f , according to the value you got in your own public.xml

Code:


<public type="id" name="seekBarPrefBarContainerCham" id="0x7f?????? />

do it too to all lines below, in the smali

2. const v4, 0x7f040106

Code:


<public type="layout" name="seek_bar_preference_cham" id="0x7f?????? />

3. const v5, 0x7f0d032d

Code:


<public type="id" name="seekBarPrefValueCham" id="0x7f?????? />

4. const v5, 0x7f0d032c

Code:


<public type="id" name="seekBarPrefUnitsRightCham" id="0x7f?????? />

5. const v5, 0x7f0d032e

Code:


<public type="id" name="seekBarPrefUnitsLeftCham" id="0x7f?????? />

- Go to Settings.apk/smali/com/android/settings/pac/animations/ScrollAnimationInterfaceSettings.smali
search this -> const v1, 0x7f080c28

1. change this -> 0x7f080c28 , according to the value you got in your own public.xml

Code:


<public type="string" name="reset" id="0x7f?????? />

do it too to all lines below, in the smali

2. const v1, 0x7f080c9e

Code:


<public type="string" name="animation_settings_reset_message" id="0x7f?????? />

3. const v1, 0x7f0801e0

Code:


<public type="string" name="ok" id="0x7f?????? />

4. const v1, 0x7f080559

Code:


<public type="string" name="cancel" id="0x7f?????? />

5. const v7, 0x7f05007a

Code:


<public type="xml" name="scroll_animation_interface_settings" id="0x7f?????? />

6. const v1, 0x7f080c28

Code:


<public type="string" name="reset" id="0x7f?????? />

7. const v1, 0x7f0200a8

Code:


<public type="drawable" name="ic_settings_backup" id="0x7f?????? />


- Go to AndroidManifest.xml
add this lines to end of it before </application>

Code:


<activity android:name=".pac.animations.ScrollAnimationInterfaceSettings" />


Code:


        - - - - - -
        - - - - - -
        - - - - - -
        <provider android:name="android.support.v4.content.FileProvider" android:exported="false" android:authorities="com.android.settings.files" android:grantUriPermissions="true">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
        </provider>
        <service android:label="LtoService" android:name=".cyanogenmod.LtoService" android:enabled="true" android:exported="false" />
        <service android:name=".search.SearchPopulator" />
        <activity android:name=".pac.animations.ScrollAnimationInterfaceSettings" />
    </application>
</manifest>



- Done and recompile it,
- SIGN it ( you can use signer_keys on attachment )
- Push new to system/priv-app/


next step on post #2








Attached Thumbnails


Click image for larger version<br/><br/>Name:	Screenshot_2015-04-08-16-28-30.png<br/>Views:	N/A<br/>Size:	129.9 KB<br/>ID:	3252626
 











Attached Files








File Type: zip Apktool_CM11_signer_keys.zip -
[Click for QR Code]
(6.3 KB)
File Type: zip Settings.apk.zip -
[Click for QR Code]
(35.3 KB)





xda-developers


  1. Htc desire 816 official lollipop update video review topic
  2. [Q] Galaxy S6 Edge T-Mobile Unlock by SIM code topic
  3. How to roll back to KK topic
  4. What is this in Greenify settings topic
  5. [Q] How to update? topic
  6. [MOD][PORT][CM11] How to add custom scrolling animation topic
  7. Screen scrolling lag topic
  8. Infinite Scrolling of Home Screens topic
  9. [Q] Taking a scrolling screenshot java command topic
  10. Gray pictures during gallery scrolling topic
  11. [Q] [Need Help] Chrome page randomly freezes especially when scrolling topic
  12. [Q] I need a launcher/ROM with more than 9 home screens, and infinite scrolling topic
  13. [Q] (Android 5.0 Stock) - Touchwiz Launcher with Theme Chooser & Wallpaper Scrolling? topic
  14. [Q] Custom Recovery On 5.0.1? topic
  15. [Q] Custom Recovery? topic
  16. Custom Recovery with Encryption. topic
  17. [Q] Need a custom rom suggestion topic
  18. [Q] Twitter Custom Ringtone topic
  19. [Q] noob questions about custom ROM topic
  20. [Q] Screwed up Galaxy S4 rooting and flashing custom rom? topic

0 commentaires:

Enregistrer un commentaire