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:
parent
36fa30aa06
commit
1730177525
@ -12,15 +12,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
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
|
||||
android:id="@+id/arrowView"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -10,6 +10,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
|
@ -5,9 +5,9 @@
|
||||
<string name="action_settings">Settings</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="title_activity_search">SearchActivity</string>
|
||||
<string name="title_activity_compass">CompassActivity</string>
|
||||
<string name="title_activity_found">FoundActivity</string>
|
||||
<string name="title_activity_search">Search</string>
|
||||
<string name="title_activity_compass">Compass</string>
|
||||
<string name="title_activity_found">Found</string>
|
||||
<string name="compass_button_text">Compass</string>
|
||||
<string name="scan_button_text">Scan</string>
|
||||
<string name="back_button_text">Back</string>
|
||||
|
@ -36,8 +36,8 @@ import android.widget.Toast;
|
||||
public class CompassActivity extends Activity implements SensorEventListener
|
||||
{
|
||||
final int SEARCH_PROXIMITY = 10;
|
||||
final int MOVING_AVERAGE_SIZE = 10;
|
||||
ImageView compassRoseView, arrowView, searchImageView;
|
||||
final int MOVING_AVERAGE_SIZE = 20;
|
||||
ImageView arrowView, searchImageView;
|
||||
Button backButton;
|
||||
SensorManager sManager;
|
||||
Sensor aSensor, mSensor;
|
||||
@ -62,7 +62,6 @@ public class CompassActivity extends Activity implements SensorEventListener
|
||||
restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation"));
|
||||
|
||||
arrowView = (ImageView)findViewById(R.id.arrowView);
|
||||
compassRoseView = (ImageView)findViewById(R.id.compassRoseView);
|
||||
searchImageView = (ImageView)findViewById(R.id.searchImageView);
|
||||
searchImageView.setVisibility(View.INVISIBLE);
|
||||
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
|
||||
compassRoseView.setRotation((long)(-1 * trueHeading));
|
||||
arrowView.setRotation((long)(-1 * rotateArrow));
|
||||
arrowView.setRotation((long)(-1 * finalRotation));
|
||||
|
||||
if(locationListener.getDistance() <= SEARCH_PROXIMITY)
|
||||
{
|
||||
arrowView.setVisibility(View.INVISIBLE);
|
||||
compassRoseView.setVisibility(View.INVISIBLE);
|
||||
searchImageView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrowView.setVisibility(View.VISIBLE);
|
||||
compassRoseView.setVisibility(View.VISIBLE);
|
||||
searchImageView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user