viezel / NappUI

A collection of extended functionality for the UI components of Titanium SDK
Other
121 stars 34 forks source link

Include Pegli's TIUIEx #16

Open wienke opened 11 years ago

wienke commented 11 years ago

I love the ImageView extension of Pegli. It adds some nice cropping functionalities.

https://github.com/pegli/TiUIEx/tree/master/mobile/iphone/Classes

It would be nice to incorporate this in a the NappUI module.

viezel commented 11 years ago

hi, have you testet this with iOS7? this part seems a bit hacky: https://github.com/pegli/TiUIEx/blob/master/mobile/iphone/Classes/ComObscureTiUIExImageView.m#L53

wienke commented 11 years ago

Didn't try it yet but will do later this week. I will also see if I can find a better solution as I think cropping should be a standard feature within appcelerator.

2013/9/10 Mads Møller notifications@github.com

hi, have you testet this with iOS7? this part seems a bit hacky: https://github.com/pegli/TiUIEx/blob/master/mobile/iphone/Classes/ComObscureTiUIExImageView.m#L53

— Reply to this email directly or view it on GitHubhttps://github.com/viezel/NappUI/issues/16#issuecomment-24137572 .

wienke commented 11 years ago

I tried to copy the code from https://github.com/pegli/TiUIEx/blob/master/mobile/iphone/Classes/ComObscureTiUIExImageView.m into the structure of NappUI in my fork (https://github.com/wienke/NappUI/blob/master/Classes/TiUIImageView%2BExtend.m) .

It compiles and runs but it seems if all images just keep their aspectfit content mode.

If I change the default contentmode in Titanium SDK (https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIImageView.m#L257) it works, also for iOS7.

I think I am close...

sindresorhus commented 11 years ago

:+1:

wienke commented 11 years ago

Hi Mads,

Is this something to consider?

Cheers, Wienke

viezel commented 11 years ago

sure - it does sound interesting. have you tried to fork Pegli repo and change the sdk to 3.1.3.GA and see if it still works? There are quite some change between these two.

sindresorhus commented 11 years ago

@viezel i did that last week and worked for me.

viezel commented 11 years ago

great then its "just" working the issues out? any of you guys care to do a PR ?

wienke commented 11 years ago

Would love to do this but my skills are not sufficient. Sindre: Are you up for this?

2013/11/4 Mads Møller notifications@github.com

great then its "just" working the issues out? any of you guys care to do a PR ?

— Reply to this email directly or view it on GitHubhttps://github.com/viezel/NappUI/issues/16#issuecomment-27668700 .

sindresorhus commented 11 years ago

No, sorry, I do JS, not ObjC.

wienke commented 10 years ago

This friday a friend of mine who knows Objective-C will have a look at it.

@Mads: one question. How to can I make sure that the ImageView header and main file are included in the project?

2013/11/6 Sindre Sorhus notifications@github.com

No, sorry, I do JS, not ObjC.

— Reply to this email directly or view it on GitHubhttps://github.com/viezel/NappUI/issues/16#issuecomment-27873636 .

viezel commented 10 years ago

screen shot 2013-11-13 at 17 42 32 Have a look here. If they are here, they are included in the project.

wienke commented 10 years ago

I think I am almost there. I included the files but when I try to build it gives me this error:

/Users/wienke/Library/Application Support/Titanium/mobilesdk/osx/3.2.0.v20131110134044/iphone/include/ImageLoader.h:9:9: 'ASIHTTPRequest.h' file not found

I included the ImageView in both metadata.json, dk.napp.ui.js and dk_napp_ui_js.

When I compile it with build.py it outputs:

The following build commands failed: CompileC build/nappui.build/Release-iphoneos/nappui.build/Objects-normal/armv7/TiUIImageView+Extended.o Classes/TiUIImageView+Extended.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler CompileC build/nappui.build/Release-iphoneos/nappui.build/Objects-normal/armv7s/TiUIImageView+Extended.o Classes/TiUIImageView+Extended.m normal armv7s objective-c com.apple.compilers.llvm.clang.1_0.compiler

Any ideas why it breaks on ImageLoader.h? Do I need to include more frameworks in the module.xconfig?

2013/11/13 Mads Møller notifications@github.com

[image: screen shot 2013-11-13 at 17 42 32]https://f.cloud.github.com/assets/312065/1533239/a1e9291a-4c82-11e3-8d2f-5e882b3f3b92.png Have a look here. If they are here, they are included in the project.

— Reply to this email directly or view it on GitHubhttps://github.com/viezel/NappUI/issues/16#issuecomment-28410692 .

dezinezync commented 10 years ago

To fix the above, modify your titanium.xcconfig file to include the following:

TITANIUM_SDK_VERSION = 3.2.0.v20131110134044

// 
// THESE SHOULD BE OK GENERALLY AS-IS
//
TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION)
TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include"
TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore"
TITANIUM_BASE_SDK3 = "$(TITANIUM_SDK)/iphone/include/ASI"
HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) $(TITANIUM_BASE_SDK3)

Then try building, if it fails, try deleting the build folder, and build again. It should work.

I ran into this issue just yesterday, however, couldn't get [ImageLoader sharedLoader] to work. Do let me know if it works for you.