NappUI icon indicating copy to clipboard operation
NappUI copied to clipboard

Include Pegli's TIUIEx

Open wienke opened this issue 11 years ago • 14 comments

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.

wienke avatar Sep 09 '13 18:09 wienke

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

viezel avatar Sep 10 '13 06:09 viezel

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 [email protected]

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 avatar Sep 10 '13 09:09 wienke

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...

wienke avatar Oct 13 '13 11:10 wienke

:+1:

sindresorhus avatar Oct 31 '13 09:10 sindresorhus

Hi Mads,

Is this something to consider?

Cheers, Wienke

wienke avatar Nov 04 '13 07:11 wienke

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.

viezel avatar Nov 04 '13 07:11 viezel

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

sindresorhus avatar Nov 04 '13 08:11 sindresorhus

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

viezel avatar Nov 04 '13 08:11 viezel

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

2013/11/4 Mads Møller [email protected]

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 .

wienke avatar Nov 06 '13 13:11 wienke

No, sorry, I do JS, not ObjC.

sindresorhus avatar Nov 06 '13 13:11 sindresorhus

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 [email protected]

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 .

wienke avatar Nov 13 '13 15:11 wienke

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

viezel avatar Nov 13 '13 16:11 viezel

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 [email protected]

[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 .

wienke avatar Nov 15 '13 12:11 wienke

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.

dezinezync avatar Nov 16 '13 02:11 dezinezync