Skip to content

Commit

Permalink
update the demo to work with the new version of the library that uses…
Browse files Browse the repository at this point in the history
… listeners

stop tracking and/or ignore bin/gen/.idea and a few more project files
  • Loading branch information
gnyman committed Jun 6, 2012
1 parent 9b3fabe commit c9b2c16
Show file tree
Hide file tree
Showing 20 changed files with 303 additions and 207 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ bin/com/walkbase/demoapp/WalkbaseDemoActivity$2.class
bin/com/walkbase/demoapp/WalkbaseDemoActivity$WalkbaseReceiver.class

bin/com/walkbase/demoapp/WalkbaseDemoActivity$WalkbaseReceiver.class
WalkbaseDemo.iml
WalkbaseDemo.eml
.idea
out
project.properties
gen
3 changes: 2 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".WalkbaseDemoActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Binary file removed bin/Footprint-Library-Demo.apk
Binary file not shown.
Binary file removed bin/WalkbaseDemo.apk
Binary file not shown.
Binary file removed bin/classes.dex
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R$attr.class
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R$drawable.class
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R$id.class
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R$layout.class
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R$string.class
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/R.class
Binary file not shown.
Binary file not shown.
Binary file removed bin/com/walkbase/demoapp/WalkbaseDemoActivity.class
Binary file not shown.
Binary file removed bin/resources.ap_
Binary file not shown.
11 changes: 0 additions & 11 deletions default.properties

This file was deleted.

30 changes: 0 additions & 30 deletions gen/com/walkbase/demoapp/R.java

This file was deleted.

30 changes: 24 additions & 6 deletions res/layout/list_item.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="16sp" >
</TextView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<TextView
android:id="@+id/locationName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" android:textSize="15pt"/>

<TextView
android:id="@+id/locationDetails"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />

</LinearLayout>

</LinearLayout>
3 changes: 1 addition & 2 deletions res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout android:layout_height="wrap_content" android:id="@+id/buttonHolder" android:background="#d1d1d1" android:layout_width="fill_parent">
<Button android:text="Scan" android:layout_height="wrap_content"
<Button android:text="Get recommendations" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:id="@+id/scanButton" android:layout_toRightOf="@+id/getListButton" android:layout_centerVertical="true"></Button>
<Button android:text="Get list of POI:s" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/getListButton" android:layout_centerVertical="true"></Button>
</RelativeLayout>

<ListView android:id="@+id/locationsList"
android:layout_width="fill_parent" android:smoothScrollbar="true"
android:cacheColorHint="#273544" android:background="#273544"
android:layout_height="fill_parent" android:layout_below="@+id/buttonHolder"></ListView>

</RelativeLayout>
38 changes: 38 additions & 0 deletions src/com/walkbase/demoapp/ListItemAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.walkbase.demoapp;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.walkbase.positioning.data.WalkbaseLocation;

public class ListItemAdapter extends ArrayAdapter<WalkbaseLocation> {
private final Context context;
private final List<WalkbaseLocation> objects;



public ListItemAdapter(Context context, int textViewResourceId, List<WalkbaseLocation> objects) {
super(context, textViewResourceId, objects);
this.context = context;
this.objects = objects;
}

public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowView = inflater.inflate(R.layout.list_item, parent, false);
TextView textView = (TextView) rowView.findViewById(R.id.locationName);
TextView detailView = (TextView) rowView.findViewById(R.id.locationDetails);
WalkbaseLocation o = this.objects.get(position);
textView.setText(o.locationName);
detailView.setText("Details:\nid:"+o.locationId+" listId:" + o.listId+" pos:"+o.latitude+","+o.longitude+"+/-"+o.accuracy+" score:"+o.score+" extra:"+o.extra);
return rowView;
}
}
Loading

0 comments on commit c9b2c16

Please sign in to comment.