phonegap / build

This is the public repository for PhoneGap Build source and bug tracking
92 stars 33 forks source link

[Android] Review 9-patch image state #20

Closed hardeep closed 10 years ago

hardeep commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

Related issue: http://community.phonegap.com/nitobi/topics/stretched_9_patch_splash_screens_android

toorshia commented 11 years ago

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

Cheers.

toorshia commented 11 years ago

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

timotae commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

+1

benkow commented 11 years ago

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 commented 11 years ago

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 commented 11 years ago

@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 commented 11 years ago

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 commented 11 years ago

Still no official word on this one?

trullock commented 11 years ago

+1

ncrossland commented 10 years ago

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

eric-sm commented 10 years ago

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

HynesIP commented 10 years ago

Ditto on the ditto.

Rule-Books commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

@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 commented 10 years ago

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 commented 10 years ago

@birchcode Yeah, dont use phonegap build

birchcode commented 10 years ago

Cheers @trullock :)

What did you move to after PG build?

trullock commented 10 years ago

Just building it locally through eclipse shudder

GlennMarkTownsend commented 10 years ago

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

jayums commented 10 years ago

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

davejohnson commented 10 years ago

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!

brendo commented 10 years ago

Great to hear!

stutteringp0et commented 10 years ago

Has anyone found a solution?

GlennMarkTownsend commented 10 years ago

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 commented 10 years ago

Hello guys, any news?

davejohnson commented 10 years ago

This has been fixed. Happy building!

ReTenant commented 10 years ago

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 commented 10 years ago

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

carlosrymer commented 10 years ago

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 commented 10 years ago

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/phonegap/build/issues/20#issuecomment-41118376 .

carlosrymer commented 10 years ago

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 commented 10 years ago

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/phonegap/build/issues/20#issuecomment-41151801 .

carlosrymer commented 10 years ago

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

goya commented 10 years ago

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 commented 9 years ago

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.