Skip to content

Commit

Permalink
correction mineure
Browse files Browse the repository at this point in the history
  • Loading branch information
Henley74 committed Mar 10, 2019
1 parent a1c2aba commit 4c6b133
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
20 changes: 3 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -27,27 +28,12 @@
</intent-filter>
</activity>
<activity android:name=".MapsActivity">
<intent-filter>
<action android:name="android.intent.action.MAPS" />

<category android:name="android.intent.category.MAIN" />
</intent-filter>
</activity>

<activity android:name=".ClosestBenchesActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ClosestBenchesActivity" ></activity>


<activity android:name=".RateBenchActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".RateBenchActivity" > </activity>


<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ public void onItemClick(AdapterView<?> parent, View view,

// Show Alert
double latBanc = listeBancs.get(position).getX();
double longBanc = listeBancs.get(position).getX();
Toast.makeText(getApplicationContext(),
double longBanc = listeBancs.get(position).getY();
/*Toast.makeText(getApplicationContext(),
"Ce banc est à :"+listeBancs.get(position).getX()+";"+ listeBancs.get(position).getY()+" et se trouve à "+getDistanceMeters(latLng.latitude, latLng.longitude, latBanc, longBanc) + " metres " , Toast.LENGTH_LONG)
.show();*/
Toast.makeText(getApplicationContext(),
"Votre banc se trouve à "+getDistanceMeters(latLng.latitude, latLng.longitude, latBanc, longBanc) + " metres " , Toast.LENGTH_LONG)
.show();

/* //afficher distance en coordonnées (ancienne version donc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ public void onClick(View v) {
buttonClosest.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(MainActivity.this, "You have already granted this permission!",
Toast.LENGTH_SHORT).show();
Intent i = new Intent(getApplicationContext(), ClosestBenchesActivity.class);
startActivity(i);

}
else {
requestLocationPermission();
}
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Wed Mar 06 15:32:11 CET 2019
#Sat Mar 09 23:40:32 CET 2019
>>>>>>>=0f53a58eb2fa1e48fb1dfe4e51b6430f7ab0ba74
sdk.dir=D\:\\Android\\Sdk
sdk.dir=C\:\\Users\\Henley\\AppData\\Local\\Android\\Sdk

0 comments on commit 4c6b133

Please sign in to comment.