Merge remote-tracking branch 'origin/master'

This commit is contained in:
prajgov 2017-12-22 11:59:28 +05:30
commit c1a4dcd547
7 changed files with 35 additions and 33 deletions

View file

@ -44,29 +44,23 @@ import timber.log.Timber;
) )
public class CommonsApplication extends DaggerApplication { public class CommonsApplication extends DaggerApplication {
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app";
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
public static final String LOGS_PRIVATE_EMAIL = "commons-app-android-private@googlegroups.com";
public static final String FEEDBACK_EMAIL_SUBJECT = "Commons Android App (%s) Feedback";
@Inject SessionManager sessionManager; @Inject SessionManager sessionManager;
@Inject DBOpenHelper dbOpenHelper; @Inject DBOpenHelper dbOpenHelper;
@Inject @Named("default_preferences") SharedPreferences defaultPrefs; @Inject @Named("default_preferences") SharedPreferences defaultPrefs;
@Inject @Named("application_preferences") SharedPreferences applicationPrefs; @Inject @Named("application_preferences") SharedPreferences applicationPrefs;
@Inject @Named("prefs") SharedPreferences otherPrefs; @Inject @Named("prefs") SharedPreferences otherPrefs;
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using Android Commons app";
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
public static final String LOGS_PRIVATE_EMAIL = "commons-app-android-private@googlegroups.com";
public static final String FEEDBACK_EMAIL_SUBJECT = "Commons Android App (%s) Feedback";
private CommonsApplicationComponent component; private CommonsApplicationComponent component;
private RefWatcher refWatcher; private RefWatcher refWatcher;
/**
* Provides a way to get member refWatcher
*
* @param context Application context
* @return application member refWatcher
*/
public static RefWatcher getRefWatcher(Context context) {
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
return application.refWatcher;
}
/** /**
* Used to declare and initialize various components and dependencies * Used to declare and initialize various components and dependencies
*/ */
@ -102,6 +96,17 @@ public class CommonsApplication extends DaggerApplication {
return LeakCanary.install(this); return LeakCanary.install(this);
} }
/**
* Provides a way to get member refWatcher
*
* @param context Application context
* @return application member refWatcher
*/
public static RefWatcher getRefWatcher(Context context) {
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
return application.refWatcher;
}
/** /**
* Helps in injecting dependency library Dagger * Helps in injecting dependency library Dagger
* @return Dagger injector * @return Dagger injector

View file

@ -14,7 +14,7 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
/** /**
* Represents LicenseList * Represents a list of Licenses
*/ */
public class LicenseList { public class LicenseList {
private Map<String, License> licenses = new HashMap<>(); private Map<String, License> licenses = new HashMap<>();

View file

@ -119,7 +119,7 @@ public class Media implements Parcelable {
} }
/** /**
* Modifies tag of media * Modifies( or creates a) tag of media
* @param key Media key * @param key Media key
* @param value Media value * @param value Media value
*/ */

View file

@ -50,9 +50,9 @@ public class Utils {
} }
/** /**
* Encodes given URL in UTF-8 format * URL Encode an URL in UTF-8 format
* @param url Unformatted URL * @param url Unformatted URL
* @return Formatted URL * @return Encoded URL
*/ */
public static String urlEncode(String url) { public static String urlEncode(String url) {
try { try {

View file

@ -84,9 +84,6 @@ public class LogBuilder {
logTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, this); logTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, this);
} }
/**
* Logs in false
*/
public void log() { public void log() {
log(false); log(false);
} }

View file

@ -64,9 +64,9 @@ public class LengthUtils {
} }
/** /**
* Gets twice the amount of arc sine of (x)^(1/2) * Computes inverse of haversine
* @param x Angle in radian * @param x Angle in radian
* @return Twice the angle * @return Inverse of haversine
*/ */
private static double arcHav(double x) { private static double arcHav(double x) {
return 2.0D * Math.asin(Math.sqrt(x)); return 2.0D * Math.asin(Math.sqrt(x));
@ -84,9 +84,9 @@ public class LengthUtils {
} }
/** /**
* Computes square sine function for half of the value entered * Computes haversine
* @param x Angle in radians * @param x Angle in radians
* @return One-forth of square of sine function * @return Haversine of x
*/ */
private static double hav(double x) { private static double hav(double x) {
double sinHalf = Math.sin(x * 0.5D); double sinHalf = Math.sin(x * 0.5D);

View file

@ -7,7 +7,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.1' classpath "com.android.tools.build:gradle:${project.gradleVersion}"
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1' classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.1' classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"