New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Review 9-patch image state #20

Closed
hardeep opened this Issue Jul 30, 2012 · 40 comments

Comments

Projects
None yet
@hardeep

hardeep commented Jul 30, 2012

Users are having issues embedding 9patch images into their Android applications, specifically for splash screens; get this investigated + working.

Related GS thread:
http://community.phonegap.com/nitobi/topics/add_a_way_for_phonegap_build_users_to_have_centered_splash_screens_on_android_instead_of_stretching?utm_content=topic_link&utm_medium=email&utm_source=reply_notification

@johannjacobsohn

This comment has been minimized.

johannjacobsohn commented Jul 30, 2012

Hey Hardeep,

you can use https://build.phonegap.com/apps/132536 to replicate this problem. I've also tried renaming the splash-Image to splash.9.png to no avail.

Please let me know if I can do anything to help clear up the matter.

Regard,
Johann

@amirudin

This comment has been minimized.

@ghost ghost assigned hardeep Oct 4, 2012

@toorshia

This comment has been minimized.

toorshia commented Jan 4, 2013

Progress, guys? :) Perhaps there's a workaround for this?

Cheers.

@toorshia

This comment has been minimized.

toorshia commented Jan 4, 2013

Ok, after renaming file to have ".9" before extension, I got it working. Funny :)

@timotae

This comment has been minimized.

timotae commented Jan 10, 2013

Did you get the 9-patch image splash-screen to work via Phonegap Build, toorshia? If so, mind sharing how you did it (corresponding line(s) in config.xml and file path)?

@toorshia

This comment has been minimized.

toorshia commented Jan 10, 2013

In config.xml, plugins section:

<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>

Then in onCreate method of DroidGap extension class:

super.setIntegerProperty("splashscreen", R.drawable.splash);

Then, in AndroidManifest.xml, in support-screens section:

android:anyDensity="true"

And finally, place valid 9patch image (validate it stretches correct with Android SDK 9patch tool), named like: "splash.9.png" in "res/drawable-nodpi" folder.

Title of the image can be anything, as long as filename ends with ".9"

@ncrossland

This comment has been minimized.

ncrossland commented Jan 15, 2013

+1

@benkow

This comment has been minimized.

benkow commented Feb 21, 2013

Still cannot get splash-screens to work correctly in android when using Phonegap-Build (Eclipse-Build works).
I'm using Cordova 2.2. I have several splash-screen-locations defined in my config.xml:

<gap:splash src="res/android/drawable-ldpi/splash.9.png" gap:platform="android" gap:density="ldpi" />
<gap:splash src="res/android/drawable-mdpi/splash.9.png" gap:platform="android" gap:density="mdpi" />
<gap:splash src="res/android/drawable-hdpi/splash.9.png" gap:platform="android" gap:density="hdpi" />
<gap:splash src="res/android/drawable-xhdpi/splash.9.png" gap:platform="android" gap:density="xhdpi" />

Screens chosen and and shown, but they are still getting stretched.
Any progress on this issue or am i missing sth.?

@brendo

This comment has been minimized.

brendo commented Feb 28, 2013

Same situation as @benkow, I have created a splash.9.png file using the draw9patch tool, but unsure how to implemented it in my config.xml file so it will correctly work for Phonegap Build.

@zacheryrodgers

This comment has been minimized.

zacheryrodgers commented Mar 6, 2013

@toorshia, Your fix works for Phonegap, but there is no way (that I am aware of) to append the onCreate method for Phonegap Build.

@toorshia

This comment has been minimized.

toorshia commented Mar 7, 2013

I haven't done builds with Phonegap Build, so I am not familiar with the process. The fix I did works for Eclipse (or Aptana Studio 3) builds.

@zacheryrodgers

This comment has been minimized.

zacheryrodgers commented Mar 29, 2013

Still no official word on this one?

@trullock

This comment has been minimized.

trullock commented May 20, 2013

+1

@ncrossland

This comment has been minimized.

ncrossland commented Sep 18, 2013

@hardeep Is this issue closed because it has been fixed?

@eric-sm

This comment has been minimized.

eric-sm commented Sep 30, 2013

Ditto on ncrossland's question? And, of course, what's the usage/configuration necessary?

@HynesIP

This comment has been minimized.

HynesIP commented Oct 29, 2013

Ditto on the ditto.

@Rule-Books

This comment has been minimized.

Rule-Books commented Nov 5, 2013

Sorry for asking again, is there a solution for this issue?
toorshia seems to have provided a solution.
Can someone provide an example of the code in the appropriate files?
Thanks

@birchcode

This comment has been minimized.

birchcode commented Nov 21, 2013

This doesn't appear to be fixed, which makes Phonegap build quite unusable. The very first image, the first judgement that any user of a PhoneGap build app is going to be some stretched out dodgy looking crap.

The other option is to just load a blank while the user waits, which isn't great.

How has this gone unfixed for a year?

@birchcode

This comment has been minimized.

birchcode commented Nov 21, 2013

@shawnmckay24 Is it closed because there is a solution?

@HynesIP @Rule-Books @eric-small @ncrossland @trullock @tarnic @hardeep : Did any of you guys work out ever workout a fix for this?

@benkow

This comment has been minimized.

benkow commented Nov 21, 2013

I totally agree with @birchcode. this bug makes build service completely unusable. My "solution" was to skip pg-build and compile directly via xcode and eclipse. Fotunately i did not have to serve another platform.

@trullock

This comment has been minimized.

trullock commented Nov 21, 2013

@birchcode Yeah, dont use phonegap build

@birchcode

This comment has been minimized.

birchcode commented Nov 22, 2013

Cheers @trullock :)

What did you move to after PG build?

@trullock

This comment has been minimized.

trullock commented Nov 22, 2013

Just building it locally through eclipse shudder

@GlennMarkTownsend

This comment has been minimized.

GlennMarkTownsend commented Dec 1, 2013

Is there anyone "official" that can tell us why shawnmckay24 closed this?

@jayums

This comment has been minimized.

jayums commented Feb 8, 2014

Having to build locally through eclipse just for this reason is really inconvenient. Why is this issue closed if there's no solution?

@davejohnson

This comment has been minimized.

Member

davejohnson commented Feb 13, 2014

Hey all, not sure why this was closed -- we are adding it to the backlog and will be looking at getting it into Build soon. Thanks for the feedback on this!

@davejohnson davejohnson reopened this Feb 13, 2014

@brendo

This comment has been minimized.

brendo commented Feb 14, 2014

Great to hear!

@stutteringp0et

This comment has been minimized.

stutteringp0et commented Mar 13, 2014

Has anyone found a solution?

@GlennMarkTownsend

This comment has been minimized.

GlennMarkTownsend commented Mar 13, 2014

Hi, go here http://gsfn.us/t/34x9g I have provided a work around which works. Yet again they have closed as resolved even though there are still some issues (they wanted me to open a new thread for the same issue). To be honest i've now given up using PhoneGap Build due to their total disregard and arrogance towards their Customers.

Personally I now use Appery.io It's much better, has an app UI builder, has all the DB and background support and compiles great, not perfect but at least you can tweak the code and even download as an Eclipes project to get it 100% right.

@m-misseri

This comment has been minimized.

m-misseri commented Mar 19, 2014

Hello guys, any news?

@davejohnson

This comment has been minimized.

Member

davejohnson commented Apr 8, 2014

This has been fixed. Happy building!

@davejohnson davejohnson closed this Apr 8, 2014

@ReTenant

This comment has been minimized.

ReTenant commented Apr 17, 2014

Dave Johnson,

I'm glad that you say it has been fixed. Please give us an example so that we know how to properly use this feature. Also, please update the documentation to reflect improvements such as this.

Do we ONLY need to append 9 before .png, or do we need to add other options to config.xml?

Devin

@goya

This comment has been minimized.

Member

goya commented Apr 17, 2014

it's added to the docs. just add your patch nine images like any other splashscreen. no special magic sauce needed.

@carlosrymer

This comment has been minimized.

carlosrymer commented Apr 23, 2014

Still doesn't work. I have upgraded to the latest version of the CLI and tried everything from using the .9.png extension to using the online Android Studios tool. It just doesn't work when running the app from the CLI.

@ReTenant

This comment has been minimized.

ReTenant commented Apr 23, 2014

It did work for me. I just saved the 9 patched files with the .9.png
extension and all was good.

On Tue, Apr 22, 2014 at 9:27 PM, Carlos Rymer notifications@github.comwrote:

It still doesn't work. I've tried many workarounds.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-41118376
.

@carlosrymer

This comment has been minimized.

carlosrymer commented Apr 23, 2014

Did you do anything else? Did you use the cordova run command? Is the version of the CLI 3.4.0-0.1? I also saved the file as screen.9.png and have the value of the splash screen preference as "screen" in the config.

@ReTenant

This comment has been minimized.

ReTenant commented Apr 23, 2014

I didn't. I'm actually using PhoneGap Build for buiding, so all I had to
do was create the 9 patch files, set them in config.xml, and upload the
files to the build server. PhoneGap build is taking care of the details.

Snippet from my config.xml

<gap:splash src="splash/android/ldpi.9.png" gap:platform="android"
gap:density="ldpi" />
<gap:splash src="splash/android/mdpi.9.png" gap:platform="android"
gap:density="mdpi" />
<gap:splash src="splash/android/hdpi.9.png" gap:platform="android"
gap:density="hdpi" />
<gap:splash src="splash/android/xhdpi.9.png" gap:platform="android"
gap:density="xhdpi" />

On Wed, Apr 23, 2014 at 6:52 AM, Carlos Rymer notifications@github.comwrote:

Did you do anything else? Did you use the cordova run command? Is the
version of the CLI 3.4.0-0.1? I also saved the file as screen.9.png and
have the value of the splash screen preference as "screen" in the config.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-41151801
.

@carlosrymer

This comment has been minimized.

carlosrymer commented Apr 23, 2014

Thanks. I guess it's different just using Cordova.

@goya

This comment has been minimized.

Member

goya commented Apr 23, 2014

yeah this is for phonegap build issues, for the cli or if you're building your own cordova projects on your computer then support can be found on the google groups or preferably stackoverflow: http://stackoverflow.com/questions/tagged/cordova

@guitarhb

This comment has been minimized.

guitarhb commented Aug 7, 2014

Well, this solution has worked to me. Copy the file "splash.9.png" to the folders: "drawable-ldpi", "drawable-mdpi", "drawable-hdpi" and "drawable-xhdpi". Remove all content in "ant-build" folder and build again. I hope that be usefull for all. Greetings.

@hardeep hardeep removed their assignment Aug 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment