[Request]Readable? Guide for 9patch - Android Q&A, Help & Troubleshooting

Title says it all. If anyone has ever found a decent guide that comprehensively explains how to edit .9.pngs and add guides please post here, i have tried reading more than 10 in google and none actually tought me how to add guides and edit pngs :S

It does take some getting used to.
http://developer.android.com/tools/help/draw9patch.html
right panel shows how the png will stretch
goal:
draw lines around the edges of the png to create stretchable and static parts of the png.
basically the pink content is stretchable.
stretchable content should be part of the png that is ok to get skewed
when it stretches. so if you have an image in stretchable area
you will need to make sure in the layout of the app it stretches the same on x axis and y axis
if only stretches on one axis image will become distorted.
on the right panel just make sure your png looks good in all 3 examples and you should be fine.

wes342 said:
It does take some getting used to.
http://developer.android.com/tools/help/draw9patch.html
right panel shows how the png will stretch
goal:
draw lines around the edges of the png to create stretchable and static parts of the png.
basically the pink content is stretchable.
stretchable content should be part of the png that is ok to get skewed
when it stretches. so if you have an image in stretchable area
you will need to make sure in the layout of the app it stretches the same on x axis and y axis
if only stretches on one axis image will become distorted.
on the right panel just make sure your png looks good in all 3 examples and you should be fine.
Click to expand...
Click to collapse
Really, i cant understand what means for the png to be strechable and what do the squares in the second image of link are

let me try again.
Define:
a 9patch is a .png that is cut into sections
and the green part is showing the sections
the pink part is showing the stretchable part of the .png
the whole point of a 9patched png is to make a png so it can be used
many different times in an app. sometimes the png will be a square and sometimes a rectangle. basically when you want to use the png as a rectangle its just stretching the square png along the x-axis to make it a rectangle.(like when you set an image that is too small as your desktop wallpaper the image becomes distorted) if you stretch a square image into a rectangle you are distorting the original image to make a rectangle (so things will look funny)
yes the 9patch tool takes some getting used to.
so if you load your png into the 9patch tool
you will be able to draw little lines around the edges.
look closely at the second image (you will see black lines at the bottom and on the right plus 2 small lines on the top and left.
this is what defines your patches.
once you draw the lines around your png you will see a pink section in the middle (this is the part of the png that will stretch when you use your png as a rectangle)
the green sections are showing you the sections that that you have made.
make sure you check the show patches and show content buttons at the bottom.
Now on the right side you will see 3 different shapes a square , vertical rectangle and horizontal rectangle. these are examples of what your png will look like if you stretch it.
as far as I can tell if the images of your png on the right look good and are not distorted then your png will look fine in the app.
If you need some more help
watch the top 3-4 videos that should give you a better handle on 9patch tool.
9patch tool youtube search

Wow thanks i didnt think that it was so simple ( Maybe i was really confused ) Thanks mate will also have a look at the videos

It really is quite simple once you get the basic concept down.

Yeap i managed to edit some .9 pngs with success thanks dude

Related

Guide on how to correct the framework-res.apk so you can cook ICONs

OK folks,
Have a look at this guide that I created for editing the framework-res.apk so that you can then go to the UOT Kitchen and cook up your own ICONS and Batteries.
It is a long read and most folks can probably figure it out.
I have used this to create my own Battery and Status bar icons.
Regards,
Alperin1
I have converted your document to a PDF (some folks don't use Word).
Download here
If you want me to remove this I will.
thanks very helpful guide, but too involved for me. I will either use some one else theme, or use 7zip open archive and change PNG's trick.
Hopefully someone can upload an edited framework-res, for every DJ_Steve update that we all can share for UOT.. hint...hint...
thanks again, I may give this a try when I have time, hopefully I wont need to though.
chrisrotolo said:
thanks very helpful guide, but too involved for me. I will either use some one else theme, or use 7zip open archive and change PNG's trick.
Hopefully someone can upload an edited framework-res, for every DJ_Steve update that we all can share for UOT.. hint...hint...
thanks again, I may give this a try when I have time, hopefully I wont need to though.
Click to expand...
Click to collapse
Gopu already uploaded an edited framework-res..here it is
http://www.megaupload.com/?d=4TI7W0E1
ramtix said:
Gopu already uploaded an edited framework-res..here it is
http://www.megaupload.com/?d=4TI7W0E1
Click to expand...
Click to collapse
Ramtix, i knew that the framework was out thre for the others to use.
I guess the guide is for the folks that want to do all the work and learn a lttile bit about how the Framework is edited.
It took me a long time to figure out how to edit the 9.png files and compile them and just wanted to help others to do the same.
I tried that framework and failed to cook everytime
What is the use of those .9 pngs anyways?
chrisrotolo said:
I tried that framework and failed to cook everytime
What is the use of those .9 pngs anyways?
Click to expand...
Click to collapse
OK, what are the 9.pngs used for or why are they needed.
Stretchable Patches
If you have an image that you may need to stretch you then converting it to a 9.png will allow it to stretch. Also if you need put something in the PNG file, by converting it to a 9.png you can tell it where the text/data/information is allowed in the png file.
When you convert to a PNG you need to need to put a single pixel on the left side of the image and the top of the image. This pixel is not part of the image but in a frame around the image the frame also is just one pixel all the way around the image.
When you put the pixel on the top of the image you are telling the system where the image can be enlarged. Draw and line straight down from you pixel and this is where the image will stretch from. This just allows the image to grow to the left and to the right. Think of it as a square when you put the dot at the top of the square you can them change the square and stretch it left and right to make the square wider, so that it is now a rectangle. This all comes in handy when you rotate your device from landscape to portrait and back again.
Now when you put the pixel on the left side of the image, again in the frame that is around the PNG file, you are telling the system where it can stretch the image, this time you can pull the image up or down and so the height will change. Again image a square, you put the dot on the left side of the this determines at what point the square is allowed to stretch.
Only the lines with the dots on them will change, the rest of the square will retain the original shape and the original image. Most of the time this is done to an image that is only one color so that you are not messing with an image.
Here is the best example I can give of the DOT at the top of the 9.PNG or the left side.
Take two pieces of blank paper that you have and set one on the table and then set the second piece of paper in top of the first with about one inch of the right side of the first (bottom) piece of paper showing. The point where the top piece of paper ends and the bottom piece of paper starts is that DOT. Now slide the bottom piece of paper to the right and keep the top piece of paper still. Hope this all make sense
Content Area
Now lets look at the right side and the bottom of the PNG file. These two side determine where in the PNG file that text or other stuff can overlay or be imposed into the PNG file.
If I have an PNG that is a button and it is 50 x 50 pixels and I want the text for the button to be centered left to right, I would focus on the bottom of the 9.PNG image. I want the text to be able to use most of the pace from left to right but i do not want it to use the left 5 pixels at either end, I would create a line at the bottom of the 9.PNG that begins 6 pixels from the left and ends 6 pixels from the right. Why 6 pixels you are asking, well I have a one pixel from around the image and I needed to take that into account.
The same thing is used to center the text on the button from the top and bottom. Only this time you would use the right side of the image and fill in all pixels except for the 6 from the top and the 6 from the bottom.
Now when the button is stretched, you can use more of the space, but you will never be able to use the last 5 pixel on the top, bottom, left or right.
WOW, that was a long write up.
Enjoy,
Alperin1.
BTW, this is not unique to the Streak, it is used for the Android OS and maybe more.
alperin1 said:
Ramtix, i knew that the framework was out thre for the others to use.
I guess the guide is for the folks that want to do all the work and learn a lttile bit about how the Framework is edited.
It took me a long time to figure out how to edit the 9.png files and compile them and just wanted to help others to do the same.
Click to expand...
Click to collapse
Alperin, dont get me wrong, what you did is awesome, useful and will be appreciated for all other users in the forum especially for future bulids.You did a great effort putting it in words and composing that. thumbs up!
ramtix said:
Alperin, dont get me wrong, what you did is awesome, useful and will be appreciated for all other users in the forum especially for future bulids.You did a great effort putting it in words and composing that. thumbs up!
Click to expand...
Click to collapse
All is good. I did not intend for my response to be a flamer at you.
I think some folks just want to have some fun and try to make things work and a little help here and there can go a long way.
Thanks
Great explanation of .9.png's
Finally got the edited framework to cook
Hopefully this helps with more themes for Streak.
Thank you all around
Tried making my own framework.apk but failed big time, appreciate you uploading your work for me to use. Will keep the guide and continue to play with it, would like to say that I beat the software, not that the software beat me.
Keep hacking away at it.
Do you know where you are beating the software into submission. (where are you stuck?)
When it's time to complie is where I fail
alperin1 said:
Keep hacking away at it.
Do you know where you are beating the software into submission. (where are you stuck?)
Click to expand...
Click to collapse
alperin1, I will walk you through my Eclipse phase and maybe you can tell where all goes wrong.....
1. Make edits to .9 files like a champ if you don't mind me saying so...
2. Open Eclipse and go to File/new/android project and nothing, import LunarLander files and make sure settings are on Android 2.2
3. Create and now my copy of LunarLander is permanently updated to my edited .9 files (so assume at this point all is good to go).
4. At Export Signed Application Package is where I am having my problems, go throught the steps receive confirmation my file is G2G and when I move them to my Framework file all the edits are gone, like I did nothing to them.
5. Have preformed #4 multiple times and same result every time, everything moves but my edits are stripped out.
6. Figured maybe it is magic and edits will reappear when I cook my file, well no luck, get same exact error report as when I first tried to cook me some Icons on UOT.
Any ideas on what is causing my updated .9 files to loose the edits when I move them from LunarLander to Framework (Yes I do accept the overwrites when prompted).
Before you do the last step in Eclipse, drag one of the png files to your desktop and view it.
I am at work. I will play with this when I am home.
Sent from my Dell Streak using XDA App
vanemburghj said:
alperin1, I will walk you through my Eclipse phase and maybe you can tell where all goes wrong.....
Any ideas on what is causing my updated .9 files to loose the edits when I move them from LunarLander to Framework (Yes I do accept the overwrites when prompted).
Click to expand...
Click to collapse
This is very interesting. When I export my package from Eclipse and then pull the images they do not show the dots and the bars just like you are seeing. So, I have to say this part may not be where your are running into problems.
Is it possible for you to post the error text? Put it into a zipped file. I will see what I can do. This is kinda new to me so I will do what I can for you.
So you are in Eclipse and you have lunarlander, you then put all your edit 9.PNG files into the folder. Next your export it.
After you have created the new lunarlander.apk, you are going into it and extracting the 9.png files you need. You are then placing these file in the same location that you pulled them from in the framework-res.apk. right? Then you are uploading this to the UOT kitchen.
Will do
But will have to wait till I get home from work.
alperin1
Here is my LunarLaner.apk, none of the edits survived creation of .apk, but they are in my LunarLander sample as your guide shows them to be. So it is when I make the .apk that all fails. Have attached my Pre-export LunarLander so you can verify I made the changes to .9 files.
Window 7 Ultimate 64 bit
Norton Anti Virus
Plus other software
Any and all ideas are welcome.
vanemburghj said:
Here is my LunarLaner.apk, none of the edits survived creation of .apk, but they are in my LunarLander sample as your guide shows them to be. So it is when I make the .apk that all fails. Have attached my Pre-export LunarLander so you can verify I made the changes to .9 files.
.
Click to expand...
Click to collapse
Well, I have taken the 9.PNG files that you have provided and I put them into my Framework-res.apk file and I was able to cook up some goodness for myself at the kitchen.
As you are stating and you are correct, the frame around the 9.png is not showing after step number 4, but the information is there, i just do not yet know how to view it.
I think the problem may be that the same 9.png files are in two locations in the framework-res.apk. Can you try to cook a new set of ICONs or anything for that matter and when you get the errors, put them in a zipped text file and post it here for me.
Oh and what ROM are you using? DJ Steve 1.9? If so, you should have many more images to edit that what you have provided to me.
Cooked my own framework!!!
alperin1, Thank you, think I needed confirmation that once exported via eclipse edits would disappear, plus I took my time and made sure I did the wallpaper steps exact. Cooked my own framework, I am getting there, am sure it is one very small drop in a very big ocean of Android development that I have learned with your expert help I do appreciate it.
vanemburghj said:
alperin1, Thank you, think I needed confirmation that once exported via eclipse edits would disappear, plus I took my time and made sure I did the wallpaper steps exact. Cooked my own framework, I am getting there, am sure it is one very small drop in a very big ocean of Android development that I have learned with your expert help I do appreciate it.
Click to expand...
Click to collapse
Grasshopper.you are doing well. You have made my day.
Sent from my Dell Streak using XDA App

draw9patch and transparency

Has anybody had any luck with transparency and draw9patch? for example, take the music.apk file and change the background for the widget to be 80% visible, toss it into the sdk draw9patch tool, save it. You get a simple stretching operation.
NFHimself said:
Has anybody had any luck with transparency and draw9patch? for example, take the music.apk file and change the background for the widget to be 80% visible, toss it into the sdk draw9patch tool, save it. You get a simple stretching operation.
Click to expand...
Click to collapse
read up on setting pixel borders using the draw9 tool usually in the sdk/tools folder. the outer most pixel basically has to be either completely transparant or completely filled. otherwise it won't work. and its a pain finding the perfect stretching area.

[SOLVED] Pattern Lock Screen: How do I change the clock font and dots?

UPDATE: All info in this thread summarized here: [GUIDE] Pattern lock tweaks - Wallpaper Brightness, Pattern Lock Dots, etc.
Rooted phone running Cognition 1.5.1. I am using a pattern lock so I have the standard Samsung lockscreen.
How can I change the clock font on the pattern lock screen? It looks very out of place compared to the other fonts.
Can I make the pattern lock dots smaller or more transparent? I don't like how it covers up almost all of my wallpaper. I know CyanogenMod has an option to make the pattern lock dots completely invisible. I don't really want that either, I just want them to be less obstructive.
Thanks in advance!
You can't change them afaik! You can always use third party lockscreen app like Widget Locker to get your desired lock screen.
I figured out how to change the clock font. Simply replace the Clockopia.ttf in /system/fonts. You can also use the Font Changer app, available on XDA or Market: http://forum.xda-developers.com/showthread.php?t=874658
However I noticed that my replacement clock font did not seem to line up properly. I think this is a common problem with replacing Clockopia.ttf. So you might need to adjust your font with something like FontForge first. Check out the guide here: http://forum.xda-developers.com/showthread.php?t=990853
UPDATE: This thread on Rootzwiki gives a good description of the Clockopia alignment problem and how to fix it. Basically, use a font editor to replace the glyphs in the Clockopia.ttf with the glyphs from your favorite font.
Still investigating the pattern lock dots.
Figured out the pattern lock dots! The files are in the framework-res.apk, under res\drawable-hdpi. There are two files you need to edit:
btn_code_lock_default.png -- This is the white dot in the middle
indicator_code_lock_point_area_default.png -- This is the dark circular background of the dot
I reduced the size of the white dot by 50% and used a clear transparent background so it doesn't block the wallpaper. Files are attached below in case anyone wants to use these.
One more discovery today. Normally the pattern lock wallpaper is not as bright as the original -- there's a dim or dark filter over it. To change this, decompile framework-res.apk (need to use apktool or apk_manager), and edit res\layout\keyguard_screen_unlock_portrait.xml.
On line 4, change android:background="#70000000" to android:background="@color/transparent"
Compile framework-res.apk and put it back into system\framework. Reboot and you should see that the pattern lock wallpaper is much brighter!
Also I've made another set of pattern lock dots. For this one, I reduced both the white middle dot and the outer ring by 50%. Then I increased the transparency of both and made the outer ring a lighter gray. So now the dots are larger, but even less intrusive. I've attached the files below, plus a screenshot.
Thanks a lot for the background transparency trick ! That was exactly what I was loogking for.
Also, may I add something just for information if ppl need it :
There are other files if you want a complete edit :
the ones you told about :
btn_code_lock_default.png (the small dot in the center)
indicator_code_lock_point_area_default.png (the black circle around)
The pngs that shows up when the pattern is the wrong one :
indicator_code_lock_point_area_red.png (the circle around)
indicator_code_lock_drag_direction_red_up.png (the arrow showing the direction)
And if you use "visible pattern" in the options, these are the green ones :
indicator_code_lock_point_area_green.png
indicator_code_lock_drag_direction_green_up.png
btn_code_lock_touched.png (the small dot in the center, touched version)
One more thing, if you're only editing pngs, you don't need apk tool, a simple unzip with 7zip is possible.
Thanks for the modification ideas.
I am using a Htc Desire on dGB aosp rom but just to add to this thread. In the keyguard_screen_unlock_portrait.xml, I changed:
android:background="#70000000" to android:background="@drawable/patternlock_background"
Added an image called patternlock_background.png to the drawable-hdpi folder.
Made some of the images mentioned in the previous posts transparent.
And came up with this:
Obviously, I still need to edit other aspects of that screen to tidy it up.
Great work LfcFan1977! I would be really interested in seeing more wallpapers that incorporate the pattern lock into their design. There could be some pretty cool ideas by mixing a pattern lock wallpaper with custom pattern dots and lines.
Yea, I have been wanting this kind of mod ever since I got my Android.
Here's a few ideas:
Galaxy with stars/rockets/shuttles/astronauts/planets/moons.
Dot to dot of a gingerbread man.
Flowers with the honeycomb bee.
Treasure maps and pirates.
Football.
Homer Simpson and donuts.
Pacman.
Anyway, I had a bit more of a play with the xml/images and got this.
Hi,
a few month ago I investigated the size of the background image to fit the pattern dots, and after a few experiments I saw that android was doing a bit of resizing, even if the image was exactly the screen size.
What worked for me, is to make an image smaller than 800 in height (763px to be precise) and 480 in width (regular width of 1 screen). But when done editing, I stretch its height back to 800. Then, when applying within gallery ("use as..."), it stretch it back to undeformed.
I made a template in photoshop, for those who are interested, also with my actual pattern background. Still can't post urls here, so...it's hosted at mediafire.com :
Code:
/?fo04gtvp82y1xw1 (the template)
/?82txu5qxdea6usb (the background)
Wow, this thread is a great resource for customizing the lockscreen, and it's rather painless (not much APK tool messing to do, if simple unzip, rezip works, wonderfull )
This is going into my bookmarks
I wish I would have found this thread sooner. I was looking for which files to edit for the buttons but found them elsewhere. I still have one question, though. Does anyone know how to change the path color? I can't find which file it is located in. TIA.
I can only assume the colour is applied by something in the framework.jar but as my understanding of smali coding is practically none, I can not figure it out.
I was thinking that maybe re-posting all the previous information and the above question in the android themes thread may be better. I do not think any of it is device or rom specific and we may need a wider audience in order to resovle questions like the last one.
I can't find the path color in the xml or png files so it must be something in smali code. Moving to the Android themes forum is a good idea. I am going to summarize everything and repost it in that forum.
Check out the new thread here! http://forum.xda-developers.com/showthread.php?t=1330063
A little help
This line about android:background is in keyguard_screen_unlock_portrait? I think it's keyguard_screen_password_portrait

Tab 10.1 Wallpaper Template

I've seen a few other wallpaper templates out there, but i wasn't extremely satisfied with them as they only focused on the home screen.
I put alot of work into checking and re-checking this on the honeycomb default launcher (3.1), and it accurately displays the location of each screen both vertical and horizontal.
It's a PNG image to maintain transparency, and the resolution of it is what i've calculated to be optimal to maintain 1280x800 on the primary home screen.
I'm uploading the easier to use PNG file, the psd, and a simple wallpaper i just threw together to illustrate.
When using this template, you just set the crop in the upper left hand corner and expand down as far as you can. there is about a 5px buffer at the bottom to allow some give.
I know it's kind of a busy template, but the green lines will define the home screen in either direction, and each screen is defined by it's matching colored line.
awesome!! thanks!
thanks! time to make some wallpapers
Thanks for sharing, Shane86. This is exactly what I was looking for. You Rock!
Just thought I'd throw up a few wallpapers I've made with this template.
EDIT: Didn't know that this site will re-size image uploads
I've uploaded their original images in the RARs you'll find below.

Development Discussion: Modification of PDF Viewer

Taking notes over PDF slides with the scribe pen has really saved me a lot of hassle. I love this function of the flyer. There's really only one way it could be better: Fullscreen support, or at least "more screen" support.
Not only does the HC bar take up space, but the menu/title bar on top is even bigger. The pdf viewer has the screen real estate of a 5inch phone.
PDF editing seems like only a moderately used feature, so I don't see this getting done on it's own. I'm offering a very modest reward for a fix.
I would be willing to donate for the removal of the huge uppermost Title/menu bar in PDF viewer, so that a double-tapped fitted pdf page will fill the new space. See the attached image. You can leave the small menu button in the corner if possible, or just get rid of it if it's too difficult.
I'm hoping this is as simple as modifying a few variables in the apk. I could be very wrong.
I can live with just the HC bar at the bottom.
Note: I have tried apps like repligo and ezpdf which do offer fullscreen support. However, annotating and changing annotation options takes many more steps than the HTC pdf viewer.
Secondary goal:
Apps like honeybar and honey hide widget cause all pen written annotations to be shifted up.
I believe the solution to the first problem would also allow an easy fix of the shifting pen annotations. I would like the PDF viewer to accept pen strokes properly with a hidden HC bar.
No one's willing to give it a shot? Ah well.
This will be my only bump.
I've attached the (unmodified, I think) HTCPDFViewer.apk from /system/app from LeeDroid's 4.1.0 rom.
I was the guy who removed the obnoxiously large language bar from Sony Ericsson's keyboard back when I was still using my u20i phone... unless HTC is particularly irritating about how it structures its resources, you're right that it is a matter of decompiling the APK, adjusting numbers, and recompiling it. Merely hiding is not difficult (making the Menu button semi-transparent is probably too difficult, though, but you can pick a ROM with the hardware buttons enabled).
Unfortunately it is also incredibly tedious to decompile and recompile everything right, from my experience of the keyboard hack. I'm not really up to it at the moment. Hope you can do it.
I've poked around in the archive. I wonder if I could just delete the ti.tle bar png or layout file. There doesn't seem to be a definitive title bar png
I'm also experimenting with apk multitool.
Since it's a stock rom app, is this venture going to be a lot more complicated than editing an xml line and then recompiling?
Here's where I'm at. Everything I know about android programming I've learned tonight, so this may be confusing and stupid sounding:
The decompiled apk has several things which could refer to the title bar.
dimens.xml has lines like
<dimen name="global_title_height">35.0dip</dimen>
<dimen name="editing_panel_header_height">56.0px</dimen>
<dimen name="editing_panel_header_margin">47.0px</dimen>
<dimen name="editing_panel_no_footer_header_margin">35.0px</dimen>
However there are also thousands of header and title lines from other xmls.
Can I just use a theme line in the manifest?
It uses the ActPDFReaderTheme whose parent is the HtcActionBar.FullScreen from the com.htc.resources.apk
These link to the common_mainnav xmls and pngs in the resources.
Do I need to find an HTC theme from the com.htc.resources.apk that doesn't have a title bar? Could I edit the com.htc.resources.apk and edit the pngs or delete the referencing lines in the styles.xml?
Thanks. I'll keep digging.
And btw, the bounty's still out if anyone can do it faster. I don't have much free time.
I think I've got this. I'm real close
I figured out how to decompile, edit xmls, recompile, copy original meta-infs and androidmanifest, and adb push.
The dimens.xml in the viewer apk has no effect on the bar. It's a standard template htcactionbar.fullscreen
I could direct the apk to a new theme, but I've decided just to try deleting or shrinking the bar from the com resources apk.
Good luck! Remember the apk you push back must be a signed one, probably via hacking the modified xml files back into the original signed apk.
Now I've run into a snag.
No matter how many margin and layout dimension variables in the com resource I set to 1.0px, I still have a black bar above the pdf.
Then I tried changing the theme reference in the pdfviewer.apk. It loads the file picker without an action bar, but as soon as I click a file it crashes. It seems (I think) that the program has too many calls for the action bar. I'm not a programmer. Do you know how I can get the program to simply ignore any lines referencing the "actionbar"?
Lines such as: "invoke-virtual {v3}, Lcom/htc/pdfviewer/ActPDFReader;->getActionBarHeight()I"
I also tried <item name="android:windowNoTitle">true</item> after the theme and I have the same effect of no title bar but a forceclose after selecting a file
Could you post the entirety of the relevant xml layout file?
porcupineadvocate said:
Could you post the entirety of the relevant xml layout file?
Click to expand...
Click to collapse
Unfortunately there is no simple relevant layout file. I can't go any further with this project because I don't know programming. Here's my progress if anyone would like to give it a shot:
In the decompiled HTCPDFViewer is a \res\values\styles.xml
There is the line:
<style name="ActPDFReaderTheme" parent="@com.htc:style/HtcActionBar.FullScreen">
This tells the program to use the HTCactionbar.fullscreen template style in com.htc.resources.apk
Now there are two paths to take from here:
1) Changing the style template to @android:style/Theme.NoTitleBar.Fullscreen
or adding the requestWindowFeature(Window.FEATURE_NO_TITLE) line
Issue: This causes the file picker to load without a title fine, but as soon as a pdf loads, the program crashes.
How far I got: I simply deleted 2 lines referring to the actionbar in the PdfLoadingPage$LOADING_PAGE_Handler.smali and the pdf loads. However there is a now a black empty bar on the bottom, and any pen writing is being moved upwards.
I suspect this is because of the ActionBarMenuAdapter.smali that controls how the pen annotations are moved in relation to the actionbar. There are also 100 more lines referring the actionbar in the other smalis. You can find them all by searching the apk for "actionbar". A proper programmer could remove these lines, or more easily make every m_iActionBarHeight:I line refer to zero.
If someone can fix the programming, I suspect that this would also solve the hidden HC bar issue, allowing true fullscreen support!
2) Editing the com.htc.resources.apk
The styles.xml in this file has a NoTitleBar.Fullscreen theme that redirects to other xmls redirecting to different layout files and pngs.
I've looked through every dimens.xml and other xmls that may be even loosely linked to the actionbar. I even tried haphazardly changing every possibly connected dimension to 1.0px.
I then tried shrinking all of the related PNGs to 1x1 pixel.
The end result was just a funking looking grey and black bar at the top.
I have no idea where to find the dimensions controlling the size of the actionbar.
Thanks for any help! Warning: Recovery backup before pushing a new com.htc apk, if you don't do it correctly, things can get messy with the OS.
porcupineadvocate said:
Could you post the entirety of the relevant xml layout file?
Click to expand...
Click to collapse
Ok I may have lied. There are one or two files I wasn't sure about.
These are from the xmls in layout folders of com.htc apk.
Can you take a look and see if there are simple line(s) to change here? notepad++ is great.
I already attempted to edit all of the dimens.xml dimensions. I can't remember if I got all of the dimensions in these files too.
The bar seems to be about 56 pixels. I gathered that from reduced editing view dimensions but I could be wrong.
Not that it is a big deal for a minor issue like this in a low traffic forum like EVO View but "bounty threads" are strictly prohibited by xda.
I doubt the mods will hassle you since this isn't a heavily travelled thread but they might shut you down at any second. Good idea to get some PM's going with anyone who is helping you.
Good luck.
Sent from my PG41200 using Tapatalk
Post the decompiled HTPDFViewer, please. I particularly want to see the contents of res/layout/*.xml files.
As a tip, don't delete any elements; just resize them to zero height/width if possible. Deleting will cause crashes when the program tries to reference them.
porcupineadvocate said:
Post the decompiled HTPDFViewer, please. I particularly want to see the contents of res/layout/*.xml files.
As a tip, don't delete any elements; just resize them to zero height/width if possible. Deleting will cause crashes when the program tries to reference them.
Click to expand...
Click to collapse
Here it is.
Woops I didn't realize bounties were prohibited, especially with so many developers asking for "donations"
Delete this if you'd like. I didn't mean to break the rules.
Donations and bounties are different. Donations are thanks for work done, bounties are offer of compensation to do work. If they allowed bounty threads xda would be overrun with them.
No big deal. I doubt the mods even visit this thread. Just wanted to give you heads up to establish pm conversations in case they did
Sent from my PG41200 using Tapatalk
No progress since my last update on the programming front. However I have been playing with the lcd density changer.
Setting it to 170 from 160 and enabling the GB like bar on top has interesting results. The pdfviewer only edits properly when I use Honeyhide or Honeybar. So we know that disabling the notification bar and having a working pdfviewer is possible.
However, I found I have the best pdf editing real estate when I set the lcd density to very low, like 120. In fact, not only are the title and HC bars smaller, but the pen seems to be more accurate too!
Maybe this information will help with our goal.
EDIT: at 120 and below, the scribe color wheel pops up on the wrong side. Still works though. Other tablet functions are much slower and there's some screen corruption too. It's not a permanent solution, but works for annotating pdfs.

Categories

Resources