Posts

Showing posts from February, 2014

Partial HTML5 support in IE8 without shims or javascript

Image
Today, I stumbled across something strange in IE8 where it was able to identify and render HTML5 elements like <section> and <article> without the use of the HTML5-shiv or even without having to use document.createElement() . I figured it had to do with an "xmlns" attributed which accidently landed up on one of the <section> tags in my html. To illustrate my point, I'll use variations of the following HTML: <!DOCTYPE html> <html>   <head>     <style>       .outer,.middle,.inner {         padding: 20px;       }       .outer {         border: 1px solid black;         background: lightblue;       }       .middle {         border: 1px solid red;         background: yellow;       }       .inner {         border...

ListView/ExpandableListView randomly changes background colour on scroll/click/expand/collapse

Image
Working on the same android app which I posted about a couple of times earlier, I had this one feature I wanted to implement where I show a list of persons and highlight those from that list who have a birthday today. I tried a couple of different approaches to to the "highlight" the list items which had a birthday today for e.g: setting the background colour for those items, setting up a background icon for those, changing the text colour of the list item, and with all of these I faced 1 common problem: if I had to scroll the list or expand/collapse one item group (in case of ExpandableListView ), then it would end up highlighting some random items from the list, and if I continued that excercise, finally almost all items would get highlighted. Since I had used an ExpandableListView , my getGroupView method looked somewhat like this: @Override  public View getGroupView(int groupPosition, ..., ViewGroup parent) {   Person person = (Person) getGroup(groupPosition);  ...