mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c1a4dcd547
7 changed files with 35 additions and 33 deletions
|
|
@ -44,29 +44,23 @@ import timber.log.Timber;
|
|||
)
|
||||
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 DBOpenHelper dbOpenHelper;
|
||||
@Inject @Named("default_preferences") SharedPreferences defaultPrefs;
|
||||
@Inject @Named("application_preferences") SharedPreferences applicationPrefs;
|
||||
@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 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
|
||||
*/
|
||||
|
|
@ -101,11 +95,22 @@ public class CommonsApplication extends DaggerApplication {
|
|||
}
|
||||
return LeakCanary.install(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helps in injecting dependency library Dagger
|
||||
* @return Dagger injector
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @return Dagger injector
|
||||
*/
|
||||
@Override
|
||||
protected AndroidInjector<? extends DaggerApplication> applicationInjector() {
|
||||
return injector();
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.Locale;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Represents LicenseList
|
||||
* Represents a list of Licenses
|
||||
*/
|
||||
public class LicenseList {
|
||||
private Map<String, License> licenses = new HashMap<>();
|
||||
|
|
@ -124,4 +124,4 @@ public class LicenseList {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 value Media value
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* @return Formatted URL
|
||||
* @return Encoded URL
|
||||
*/
|
||||
public static String urlEncode(String url) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -83,10 +83,7 @@ public class LogBuilder {
|
|||
LogTask logTask = new LogTask(mwApi);
|
||||
logTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs in false
|
||||
*/
|
||||
|
||||
public void log() {
|
||||
log(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
* @return Twice the angle
|
||||
* @return Inverse of haversine
|
||||
*/
|
||||
private static double arcHav(double 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
|
||||
* @return One-forth of square of sine function
|
||||
* @return Haversine of x
|
||||
*/
|
||||
private static double hav(double x) {
|
||||
double sinHalf = Math.sin(x * 0.5D);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
google()
|
||||
}
|
||||
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.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue