Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 13    Views: 102

Alsadah
Aspiring developer
Profile
Posts: 17
Reg: Jan 19, 2011
KSA,Qatif
2,120
12/22/13 01:54 AM (10 years ago)

Problem with Rss plugin

Hi >>> All The problem : does not appear the description text fully in Rss plugin.. As shown in the attached picture in this link http://s14.postimg.org/wsst83z2p/photo.png And I have another Question : Can I determine the time and date of the news with a text description. Best Regards
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
12/22/13 10:20 AM (10 years ago)
Hi Alsadah. I sent you a PM. There is a problem with how ios 7 is displaying the cell menu. I am trying to find a fix and will update the plugin as soon as it is ready.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/22/13 10:25 AM (10 years ago)
@Red Dog, is this similar to the way that menu with image display the 2nd line descriptions? It is just there have been similar sounding problems there too.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/22/13 10:26 AM (10 years ago)
Are you self-hosted? If yes, please download the latest version of the RSS Plugin to see if that fixes the problem. After you update the plugin (via FTP or through control panel), remember to click on "refresh" to "install" that new version. You screen looks good, nice design! :-) Update -- Looks like Red Dog Barry is on the hunt for the solution. :-) -- Niraj
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/22/13 10:33 AM (10 years ago)
FOR iOS 7 I know the solution for menu with image plug-in is as shown below. This is probably a similar solution for this type of menu screen. In Xcode, look for this through the .m files in the RSS group (folder): Find this line: [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-8,0,0)]; For the Menu with Image plugin, I changed the values to this and it worked for me: [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-4,0,0)]; The numbers are in this order top - left - bottom - right. Find the "UIEdgeInsetsMake" phrase in the code and play with the numbers to truly understand how it makes a difference. Perhaps the same solution will solve your RSS Screen problem. I don't have a computer to try it right away. It's breakfast time! :-) -- Niraj
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/22/13 10:47 AM (10 years ago)
Hi Niraj I've noticed with this fix that it affects the 2nd line slightly different on IOS 7 compared to IOS 6 - I don't believe you can get both right. Does it need some extra logic to detect versions?
 
Alsadah
Aspiring developer
Profile
Posts: 17
Reg: Jan 19, 2011
KSA,Qatif
2,120
like
12/22/13 11:51 AM (10 years ago)
Hi ... For everyone Thank you very much for your quick response.. I will try Niraj's solution ... Until update this plugin as soon as possible ... Thanks for all. Alsadah
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/22/13 12:20 PM (10 years ago)
@Alan -- In general, here is the code to make it work for both iOS 6 and 7 if ( floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1 ) { // Do iOS 7 stuff here (even though it makes reference to 6_1, just go with it) } else { // Do less than iOS 7 (iOS 6 and 5 stuff here) }
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/22/13 01:10 PM (10 years ago)
Try this fix. Go into the BT_Plugins group folder Then into the bt_Screen_menuSimple group folder Then edit the BT_cellMenuList.m file Go to line #109, which has this code in it: [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-8,0,0)]; Change it to this: if ( floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1 ) { [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-4,0,0)]; } else { [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-8,0,0)]; } ---------- The RSS plugin is using code from the Menu Simple plugin to draw the cells for each row onto the screen. That particular plugin has not (yet) been updated for iOS 7. ---------- How did I find the fix? I knew it had to do with the "drawing of the cell" onto the screen. For iOS software, that means it has to do with the tableView, in particular the tableView:cellForRowAtIndexPath method. Inside that cellForRowAtIndexPath method, if the cell has not yet been created nor is there one to be reused, we must initialize a cell to be populated with data. The initialization of the cell is done with this line: cell = [[BT_cell_menuList alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; Notice the cell gets initialized by calling the method "initWithStyle". That is the one that sets up all kinds of things for the new cell, such as the background color, text alignment, etc. The "initWithStyle" also defines the spacing around the description text via the "setContentInset" method on the descriptionLabel. But how did I know the fix should be in the BT_cell_menuList.m and not in some other file within the actual RSS plugin group folder? Go back to the RSS plugin's file, Rd_simplerss.m file. It has a method for putting content into the cell in the tableView:cellForRowAtIndexPath method. Go to line #485 of that file. That is where the initWithStyle method is being invoked. Right-click on the "initWithStyle" words. Select "Jump to definition" menu item. That jumps you over to the bt_Screen_menuSimple plugin, in particular into the BT_cell_menuList.m, landing you at line #53 of that file. Then scroll-down to the section on "textView for description" block. ------------- Let us know if that works. -- Niraj
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
12/22/13 03:51 PM (10 years ago)
Looks like Santa came while I was out Christmas shopping; (Niraj). I remember changing the BT_cellMenuList.m settings for iOS 6. I guess I will have to keep a close eye on this with each update. This is something I cannot change in the plugin. Thank you Niraj, and "Happy Holidays" everyone.
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
12/24/13 08:48 AM (10 years ago)
@ Niraj I did not realize that BT_cellMenuList.h/m had been removed from BT_core in the new 3.0. I did see a copy of it in the simple menu plugin. I will add a copy, or the code, into my plugin and submit an update. Thank you again.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/24/13 09:15 AM (10 years ago)
@Barry -- leave it be, don't duplicate the code. Alternatively, you can be the foster parent of that plugin. That way you will still have control to make the necessary changes as BT evolves. -- Niraj
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
12/24/13 10:37 AM (10 years ago)
But if a user wants to use my rss plugin with a different menu than the simple menu, it will not work. I can not add the BT_cellmenuList back into the BT_core, so I must add it into my plugin. Right?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
12/24/13 11:00 AM (10 years ago)
I don't want to have duplicated code, it is too much maintenance. Yet we have it across most of the Menu plugins. Yikes, how to keep it all the same?! (Perhaps with coding techniques such as blocks, categories, sub-classing, etc.) We have a predicament as outlined in this forum post with bt_cellMenuList. The RSS Plugin is (accidentally) using the bt_simpleMenu Class from the Simple Menu plugin. Yet, that class has not been updated for iOS 7 in relation to spacing within a table cell. That is a good approach, reuse, don't duplicate. However, it causes a dependency on code that is not under the control of the RSS Plugin developer. Eventually, that Simple Menu plugin will get updated. In the meanwhile, the RSS Plugin users can include the Simple Menu plugin and make the necessary code change. A pain yes, and patience is essential. I know the BT Core is being slimmed-down with plugins taking up the slack. Yet, TableViews are fundamental to iOS apps. As such, the BT Core should provide core TableView capabilities that are tied to the Web Control Panel. One thing is guaranteed, the BT Core will indeed evolve. Plugin updates are at the mercy of the Developer and Darwin. My suggestion is for the BT Core to re-assimilate the bt_cellMenuList code. -- Niraj
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.