Merge pull request #1149 from tshradheya/codestyle-fixes

Improve code quality
This commit is contained in:
neslihanturan 2018-02-15 14:56:36 +03:00 committed by GitHub
commit afe964d359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 19 deletions

View file

@ -57,7 +57,6 @@ public class CommonsApplication extends Application {
public static final String FEEDBACK_EMAIL_SUBJECT = "Commons Android App (%s) Feedback";
private CommonsApplicationComponent component;
private RefWatcher refWatcher;
@ -136,9 +135,10 @@ public class CommonsApplication extends Application {
.subscribe(() -> {
Timber.d("All accounts have been removed");
//TODO: fix preference manager
defaultPrefs.edit().clear().commit();
applicationPrefs.edit().clear().commit();
applicationPrefs.edit().putBoolean("firstrun", false).apply();otherPrefs.edit().clear().commit();
defaultPrefs.edit().clear().apply();
applicationPrefs.edit().clear().apply();
applicationPrefs.edit().putBoolean("firstrun", false).apply();
otherPrefs.edit().clear().apply();
updateAllDatabases();
logoutListener.onLogoutComplete();

View file

@ -38,7 +38,7 @@ public class LatLng {
/**
* gets the latitude and longitude of a given non-null location
* @param location the non-null location of the user
* @return
* @return LatLng the Latitude and Longitude of a given location
*/
public static LatLng from(@NonNull Location location) {
return new LatLng(location.getLatitude(), location.getLongitude(), location.getAccuracy());
@ -48,13 +48,12 @@ public class LatLng {
* creates a hash code for the longitude and longitude
*/
public int hashCode() {
boolean var1 = true;
byte var2 = 1;
long var3 = Double.doubleToLongBits(this.latitude);
int var5 = 31 * var2 + (int)(var3 ^ var3 >>> 32);
var3 = Double.doubleToLongBits(this.longitude);
var5 = 31 * var5 + (int)(var3 ^ var3 >>> 32);
return var5;
byte var1 = 1;
long var2 = Double.doubleToLongBits(this.latitude);
int var3 = 31 * var1 + (int)(var2 ^ var2 >>> 32);
var2 = Double.doubleToLongBits(this.longitude);
var3 = 31 * var3 + (int)(var2 ^ var2 >>> 32);
return var3;
}
/**

View file

@ -49,18 +49,14 @@ public class FileUtils {
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
} else if (isDownloadsDocument(uri)) { // DownloadsProvider
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
} else if (isMediaDocument(uri)) { // MediaProvider
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];

View file

@ -15,6 +15,8 @@ public class ExecutorUtils {
}
};
public static Executor uiExecutor() { return uiExecutor; }
public static Executor uiExecutor() {
return uiExecutor;
}
}