1
0
mirror of https://github.com/bspeice/itcs4180 synced 2024-12-04 13:18:16 -05:00

Changed activity names and added padding to checkboxes. Removed compass

rose.
This commit is contained in:
tokugawa 2014-04-26 10:28:58 -04:00
parent 36fa30aa06
commit 1730177525
4 changed files with 7 additions and 19 deletions

View File

@ -12,15 +12,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" > android:layout_weight="1" >
<ImageView
android:id="@+id/compassRoseView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_weight="1"
android:src="@drawable/compass_rose_brosen" />
<ImageView <ImageView
android:id="@+id/arrowView" android:id="@+id/arrowView"
android:layout_width="fill_parent" android:layout_width="fill_parent"

View File

@ -10,6 +10,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:padding="5dp"
android:src="@drawable/ic_launcher" /> android:src="@drawable/ic_launcher" />
<TextView <TextView

View File

@ -5,9 +5,9 @@
<string name="action_settings">Settings</string> <string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string> <string name="hello_world">Hello world!</string>
<string name="endpoint">http://ec2-54-187-106-212.us-west-2.compute.amazonaws.com/</string> <string name="endpoint">http://ec2-54-187-106-212.us-west-2.compute.amazonaws.com/</string>
<string name="title_activity_search">SearchActivity</string> <string name="title_activity_search">Search</string>
<string name="title_activity_compass">CompassActivity</string> <string name="title_activity_compass">Compass</string>
<string name="title_activity_found">FoundActivity</string> <string name="title_activity_found">Found</string>
<string name="compass_button_text">Compass</string> <string name="compass_button_text">Compass</string>
<string name="scan_button_text">Scan</string> <string name="scan_button_text">Scan</string>
<string name="back_button_text">Back</string> <string name="back_button_text">Back</string>

View File

@ -36,8 +36,8 @@ import android.widget.Toast;
public class CompassActivity extends Activity implements SensorEventListener public class CompassActivity extends Activity implements SensorEventListener
{ {
final int SEARCH_PROXIMITY = 10; final int SEARCH_PROXIMITY = 10;
final int MOVING_AVERAGE_SIZE = 10; final int MOVING_AVERAGE_SIZE = 20;
ImageView compassRoseView, arrowView, searchImageView; ImageView arrowView, searchImageView;
Button backButton; Button backButton;
SensorManager sManager; SensorManager sManager;
Sensor aSensor, mSensor; Sensor aSensor, mSensor;
@ -62,7 +62,6 @@ public class CompassActivity extends Activity implements SensorEventListener
restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation")); restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation"));
arrowView = (ImageView)findViewById(R.id.arrowView); arrowView = (ImageView)findViewById(R.id.arrowView);
compassRoseView = (ImageView)findViewById(R.id.compassRoseView);
searchImageView = (ImageView)findViewById(R.id.searchImageView); searchImageView = (ImageView)findViewById(R.id.searchImageView);
searchImageView.setVisibility(View.INVISIBLE); searchImageView.setVisibility(View.INVISIBLE);
Bitmap b = BitmapAccess.loadBitmap(this, restLocation.getName()); Bitmap b = BitmapAccess.loadBitmap(this, restLocation.getName());
@ -174,19 +173,16 @@ public class CompassActivity extends Activity implements SensorEventListener
//Rotate compass and arrow. Rotations must be opposite to counteract device movement //Rotate compass and arrow. Rotations must be opposite to counteract device movement
compassRoseView.setRotation((long)(-1 * trueHeading)); arrowView.setRotation((long)(-1 * finalRotation));
arrowView.setRotation((long)(-1 * rotateArrow));
if(locationListener.getDistance() <= SEARCH_PROXIMITY) if(locationListener.getDistance() <= SEARCH_PROXIMITY)
{ {
arrowView.setVisibility(View.INVISIBLE); arrowView.setVisibility(View.INVISIBLE);
compassRoseView.setVisibility(View.INVISIBLE);
searchImageView.setVisibility(View.VISIBLE); searchImageView.setVisibility(View.VISIBLE);
} }
else else
{ {
arrowView.setVisibility(View.VISIBLE); arrowView.setVisibility(View.VISIBLE);
compassRoseView.setVisibility(View.VISIBLE);
searchImageView.setVisibility(View.INVISIBLE); searchImageView.setVisibility(View.INVISIBLE);
} }
} }