Yalantis / Phoenix

Phoenix Pull-to-Refresh
https://yalantis.com/
Apache License 2.0
4.02k stars 920 forks source link

How are you supposed to change the images, sun, buildings, sky? #27

Closed kiaanpillay closed 8 years ago

kiaanpillay commented 8 years ago

Hi,

This may be a very dumb question but I don't understand where we are supposed to change the images to customise it with our own?

kiaanpillay commented 8 years ago

I have imported the project with Gradle and it is working just not with my images

shliama commented 8 years ago

@kiaanpillay So you've already included the library as a module. Now you need to replace our images (sun.png , sky.png , buildings.png ) with your own - for all screen densities of course. And it should do the job.

ErelOzcakirlar commented 8 years ago

@shliama I already tried this today. But gradle always updating library to use default resources. So if you make these drawables customizable programmatically. We will be very appreciate that :)

kiaanpillay commented 8 years ago

Hi, I have the same problem. Gradle updates the resources ever time I run it. Not sure what to do?

ErelOzcakirlar commented 8 years ago

@kiaanpillay I used this library man. It is real pain to implement that too. But I finally made what I want. After spend whole day...

kiaanpillay commented 8 years ago

I tried to get that lib working with no luck. Yalantis is so simple I love it, I just wish I could change the images? Any help?

shliama commented 8 years ago

@kiaanpillay Sure, I'll try to implement it soon but I cannot give you any ETA on this.

But still I cannot understand how "Gradle updates the resources ever time I run it" is possible? :)

So, you have included library like a module (not like this compile 'com.yalantis:phoenix:1.2.3') but just folders with files etc, and added it to your settings.gradle (e.g. include ':app', ':libraries:phoenix') Then you have replaced images in the library res folders with yours (names the same of course) and it won't work for you?

kiaanpillay commented 8 years ago

I did it like this compile compile 'com.yalantis:phoenix:1.2.3'

shliama commented 8 years ago

@kiaanpillay So how do you even replaced images? Please just follow my answer and it'll work.

kiaanpillay commented 8 years ago

I'm not sure what you mean? Must I just copy it and add it to the settings.gradle? Please give clear steps, I'm sorry if I'm being ignorant. Im just really struggling, I really appreciate the help

shliama commented 8 years ago

To import the library to Android Studio:

  1. Open your project in Android Studio
  2. Download the library (using Git, or a zip archive to unzip)
  3. Create a folder libraries in your project
  4. Copy and paste the Phoenix library folder to this libraries folder (optionally rename it to e.g. PhoenixLibrary, you might want to include some more libraries later)
  5. On the root of your project directory create/modify the settings.gradle file. It should contain something like the following:
include ':app', ':libraries:PhoenixLibrary'
  1. Edit your project's build.gradle to add this in the "dependencies" section:
dependencies {
//...
    compile project(':libraries:PhoenixLibrary')
}

Sync your project - boom! Now you have Phoenix library included. But not like .jar - whole source code, so you are able to modify it (and replace images too).

P.S. If you still have problems - check this SO answer http://stackoverflow.com/a/21170626/4903519

kiaanpillay commented 8 years ago

Perfect! Thank you so much! I think it would be best if you made it customizable from the gradle build, just as a suggestion. But thank you so much!