diff --git a/app/build.gradle b/app/build.gradle
index 480916ee8..6f225dc2f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -18,7 +18,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.1'
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation 'info.debatty:java-string-similarity:0.24'
- implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.2.1@aar'){
+ implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.4.1@aar'){
transitive=true
}
@@ -26,6 +26,7 @@ dependencies {
implementation "com.android.support:support-v4:$SUPPORT_LIB_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIB_VERSION"
implementation "com.android.support:design:$SUPPORT_LIB_VERSION"
+ implementation "com.android.support:customtabs:$SUPPORT_LIB_VERSION"
implementation "com.android.support:cardview-v7:$SUPPORT_LIB_VERSION"
@@ -48,7 +49,7 @@ dependencies {
compile 'com.facebook.stetho:stetho:1.5.0'
testCompile 'junit:junit:4.12'
- testCompile 'org.robolectric:robolectric:3.4'
+ testCompile 'org.robolectric:robolectric:3.7.1'
testCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
@@ -77,7 +78,7 @@ dependencies {
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
testImplementation 'junit:junit:4.12'
- testImplementation 'org.robolectric:robolectric:3.4'
+ testImplementation 'org.robolectric:robolectric:3.7.1'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.8.1'
diff --git a/app/src/main/java/fr/free/nrw/commons/AboutActivity.java b/app/src/main/java/fr/free/nrw/commons/AboutActivity.java
index 54e12fcf2..8516eb593 100644
--- a/app/src/main/java/fr/free/nrw/commons/AboutActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/AboutActivity.java
@@ -3,6 +3,8 @@ package fr.free.nrw.commons;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.support.customtabs.CustomTabsIntent;
+import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.TextView;
@@ -47,28 +49,28 @@ public class AboutActivity extends NavigationBaseActivity {
intent.setPackage("com.facebook.katana");
startActivity(intent);
} catch (Exception e) {
- startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/" + "1921335171459985")));
+ Utils.handleWebUrl(this,Uri.parse("https://www.facebook.com/" + "1921335171459985"));
}
-
}
@OnClick(R.id.github_launch_icon)
public void launchGithub(View view) {
-
- Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/commons-app/apps-android-commons\\"));
- startActivity(browserIntent);
+ Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\"));
}
@OnClick(R.id.website_launch_icon)
public void launchWebsite(View view) {
-
- Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://commons-app.github.io/\\"));
- startActivity(browserIntent);
+ Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\"));
}
- @OnClick(R.id.about_rate_us)
- public void rateApp(View view) {
-
- Utils.rateApp(this);
+ @OnClick(R.id.about_credits)
+ public void launchCredits(View view) {
+ Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/blob/master/CREDITS/\\"));
}
+
+ @OnClick(R.id.about_privacy_policy)
+ public void launchPrivacyPolicy(View view) {
+ Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
+ }
+
}
\ No newline at end of file
diff --git a/app/src/main/java/fr/free/nrw/commons/Utils.java b/app/src/main/java/fr/free/nrw/commons/Utils.java
index 48a8ce739..1044a7c17 100644
--- a/app/src/main/java/fr/free/nrw/commons/Utils.java
+++ b/app/src/main/java/fr/free/nrw/commons/Utils.java
@@ -5,6 +5,8 @@ import android.content.Intent;
import android.net.Uri;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
+import android.support.customtabs.CustomTabsIntent;
+import android.support.v4.content.ContextCompat;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils;
@@ -13,6 +15,7 @@ import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
+import java.net.URL;
import java.net.URLEncoder;
import java.util.Locale;
import java.util.regex.Matcher;
@@ -172,4 +175,15 @@ public class Utils {
}
return ;
}
-}
\ No newline at end of file
+
+ public static void handleWebUrl(Context context,Uri url){
+ CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
+ builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
+ builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor));
+ builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ CustomTabsIntent customTabsIntent = builder.build();
+ customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ customTabsIntent.launchUrl(context, url);
+ }
+
+}
diff --git a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java
index b771e8c1d..cbdff2e0b 100644
--- a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java
@@ -72,6 +72,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
@BindView(R.id.loginTwoFactor) EditText twoFactorEdit;
@BindView(R.id.error_message_container) ViewGroup errorMessageContainer;
@BindView(R.id.error_message) TextView errorMessage;
+ @BindView(R.id.login_credentials) TextView loginCredentials;
@BindView(R.id.two_factor_container)TextInputLayout twoFactorContainer;
ProgressDialog progressDialog;
private AppCompatDelegate delegate;
@@ -112,6 +113,12 @@ public class LoginActivity extends AccountAuthenticatorActivity {
loginButton.setOnClickListener(view -> performLogin());
signupButton.setOnClickListener(view -> signUp());
+
+ if(BuildConfig.FLAVOR == "beta"){
+ loginCredentials.setText(getString(R.string.login_credential));
+ } else {
+ loginCredentials.setVisibility(View.GONE);
+ }
}
diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyInfoDialog.java b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyInfoDialog.java
index b383fd9b9..69fce546c 100644
--- a/app/src/main/java/fr/free/nrw/commons/nearby/NearbyInfoDialog.java
+++ b/app/src/main/java/fr/free/nrw/commons/nearby/NearbyInfoDialog.java
@@ -3,7 +3,9 @@ package fr.free.nrw.commons.nearby;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.support.customtabs.CustomTabsIntent;
import android.support.v4.app.FragmentActivity;
+import android.support.v4.content.ContextCompat;
import android.support.v7.widget.PopupMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
@@ -17,6 +19,7 @@ import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import fr.free.nrw.commons.R;
+import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.ui.widget.OverlayDialog;
import fr.free.nrw.commons.utils.DialogUtil;
@@ -141,8 +144,7 @@ public class NearbyInfoDialog extends OverlayDialog {
}
private void openWebView(Uri link) {
- Intent browserIntent = new Intent(Intent.ACTION_VIEW, link);
- startActivity(browserIntent);
+ Utils.handleWebUrl(getContext(),link);
}
@OnClick(R.id.emptyLayout)
diff --git a/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java b/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java
index dc9d733f4..cdb9e97d3 100644
--- a/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/notification/NotificationActivity.java
@@ -5,11 +5,13 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
+import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.pedrogomez.renderers.RVRendererAdapter;
+import java.util.Collections;
import java.util.List;
import javax.inject.Inject;
@@ -45,8 +47,9 @@ public class NotificationActivity extends NavigationBaseActivity {
}
private void initListView() {
- recyclerView = findViewById(R.id.listView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
+ DividerItemDecoration itemDecor = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
+ recyclerView.addItemDecoration(itemDecor);
addNotifications();
}
@@ -58,6 +61,7 @@ public class NotificationActivity extends NavigationBaseActivity {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(notificationList -> {
+ Collections.reverse(notificationList);
Timber.d("Number of notifications is %d", notificationList.size());
setAdapter(notificationList);
}, throwable -> Timber.e(throwable, "Error occurred while loading notifications"));
diff --git a/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java b/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java
index a2c85d50b..81f56adea 100644
--- a/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java
+++ b/app/src/main/java/fr/free/nrw/commons/theme/NavigationBaseActivity.java
@@ -121,8 +121,9 @@ public abstract class NavigationBaseActivity extends BaseActivity
return true;
case R.id.action_feedback:
drawerLayout.closeDrawer(navigationView);
- Intent feedbackIntent = new Intent(Intent.ACTION_SEND);
+ Intent feedbackIntent = new Intent(Intent.ACTION_SENDTO);
feedbackIntent.setType("message/rfc822");
+ feedbackIntent.setData(Uri.parse("mailto:"));
feedbackIntent.putExtra(Intent.EXTRA_EMAIL,
new String[]{CommonsApplication.FEEDBACK_EMAIL});
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT,
diff --git a/app/src/main/res/layout-land/activity_login.xml b/app/src/main/res/layout-land/activity_login.xml
index 9ecaf9855..a87084f66 100644
--- a/app/src/main/res/layout-land/activity_login.xml
+++ b/app/src/main/res/layout-land/activity_login.xml
@@ -13,12 +13,12 @@
@@ -40,11 +40,26 @@
android:textColor="@android:color/white"
android:textSize="@dimen/heading_text_size" />
+
+
@@ -56,6 +71,7 @@
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap"
+ android:gravity="center"
android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap"
android:textColor="@color/secondaryDarkColor"
@@ -149,8 +165,8 @@
+ android:layout_marginBottom="@dimen/standard_gap"
+ android:text="@string/about_privacy_policy" />
@@ -188,19 +204,19 @@
+ android:elevation="8dp"
+ app:srcCompat="@drawable/blue_rinse_circle"
+ tools:ignore="UnusedAttribute" />
+ app:srcCompat="@drawable/commons_logo_large"
+ tools:ignore="UnusedAttribute" />
diff --git a/app/src/main/res/layout-land/welcome_do_upload.xml b/app/src/main/res/layout-land/welcome_do_upload.xml
index 1f02c3183..d96b00675 100644
--- a/app/src/main/res/layout-land/welcome_do_upload.xml
+++ b/app/src/main/res/layout-land/welcome_do_upload.xml
@@ -73,16 +73,91 @@
android:gravity="center_horizontal"
android:textColor="@android:color/white"/>
-
+
+
+
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-land/welcome_dont_upload.xml b/app/src/main/res/layout-land/welcome_dont_upload.xml
index 1d4d0db80..d950ffc1d 100644
--- a/app/src/main/res/layout-land/welcome_dont_upload.xml
+++ b/app/src/main/res/layout-land/welcome_dont_upload.xml
@@ -55,16 +55,90 @@
android:gravity="center_horizontal"
android:textColor="@android:color/white"/>
-
+
+
+
+
+
+
+
+
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-land/welcome_image_details.xml b/app/src/main/res/layout-land/welcome_image_details.xml
index d112292a1..79f48829b 100644
--- a/app/src/main/res/layout-land/welcome_image_details.xml
+++ b/app/src/main/res/layout-land/welcome_image_details.xml
@@ -38,16 +38,89 @@
android:gravity="center_horizontal"
android:textColor="@android:color/white"/>
-
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout-xlarge/activity_login.xml b/app/src/main/res/layout-xlarge/activity_login.xml
index 32cd47451..475963b44 100644
--- a/app/src/main/res/layout-xlarge/activity_login.xml
+++ b/app/src/main/res/layout-xlarge/activity_login.xml
@@ -13,12 +13,12 @@
@@ -40,6 +40,21 @@
android:textColor="@android:color/white"
android:textSize="@dimen/heading_text_size" />
+
+
+ android:layout_marginBottom="@dimen/standard_gap"
+ android:text="@string/about_privacy_policy" />
@@ -188,8 +204,8 @@
@@ -198,9 +214,9 @@
android:layout_height="42dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
- tools:ignore="UnusedAttribute"
android:elevation="8dp"
- app:srcCompat="@drawable/commons_logo_large" />
+ app:srcCompat="@drawable/commons_logo_large"
+ tools:ignore="UnusedAttribute" />
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
index 4286371a9..892da2fa6 100644
--- a/app/src/main/res/layout/activity_about.xml
+++ b/app/src/main/res/layout/activity_about.xml
@@ -5,102 +5,131 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+ android:layout_height="wrap_content">
-
+ android:layout_height="wrap_content">
-
-
-
-
-
-
-
-
-
-
-
-
+ android:layout_marginLeft="@dimen/activity_margin_horizontal"
+ android:layout_marginRight="@dimen/activity_margin_horizontal"
+ android:layout_marginStart="@dimen/activity_margin_horizontal"
+ android:layout_marginTop="@dimen/activity_margin_vertical"
+ android:gravity="center"
+ android:orientation="vertical">
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:contentDescription="@string/commons_logo"
+ android:src="@drawable/ic_launcher" />
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -112,6 +141,7 @@
android:gravity="center"
android:textColor="@color/primaryColor"
android:text="@string/about_rate_us" />
+
-
+
+
+ app:menu="@menu/drawer" />
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml
index 15d4c099d..c9ac545cb 100644
--- a/app/src/main/res/layout/activity_login.xml
+++ b/app/src/main/res/layout/activity_login.xml
@@ -44,11 +44,27 @@
android:textColor="@android:color/white"
android:textSize="@dimen/heading_text_size" />
+
+
+
@@ -60,6 +76,7 @@
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap"
+ android:gravity="center"
android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap"
android:textColor="@color/secondaryDarkColor"
diff --git a/app/src/main/res/layout/welcome_do_upload.xml b/app/src/main/res/layout/welcome_do_upload.xml
index b2befbf12..fab6452df 100644
--- a/app/src/main/res/layout/welcome_do_upload.xml
+++ b/app/src/main/res/layout/welcome_do_upload.xml
@@ -67,15 +67,95 @@
android:textColor="@android:color/white"
/>
-
+ android:gravity="center"
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/welcome_dont_upload.xml b/app/src/main/res/layout/welcome_dont_upload.xml
index 8d352547e..d819bc035 100644
--- a/app/src/main/res/layout/welcome_dont_upload.xml
+++ b/app/src/main/res/layout/welcome_dont_upload.xml
@@ -48,15 +48,87 @@
android:textColor="@android:color/white"
/>
-
+ android:gravity="center"
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/welcome_image_details.xml b/app/src/main/res/layout/welcome_image_details.xml
index 0b4618b37..e38eb5979 100644
--- a/app/src/main/res/layout/welcome_image_details.xml
+++ b/app/src/main/res/layout/welcome_image_details.xml
@@ -32,15 +32,101 @@
android:textColor="@android:color/white"
/>
-
+ android:gravity="center"
+ android:orientation="horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/drawer.xml b/app/src/main/res/menu/drawer.xml
index 83c1bf0ad..f41d1c43a 100644
--- a/app/src/main/res/menu/drawer.xml
+++ b/app/src/main/res/menu/drawer.xml
@@ -10,6 +10,11 @@
android:icon="@drawable/ic_location_black_24dp"
android:title="@string/navigation_item_nearby"/>
+
+
-
-
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 98faa8de5..7c3feaae1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,9 +1,11 @@
Commons
+ •
Settings
Username
Password
+ Log in to your Commons Beta account
Log in
Sign up
Logging in
@@ -77,8 +79,8 @@
The Wikimedia Commons app is an open-source app created and maintained by grantees and volunteers of the Wikimedia community. The Wikimedia Foundation is not involved in the creation, development, or maintenance of the app.
Wikimedia Commons
Create a new <a href=\"https://github.com/commons-app/apps-android-commons/issues\">GitHub issue</a> for bug reports and suggestions.
- <a href=\"https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\">Privacy policy</a>
- <a href=\"https://github.com/commons-app/apps-android-commons/blob/master/CREDITS\">Credits</a>
+ Privacy policy
+ Credits
About
Send Feedback (via Email)
No email client installed
@@ -119,11 +121,20 @@
Wikimedia Commons hosts most of the images that are used in Wikipedia.
Your images help educate people around the world!
Please upload pictures that are taken or created entirely by yourself:
- - Natural objects (flowers, animals, mountains)\n- Useful objects (bicycles, train stations)\n- Famous people (your mayor, Olympic athletes you met)
+ Natural objects (flowers, animals, mountains)\n• Useful objects (bicycles, train stations)\n• Famous people (your mayor, Olympic athletes you met)
+ Natural objects (flowers, animals, mountains)
+ Useful objects (bicycles, train stations)
+ Famous people (your mayor, Olympic athletes you met)
Please do NOT upload:
- Selfies or pictures of your friends\n- Pictures you downloaded from the Internet\n- Screenshots of proprietary apps
+ Selfies or pictures of your friends
+ Pictures you downloaded from the Internet
+ Screenshots of proprietary apps
Example upload:
- Title: Sydney Opera House\n- Description: Sydney Opera House as viewed from across the bay\n- Categories: Sydney Opera House from the west, Sydney Opera House remote views
+ Title: Sydney Opera House
+ Description: Sydney Opera House as viewed from across the bay
+ Categories: Sydney Opera House from the west, Sydney Opera House remote views
Contribute your images. Help Wikipedia articles come to life!
Images on Wikipedia come from Wikimedia Commons.
Your images help educate people around the world.