mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Add hardcoded strings to strings.xml
This commit is contained in:
parent
1d559f577d
commit
5395967c86
4 changed files with 16 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package fr.free.nrw.commons.contributions;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
|
@ -21,6 +22,7 @@ import android.support.v4.content.ContextCompat;
|
|||
import android.support.v4.content.CursorLoader;
|
||||
import android.support.v4.content.Loader;
|
||||
import android.support.v4.app.LoaderManager;
|
||||
import android.support.v4.content.PermissionChecker;
|
||||
import android.support.v4.widget.CursorAdapter;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -451,8 +453,6 @@ public class ContributionsFragment
|
|||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
((ContributionsActivity)getActivity()).locationManager.addLocationListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -472,6 +472,9 @@ public class ContributionsFragment
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
((ContributionsActivity)getActivity()).locationManager.addLocationListener(this);
|
||||
|
||||
boolean isSettingsChanged = prefs.getBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED, false);
|
||||
prefs.edit().putBoolean(Prefs.IS_CONTRIBUTION_COUNT_CHANGED, false).apply();
|
||||
if (isSettingsChanged) {
|
||||
|
|
@ -489,7 +492,7 @@ public class ContributionsFragment
|
|||
// Display nearest location, first listen
|
||||
nearbyNoificationCardView.displayPermissionRequestButton(false);
|
||||
((ContributionsActivity)getActivity()).locationManager.registerLocationManager();
|
||||
Log.d("deneme","location manager registered, location manager:"+((ContributionsActivity)getActivity()).locationManager);
|
||||
Log.d("deneme","location manager registered*, location manager:"+((ContributionsActivity)getActivity()).locationManager);
|
||||
} else {
|
||||
// Display tab to see button, since permission is not granted and you have to grant it first
|
||||
nearbyNoificationCardView.displayPermissionRequestButton(true);
|
||||
|
|
@ -497,8 +500,10 @@ public class ContributionsFragment
|
|||
} else {
|
||||
nearbyNoificationCardView.displayPermissionRequestButton(false);
|
||||
((ContributionsActivity)getActivity()).locationManager.registerLocationManager();
|
||||
Log.d("deneme","location manager registered"+((ContributionsActivity)getActivity()).locationManager.isLocationPermissionGranted());
|
||||
}
|
||||
} else {
|
||||
// Hide nearby notification card view if related shared preferences is false
|
||||
nearbyNoificationCardView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
|
@ -532,6 +537,7 @@ public class ContributionsFragment
|
|||
nearbyNoificationCardView.updateContent (true, closestNearbyPlace);
|
||||
Log.d("deneme","placelist size > 0");
|
||||
} else {
|
||||
// Means that no close nearby place is found
|
||||
Log.d("deneme","placelist bos");
|
||||
nearbyNoificationCardView.updateContent (false, null);
|
||||
}
|
||||
|
|
@ -541,6 +547,8 @@ public class ContributionsFragment
|
|||
public void onDestroy() {
|
||||
compositeDisposable.clear();
|
||||
getChildFragmentManager().removeOnBackStackChangedListener(this);
|
||||
((ContributionsActivity)getActivity()).locationManager.unregisterLocationManager();
|
||||
((ContributionsActivity)getActivity()).locationManager.removeLocationListener(this);
|
||||
super.onDestroy();
|
||||
|
||||
if (isUploadServiceConnected) {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import android.location.LocationManager;
|
|||
import android.os.Bundle;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -253,6 +254,7 @@ public class LocationServiceManager implements LocationListener {
|
|||
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
Log.d("deneme","onLocationChanged is called");
|
||||
if (isBetterLocation(location, lastLocation)
|
||||
.equals(LocationChangeType.LOCATION_SIGNIFICANTLY_CHANGED)) {
|
||||
lastLocation = location;
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ public class NearbyNoificationCardView extends CardView{
|
|||
}
|
||||
|
||||
public void updateContent(boolean isClosestNearbyPlaceFound, Place place) {
|
||||
Log.d("deneme","called3");
|
||||
// Make progress bar invisible once data is ready
|
||||
progressBar.setVisibility(GONE);
|
||||
// And content views visible since they are ready
|
||||
|
|
@ -150,7 +151,7 @@ public class NearbyNoificationCardView extends CardView{
|
|||
notificationDistance.setText(place.distance);
|
||||
} else {
|
||||
notificationDistance.setText("");
|
||||
notificationTitle.setText("No nearby places found around you");
|
||||
notificationTitle.setText(R.string.no_close_nearby);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -358,5 +358,6 @@
|
|||
<string name="notifications">Notifications</string>
|
||||
<string name="display_nearby_notification">Display nearby notification</string>
|
||||
<string name="display_nearby_notification_summary">Display closest wikidata item needs an image, above contribution list</string>
|
||||
<string name="no_close_nearby">No nearby places found close to you</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue