FORUMS
Remove All Ads from XDA

[MIUI_V5 Bugfix][TUT] Fix RTL Bug on MIUI V5 Applications

1,545 posts
Thanks Meter: 2,598
 
By M_J_Nazari, Inactive Recognized Developer on 29th May 2013, 03:49 AM
Post Reply Email Thread
Hi to All

I found the RTL bug on default MIUI V5 applications, after working on default's miui programs like Messaging, Contacts, Notes, .... finally i found the bug where it comes from.

little explanation how to fix this issue on Messaging app.
the problem is come from where the miui developers did not defined the android layout gravity for text editing layouts, when you don't add layout gravity for item, it will stick to left for all items. now when you want type over right layout based languages, like Persian, Arabic, Hebrew, Urdu ..., it will stick to left and you cant edit the text, the courser will stick to left while you are typing from right. i hope understand what i mean.

now get back to title and there is a solution.

we need to edit all MIUI V5 apps and put the layout_gravity parameter on edit text layouts, but its required huge work and need too much free time.
but there is simple way to fix this issue:
i study an d checking the MIUI V5 apps , and find that all of those text layouts have common style and they referred to "V5.TextAppearance" style.
i found this style on "framework-miui-res.apk" file. finally i changed this style and all RTL problems are fixed already.

lets begin the tutorial:

1- De-compile the framework-miui-res.apk file.
2- open /res/values/styles.xml file via Notepad++
3- how to fix text edit layouts rtl problem , like Music player meta ID3 editor, Messaging app and phone.

do a search and find this style:
PHP Code:
     <style name="V5.TextAppearance" parent="@*android:style/TextAppearance">
            <
item name="android:textSize">@dimen/v5_text_font_size_primary</item>
    </
style
4- fix the styles:
add this below line through above style:
PHP Code:
<item name="android:gravity">start</item

finally we have :
PHP Code:
 <style name="V5.TextAppearance" parent="@*android:style/TextAppearance">
        <
item name="android:gravity">start</item>
        <
item name="android:textSize">@dimen/v5_text_font_size_primary</item>
</
style 

4- how to fix texts on search layout's rtl problem like Contacts search function, Notes search function, Music player search function

find this line:
PHP Code:
<style name="V5.Widget.EditText" parent="@*android:style/Widget.EditText"
on this style you will see this parameter:
PHP Code:
<item name="android:gravity">left|center</item
change the above parameter to below one:
PHP Code:
<item name="android:gravity">start|center</item
finally we have:
PHP Code:
    <style name="V5.Widget.EditText" parent="@*android:style/Widget.EditText">
        <
item name="android:textAppearance">@style/V5.TextAppearance.EditText</item>
        <
item name="android:gravity">start|center</item>
        <
item name="android:background">?v5_edit_text_bg</item>
        <
item name="android:singleLine">true</item>
    </
style
5- save the "Styles.xml" file and close Notepad++ application.
6- compile "framework-miui-res.apk" file.
7- now transfer your edited "framework-miui-res.apk" into your phone.
8- enjoy!



Original Thread, Persian Language
Best Regards , Amestris Team
The Following 10 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ] Gift M_J_Nazari Ad-Free
 
 
29th May 2013, 03:53 AM |#2  
M_J_Nazari's Avatar
OP Inactive Recognized Developer
Bushehr
Thanks Meter: 2,598
 
Donate to Me
More

How to fix RTL issue on Global search in home screen.

1- decompile QuickSearchBox.apk
2- open /res/layout/query_text_view.xml via notepad++
3- find this item:
Code:
android:gravity="left|center"
4- change above item to
Code:
android:gravity="start|center"
5- compile and move it into system/app folder.

The Following 3 Users Say Thank You to M_J_Nazari For This Useful Post: [ View ] Gift M_J_Nazari Ad-Free
29th May 2013, 02:17 PM |#3  
M_J_Nazari's Avatar
OP Inactive Recognized Developer
Bushehr
Thanks Meter: 2,598
 
Donate to Me
More
The Following User Says Thank You to M_J_Nazari For This Useful Post: [ View ] Gift M_J_Nazari Ad-Free
29th May 2013, 02:20 PM |#4  
M_J_Nazari's Avatar
OP Inactive Recognized Developer
Bushehr
Thanks Meter: 2,598
 
Donate to Me
More
thread is updated. if you find any rtl bugs either please report me.
best regards.
The Following User Says Thank You to M_J_Nazari For This Useful Post: [ View ] Gift M_J_Nazari Ad-Free
29th May 2013, 05:16 PM |#5  
Member
Thanks Meter: 22
 
More
Quote:
Originally Posted by M_J_Nazari

thread is updated. if you find any rtl bugs either please report me.
best regards.

Thanks!! What about SMS pop-up (the quick respond)?
The Following User Says Thank You to SagiMedina For This Useful Post: [ View ] Gift SagiMedina Ad-Free
29th May 2013, 09:43 PM |#6  
M_J_Nazari's Avatar
OP Inactive Recognized Developer
Bushehr
Thanks Meter: 2,598
 
Donate to Me
More
Quote:
Originally Posted by SagiMedina

Thanks!! What about SMS pop-up (the quick respond)?

yes, its fixed too.
The Following User Says Thank You to M_J_Nazari For This Useful Post: [ View ] Gift M_J_Nazari Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes