[Q][SOLVED]Problem with PreferenceScreen xml file - Android Q&A, Help & Troubleshooting

i have a gitc_preferences.xml layout file in my res/layout/ folder. i am using IntelliJ 10.0.3 and i love it. the code completion in java and in xml is by and far the best ive used. but for some reason when i am making a PreferenceScreen it seems to choke.
lemme show a little stub of something...
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="first_cat">
<CheckBoxPreference
android:key="checkbox_preference"
android:title="title toggle preference"
android:summary="bleh" />
</PreferenceCategory>
</PreferenceScreen>
now everything inside the <PreferenceScreen></PreferenceScreen> tag is red. it says "Element PreferenceCatagory is not allowed here" "Element CheckBoxPreference is not allowed here"
now it code completes to CheckBox but it turns red when i continue on to CheckBoxPreferences.
any help. it wont compile.

YAY! ive once again solved my own problem.
layouts of PreferenceScreen's cant be in res/layout/ they have to be in res/xml/

killersnowman said:
YAY! ive once again solved my own problem.
layouts of PreferenceScreen's cant be in res/layout/ they have to be in res/xml/
Click to expand...
Click to collapse
THANK YOU for your own answer, it helped me !

Thanks
killersnowman said:
YAY! ive once again solved my own problem.
layouts of PreferenceScreen's cant be in res/layout/ they have to be in res/xml/
Click to expand...
Click to collapse
Thanks you very much dude... only here I found this problem and the solution. :fingers-crossed::highfive:

Thank you
Thank you

Related

(T)leave the default theme for cm7 rom

well my policy I share what I learn
Several friends have asked me how to do it to not be sending pm to give the public preferred time for all to their own kitchens roms
Step 1 CHOOSE the item you want to leave the default
I Elected
CRYSTAL CM7 Theme by DaRk_dOg
step 2
apktool use to decompile and know the command line to add in the build.prop
ejmplo
copy the apk where is the apktool
C: \ Crystal.apk
go to cmd type the following command
cd ..
cd ..
apktool if Crystal.apk
apktool d Crystal.apk (decompile)
step 3
see the lines that nesesitamos for build.prop
go to
C: \ Crystal \ AndroidManifest.xml (use notepad + + to see the lines you need)
and find the following lines
PHP:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:hasCode="false" android:versionCode="44" android:versionName="2.5" package="com.darkdog.theme.crystal"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
<application android:label="@string/theme_name" android:icon="@drawable/icon" android:hasCode="false" />
<uses-feature android:name="com.tmobile.software.themes" />
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9" />
<theme pluto:themeId="Crystal" pluto:styleId="@style/Crystal" pluto:name="@string/theme_name" pluto:preview="@drawable/preview" pluto:author="@string/author" pluto:copyright="@string/copyright" pluto:wallpaperImage="@drawable/wallpaper" pluto:styleName="@string/style_appearance_name" pluto:ringtoneName="Shocking" pluto:ringtoneFileName="media/audio/ringtones/Shocking.mp3" pluto:notificationRingtoneName="Teleport" pluto:notificationRingtoneFileName="media/audio/notifications/Teleport.mp3">
<meta-data android:name="com.tmobile.theme.redirections" android:resource="@xml/redirections" />
</theme>
</manifest>
PHP:
package="com.darkdog.theme.crystal
pluto:themeId="Crystal""
PHP:
#Theme
persist.sys.themeId=
persist.sys.themePackageName=
and get something like this in bulid.prop
PHP:
#Theme
persist.sys.themeId=Crystal
persist.sys.themePackageName=com.darkdog.theme.crystal
I hope it serves
Bro,
appreciate your work. but i dont understand what you have done in the above.
is it a theme extract from a rom? pls provide little information.
(its ok, even if you know little english just post some info)
Thank you!
Tommylee567 said:
Bro,
appreciate your work. but i dont understand what you have done in the above.
is it a theme extract from a rom? pls provide little information.
(its ok, even if you know little english just post some info)
Thank you!
Click to expand...
Click to collapse
is to use a default theme in the rom without using theme choose
Sent from my U20i using xda premium

[Q][DEV] Question about GingerBread code - Settings.apk

Hello everyone!
I recently started modfying Settings.apk to make it look like ICS following THIS GUIDE.
What I'm trying to do, though, is to add toggle buttons to the Wi-Fi and Bluetooth options, just like ICS.
This code:
Code:
<PreferenceScreen android:title="@string/settings_label" android:key="parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory android:title="@string/settings_ics_radio" />
<CheckBoxPreference android:persistent="false" android:title="@string/wifi_quick_toggle_title" android:key="enable_wifi" android:summary="@string/wifi_quick_toggle_summary" />
Adds the button, but that said button does nothing.
What do I need to add in order to make it work?
Edit: I see from here that it might require smali editing, but I'm not too sure since that last guide was trying to add a toggle that didn't actually exist before, and I just want to add a button that already exists in another menu.
Thanks in advance.

Animation codes

1) Fly in straight line
----fly along X----
<?xml version="1.0" encoding="utf-8"?><set android:shareInterpolator="false" android:zAdjustment="top" xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration="@integer/config_longAnimTime" android:fromXDelta="100.0%p" android:toXDelta="0.0" /></set>
----fly along y---
<?xml version="1.0" encoding="utf-8"?><set android:shareInterpolator="false" android:zAdjustment="top" xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration="@integer/config_longAnimTime" android:fromYDelta="100.0%p" android:toYDelta="0.0" /></set>
---fly along X-Y-----
<?xml version="1.0" encoding="utf-8"?><set android:shareInterpolator="false" android:zAdjustment="top" xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:duration="@integer/config_longAnimTime" android:fromYDelta="100.0%p" android:toYDelta="0.0" android:fromXDelta="100.0%p" android:toXDelta="0.0" /></set>
^^^^^^^^^CHANGE VALUES ACCORDINGLY TO ALTER DIRECTIONS^^^^^^^^^
---requirements------ basic knowledge of co-ordinate geometry----in translate animation,,,,, the center of mass of screen (if seen as a rectangle) is the ORIGIN (0,0)-=----------------------and 100%p means 100% (along X or Y , down or right if positive and up or left if negative) relative to paren]]]]]
2) Popup from CENTER
<?xml version="1.0" encoding="utf-8"?><set android:interpolator="@anim/decelerate_interpolator" xmlns:android="http://schemas.android.com/apk/res/android">
<scale android:duration="500 android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" />
</set>
3) Popup from top-left (relative to you,, not screen)
<?xml version="1.0" encoding="utf-8"?><set android:interpolator="@anim/decelerate_interpolator" xmlns:android="http://schemas.android.com/apk/res/android">
<scale android:duration="500 androidivotX="100%p" android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" />
</set>
4) Fade in
<?xml version="1.0" encoding="utf-8"?><set android:interpolator="@anim/decelerate_interpolator" xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:duration="@integer/config_mediumAnimTime" android:fromAlpha="0.0" android:toAlpha="1.0" /></set>
-------combine all these intelligently to create several combos------------------------
change values accordingly to create OUT animations
------------------------------------------------------------------PRESS THANKS IF YOU LIKE MY WORK :good: ---------------------------------------------------------------------
Can I apply this for lockscreen...
Regards,
Ganesh
Ganesh A said:
Can I apply this for lockscreen...
Regards,
Ganesh
Click to expand...
Click to collapse
yes you can... just edit lockscreen exit xml in framework-res/anim/
Great one ..... Helped meh alot !! (Y)
@aman d awsum--- COOL :good:
re animation
nice guide
i will try
where are the activity_open_enter, open_exit and activity_close_enter, close_exit used for? i mean, how do these work? if an app is opened, does activity_open_enter get used, and if an app is closed activity_close_exit is used?
How to do this with stock rom
mjz2cool said:
where are the activity_open_enter, open_exit and activity_close_enter, close_exit used for? i mean, how do these work? if an app is opened, does activity_open_enter get used, and if an app is closed activity_close_exit is used?
Click to expand...
Click to collapse
bro,,, see the anims that begin with the word wallpaper,,,, those are the one that show the way wallpaper and app opening closing etc!!! just search for them in styles.xml and you will know

[TUTORIAL]How To Colorize Navigation Bar Buttons[31/12/2013]

After I have posted my tutorial How To Add Extra Buttons In Navigation Bar,
Many user PM'ed me how to colorize navigation bar buttons.
So, here I will teach you how to colorize navigation bar buttons.
Maybe this is the last tutorial of 2013 from me.
Decompile SystemUI.apk
Navigate to SystemUI.apk\
Open apktool.yml file in file editor
Mine is look like this
Code:
version: 2.0.0-Beta7
apkFileName: 1-SystemUI.apk
isFrameworkApk: false
usesFramework:
ids:
- 1
sdkInfo:
minSdkVersion: '15'
targetSdkVersion: '15'
packageInfo:
cur_package: com.android.systemui
cur_package_id: '127'
orig_package: com.android.systemui
versionInfo:
versionCode: '15'
versionName: 4.0.4-tL1_3w
compressionType: false
[*]Add the red line only
Code:
version: 2.0.0-Beta7
apkFileName: 1-SystemUI.apk
isFrameworkApk: false
usesFramework:
ids:
- 1
[COLOR="Red"]- 2[/COLOR]
sdkInfo:
minSdkVersion: '15'
targetSdkVersion: '15'
packageInfo:
cur_package: com.android.systemui
cur_package_id: '127'
orig_package: com.android.systemui
versionInfo:
versionCode: '15'
versionName: 4.0.4-tL1_3w
compressionType: false
[*]Save the file
[*]Navigate to SystemUI.apk\res\drawable-hdpi
[*]Mark all the navigation buttons png and move them to a known directory
[*]In my case the files are
Code:
ic_sysbar_back.png
ic_sysbar_back_land.png
ic_sysbar_home.png
ic_sysbar_home_land.png
ic_sysbar_recent.png
ic_sysbar_recent_land.png
[*]Now rename all the files and add "_colored" at the end without quote
[*]The files will be look like
Code:
ic_sysbar_back[COLOR="Green"]_colored[/COLOR].png
ic_sysbar_back_land[COLOR="Green"]_colored[/COLOR].png
ic_sysbar_home[COLOR="Green"]_colored[/COLOR].png
ic_sysbar_home_land[COLOR="Green"]_colored[/COLOR].png
ic_sysbar_recent[COLOR="Green"]_colored[/COLOR].png
ic_sysbar_recent_land[COLOR="Green"]_colored[/COLOR].png
[*]Now have to make 6 xml files like bellow
File Name: ic_sysbar_back.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_back_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
File Name: ic_sysbar_back_land.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_back_land_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
File Name: ic_sysbar_home.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_home_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
File Name: ic_sysbar_home_land.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_home_land_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
File Name: ic_sysbar_recent.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_recent_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
File Name: ic_sysbar_recent_land.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<somc:colorizable android:drawable="@drawable/ic_sysbar_recent_land_colored" android:color="@com.sonyericsson.uxp:color/semc_theme_accent_color" xmlns:somc="com.sonymobile"
xmlns:android="http://schemas.android.com/apk/res/android" />
[*]Now place all the xml files to SystemUI.apk\res\drawable folder
[*]Recompile your SystemUI.apk
Please Note :
Take backup before doing anything.
Use Notepad++ to edit files.
Please read the tutorial properly befor editing files.
This tutorial will work for other devices too.
Nice guide!however,i want to know how to add quick button on status bar expanded。And how to add txt under the quick buttons ?hope you can help me。Want to change my Xperia Z systemui changed。
@BDFreak
U made arc section alive once more!
Thank you bro!
Sent from my LT18i using Tapatalk 2
bxfdaxia said:
Nice guide!however,i want to know how to add quick button on status bar expanded。And how to add txt under the quick buttons ?hope you can help me。Want to change my Xperia Z systemui changed。
Click to expand...
Click to collapse
These things are too difficult and
I didn't try this kind of things.
poria1999 said:
@BDFreak
U made arc section alive once more!
Thank you bro!
Sent from my LT18i using Tapatalk 2
Click to expand...
Click to collapse
This kind of comments inspire me too much.
:good:GOOD JOB!I always enjoy you provide tutorials
Thanks your contribution!
Hi all
Do you have a problem with "Back" button didn't change color ?
For me i have to edit smali file to make it work.
devilmaycry2020 said:
Hi all
Do you have a problem with "Back" button didn't change color ?
For me i have to edit smali file to make it work.
Click to expand...
Click to collapse
No, I didn't face this kind of problem...
But I have heard that some people have this problem with 2012-2013 phones.
question
This tutorial does work in all devices
nice mod but when im trying to compile my systemui again it gives me lot of errors thats weird since i ve been recomping it lots of times and never got this;
Can u help me somehow ?

[TUTORIAL] [MOD] How to add Extra Options in About Sections

Hello Today I am Showing How to add Extra Options in Settings CPU Info Screen Resolution Mem Info Swap Mem Info I will Update This Thread with New Options So Let"s Start
Requirement:
Apktool http://forum.xda-developers.com/show....php?t=1755243
Settings.apk From Your Phone
Nice Brain to Understand
Credits:
My Friends Aryne Neil Carlno Cabatan
Instructions:
Step 1 :- Pull Your Settings from Your Phone
Step 2 :- Decompile The Settings.apk
Step 3 :- Merged The Your Settings with My Zip
Step 4 :- Open Values/strings.xml
Step 5 :- Add This
Code:
<string name="cpu_info">CPU info</string>
<string name="mem_info">Mem info (avail/total)</string>
<string name="swap_mem_info">Swap mem info (avail/total)</string>
<string name="device_screen_resolution">Screen resolution</string>
Step 6 :- Open xml/device_info_settings
Step 7 :- Remove All lines
Step 8 :- Add This
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/about_settings"
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen android:title="@string/device_status" android:key="status_info" android:summary="@string/device_status_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.deviceinfo.Status" />
</PreferenceScreen>
<Preference android:title="@string/model_number" android:key="device_model" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/firmware_version" android:key="firmware_version" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/baseband_version" android:key="baseband_version" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/kernel_version" android:key="kernel_version" android:summary="@string/device_info_default" />
<Preference android:title="@string/cpu_info" android:key="device_cpu" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/device_screen_resolution" android:key="device_screen_resolution" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/mem_info" android:key="device_memory" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/swap_mem_info" android:key="device_swap_memory" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="Guide by" android:key="android_fire_xda" android:summary="AndroidFire" style="?android:preferenceInformationStyle" />
</PreferenceScreen>
Step 9 :- Recompile and Decompile Again
Step 10 :- Go to values/public.xml
Step 11 :- search for device_info_settings Note the id code
Step 12 :- Search for 0x7f040010 Change This according to your public
Step 13 :- Recompile And Sign And Enjoy
My Work
My Work
Android
APP
AF-Root Checker
[APP][4.1+] AF Calendar Widget
[APP][2.3+] AF CPU Widget
GUIDE
[GUIDE][2.3+] How to add AF Volume Panel to Android Phone
AF-Battery Mod
ICS PlatLogo
[GUIDE] How to Disable Scrolling Cache for Smooth
[GUIDE] How to add Extra Options in About Sections
[GUIDE] How to add Colorey Platlogo
[GUIDE] How to add Android L Preview Platlogo
[GUIDE] [TUTORIAL] [GUIDE] How to Play with Screen Title
[GUIDE]How to Replace Checkbox with Switch
ROM
[ROM] AF Firey
TOOL
[TOOL] AF-Apk​[TOOL] AF-Signer​​
Reserved
AF Work
AF Work
Android
APP
[APP][4.1+] AF Calendar Widget
[APP][2.3+] AF CPU Widget
GUIDE
[GUIDE][2.3+] How to add AF Volume Panel to Android Phone
ROM
[ROM] AF Firey
TOOL
[TOOL] AF-Apk​[TOOL] AF-Signer​​
I have an error
Hello there
At first I apologize for my English.
I tried this method but I have a problem with steps 11 and 12
can you help me?
when I do research in device_info_settings .. / values ​​/ public.xml
I find 2 id's:
Line 451: <public type="xml" name="device_info_settings" id="0x7f050011" />
Line 2469: <public type="string" name="device_info_settings" id="0x7f0b04a8" />
And I tried with the two solution, I get an error ...
And id 0x7f040010, is:
Line 261: <public type="layout" name="auto_brightness_preview" id="0x7f040010" />
thank you in advance.
daemon1666 said:
Hello there
At first I apologize for my English.
I tried this method but I have a problem with steps 11 and 12
can you help me?
when I do research in device_info_settings .. / values ​​/ public.xml
I find 2 id's:
Line 451:
Line 2469:
And I tried with the two solution, I get an error ...
And id 0x7f040010, is:
Line 261:
thank you in advance.
Click to expand...
Click to collapse
First of Thing that What Android Version r using if Your Android Version 2.3 leave step 12 and 13 if are using 3.0+ then find for that ids change valuse according to ur public device_info_settings (xml one not strings) if u get error pls show me logcat logcat will easily to understand ur problem Recommended You to use AF-Apk to Decompile and Recompile Apk If Want it search on google ok
2nd Things No Need to Say Thanks Just Presss the button
AndroidFire said:
First of You What Android Version if Your Android Version 2.3 leave step 12 and 13 if are using 2.3+ then find for that ids change valuse according to ur public device_info_settings (xml one not layout)
2nd Things No Need to Say Thanks Just Presss the button
Click to expand...
Click to collapse
I have a nexus 5
in custom rom 4.4.4
I started in xml, so I don't know by what I must change the id
can you show me an example?
Sorry but I am a beginner.
daemon1666 said:
I have a nexus 5
in custom rom 4.4.4
I started in xml, so I don't know by what I must change the id
can you show me an example?
Sorry but I am a beginner.
Click to expand...
Click to collapse
First things.
can u attach ur public.xml and DeviceInfoSettings.smali I will Do for You
Second Things Thanks Button will more appericated then saying thanks
AndroidFire said:
First things.
can u attach ur public.xml and DeviceInfoSettings.smali I will Do for You
Second Things Thanks Button will more appericated then saying thanks
Click to expand...
Click to collapse
I joined the archive.
Ihave already made steps 1-9
And
I clicked on the button "thanks" and +1 on Google+
daemon1666 said:
I joined the archive.
Ihave already made steps 1-9
And
I clicked on the button "thanks" and +1 on Google+
Click to expand...
Click to collapse
done mind don't kang my work respect my work here is the link just replace the file
https://db.tt/ieOJqB3g
Thx... Again
If something has changed, I'm sorry, I had tried so many things by myself.
What was the problem?
I just tested ..
The first compilation, I have problems compiling
having replaced the device_info_settings.smali well.
I have attached the log
deleted sorry..

Categories

Resources