Project

General

Profile

« Previous | Next » 

Revision 7ba38011

Added by Leszek Koltunski over 7 years ago

New app: Around The World (beginnings)

View differences:

src/main/java/org/distorted/examples/TableOfContents.java
34 34
import android.widget.AdapterView.OnItemClickListener;
35 35
import android.widget.SimpleAdapter;
36 36

  
37
import org.distorted.examples.aroundtheworld.AroundTheWorldActivity;
37 38
import org.distorted.examples.monalisa.MonaLisaActivity;
38 39
import org.distorted.examples.sink.SinkActivity;
39 40
import org.distorted.examples.fov.FOVActivity;
......
59 60
import org.distorted.examples.save.SaveActivity;
60 61
import org.distorted.examples.flag.FlagActivity;
61 62
import org.distorted.examples.wind.WindActivity;
63
import org.distorted.examples.aroundtheworld.AroundTheWorldActivity;
62 64

  
63 65
///////////////////////////////////////////////////////////////////////////////////////////////////
64 66

  
......
306 308
      activityMapping.put(i++, WindActivity.class);
307 309
   }
308 310

  
311
   {
312
      final Map<String, Object> item = new HashMap<>();
313
      item.put(ITEM_IMAGE, R.drawable.icon_example_aroundtheworld);
314
      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_aroundtheworld));
315
      item.put(ITEM_SUBTITLE, getText(R.string.example_aroundtheworld_subtitle));
316
      data.add(item);
317
      activityMapping.put(i++, AroundTheWorldActivity.class);
318
   }
319

  
309 320
   final SimpleAdapter dataAdapter = new SimpleAdapter(this, data, R.layout.toc_item, new String[] {ITEM_IMAGE, ITEM_TITLE, ITEM_SUBTITLE}, new int[] {R.id.Image, R.id.Title, R.id.SubTitle});
310 321
   setListAdapter(dataAdapter);  
311 322
      

Also available in: Unified diff