Merge branch 'master' into Fixes-#1198

This commit is contained in:
Vivek Maskara 2018-03-16 18:40:41 +05:30 committed by GitHub
commit ff54d03aeb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 1641 additions and 603 deletions

View file

@ -33,3 +33,7 @@ You can find this information by going to the navigation drawer in the app and t
**Screen-shots:** **Screen-shots:**
Can be created by pressing the Volume Down and Power Button at the same time on Android 4.0 and higher. Can be created by pressing the Volume Down and Power Button at the same time on Android 4.0 and higher.
**Would you like to work on the issue?**
Please let us know whether you want to fix the issue by yourself. If not, anyone can get the issue assigned to them.

View file

@ -4,6 +4,12 @@ Fixes #{GitHub issue number}
{Describe the changes made and why they were made.} {Describe the changes made and why they were made.}
## Tests performed
Tested on {API level & name of device/emulator}, with {build variant, e.g. ProdDebug}.
{Please test your PR at least once before submitting.}
## Screenshots showing what changed ## Screenshots showing what changed
{Only for user interface changes, otherwise remove this section. See [how to take a screenshot](https://android.stackexchange.com/questions/1759/how-to-take-a-screenshot-with-an-android-device)} {Only for user interface changes, otherwise remove this section. See [how to take a screenshot](https://android.stackexchange.com/questions/1759/how-to-take-a-screenshot-with-an-android-device)}

View file

@ -48,8 +48,11 @@ dependencies {
compile 'com.facebook.fresco:fresco:1.3.0' compile 'com.facebook.fresco:fresco:1.3.0'
compile 'com.facebook.stetho:stetho:1.5.0' compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.android.support:multidex:1.0.3'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.7.1' testCompile 'org.robolectric:robolectric:3.7.1'
testCompile "org.robolectric:multidex:3.4.2"
testCompile 'com.squareup.okhttp3:mockwebserver:3.8.1' testCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.8.1' androidTestCompile 'com.squareup.okhttp3:mockwebserver:3.8.1'
@ -94,6 +97,9 @@ dependencies {
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION" implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION" kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION" kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION"
compile 'com.borjabravo:readmoretextview:2.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
} }
android { android {
@ -149,6 +155,7 @@ android {
buildConfigField "String", "EVENTLOG_WIKI", "\"commonswiki\"" buildConfigField "String", "EVENTLOG_WIKI", "\"commonswiki\""
buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\"" buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\""
buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes\"" buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes\""
buildConfigField "String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.org/wiki/Special:PasswordReset\""
dimension 'tier' dimension 'tier'
} }
@ -163,6 +170,7 @@ android {
buildConfigField "String", "EVENTLOG_WIKI", "\"commonswiki\"" buildConfigField "String", "EVENTLOG_WIKI", "\"commonswiki\""
buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\"" buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\""
buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Main_Page&welcome=yes\"" buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Main_Page&welcome=yes\""
buildConfigField "String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.beta.wmflabs.org/wiki/Special:PasswordReset\""
dimension 'tier' dimension 'tier'
} }
} }

View file

@ -5,6 +5,7 @@ import android.preference.PreferenceManager;
import android.support.test.espresso.Espresso; import android.support.test.espresso.Espresso;
import android.support.test.espresso.action.ViewActions; import android.support.test.espresso.action.ViewActions;
import android.support.test.espresso.assertion.ViewAssertions; import android.support.test.espresso.assertion.ViewAssertions;
import android.support.test.espresso.matcher.PreferenceMatchers;
import android.support.test.espresso.matcher.ViewMatchers; import android.support.test.espresso.matcher.ViewMatchers;
import android.support.test.filters.LargeTest; import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule; import android.support.test.rule.ActivityTestRule;
@ -61,7 +62,7 @@ public class SettingsActivityTest {
@Test @Test
public void oneLicenseIsChecked() { public void oneLicenseIsChecked() {
// click "License" (the first item) // click "License" (the first item)
Espresso.onData(Matchers.anything()) Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list)) .inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0) .atPosition(0)
.perform(ViewActions.click()); .perform(ViewActions.click());
@ -74,7 +75,7 @@ public class SettingsActivityTest {
@Test @Test
public void afterClickingCcby4ItWillStay() { public void afterClickingCcby4ItWillStay() {
// click "License" (the first item) // click "License" (the first item)
Espresso.onData(Matchers.anything()) Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list)) .inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0) .atPosition(0)
.perform(ViewActions.click()); .perform(ViewActions.click());
@ -85,7 +86,7 @@ public class SettingsActivityTest {
).perform(ViewActions.click()); ).perform(ViewActions.click());
// click "License" (the first item) // click "License" (the first item)
Espresso.onData(Matchers.anything()) Espresso.onData(PreferenceMatchers.withKey("defaultLicense"))
.inAdapterView(ViewMatchers.withId(android.R.id.list)) .inAdapterView(ViewMatchers.withId(android.R.id.list))
.atPosition(0) .atPosition(0)
.perform(ViewActions.click()); .perform(ViewActions.click());

View file

@ -1,12 +1,17 @@
package fr.free.nrw.commons; package fr.free.nrw.commons;
import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.util.Log;
import android.support.customtabs.CustomTabsIntent; import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
@ -14,12 +19,15 @@ import butterknife.OnClick;
import fr.free.nrw.commons.theme.NavigationBaseActivity; import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.ui.widget.HtmlTextView; import fr.free.nrw.commons.ui.widget.HtmlTextView;
import static android.widget.Toast.LENGTH_SHORT;
/** /**
* Represents about screen of this app * Represents about screen of this app
*/ */
public class AboutActivity extends NavigationBaseActivity { public class AboutActivity extends NavigationBaseActivity {
@BindView(R.id.about_version) TextView versionText; @BindView(R.id.about_version) TextView versionText;
@BindView(R.id.about_license) HtmlTextView aboutLicenseText; @BindView(R.id.about_license) HtmlTextView aboutLicenseText;
@BindView(R.id.about_faq) TextView faqText;
/** /**
* This method helps in the creation About screen * This method helps in the creation About screen
@ -27,22 +35,23 @@ public class AboutActivity extends NavigationBaseActivity {
* @param savedInstanceState Data bundle * @param savedInstanceState Data bundle
*/ */
@Override @Override
@SuppressLint("StringFormatInvalid")
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about); setContentView(R.layout.activity_about);
ButterKnife.bind(this); ButterKnife.bind(this);
String aboutText = getString(R.string.about_license); String aboutText = getString(R.string.about_license);
aboutLicenseText.setHtmlText(aboutText); aboutLicenseText.setHtmlText(aboutText);
SpannableString content = new SpannableString(getString(R.string.about_faq));
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
faqText.setText(content);
versionText.setText(BuildConfig.VERSION_NAME); versionText.setText(BuildConfig.VERSION_NAME);
initDrawer(); initDrawer();
} }
@OnClick(R.id.facebook_launch_icon) @OnClick(R.id.facebook_launch_icon)
public void launchFacebook(View view) { public void launchFacebook(View view) {
Intent intent; Intent intent;
try { try {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/" + "1921335171459985")); intent = new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/" + "1921335171459985"));
@ -55,7 +64,7 @@ public class AboutActivity extends NavigationBaseActivity {
@OnClick(R.id.github_launch_icon) @OnClick(R.id.github_launch_icon)
public void launchGithub(View view) { public void launchGithub(View view) {
Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\")); Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons\\"));
} }
@OnClick(R.id.website_launch_icon) @OnClick(R.id.website_launch_icon)
@ -63,6 +72,11 @@ public class AboutActivity extends NavigationBaseActivity {
Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\")); Utils.handleWebUrl(this,Uri.parse("https://commons-app.github.io/\\"));
} }
@OnClick(R.id.about_rate_us)
public void launchRatings(View view){
Utils.rateApp(this);
}
@OnClick(R.id.about_credits) @OnClick(R.id.about_credits)
public void launchCredits(View view) { public void launchCredits(View view) {
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/blob/master/CREDITS/\\")); Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/blob/master/CREDITS/\\"));
@ -73,5 +87,8 @@ public class AboutActivity extends NavigationBaseActivity {
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\")); Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
} }
@OnClick(R.id.about_faq)
public void launchFrequentlyAskedQuesions(View view) {
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Frequently-Asked-Questions\\"));
}
} }

View file

@ -4,8 +4,10 @@ import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.support.multidex.MultiDexApplication;
import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.stetho.Stetho; import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary; import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher; import com.squareup.leakcanary.RefWatcher;
@ -24,7 +26,6 @@ import fr.free.nrw.commons.category.CategoryDao;
import fr.free.nrw.commons.contributions.ContributionDao; import fr.free.nrw.commons.contributions.ContributionDao;
import fr.free.nrw.commons.data.DBOpenHelper; import fr.free.nrw.commons.data.DBOpenHelper;
import fr.free.nrw.commons.di.ApplicationlessInjection; import fr.free.nrw.commons.di.ApplicationlessInjection;
import fr.free.nrw.commons.di.CommonsApplicationComponent;
import fr.free.nrw.commons.modifications.ModifierSequenceDao; import fr.free.nrw.commons.modifications.ModifierSequenceDao;
import fr.free.nrw.commons.utils.FileUtils; import fr.free.nrw.commons.utils.FileUtils;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
@ -40,7 +41,7 @@ import timber.log.Timber;
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, resDialogCommentPrompt = R.string.crash_dialog_comment_prompt,
resDialogOkToast = R.string.crash_dialog_ok_toast resDialogOkToast = R.string.crash_dialog_ok_toast
) )
public class CommonsApplication extends Application { public class CommonsApplication extends MultiDexApplication {
@Inject SessionManager sessionManager; @Inject SessionManager sessionManager;
@Inject DBOpenHelper dbOpenHelper; @Inject DBOpenHelper dbOpenHelper;
@ -49,7 +50,7 @@ public class CommonsApplication extends Application {
@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 DEFAULT_EDIT_SUMMARY = "Uploaded using [[COM:MOA|Commons Mobile App]]";
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com"; public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
@ -71,8 +72,11 @@ public class CommonsApplication extends Application {
.getInstance(this) .getInstance(this)
.getCommonsApplicationComponent() .getCommonsApplicationComponent()
.inject(this); .inject(this);
// Set DownsampleEnabled to True to downsample the image in case it's heavy
Fresco.initialize(this); ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
.setDownsampleEnabled(true)
.build();
Fresco.initialize(this,config);
if (setupLeakCanary() == RefWatcher.DISABLED) { if (setupLeakCanary() == RefWatcher.DISABLED) {
return; return;
} }

View file

@ -7,6 +7,7 @@ import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.customtabs.CustomTabsIntent; import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.widget.Toast;
import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.binary.Hex;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
@ -15,7 +16,6 @@ import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.Locale; import java.util.Locale;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -24,6 +24,8 @@ import java.util.regex.Pattern;
import fr.free.nrw.commons.settings.Prefs; import fr.free.nrw.commons.settings.Prefs;
import timber.log.Timber; import timber.log.Timber;
import static android.widget.Toast.LENGTH_SHORT;
public class Utils { public class Utils {
/** /**
@ -165,7 +167,24 @@ public class Utils {
return stringBuilder.toString(); return stringBuilder.toString();
} }
public static void rateApp(Context context) {
final String appPackageName = BuildConfig.class.getPackage().getName();
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
}
catch (android.content.ActivityNotFoundException anfe) {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
}
public static void handleWebUrl(Context context,Uri url){ public static void handleWebUrl(Context context,Uri url){
Intent browserIntent = new Intent(Intent.ACTION_VIEW, url);
if (browserIntent.resolveActivity(context.getPackageManager()) == null) {
Toast toast = Toast.makeText(context, context.getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
return;
}
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor)); builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor)); builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor));

View file

@ -5,6 +5,7 @@ import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
@ -54,11 +55,19 @@ public class WelcomePagerAdapter extends PagerAdapter {
public Object instantiateItem(ViewGroup container, int position) { public Object instantiateItem(ViewGroup container, int position) {
LayoutInflater inflater = LayoutInflater.from(container.getContext()); LayoutInflater inflater = LayoutInflater.from(container.getContext());
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false); ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
if( BuildConfig.FLAVOR == "beta"){
TextView textView = (TextView) layout.findViewById(R.id.welcomeYesButton);
if( textView.getVisibility() != View.VISIBLE){
textView.setVisibility(View.VISIBLE);
}
ViewHolder holder = new ViewHolder(layout);
layout.setTag(holder);
} else {
if (position == PAGE_FINAL) { if (position == PAGE_FINAL) {
ViewHolder holder = new ViewHolder(layout); ViewHolder holder = new ViewHolder(layout);
layout.setTag(holder); layout.setTag(holder);
} }
}
container.addView(layout); container.addView(layout);
return layout; return layout;
} }
@ -92,5 +101,6 @@ public class WelcomePagerAdapter extends PagerAdapter {
callback.onYesClicked(); callback.onYesClicked();
} }
} }
} }
} }

View file

@ -8,6 +8,7 @@ import android.app.Activity;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.ColorRes; import android.support.annotation.ColorRes;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
@ -27,6 +28,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException; import java.io.IOException;
@ -35,6 +37,7 @@ import javax.inject.Named;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick;
import fr.free.nrw.commons.BuildConfig; import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.PageTitle; import fr.free.nrw.commons.PageTitle;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
@ -44,6 +47,7 @@ import fr.free.nrw.commons.contributions.ContributionsActivity;
import fr.free.nrw.commons.di.ApplicationlessInjection; import fr.free.nrw.commons.di.ApplicationlessInjection;
import fr.free.nrw.commons.mwapi.MediaWikiApi; import fr.free.nrw.commons.mwapi.MediaWikiApi;
import fr.free.nrw.commons.theme.NavigationBaseActivity; import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.ui.widget.HtmlTextView;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
@ -74,10 +78,15 @@ public class LoginActivity extends AccountAuthenticatorActivity {
@BindView(R.id.error_message) TextView errorMessage; @BindView(R.id.error_message) TextView errorMessage;
@BindView(R.id.login_credentials) TextView loginCredentials; @BindView(R.id.login_credentials) TextView loginCredentials;
@BindView(R.id.two_factor_container) TextInputLayout twoFactorContainer; @BindView(R.id.two_factor_container) TextInputLayout twoFactorContainer;
@BindView(R.id.forgotPassword) HtmlTextView forgotPasswordText;
ProgressDialog progressDialog; ProgressDialog progressDialog;
private AppCompatDelegate delegate; private AppCompatDelegate delegate;
private LoginTextWatcher textWatcher = new LoginTextWatcher(); private LoginTextWatcher textWatcher = new LoginTextWatcher();
private Boolean loginCurrentlyInProgress = false;
private static final String LOGING_IN = "logingIn";
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
setTheme(Utils.isDarkTheme(this) ? R.style.DarkAppTheme : R.style.LightAppTheme); setTheme(Utils.isDarkTheme(this) ? R.style.DarkAppTheme : R.style.LightAppTheme);
@ -114,6 +123,8 @@ public class LoginActivity extends AccountAuthenticatorActivity {
loginButton.setOnClickListener(view -> performLogin()); loginButton.setOnClickListener(view -> performLogin());
signupButton.setOnClickListener(view -> signUp()); signupButton.setOnClickListener(view -> signUp());
forgotPasswordText.setOnClickListener(view -> forgotPassword());
if(BuildConfig.FLAVOR == "beta"){ if(BuildConfig.FLAVOR == "beta"){
loginCredentials.setText(getString(R.string.login_credential)); loginCredentials.setText(getString(R.string.login_credential));
} else { } else {
@ -121,6 +132,14 @@ public class LoginActivity extends AccountAuthenticatorActivity {
} }
} }
private void forgotPassword() {
Utils.handleWebUrl(this, Uri.parse(BuildConfig.FORGOT_PASSWORD_URL));
}
@OnClick(R.id.about_privacy_policy)
void onPrivacyPolicyClicked() {
Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
}
public void hideKeyboard(View view) { public void hideKeyboard(View view) {
InputMethodManager inputMethodManager =(InputMethodManager)this.getSystemService(Activity.INPUT_METHOD_SERVICE); InputMethodManager inputMethodManager =(InputMethodManager)this.getSystemService(Activity.INPUT_METHOD_SERVICE);
@ -164,6 +183,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
} }
private void performLogin() { private void performLogin() {
loginCurrentlyInProgress = true;
Timber.d("Login to start!"); Timber.d("Login to start!");
final String username = canonicializeUsername(usernameEdit.getText().toString()); final String username = canonicializeUsername(usernameEdit.getText().toString());
final String password = passwordEdit.getText().toString(); final String password = passwordEdit.getText().toString();
@ -194,6 +214,7 @@ public class LoginActivity extends AccountAuthenticatorActivity {
if (result.equals("PASS")) { if (result.equals("PASS")) {
handlePassResult(username, password); handlePassResult(username, password);
} else { } else {
loginCurrentlyInProgress = false;
handleOtherResults(result); handleOtherResults(result);
} }
} }
@ -316,6 +337,21 @@ public class LoginActivity extends AccountAuthenticatorActivity {
return getDelegate().getMenuInflater(); return getDelegate().getMenuInflater();
} }
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(LOGING_IN, loginCurrentlyInProgress);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
loginCurrentlyInProgress = savedInstanceState.getBoolean(LOGING_IN, false);
if(loginCurrentlyInProgress){
performLogin();
}
}
public void askUserForTwoFactorAuth() { public void askUserForTwoFactorAuth() {
progressDialog.dismiss(); progressDialog.dismiss();
twoFactorContainer.setVisibility(VISIBLE); twoFactorContainer.setVisibility(VISIBLE);

View file

@ -1,5 +1,6 @@
package fr.free.nrw.commons.category; package fr.free.nrw.commons.category;
import android.app.Activity; import android.app.Activity;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;

View file

@ -108,10 +108,10 @@ public class CategoryDao {
Category fromCursor(Cursor cursor) { Category fromCursor(Cursor cursor) {
// Hardcoding column positions! // Hardcoding column positions!
return new Category( return new Category(
CategoryContentProvider.uriForId(cursor.getInt(0)), CategoryContentProvider.uriForId(cursor.getInt(cursor.getColumnIndex(Table.COLUMN_ID))),
cursor.getString(1), cursor.getString(cursor.getColumnIndex(Table.COLUMN_NAME)),
new Date(cursor.getLong(2)), new Date(cursor.getLong(cursor.getColumnIndex(Table.COLUMN_LAST_USED))),
cursor.getInt(3) cursor.getInt(cursor.getColumnIndex(Table.COLUMN_TIMES_USED))
); );
} }

View file

@ -8,6 +8,7 @@ import android.net.Uri;
import android.os.RemoteException; import android.os.RemoteException;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log;
import java.util.Date; import java.util.Date;
@ -115,23 +116,30 @@ public class ContributionDao {
// Hardcoding column positions! // Hardcoding column positions!
//Check that cursor has a value to avoid CursorIndexOutOfBoundsException //Check that cursor has a value to avoid CursorIndexOutOfBoundsException
if (cursor.getCount() > 0) { if (cursor.getCount() > 0) {
int index;
if (cursor.getColumnIndex(Table.COLUMN_LICENSE) == -1){
index = 15;
} else {
index = cursor.getColumnIndex(Table.COLUMN_LICENSE);
}
return new Contribution( return new Contribution(
uriForId(cursor.getInt(0)), uriForId(cursor.getInt(cursor.getColumnIndex(Table.COLUMN_ID))),
cursor.getString(1), cursor.getString(cursor.getColumnIndex(Table.COLUMN_FILENAME)),
parseUri(cursor.getString(2)), parseUri(cursor.getString(cursor.getColumnIndex(Table.COLUMN_LOCAL_URI))),
cursor.getString(3), cursor.getString(cursor.getColumnIndex(Table.COLUMN_IMAGE_URL)),
parseTimestamp(cursor.getLong(4)), parseTimestamp(cursor.getLong(cursor.getColumnIndex(Table.COLUMN_TIMESTAMP))),
cursor.getInt(5), cursor.getInt(cursor.getColumnIndex(Table.COLUMN_STATE)),
cursor.getLong(6), cursor.getLong(cursor.getColumnIndex(Table.COLUMN_LENGTH)),
parseTimestamp(cursor.getLong(7)), parseTimestamp(cursor.getLong(cursor.getColumnIndex(Table.COLUMN_UPLOADED))),
cursor.getLong(8), cursor.getLong(cursor.getColumnIndex(Table.COLUMN_TRANSFERRED)),
cursor.getString(9), cursor.getString(cursor.getColumnIndex(Table.COLUMN_SOURCE)),
cursor.getString(10), cursor.getString(cursor.getColumnIndex(Table.COLUMN_DESCRIPTION)),
cursor.getString(11), cursor.getString(cursor.getColumnIndex(Table.COLUMN_CREATOR)),
cursor.getInt(12) == 1, cursor.getInt(cursor.getColumnIndex(Table.COLUMN_MULTIPLE)) == 1,
cursor.getInt(13), cursor.getInt(cursor.getColumnIndex(Table.COLUMN_WIDTH)),
cursor.getInt(14), cursor.getInt(cursor.getColumnIndex(Table.COLUMN_HEIGHT)),
cursor.getString(15)); cursor.getString(index)
);
} }
return null; return null;

View file

@ -26,6 +26,7 @@ import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.HandlerService; import fr.free.nrw.commons.HandlerService;
import fr.free.nrw.commons.Media; import fr.free.nrw.commons.Media;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
@ -139,9 +140,13 @@ public class ContributionsActivity
requestAuthToken(); requestAuthToken();
initDrawer(); initDrawer();
setTitle(getString(R.string.title_activity_contributions)); setTitle(getString(R.string.title_activity_contributions));
if(!BuildConfig.FLAVOR.equalsIgnoreCase("beta")){
setUploadCount(); setUploadCount();
} }
}
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -279,6 +284,12 @@ public class ContributionsActivity
)); ));
} }
public void betaSetUploadCount(int betaUploadCount){
getSupportActionBar().setSubtitle(getResources()
.getQuantityString(R.plurals.contributions_subtitle, betaUploadCount, betaUploadCount));
}
@Override @Override
public void notifyDatasetChanged() { public void notifyDatasetChanged() {
// Do nothing for now // Do nothing for now

View file

@ -27,6 +27,7 @@ import javax.inject.Named;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
import fr.free.nrw.commons.di.CommonsDaggerSupportFragment; import fr.free.nrw.commons.di.CommonsDaggerSupportFragment;
import fr.free.nrw.commons.nearby.NearbyActivity; import fr.free.nrw.commons.nearby.NearbyActivity;
@ -56,6 +57,7 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
private ContributionController controller; private ContributionController controller;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_contributions, container, false); View v = inflater.inflate(R.layout.fragment_contributions, container, false);
@ -87,6 +89,10 @@ public class ContributionsListFragment extends CommonsDaggerSupportFragment {
public void setAdapter(ListAdapter adapter) { public void setAdapter(ListAdapter adapter) {
this.contributionsList.setAdapter(adapter); this.contributionsList.setAdapter(adapter);
if(BuildConfig.FLAVOR.equalsIgnoreCase("beta")){
((ContributionsActivity) getActivity()).betaSetUploadCount(adapter.getCount());
}
} }
public void changeProgressBarVisibility(boolean isVisible) { public void changeProgressBarVisibility(boolean isVisible) {

View file

@ -14,6 +14,7 @@ import android.view.ViewTreeObserver;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException; import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -36,6 +37,8 @@ import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.ui.widget.CompatTextView; import fr.free.nrw.commons.ui.widget.CompatTextView;
import timber.log.Timber; import timber.log.Timber;
import static android.widget.Toast.LENGTH_SHORT;
public class MediaDetailFragment extends CommonsDaggerSupportFragment { public class MediaDetailFragment extends CommonsDaggerSupportFragment {
private boolean editable; private boolean editable;
@ -273,7 +276,12 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
} }
private void setOnClickListeners(final Media media) { private void setOnClickListeners(final Media media) {
if (licenseLink(media) != null) {
license.setOnClickListener(v -> openWebBrowser(licenseLink(media))); license.setOnClickListener(v -> openWebBrowser(licenseLink(media)));
} else {
Toast toast = Toast.makeText(getContext(), getString(R.string.null_url), Toast.LENGTH_SHORT);
toast.show();
}
if (media.getCoordinates() != null) { if (media.getCoordinates() != null) {
coordinates.setOnClickListener(v -> openMap(media.getCoordinates())); coordinates.setOnClickListener(v -> openMap(media.getCoordinates()));
} }
@ -299,7 +307,13 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
Intent viewIntent = new Intent(); Intent viewIntent = new Intent();
viewIntent.setAction(Intent.ACTION_VIEW); viewIntent.setAction(Intent.ACTION_VIEW);
viewIntent.setData(new PageTitle(selectedCategoryTitle).getCanonicalUri()); viewIntent.setData(new PageTitle(selectedCategoryTitle).getCanonicalUri());
//check if web browser available
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
startActivity(viewIntent); startActivity(viewIntent);
} else {
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
}
}); });
} }
return item; return item;
@ -379,7 +393,14 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
private void openWebBrowser(String url) { private void openWebBrowser(String url) {
Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
//check if web browser available
if (browser.resolveActivity(getActivity().getPackageManager()) != null) {
startActivity(browser); startActivity(browser);
} else {
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
}
} }
private void openMap(LatLng coordinates) { private void openMap(LatLng coordinates) {

View file

@ -24,6 +24,7 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Toast;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
@ -40,6 +41,7 @@ import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.content.Context.DOWNLOAD_SERVICE; import static android.content.Context.DOWNLOAD_SERVICE;
import static android.content.Intent.ACTION_VIEW; import static android.content.Intent.ACTION_VIEW;
import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.widget.Toast.LENGTH_SHORT;
public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment implements ViewPager.OnPageChangeListener { public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment implements ViewPager.OnPageChangeListener {
@ -118,7 +120,14 @@ public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment imple
Intent viewIntent = new Intent(); Intent viewIntent = new Intent();
viewIntent.setAction(ACTION_VIEW); viewIntent.setAction(ACTION_VIEW);
viewIntent.setData(m.getFilePageTitle().getMobileUri()); viewIntent.setData(m.getFilePageTitle().getMobileUri());
//check if web browser available
if(viewIntent.resolveActivity(getActivity().getPackageManager()) != null){
startActivity(viewIntent); startActivity(viewIntent);
} else {
Toast toast = Toast.makeText(getContext(), getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
}
return true; return true;
case R.id.menu_download_current_image: case R.id.menu_download_current_image:
// Download // Download

View file

@ -45,7 +45,7 @@ public class ModifierSequence {
for (PageModifier modifier: modifiers) { for (PageModifier modifier: modifiers) {
editSummary.append(modifier.getEditSumary()).append(" "); editSummary.append(modifier.getEditSumary()).append(" ");
} }
editSummary.append("Via Commons Mobile App"); editSummary.append("Using [[COM:MOA|Commons Mobile App]]");
return editSummary.toString(); return editSummary.toString();
} }

View file

@ -54,12 +54,12 @@ public class ModifierSequenceDao {
// Hardcoding column positions! // Hardcoding column positions!
ModifierSequence ms; ModifierSequence ms;
try { try {
ms = new ModifierSequence(Uri.parse(cursor.getString(1)), ms = new ModifierSequence(Uri.parse(cursor.getString(cursor.getColumnIndex(Table.COLUMN_MEDIA_URI))),
new JSONObject(cursor.getString(2))); new JSONObject(cursor.getString(cursor.getColumnIndex(Table.COLUMN_DATA))));
} catch (JSONException e) { } catch (JSONException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(0))); ms.setContentUri( ModificationsContentProvider.uriForId(cursor.getInt(cursor.getColumnIndex(Table.COLUMN_ID))));
return ms; return ms;
} }

View file

@ -274,7 +274,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
LatLng lastLocation = locationManager.getLastLocation(); LatLng lastLocation = locationManager.getLastLocation();
if (curLatLang != null && curLatLang.equals(lastLocation)) { //refresh view only if location has changed if (curLatLang != null && curLatLang.equals(lastLocation)) { //refresh view only if location has changed
if (isHardRefresh) { if (isHardRefresh) {
ViewUtil.showLongToast(this, R.string.nearby_location_has_not_changed); ViewUtil.showSnackbar(findViewById(R.id.container), R.string.nearby_location_has_not_changed);
} }
return; return;
} }
@ -301,9 +301,7 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
String gsonCurLatLng = gson.toJson(curLatLang); String gsonCurLatLng = gson.toJson(curLatLang);
if (placeList.size() == 0) { if (placeList.size() == 0) {
int duration = Toast.LENGTH_SHORT; ViewUtil.showSnackbar(findViewById(R.id.container), R.string.no_nearby);
Toast toast = Toast.makeText(this, R.string.no_nearby, duration);
toast.show();
} }
bundle.clear(); bundle.clear();

View file

@ -44,8 +44,10 @@ class PlaceRenderer extends Renderer<Place> {
Place place = getContent(); Place place = getContent();
tvName.setText(place.name); tvName.setText(place.name);
String descriptionText = place.getLongDescription(); String descriptionText = place.getLongDescription();
tvDesc.setVisibility(View.VISIBLE);
if (descriptionText.equals("?")) { if (descriptionText.equals("?")) {
descriptionText = getContext().getString(R.string.no_description_found); descriptionText = getContext().getString(R.string.no_description_found);
tvDesc.setVisibility(View.INVISIBLE);
} }
tvDesc.setText(descriptionText); tvDesc.setText(descriptionText);
distance.setText(place.distance); distance.setText(place.distance);

View file

@ -6,8 +6,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.widget.Toast;
import com.pedrogomez.renderers.RVRendererAdapter; import com.pedrogomez.renderers.RVRendererAdapter;
@ -24,6 +26,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import timber.log.Timber; import timber.log.Timber;
import static android.widget.Toast.LENGTH_SHORT;
/** /**
* Created by root on 18.12.2017. * Created by root on 18.12.2017.
*/ */
@ -50,8 +54,9 @@ public class NotificationActivity extends NavigationBaseActivity {
} }
private void initListView() { private void initListView() {
recyclerView = findViewById(R.id.listView);
recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.setLayoutManager(new LinearLayoutManager(this));
DividerItemDecoration itemDecor = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
recyclerView.addItemDecoration(itemDecor);
addNotifications(); addNotifications();
} }
@ -77,7 +82,14 @@ public class NotificationActivity extends NavigationBaseActivity {
if (url == null || url.equals("")) { if (url == null || url.equals("")) {
return; return;
} }
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); Intent browser = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
//check if web browser available
if(browser.resolveActivity(this.getPackageManager()) != null){
startActivity(browser);
} else {
Toast toast = Toast.makeText(this, getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
}
} }
private void setAdapter(List<Notification> notificationList) { private void setAdapter(List<Notification> notificationList) {
@ -91,6 +103,7 @@ public class NotificationActivity extends NavigationBaseActivity {
public static void startYourself(Context context) { public static void startYourself(Context context) {
Intent intent = new Intent(context, NotificationActivity.class); Intent intent = new Intent(context, NotificationActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
context.startActivity(intent); context.startActivity(intent);
} }

View file

@ -1,11 +1,13 @@
package fr.free.nrw.commons.notification; package fr.free.nrw.commons.notification;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.borjabravo.readmoretextview.ReadMoreTextView;
import com.pedrogomez.renderers.Renderer; import com.pedrogomez.renderers.Renderer;
import butterknife.BindView; import butterknife.BindView;
@ -17,8 +19,8 @@ import fr.free.nrw.commons.R;
*/ */
public class NotificationRenderer extends Renderer<Notification> { public class NotificationRenderer extends Renderer<Notification> {
@BindView(R.id.title) TextView title; @BindView(R.id.title) ReadMoreTextView title;
@BindView(R.id.description) TextView description; @BindView(R.id.description) ReadMoreTextView description;
@BindView(R.id.time) TextView time; @BindView(R.id.time) TextView time;
@BindView(R.id.icon) ImageView icon; @BindView(R.id.icon) ImageView icon;
private NotificationClicked listener; private NotificationClicked listener;
@ -46,9 +48,13 @@ public class NotificationRenderer extends Renderer<Notification> {
@Override @Override
public void render() { public void render() {
Notification notification = getContent(); Notification notification = getContent();
title.setText(notification.notificationText); StringBuilder str = new StringBuilder(notification.notificationText);
str.append(" " );
title.setText(str);
time.setText(notification.date); time.setText(notification.date);
description.setText(notification.description); StringBuilder desc = new StringBuilder(notification.description);
desc.append(" ");
description.setText(desc);
switch (notification.notificationType) { switch (notification.notificationType) {
case THANK_YOU_EDIT: case THANK_YOU_EDIT:
icon.setImageResource(R.drawable.ic_edit_black_24dp); icon.setImageResource(R.drawable.ic_edit_black_24dp);

View file

@ -3,14 +3,17 @@ package fr.free.nrw.commons.settings;
import android.Manifest; import android.Manifest;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.CheckBoxPreference; import android.preference.SwitchPreference;
import android.preference.EditTextPreference; import android.preference.EditTextPreference;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.preference.Preference; import android.preference.Preference;
@ -21,6 +24,8 @@ import android.support.v4.content.FileProvider;
import android.widget.Toast; import android.widget.Toast;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
@ -59,7 +64,7 @@ public class SettingsFragment extends PreferenceFragment {
return true; return true;
}); });
CheckBoxPreference themePreference = (CheckBoxPreference) findPreference("theme"); SwitchPreference themePreference = (SwitchPreference) findPreference("theme");
themePreference.setOnPreferenceChangeListener((preference, newValue) -> { themePreference.setOnPreferenceChangeListener((preference, newValue) -> {
getActivity().recreate(); getActivity().recreate();
return true; return true;
@ -141,19 +146,24 @@ public class SettingsFragment extends PreferenceFragment {
appLogsFile appLogsFile
); );
Intent feedbackIntent = new Intent(Intent.ACTION_SEND); //initialize the emailSelectorIntent
feedbackIntent.setType("message/rfc822"); Intent emailSelectorIntent = new Intent(Intent.ACTION_SENDTO);
feedbackIntent.putExtra(Intent.EXTRA_EMAIL, emailSelectorIntent.setData(Uri.parse("mailto:"));
new String[]{CommonsApplication.LOGS_PRIVATE_EMAIL}); //initialize the emailIntent
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, final Intent emailIntent = new Intent(Intent.ACTION_SEND);
String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{CommonsApplication.FEEDBACK_EMAIL});
BuildConfig.VERSION_NAME)); emailIntent.putExtra(Intent.EXTRA_SUBJECT, String.format(CommonsApplication.FEEDBACK_EMAIL_SUBJECT, BuildConfig.VERSION_NAME));
feedbackIntent.putExtra(Intent.EXTRA_STREAM,appLogsFilePath); emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
emailIntent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
emailIntent.setSelector( emailSelectorIntent );
//adding the attachment to the intent
emailIntent.putExtra(Intent.EXTRA_STREAM, appLogsFilePath);
try { try {
startActivity(feedbackIntent); startActivity(Intent.createChooser(emailIntent, "Send mail.."));
} catch (ActivityNotFoundException e) { } catch (ActivityNotFoundException e) {
Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.no_email_client, Toast.LENGTH_SHORT).show();
} }
} }
} }

View file

@ -5,6 +5,7 @@ import android.accounts.AccountManager;
import android.content.ActivityNotFoundException; import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
@ -22,6 +23,7 @@ import fr.free.nrw.commons.AboutActivity;
import fr.free.nrw.commons.BuildConfig; import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.CommonsApplication; import fr.free.nrw.commons.CommonsApplication;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.WelcomeActivity; import fr.free.nrw.commons.WelcomeActivity;
import fr.free.nrw.commons.auth.AccountUtil; import fr.free.nrw.commons.auth.AccountUtil;
import fr.free.nrw.commons.auth.LoginActivity; import fr.free.nrw.commons.auth.LoginActivity;
@ -86,8 +88,11 @@ public abstract class NavigationBaseActivity extends BaseActivity
private void setDrawerPaneWidth() { private void setDrawerPaneWidth() {
ViewGroup.LayoutParams params = navigationView.getLayoutParams(); ViewGroup.LayoutParams params = navigationView.getLayoutParams();
// set width to lowerBound of 80% of the screen size // set width to lowerBound of 70% of the screen size in portrait mode
params.width = (getResources().getDisplayMetrics().widthPixels * 70) / 100; // set width to lowerBound of 50% of the screen size in landscape mode
int percentageWidth = getResources().getInteger(R.integer.drawer_width);
params.width = (getResources().getDisplayMetrics().widthPixels * percentageWidth) / 100;
navigationView.setLayoutParams(params); navigationView.setLayoutParams(params);
} }
@ -119,8 +124,9 @@ public abstract class NavigationBaseActivity extends BaseActivity
return true; return true;
case R.id.action_feedback: case R.id.action_feedback:
drawerLayout.closeDrawer(navigationView); drawerLayout.closeDrawer(navigationView);
Intent feedbackIntent = new Intent(Intent.ACTION_SEND); Intent feedbackIntent = new Intent(Intent.ACTION_SENDTO);
feedbackIntent.setType("message/rfc822"); feedbackIntent.setType("message/rfc822");
feedbackIntent.setData(Uri.parse("mailto:"));
feedbackIntent.putExtra(Intent.EXTRA_EMAIL, feedbackIntent.putExtra(Intent.EXTRA_EMAIL,
new String[]{CommonsApplication.FEEDBACK_EMAIL}); new String[]{CommonsApplication.FEEDBACK_EMAIL});
feedbackIntent.putExtra(Intent.EXTRA_SUBJECT, feedbackIntent.putExtra(Intent.EXTRA_SUBJECT,

View file

@ -1,11 +1,13 @@
package fr.free.nrw.commons.upload; package fr.free.nrw.commons.upload;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import java.io.IOException; import java.io.IOException;
import java.lang.ref.WeakReference;
import fr.free.nrw.commons.R; import fr.free.nrw.commons.R;
import fr.free.nrw.commons.contributions.ContributionsActivity; import fr.free.nrw.commons.contributions.ContributionsActivity;
@ -28,12 +30,14 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
DUPLICATE_CANCELLED DUPLICATE_CANCELLED
} }
private final WeakReference<Activity> activity;
private final MediaWikiApi api; private final MediaWikiApi api;
private final String fileSha1; private final String fileSha1;
private final Context context; private final WeakReference<Context> context;
private final Callback callback; private final Callback callback;
public ExistingFileAsync(String fileSha1, Context context, Callback callback, MediaWikiApi mwApi) { public ExistingFileAsync(WeakReference<Activity> activity, String fileSha1, WeakReference<Context> context, Callback callback, MediaWikiApi mwApi) {
this.activity = activity;
this.fileSha1 = fileSha1; this.fileSha1 = fileSha1;
this.context = context; this.context = context;
this.callback = callback; this.callback = callback;
@ -69,19 +73,21 @@ public class ExistingFileAsync extends AsyncTask<Void, Void, Boolean> {
// If file exists, display warning to user. // If file exists, display warning to user.
// Use soft warning for now (user able to choose to proceed) until have determined that implementation works without bugs // Use soft warning for now (user able to choose to proceed) until have determined that implementation works without bugs
if (fileExists) { if (fileExists) {
AlertDialog.Builder builder = new AlertDialog.Builder(context); AlertDialog.Builder builder = new AlertDialog.Builder(context.get());
builder.setMessage(R.string.file_exists) builder.setMessage(R.string.file_exists)
.setTitle(R.string.warning); .setTitle(R.string.warning);
builder.setPositiveButton(R.string.no, (dialog, id) -> { builder.setPositiveButton(R.string.no, (dialog, id) -> {
//Go back to ContributionsActivity //Go back to ContributionsActivity
Intent intent = new Intent(context, ContributionsActivity.class); Intent intent = new Intent(context.get(), ContributionsActivity.class);
context.startActivity(intent); context.get().startActivity(intent);
callback.onResult(Result.DUPLICATE_CANCELLED); callback.onResult(Result.DUPLICATE_CANCELLED);
}); });
builder.setNegativeButton(R.string.yes, (dialog, id) -> callback.onResult(Result.DUPLICATE_PROCEED)); builder.setNegativeButton(R.string.yes, (dialog, id) -> callback.onResult(Result.DUPLICATE_PROCEED));
AlertDialog dialog = builder.create(); AlertDialog dialog = builder.create();
if (!activity.get().isFinishing()) {
dialog.show(); dialog.show();
}
} else { } else {
callback.onResult(Result.NO_DUPLICATE); callback.onResult(Result.NO_DUPLICATE);
} }

View file

@ -1,7 +1,9 @@
package fr.free.nrw.commons.upload; package fr.free.nrw.commons.upload;
import android.Manifest; import android.Manifest;
import android.app.Activity;
import android.content.ContentResolver; import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
@ -32,6 +34,7 @@ import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.math.BigInteger; import java.math.BigInteger;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
@ -371,7 +374,7 @@ public class ShareActivity
Timber.d("File SHA1 is: %s", fileSHA1); Timber.d("File SHA1 is: %s", fileSHA1);
ExistingFileAsync fileAsyncTask = ExistingFileAsync fileAsyncTask =
new ExistingFileAsync(fileSHA1, this, result -> { new ExistingFileAsync(new WeakReference<Activity>(this), fileSHA1, new WeakReference<Context>(this), result -> {
Timber.d("%s duplicate check: %s", mediaUri.toString(), result); Timber.d("%s duplicate check: %s", mediaUri.toString(), result);
duplicateCheckPassed = (result == DUPLICATE_PROCEED duplicateCheckPassed = (result == DUPLICATE_PROCEED
|| result == NO_DUPLICATE); || result == NO_DUPLICATE);

View file

@ -9,6 +9,7 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Editable; import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
@ -27,6 +28,7 @@ import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList; import java.util.ArrayList;
@ -64,9 +66,6 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
@Override @Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.activity_share, menu); inflater.inflate(R.menu.activity_share, menu);
if (titleEdit != null) {
menu.findItem(R.id.menu_upload_single).setEnabled(titleEdit.getText().length() != 0);
}
} }
@Override @Override
@ -75,6 +74,11 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
//What happens when the 'submit' icon is tapped //What happens when the 'submit' icon is tapped
case R.id.menu_upload_single: case R.id.menu_upload_single:
if (titleEdit.getText().toString().isEmpty()) {
Toast.makeText(getContext(), R.string.add_title_toast, Toast.LENGTH_LONG).show();
return false;
}
String title = titleEdit.getText().toString(); String title = titleEdit.getText().toString();
String desc = descEdit.getText().toString(); String desc = descEdit.getText().toString();
@ -97,6 +101,14 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
View rootView = inflater.inflate(R.layout.fragment_single_upload, container, false); View rootView = inflater.inflate(R.layout.fragment_single_upload, container, false);
ButterKnife.bind(this, rootView); ButterKnife.bind(this, rootView);
Intent activityIntent = getActivity().getIntent();
if (activityIntent.hasExtra("title")) {
titleEdit.setText(activityIntent.getStringExtra("title"));
}
if (activityIntent.hasExtra("description")) {
descEdit.setText(activityIntent.getStringExtra("description"));
}
ArrayList<String> licenseItems = new ArrayList<>(); ArrayList<String> licenseItems = new ArrayList<>();
licenseItems.add(getString(R.string.license_name_cc0)); licenseItems.add(getString(R.string.license_name_cc0));
licenseItems.add(getString(R.string.license_name_cc_by)); licenseItems.add(getString(R.string.license_name_cc_by));
@ -228,36 +240,41 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
*/ */
@OnTouch(R.id.titleEdit) @OnTouch(R.id.titleEdit)
boolean titleInfo(View view, MotionEvent motionEvent) { boolean titleInfo(View view, MotionEvent motionEvent) {
//Should replace right with end to support different right-to-left languages as well final int value;
final int value = titleEdit.getRight() - titleEdit.getCompoundDrawables()[2].getBounds().width(); if (ViewCompat.getLayoutDirection(getView()) == ViewCompat.LAYOUT_DIRECTION_LTR) {
value = titleEdit.getRight() - titleEdit.getCompoundDrawables()[2].getBounds().width();
if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() >= value) { if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() >= value) {
new AlertDialog.Builder(getContext()) showInfoAlert(R.string.media_detail_title, R.string.title_info);
.setTitle(R.string.media_detail_title)
.setMessage(R.string.title_info)
.setCancelable(true)
.setNeutralButton(android.R.string.ok, (dialog, id) -> dialog.cancel())
.create()
.show();
return true; return true;
} }
}
else {
value = titleEdit.getLeft() + titleEdit.getCompoundDrawables()[0].getBounds().width();
if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() <= value) {
showInfoAlert(R.string.media_detail_title, R.string.title_info);
return true;
}
}
return false; return false;
} }
@OnTouch(R.id.descEdit) @OnTouch(R.id.descEdit)
boolean descriptionInfo(View view, MotionEvent motionEvent) { boolean descriptionInfo(View view, MotionEvent motionEvent) {
final int value = descEdit.getRight() - descEdit.getCompoundDrawables()[2].getBounds().width(); final int value;
if (ViewCompat.getLayoutDirection(getView()) == ViewCompat.LAYOUT_DIRECTION_LTR) {
value = descEdit.getRight() - descEdit.getCompoundDrawables()[2].getBounds().width();
if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() >= value) { if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() >= value) {
new AlertDialog.Builder(getContext()) showInfoAlert(R.string.media_detail_description,R.string.description_info);
.setTitle(R.string.media_detail_description)
.setMessage(R.string.description_info)
.setCancelable(true)
.setNeutralButton(android.R.string.ok, (dialog, id) -> dialog.cancel())
.create()
.show();
return true; return true;
} }
}
else{
value = descEdit.getLeft() + descEdit.getCompoundDrawables()[0].getBounds().width();
if (motionEvent.getAction() == ACTION_UP && motionEvent.getRawX() <= value) {
showInfoAlert(R.string.media_detail_description,R.string.description_info);
return true;
}
}
return false; return false;
} }
@ -321,4 +338,14 @@ public class SingleUploadFragment extends CommonsDaggerSupportFragment {
} }
} }
} }
private void showInfoAlert (int titleStringID, int messageStringID){
new AlertDialog.Builder(getContext())
.setTitle(titleStringID)
.setMessage(messageStringID)
.setCancelable(true)
.setNeutralButton(android.R.string.ok, (dialog, id) -> dialog.cancel())
.create()
.show();
}
} }

View file

@ -1,12 +1,12 @@
package fr.free.nrw.commons.utils; package fr.free.nrw.commons.utils;
import android.content.Context; import android.support.design.widget.Snackbar;
import android.support.annotation.StringRes; import android.view.View;
import android.widget.Toast;
public class ViewUtil { public class ViewUtil {
public static void showLongToast(final Context context, @StringRes final int stringResId) { public static void showSnackbar(View view, int messageResourceId) {
ExecutorUtils.uiExecutor().execute(() -> Toast.makeText(context, context.getString(stringResId), Toast.LENGTH_LONG).show()); Snackbar.make(view, messageResourceId, Snackbar.LENGTH_SHORT).show();
} }
} }

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,19h-2v-2h2v2zM15.07,11.25l-0.9,0.92C13.45,12.9 13,13.5 13,15h-2v-0.5c0,-1.1 0.45,-2.1 1.17,-2.83l1.24,-1.26c0.37,-0.36 0.59,-0.86 0.59,-1.41 0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2L8,9c0,-2.21 1.79,-4 4,-4s4,1.79 4,4c0,0.88 -0.36,1.68 -0.93,2.25z"/>
</vector>

View file

@ -13,12 +13,12 @@
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/large_gap"
android:layout_marginBottom="@dimen/standard_gap" android:layout_marginBottom="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:layout_marginTop="@dimen/large_gap"
app:cardCornerRadius="4dp" app:cardCornerRadius="4dp"
app:cardElevation="4dp"> app:cardElevation="4dp">
@ -40,11 +40,26 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/heading_text_size" /> android:textSize="@dimen/heading_text_size" />
<TextView
android:id="@+id/login_credentials"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap"
android:paddingBottom="@dimen/standard_gap"
android:paddingTop="@dimen/small_gap"
android:textAlignment="center"
android:textColor="@color/secondaryDarkColor"
tools:text="@string/login_credential" />
<FrameLayout <FrameLayout
android:id="@+id/error_message_container" android:id="@+id/error_message_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/title" android:layout_below="@id/login_credentials"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"> tools:visibility="visible">
@ -56,6 +71,7 @@
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:gravity="center"
android:paddingBottom="@dimen/small_gap" android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap" android:paddingTop="@dimen/small_gap"
android:textColor="@color/secondaryDarkColor" android:textColor="@color/secondaryDarkColor"
@ -98,7 +114,7 @@
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
app:passwordToggleEnabled="false"> app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/loginPassword" android:id="@+id/loginPassword"
@ -149,8 +165,8 @@
<Button <Button
android:id="@+id/signupButton" android:id="@+id/signupButton"
android:layout_width="0dp"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginEnd="@dimen/small_gap" android:layout_marginEnd="@dimen/small_gap"
@ -160,8 +176,8 @@
<Button <Button
android:id="@+id/loginButton" android:id="@+id/loginButton"
android:layout_width="0dp"
style="@style/Widget.AppCompat.Button.Colored" style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/small_gap" android:layout_marginLeft="@dimen/small_gap"
android:layout_marginStart="@dimen/small_gap" android:layout_marginStart="@dimen/small_gap"
@ -171,16 +187,27 @@
</LinearLayout> </LinearLayout>
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:visibility="visible"
android:id="@+id/forgotPassword"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_below="@id/buttonFrame"
android:layout_marginBottom="@dimen/standard_gap"
android:text="@string/forgot_password"
android:textColor="@color/status_bar_blue"/>
<fr.free.nrw.commons.ui.widget.HtmlTextView <fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/about_privacy_policy" android:id="@+id/about_privacy_policy"
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
android:layout_below="@id/buttonFrame"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_gap" android:layout_below="@id/forgotPassword"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="@string/about_privacy_policy" android:layout_marginBottom="@dimen/standard_gap"
android:layout_centerHorizontal="true"/> android:text="@string/about_privacy_policy" />
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
@ -188,19 +215,19 @@
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:elevation="8dp"
tools:ignore="UnusedAttribute"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/blue_rinse_circle" /> android:elevation="8dp"
app:srcCompat="@drawable/blue_rinse_circle"
tools:ignore="UnusedAttribute" />
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:layout_width="42dp" android:layout_width="42dp"
tools:ignore="UnusedAttribute"
android:layout_height="42dp" android:layout_height="42dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:elevation="8dp" android:elevation="8dp"
app:srcCompat="@drawable/commons_logo_large" /> app:srcCompat="@drawable/commons_logo_large"
tools:ignore="UnusedAttribute" />
</FrameLayout> </FrameLayout>

View file

@ -1,88 +1,189 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#0c609c" android:background="#0c609c"
android:gravity="center"> android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/welcomeYesButton"
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:textColor="#fff"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.55" />
<GridLayout <GridLayout
android:layout_width="300dp" android:layout_width="300dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginBottom="8dp"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginTop="8dp"
android:columnCount="2" android:columnCount="2"
> app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline">
<ImageView <ImageView
android:src="@drawable/mount_zao"
android:id="@+id/mount_zao" android:id="@+id/mount_zao"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="118dp" android:layout_height="118dp"
android:scaleType="fitXY"
android:contentDescription="@string/welcome_image_mount_zao" android:contentDescription="@string/welcome_image_mount_zao"
/> android:scaleType="fitXY"
android:src="@drawable/mount_zao" />
<ImageView <ImageView
android:src="@drawable/llamas"
android:id="@+id/llamas" android:id="@+id/llamas"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="118dp" android:layout_height="118dp"
android:scaleType="fitXY"
android:contentDescription="@string/welcome_image_llamas" android:contentDescription="@string/welcome_image_llamas"
/> android:scaleType="fitXY"
android:src="@drawable/llamas" />
<ImageView <ImageView
android:src="@drawable/rainbow_bridge"
android:id="@+id/rainbow_bridge" android:id="@+id/rainbow_bridge"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="118dp" android:layout_height="118dp"
android:scaleType="fitXY"
android:contentDescription="@string/welcome_image_rainbow_bridge" android:contentDescription="@string/welcome_image_rainbow_bridge"
/> android:scaleType="fitXY"
android:src="@drawable/rainbow_bridge" />
<ImageView <ImageView
android:src="@drawable/tulip"
android:id="@+id/tulip" android:id="@+id/tulip"
android:layout_width="150dp" android:layout_width="150dp"
android:layout_height="118dp" android:layout_height="118dp"
android:scaleType="fitXY"
android:contentDescription="@string/welcome_image_tulip" android:contentDescription="@string/welcome_image_tulip"
/> android:scaleType="fitXY"
android:src="@drawable/tulip" />
</GridLayout> </GridLayout>
<LinearLayout android:orientation="vertical" <LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
>
<TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp" android:gravity="center_vertical"
android:text="@string/tutorial_2_text" android:orientation="vertical"
android:layout_gravity="center" android:layout_marginStart="@dimen/standard_gap"
android:textStyle="bold" android:layout_marginLeft="@dimen/standard_gap"
android:textSize="@dimen/normal_text" app:layout_constraintStart_toEndOf="@id/center_guideline"
android:textAlignment="center" app:layout_constraintBottom_toBottomOf="parent"
android:gravity="center_horizontal" app:layout_constraintTop_toTopOf="parent">
android:textColor="@android:color/white"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:gravity="center_horizontal"
android:paddingTop="@dimen/standard_gap" android:maxWidth="240dp"
android:gravity="start" android:text="@string/tutorial_2_text"
android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/tutorial_2_subtext_1"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext_2"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext_3"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View file

@ -1,70 +1,164 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#0c609c" xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center" android:background="#0c609c">
>
<RelativeLayout <TextView
android:layout_gravity="center" android:id="@+id/welcomeYesButton"
android:layout_width="240dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
> android:layout_marginTop="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:textColor="#fff"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50" />
<LinearLayout
android:layout_width="240dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap">
<ImageView <ImageView
android:src="@drawable/selfie_x"
android:id="@+id/selfie_x" android:id="@+id/selfie_x"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:contentDescription="@string/welcome_image_no_selfies" android:contentDescription="@string/welcome_image_no_selfies"
/> android:src="@drawable/selfie_x" />
<ImageView <ImageView
android:src="@drawable/proprietary_x"
android:id="@+id/proprietary_x" android:id="@+id/proprietary_x"
android:layout_marginStart="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/selfie_x" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap"
android:contentDescription="@string/welcome_image_proprietary" android:contentDescription="@string/welcome_image_proprietary"
/> android:src="@drawable/proprietary_x" />
</RelativeLayout> </LinearLayout>
<LinearLayout android:orientation="vertical" <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
> app:layout_constraintBottom_toBottomOf="parent"
<TextView app:layout_constraintStart_toEndOf="@id/center_guideline"
android:layout_width="wrap_content" app:layout_constraintTop_toTopOf="parent"
android:layout_height="wrap_content" android:orientation="vertical">
android:maxWidth="240dp"
android:text="@string/tutorial_3_text"
android:layout_gravity="center"
android:textStyle="bold"
android:textAlignment="center"
android:textSize="@dimen/normal_text"
android:gravity="center_horizontal"
android:textColor="@android:color/white"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:gravity="center_horizontal"
android:paddingTop="@dimen/standard_gap" android:maxWidth="240dp"
android:gravity="start" android:text="@string/tutorial_3_text"
android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/tutorial_3_subtext_1"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext_2"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext_3"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View file

@ -1,53 +1,153 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#0c609c" android:background="#0c609c"
android:gravity="center" android:gravity="center"
> android:orientation="horizontal">
<ImageView <TextView
android:id="@+id/welcomeYesButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="@dimen/overflow_button_dimen"
android:src="@drawable/sydney_opera_house" android:layout_marginEnd="@dimen/standard_gap"
android:paddingLeft="@dimen/large_gap" android:layout_marginRight="@dimen/standard_gap"
android:paddingRight="@dimen/standard_gap" android:layout_marginTop="@dimen/standard_gap"
android:paddingTop="@dimen/large_gap" android:text="@string/welcome_skip_button"
android:paddingBottom="@dimen/large_gap" android:textColor="#fff"
android:adjustViewBounds="true" android:textSize="@dimen/normal_text"
android:layout_gravity="center" android:textStyle="bold"
android:contentDescription="@string/welcome_image_sydney_opera_house" android:visibility="gone"
/> app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout android:orientation="vertical" <android.support.constraint.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:orientation="vertical"
> app:layout_constraintGuide_percent="0.60" />
<TextView
<ImageView
android:layout_width="370dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@string/welcome_image_sydney_opera_house"
android:paddingBottom="@dimen/large_gap"
android:paddingLeft="@dimen/tiny_gap"
android:paddingStart="@dimen/tiny_gap"
android:paddingRight="@dimen/standard_gap"
android:paddingEnd="@dimen/standard_gap"
android:paddingTop="@dimen/large_gap"
android:src="@drawable/sydney_opera_house"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp" android:orientation="vertical"
android:text="@string/tutorial_4_text" app:layout_constraintBottom_toBottomOf="parent"
android:layout_gravity="center" android:layout_marginEnd="@dimen/standard_gap"
android:textStyle="bold" android:layout_marginRight="@dimen/standard_gap"
android:textAlignment="center" app:layout_constraintStart_toEndOf="@id/center_guideline"
android:textSize="@dimen/normal_text" app:layout_constraintTop_toTopOf="parent">
android:gravity="center_horizontal"
android:textColor="@android:color/white"/>
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:gravity="center_horizontal"
android:paddingTop="@dimen/standard_gap" android:maxWidth="240dp"
android:gravity="start" android:text="@string/tutorial_4_text"
android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:paddingTop="@dimen/standard_gap"
android:text="@string/tutorial_4_subtext_1"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext_2"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="4dp"
android:text="@string/bullet"
android:textColor="@android:color/white"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="start"
android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext_3"
android:textAlignment="textStart"
android:textColor="@android:color/white" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>

View file

@ -1,51 +1,76 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#0c609c" android:background="#0c609c">
android:gravity="center"
> <TextView
android:id="@+id/welcomeYesButton"
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginTop="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:textColor="#fff"
android:textSize="@dimen/normal_text"
android:textStyle="bold"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.50" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/welcome_wikipedia"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/welcome_image_welcome_wikipedia" android:contentDescription="@string/welcome_image_welcome_wikipedia"
/> android:src="@drawable/welcome_wikipedia"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout android:orientation="vertical" <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:gravity="center_vertical" android:layout_marginLeft="@dimen/standard_gap"
> android:layout_marginStart="@dimen/standard_gap"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/center_guideline"
app:layout_constraintTop_toTopOf="parent">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:maxWidth="240dp" android:maxWidth="240dp"
android:text="@string/tutorial_1_text" android:text="@string/tutorial_1_text"
android:layout_gravity="center"
android:textStyle="bold"
android:textSize="@dimen/normal_text"
android:textAlignment="center" android:textAlignment="center"
android:gravity="center_horizontal" android:textColor="@android:color/white"
android:textColor="@android:color/white"/> android:textSize="@dimen/normal_text"
android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_1_subtext"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="center" android:maxWidth="240dp"
android:paddingTop="@dimen/standard_gap" android:paddingTop="@dimen/standard_gap"
android:gravity="center_horizontal" android:text="@string/tutorial_1_subtext"
android:textColor="@android:color/white" android:textAlignment="center"
/> android:textColor="@android:color/white" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</android.support.constraint.ConstraintLayout>

View file

@ -13,12 +13,12 @@
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/large_gap"
android:layout_marginBottom="@dimen/standard_gap" android:layout_marginBottom="@dimen/standard_gap"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:layout_marginTop="@dimen/large_gap"
app:cardCornerRadius="4dp" app:cardCornerRadius="4dp"
app:cardElevation="4dp"> app:cardElevation="4dp">
@ -40,6 +40,21 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/heading_text_size" /> android:textSize="@dimen/heading_text_size" />
<TextView
android:id="@+id/login_credentials"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap"
android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap"
android:textAlignment="center"
android:textColor="@color/secondaryDarkColor"
tools:text="@string/login_credential" />
<FrameLayout <FrameLayout
android:id="@+id/error_message_container" android:id="@+id/error_message_container"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -56,6 +71,7 @@
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:gravity="center"
android:paddingBottom="@dimen/small_gap" android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap" android:paddingTop="@dimen/small_gap"
android:textColor="@color/secondaryDarkColor" android:textColor="@color/secondaryDarkColor"
@ -121,7 +137,7 @@
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:visibility="gone" android:visibility="gone"
app:passwordToggleEnabled="false" app:passwordToggleEnabled="true"
tools:visibility="visible"> tools:visibility="visible">
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
@ -149,8 +165,8 @@
<Button <Button
android:id="@+id/signupButton" android:id="@+id/signupButton"
android:layout_width="0dp"
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginEnd="@dimen/small_gap" android:layout_marginEnd="@dimen/small_gap"
@ -160,8 +176,8 @@
<Button <Button
android:id="@+id/loginButton" android:id="@+id/loginButton"
android:layout_width="0dp"
style="@style/Widget.AppCompat.Button.Colored" style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/small_gap" android:layout_marginLeft="@dimen/small_gap"
android:layout_marginStart="@dimen/small_gap" android:layout_marginStart="@dimen/small_gap"
@ -171,16 +187,27 @@
</LinearLayout> </LinearLayout>
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:visibility="visible"
android:id="@+id/forgotPassword"
android:layout_width="match_parent"
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_below="@id/buttonFrame"
android:layout_marginBottom="@dimen/standard_gap"
android:text="@string/forgot_password"
android:textColor="@color/status_bar_blue" />
<fr.free.nrw.commons.ui.widget.HtmlTextView <fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/about_privacy_policy" android:id="@+id/about_privacy_policy"
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
android:layout_below="@id/buttonFrame"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/standard_gap" android:layout_below="@id/forgotPassword"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:text="@string/about_privacy_policy" android:layout_marginBottom="@dimen/standard_gap"
android:layout_centerHorizontal="true"/> android:text="@string/about_privacy_policy" />
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
@ -188,8 +215,8 @@
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="64dp" android:layout_height="64dp"
android:elevation="8dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:elevation="8dp"
app:srcCompat="@drawable/blue_rinse_circle" app:srcCompat="@drawable/blue_rinse_circle"
tools:ignore="UnusedAttribute" /> tools:ignore="UnusedAttribute" />
@ -198,9 +225,9 @@
android:layout_height="42dp" android:layout_height="42dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
tools:ignore="UnusedAttribute"
android:elevation="8dp" android:elevation="8dp"
app:srcCompat="@drawable/commons_logo_large" /> app:srcCompat="@drawable/commons_logo_large"
tools:ignore="UnusedAttribute" />
</FrameLayout> </FrameLayout>

View file

@ -5,9 +5,13 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content">
<include <include
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -19,19 +23,19 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar" android:layout_below="@id/toolbar"
android:layout_marginLeft="@dimen/activity_margin_horizontal"
android:layout_marginStart="@dimen/activity_margin_horizontal"
android:layout_marginRight="@dimen/activity_margin_horizontal"
android:layout_marginEnd="@dimen/activity_margin_horizontal" android:layout_marginEnd="@dimen/activity_margin_horizontal"
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:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
android:contentDescription="@string/commons_logo" android:contentDescription="@string/commons_logo"
/> android:src="@drawable/ic_launcher" />
<TextView <TextView
style="?android:textAppearanceLarge" style="?android:textAppearanceLarge"
@ -66,52 +70,57 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/activity_margin_horizontal"
android:layout_marginStart="@dimen/activity_margin_horizontal"
android:layout_marginRight="@dimen/activity_margin_horizontal"
android:layout_marginTop="@dimen/activity_margin_horizontal"
android:layout_marginEnd="@dimen/activity_margin_horizontal" android:layout_marginEnd="@dimen/activity_margin_horizontal"
> 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_horizontal"
android:gravity="center"
android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/website_launch_icon" android:id="@+id/website_launch_icon"
android:layout_width="@dimen/overflow_icon_dimen" android:layout_width="@dimen/overflow_icon_dimen"
android:layout_height="@dimen/overflow_icon_dimen" android:layout_height="@dimen/overflow_icon_dimen"
app:srcCompat="@drawable/ic_action_website"
android:contentDescription= "@string/commons_website"
android:layout_margin="@dimen/activity_margin_horizontal" android:layout_margin="@dimen/activity_margin_horizontal"
/> android:contentDescription="@string/commons_website"
app:srcCompat="@drawable/ic_action_website" />
<ImageView <ImageView
android:id="@+id/facebook_launch_icon" android:id="@+id/facebook_launch_icon"
android:layout_width="@dimen/overflow_icon_dimen" android:layout_width="@dimen/overflow_icon_dimen"
android:layout_height="@dimen/overflow_icon_dimen" android:layout_height="@dimen/overflow_icon_dimen"
app:srcCompat="@drawable/ic_action_facebook"
android:contentDescription= "@string/commons_facebook"
android:layout_margin="@dimen/activity_margin_horizontal" android:layout_margin="@dimen/activity_margin_horizontal"
/> android:contentDescription="@string/commons_facebook"
app:srcCompat="@drawable/ic_action_facebook" />
<ImageView <ImageView
android:id="@+id/github_launch_icon" android:id="@+id/github_launch_icon"
android:layout_width="@dimen/overflow_icon_dimen" android:layout_width="@dimen/overflow_icon_dimen"
android:layout_height="@dimen/overflow_icon_dimen" android:layout_height="@dimen/overflow_icon_dimen"
app:srcCompat="@drawable/ic_action_github"
android:contentDescription= "@string/commons_github"
android:layout_margin="@dimen/activity_margin_horizontal" android:layout_margin="@dimen/activity_margin_horizontal"
/> android:contentDescription="@string/commons_github"
app:srcCompat="@drawable/ic_action_github" />
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/about_rate_us"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:textColor="@color/primaryColor"
android:text="@string/about_rate_us" />
<TextView <TextView
android:id="@+id/about_privacy_policy" android:id="@+id/about_privacy_policy"
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap" android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
android:textColor="@color/primaryColor" android:textColor="@color/primaryColor"
android:gravity="center"
android:text="@string/about_privacy_policy" /> android:text="@string/about_privacy_policy" />
<TextView <TextView
@ -119,10 +128,19 @@
style="?android:textAppearanceSmall" style="?android:textAppearanceSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/primaryColor"
android:layout_marginTop="@dimen/standard_gap" android:layout_marginTop="@dimen/standard_gap"
android:gravity="center" android:gravity="center"
android:text="@string/about_credits" />
<TextView
android:id="@+id/about_faq"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/primaryColor" android:textColor="@color/primaryColor"
android:text="@string/about_credits" android:layout_marginTop="@dimen/standard_gap"
android:gravity="center"
/> />
<TextView <TextView
@ -136,6 +154,7 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</ScrollView>
<android.support.design.widget.NavigationView <android.support.design.widget.NavigationView
android:id="@+id/navigation_view" android:id="@+id/navigation_view"

View file

@ -2,12 +2,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent"> android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_centerInParent="true"
android:layout_gravity="center_vertical"
android:layout_marginTop="@dimen/small_gap"> android:layout_marginTop="@dimen/small_gap">
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
@ -67,6 +72,7 @@
android:layout_below="@id/login_credentials" android:layout_below="@id/login_credentials"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"> tools:visibility="visible">
<TextView <TextView
android:id="@+id/error_message" android:id="@+id/error_message"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -75,6 +81,7 @@
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
android:gravity="center"
android:paddingBottom="@dimen/small_gap" android:paddingBottom="@dimen/small_gap"
android:paddingTop="@dimen/small_gap" android:paddingTop="@dimen/small_gap"
android:textColor="@color/secondaryDarkColor" android:textColor="@color/secondaryDarkColor"
@ -117,7 +124,7 @@
android:layout_marginLeft="@dimen/standard_gap" android:layout_marginLeft="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_marginStart="@dimen/standard_gap" android:layout_marginStart="@dimen/standard_gap"
app:passwordToggleEnabled="false"> app:passwordToggleEnabled="true">
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
android:id="@+id/loginPassword" android:id="@+id/loginPassword"
@ -191,17 +198,17 @@
</LinearLayout> </LinearLayout>
<fr.free.nrw.commons.ui.widget.HtmlTextView <fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/about_privacy_policy" android:visibility="visible"
style="?android:textAppearanceSmall" android:id="@+id/forgotPassword"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:gravity="center_horizontal"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/buttonFrame" android:layout_below="@id/buttonFrame"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="@dimen/standard_gap" android:layout_marginBottom="@dimen/standard_gap"
android:text="@string/about_privacy_policy" /> android:text="@string/forgot_password" />
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
@ -220,7 +227,19 @@
android:elevation="8dp" android:elevation="8dp"
app:srcCompat="@drawable/commons_logo_large" app:srcCompat="@drawable/commons_logo_large"
tools:ignore="UnusedAttribute" /> tools:ignore="UnusedAttribute" />
</FrameLayout> </FrameLayout>
<fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/about_privacy_policy"
style="?android:textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/normal_text"
android:textColor="@color/status_bar_blue"
android:text="@string/about_privacy_policy" />
</RelativeLayout>
</ScrollView> </ScrollView>

View file

@ -21,9 +21,4 @@
app:drawableStart="@drawable/ic_info_outline_white_24dp" app:drawableStart="@drawable/ic_info_outline_white_24dp"
/> />
<fr.free.nrw.commons.media.MediaDetailSpacer
android:layout_width="match_parent"
android:layout_height="@dimen/small_gap"
/>
</LinearLayout> </LinearLayout>

View file

@ -25,21 +25,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/categories_search_text_hint" android:hint="@string/categories_search_text_hint"
android:imeOptions="flagNoExtractUi" android:maxLines="1"
android:gravity="left"
android:inputType="textCapWords" android:inputType="textCapWords"
android:maxLines="1" /> android:imeOptions="flagNoExtractUi"/>
<ProgressBar <ProgressBar
android:id="@+id/categoriesSearchInProgress" android:id="@+id/categoriesSearchInProgress"
style="?android:progressBarStyleSmall"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:indeterminate="true" android:indeterminate="true"
android:indeterminateOnly="true" android:indeterminateOnly="true"
android:visibility="gone" /> android:layout_marginRight="@dimen/tiny_gap"
android:layout_marginEnd="@dimen/tiny_gap"
android:layout_gravity="center_vertical|right"
style="?android:progressBarStyleSmall"
android:visibility="gone"
/>
</FrameLayout> </FrameLayout>
<TextView <TextView

View file

@ -149,6 +149,10 @@
tools:text="License link" /> tools:text="License link" />
</LinearLayout> </LinearLayout>
<fr.free.nrw.commons.media.MediaDetailSpacer
android:layout_width="match_parent"
android:layout_height="@dimen/small_gap" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -1,20 +1,28 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="fill"
android:orientation="vertical"
android:background="?attr/fragmentCategorisationBackground" android:background="?attr/fragmentCategorisationBackground"
android:paddingBottom="@dimen/small_gap"
android:paddingLeft="@dimen/standard_gap"
android:paddingStart="@dimen/standard_gap"
android:paddingRight="@dimen/standard_gap"
android:paddingEnd="@dimen/standard_gap"
android:paddingTop="@dimen/small_gap"
android:theme="@style/DarkAppTheme"
android:clickable="true" android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
> android:paddingBottom="@dimen/small_gap"
android:paddingEnd="@dimen/standard_gap"
android:paddingLeft="@dimen/standard_gap"
android:paddingRight="@dimen/standard_gap"
android:paddingStart="@dimen/standard_gap"
android:paddingTop="@dimen/small_gap"
android:theme="@style/DarkAppTheme">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText <EditText
android:id="@+id/titleEdit" android:id="@+id/titleEdit"
@ -22,10 +30,18 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableEnd="@drawable/mapbox_info_icon_default" android:drawableEnd="@drawable/mapbox_info_icon_default"
android:drawableRight="@drawable/mapbox_info_icon_default" android:drawableRight="@drawable/mapbox_info_icon_default"
android:scrollHorizontally="false" android:maxLines="1"
android:inputType="textMultiLine" android:maxLength="80"
android:hint="@string/share_title_hint" android:hint="@string/share_title_hint"
android:imeOptions="flagNoExtractUi" /> android:imeOptions="flagNoExtractUi"
android:inputType="text"
android:scrollHorizontally="false" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText <EditText
android:id="@+id/descEdit" android:id="@+id/descEdit"
@ -33,41 +49,40 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableEnd="@drawable/mapbox_info_icon_default" android:drawableEnd="@drawable/mapbox_info_icon_default"
android:drawableRight="@drawable/mapbox_info_icon_default" android:drawableRight="@drawable/mapbox_info_icon_default"
android:inputType="textMultiLine"
android:hint="@string/share_description_hint" android:hint="@string/share_description_hint"
android:imeOptions="flagNoExtractUi" /> android:imeOptions="flagNoExtractUi"
android:inputType="textMultiLine" />
</android.support.design.widget.TextInputLayout>
<Spinner <Spinner
android:id="@+id/licenseSpinner" android:id="@+id/licenseSpinner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="?attr/spinnerTheme" android:theme="?attr/spinnerTheme" />
/>
<Button <Button
android:text="@string/use_previous" android:id="@+id/titleDescButton"
android:background="?attr/buttonBackground"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/titleDescButton" android:background="?attr/buttonBackground"
/> android:text="@string/use_previous" />
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/share_license_summary"
android:id="@+id/share_license_summary" android:id="@+id/share_license_summary"
android:gravity="center" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/standard_gap" android:layout_marginTop="@dimen/standard_gap"
/> android:gravity="center"
android:text="@string/share_license_summary" />
<fr.free.nrw.commons.ui.widget.HtmlTextView <fr.free.nrw.commons.ui.widget.HtmlTextView
android:id="@+id/media_upload_policy"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@+id/media_upload_policy"
android:text="@string/media_upload_policy"
android:gravity="start"
android:layout_marginTop="@dimen/standard_gap" android:layout_marginTop="@dimen/standard_gap"
/> android:gravity="start"
android:text="@string/media_upload_policy" />
</LinearLayout> </LinearLayout>
</ScrollView>

View file

@ -1,11 +1,10 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:minHeight="72dp" android:minHeight="72dp">
>
<ImageView <ImageView
android:id="@+id/icon" android:id="@+id/icon"
@ -34,7 +33,7 @@
tools:text="@string/placeholder_place_distance" tools:text="@string/placeholder_place_distance"
/> />
<TextView <com.borjabravo.readmoretextview.ReadMoreTextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -46,12 +45,13 @@
android:layout_toRightOf="@id/icon" android:layout_toRightOf="@id/icon"
android:layout_toStartOf="@id/time" android:layout_toStartOf="@id/time"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" app:trimLines="2"
app:colorClickableText="#969494"
android:textAppearance="@style/TextAppearance.AppCompat.Body2" android:textAppearance="@style/TextAppearance.AppCompat.Body2"
tools:text="@string/placeholder_place_name" tools:text="@string/placeholder_place_name"
/> />
<TextView <com.borjabravo.readmoretextview.ReadMoreTextView
android:id="@+id/description" android:id="@+id/description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -62,7 +62,8 @@
android:layout_below="@id/title" android:layout_below="@id/title"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="4" app:trimLines="2"
app:colorClickableText="#969494"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:textAppearance="@style/TextAppearance.AppCompat.Body1"
tools:text="@string/placeholder_place_description" tools:text="@string/placeholder_place_description"
/> />

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -7,6 +7,13 @@
android:gravity="center" android:gravity="center"
android:weightSum="1" android:weightSum="1"
android:layout_centerHorizontal="true"> android:layout_centerHorizontal="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center_vertical"
>
<GridLayout <GridLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -67,15 +74,110 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:paddingTop="@dimen/standard_gap"
android:textColor="@android:color/white"/>
<TextView <TextView
android:layout_width="295dp" android:layout_width="295dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp" android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext" android:text="@string/tutorial_2_subtext_1"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:textAlignment="textStart"
android:paddingTop="@dimen/standard_gap" android:paddingTop="@dimen/standard_gap"
android:gravity="start" android:gravity="start"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext_2"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
</LinearLayout>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_2_subtext_3"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:id="@+id/welcomeYesButton"
android:textSize="@dimen/normal_text"
android:visibility="gone"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:textColor="#fff"
android:textStyle="bold"
/>
</RelativeLayout>

View file

@ -1,4 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center_vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -48,15 +55,103 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:paddingTop="@dimen/standard_gap"
android:textColor="@android:color/white"/>
<TextView <TextView
android:layout_width="295dp" android:layout_width="295dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp" android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext" android:text="@string/tutorial_3_subtext_1"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:textAlignment="textStart"
android:paddingTop="@dimen/standard_gap" android:paddingTop="@dimen/standard_gap"
android:gravity="start" android:gravity="start"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext_2"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_3_subtext_3"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:id="@+id/welcomeYesButton"
android:textSize="@dimen/normal_text"
android:visibility="gone"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:textColor="#fff"
android:textStyle="bold"
/>
</RelativeLayout>

View file

@ -1,4 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center_vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -6,7 +13,6 @@
android:background="#0c609c" android:background="#0c609c"
android:gravity="center_vertical" android:gravity="center_vertical"
> >
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -32,15 +38,115 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<TextView <TextView
android:layout_width="278dp" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:paddingTop="@dimen/standard_gap"
android:textColor="@android:color/white"/>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="240dp" android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext" android:text="@string/tutorial_4_subtext_1"
android:layout_gravity="center" android:layout_gravity="center"
android:textAlignment="textStart" android:textAlignment="textStart"
android:paddingTop="@dimen/standard_gap" android:paddingTop="@dimen/standard_gap"
android:gravity="start" android:gravity="start"
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
</LinearLayout>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext_2"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/bullet"
android:paddingRight="4dp"
android:textSize="16sp"
android:textColor="@android:color/white"/>
</LinearLayout>
<TextView
android:layout_width="295dp"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:text="@string/tutorial_4_subtext_3"
android:layout_gravity="center"
android:textAlignment="textStart"
android:gravity="start"
android:textColor="@android:color/white"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:id="@+id/welcomeYesButton"
android:textSize="@dimen/normal_text"
android:visibility="gone"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:textColor="#fff"
android:textStyle="bold"
/>
</RelativeLayout>

View file

@ -1,4 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0c609c"
android:gravity="center_vertical"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -42,3 +49,18 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
/> />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/overflow_button_dimen"
android:layout_marginTop="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:text="@string/welcome_skip_button"
android:id="@+id/welcomeYesButton"
android:textSize="@dimen/normal_text"
android:visibility="gone"
android:layout_gravity="right"
android:layout_alignParentRight="true"
android:textColor="#fff"
android:textStyle="bold"
/>
</RelativeLayout>

View file

@ -3,6 +3,6 @@
<item android:id="@+id/menu_upload_single" <item android:id="@+id/menu_upload_single"
android:title="@string/menu_upload_single" android:title="@string/menu_upload_single"
android:icon="@drawable/ic_send_white_24dp" android:icon="@drawable/ic_send_white_24dp"
android:enabled="false" android:enabled="true"
app:showAsAction="always" /> app:showAsAction="always" />
</menu> </menu>

View file

@ -27,7 +27,7 @@
<item <item
android:id="@+id/action_introduction" android:id="@+id/action_introduction"
android:icon="@drawable/ic_info_outline_black_24dp" android:icon="@drawable/ic_help_black_24dp"
android:title="@string/navigation_item_info"/> android:title="@string/navigation_item_info"/>
<item <item

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="drawer_width">50</integer>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="drawer_width">70</integer>
</resources>

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="preference_category_appearance">Appearance</string>
<string name="preference_category_general">General</string>
<string name="preference_category_feedback">Feedback</string>
<string name="preference_category_location">Location</string>
<string name="app_name">Commons</string> <string name="app_name">Commons</string>
<string name="bullet">&#8226; </string>
<string name="menu_settings">Settings</string> <string name="menu_settings">Settings</string>
<string name="username">Username</string> <string name="username">Username</string>
<string name="password">Password</string> <string name="password">Password</string>
<string name="login_credential">Log in to your Commons Beta account</string> <string name="login_credential">Log in to your Commons Beta account</string>
<string name="login">Log in</string> <string name="login">Log in</string>
<string name="forgot_password">Forgot Password?</string>
<string name="signup">Sign up</string> <string name="signup">Sign up</string>
<string name="logging_in_title">Logging in</string> <string name="logging_in_title">Logging in</string>
<string name="logging_in_message">Please wait…</string> <string name="logging_in_message">Please wait…</string>
@ -37,6 +43,7 @@
<string name="menu_share">Share</string> <string name="menu_share">Share</string>
<string name="menu_open_in_browser">View in Browser</string> <string name="menu_open_in_browser">View in Browser</string>
<string name="share_title_hint">Title</string> <string name="share_title_hint">Title</string>
<string name="add_title_toast">Please provide a title for this file</string>
<string name="share_description_hint">Description</string> <string name="share_description_hint">Description</string>
<string name="login_failed_network">Unable to login - network failure</string> <string name="login_failed_network">Unable to login - network failure</string>
<string name="login_failed_username">Unable to login - please check your username</string> <string name="login_failed_username">Unable to login - please check your username</string>
@ -91,7 +98,7 @@
<string name="share_license_summary">This image will be licensed under %1$s</string> <string name="share_license_summary">This image will be licensed under %1$s</string>
<string name="media_upload_policy">By submitting this picture, I declare that this is my own work, that it does not contain copyrighted material or selfies, and otherwise adheres to &lt;a href=\"https://commons.wikimedia.org/wiki/Commons:Policies_and_guidelines\"&gt;Wikimedia Commons policies&lt;/a&gt;.</string> <string name="media_upload_policy">By submitting this picture, I declare that this is my own work, that it does not contain copyrighted material or selfies, and otherwise adheres to &lt;a href=\"https://commons.wikimedia.org/wiki/Commons:Policies_and_guidelines\"&gt;Wikimedia Commons policies&lt;/a&gt;.</string>
<string name="menu_download">Download</string> <string name="menu_download">Download</string>
<string name="preference_license">License</string> <string name="preference_license">Default License</string>
<string name="use_previous">Use previous title/description</string> <string name="use_previous">Use previous title/description</string>
<string name="allow_gps">Automatically get current location</string> <string name="allow_gps">Automatically get current location</string>
<string name="allow_gps_summary">Retrieve current location to offer category suggestions if image is not geotagged</string> <string name="allow_gps_summary">Retrieve current location to offer category suggestions if image is not geotagged</string>
@ -120,11 +127,20 @@
<string name="tutorial_1_text">Wikimedia Commons hosts most of the images that are used in Wikipedia.</string> <string name="tutorial_1_text">Wikimedia Commons hosts most of the images that are used in Wikipedia.</string>
<string name="tutorial_1_subtext">Your images help educate people around the world!</string> <string name="tutorial_1_subtext">Your images help educate people around the world!</string>
<string name="tutorial_2_text">Please upload pictures that are taken or created entirely by yourself:</string> <string name="tutorial_2_text">Please upload pictures that are taken or created entirely by yourself:</string>
<string name="tutorial_2_subtext">- Natural objects (flowers, animals, mountains)\n- Useful objects (bicycles, train stations)\n- Famous people (your mayor, Olympic athletes you met)</string> <string name="tutorial_2_subtext">Natural objects (flowers, animals, mountains)\n&#8226; Useful objects (bicycles, train stations)\n&#8226; Famous people (your mayor, Olympic athletes you met)</string>
<string name="tutorial_2_subtext_1">Natural objects (flowers, animals, mountains)</string>
<string name="tutorial_2_subtext_2">Useful objects (bicycles, train stations)</string>
<string name="tutorial_2_subtext_3">Famous people (your mayor, Olympic athletes you met)</string>
<string name="tutorial_3_text">Please do NOT upload:</string> <string name="tutorial_3_text">Please do NOT upload:</string>
<string name="tutorial_3_subtext">- Selfies or pictures of your friends\n- Pictures you downloaded from the Internet\n- Screenshots of proprietary apps</string> <string name="tutorial_3_subtext">- Selfies or pictures of your friends\n- Pictures you downloaded from the Internet\n- Screenshots of proprietary apps</string>
<string name="tutorial_3_subtext_1">Selfies or pictures of your friends</string>
<string name="tutorial_3_subtext_2">Pictures you downloaded from the Internet</string>
<string name="tutorial_3_subtext_3">Screenshots of proprietary apps</string>
<string name="tutorial_4_text">Example upload:</string> <string name="tutorial_4_text">Example upload:</string>
<string name="tutorial_4_subtext">- 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</string> <string name="tutorial_4_subtext">- 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</string>
<string name="tutorial_4_subtext_1">Title: Sydney Opera House</string>
<string name="tutorial_4_subtext_2">Description: Sydney Opera House as viewed from across the bay</string>
<string name="tutorial_4_subtext_3">Categories: Sydney Opera House from the west, Sydney Opera House remote views</string>
<string name="welcome_wikipedia_text">Contribute your images. Help Wikipedia articles come to life!</string> <string name="welcome_wikipedia_text">Contribute your images. Help Wikipedia articles come to life!</string>
<string name="welcome_wikipedia_subtext">Images on Wikipedia come from Wikimedia Commons.</string> <string name="welcome_wikipedia_subtext">Images on Wikipedia come from Wikimedia Commons.</string>
<string name="welcome_copyright_text">Your images help educate people around the world.</string> <string name="welcome_copyright_text">Your images help educate people around the world.</string>
@ -158,8 +174,6 @@
<string name="become_a_tester_title">Become a Beta Tester</string> <string name="become_a_tester_title">Become a Beta Tester</string>
<string name="become_a_tester_description">Opt-in to our beta channel on Google Play and get early access to new features and bug fixes</string> <string name="become_a_tester_description">Opt-in to our beta channel on Google Play and get early access to new features and bug fixes</string>
<string name="beta_opt_in_link">https://play.google.com/apps/testing/fr.free.nrw.commons</string> <string name="beta_opt_in_link">https://play.google.com/apps/testing/fr.free.nrw.commons</string>
<string name="use_wikidata">Use Wikidata</string>
<string name="use_wikidata_summary">(Warning: disabling this may cause large mobile data consumption)</string>
<string name="map_theme_light">mapbox://styles/mapbox/traffic-day-v2</string> <string name="map_theme_light">mapbox://styles/mapbox/traffic-day-v2</string>
<string name="map_theme_dark">mapbox://styles/mapbox/traffic-night-v2</string> <string name="map_theme_dark">mapbox://styles/mapbox/traffic-night-v2</string>
<string name="mapbox_commons_app_token">pk.eyJ1IjoibWFza2FyYXZpdmVrIiwiYSI6ImNqMmxvdzFjMTAwMHYzM283ZWM3eW5tcDAifQ.ib5SZ9EVjwJe6GSKve0bcg</string> <string name="mapbox_commons_app_token">pk.eyJ1IjoibWFza2FyYXZpdmVrIiwiYSI6ImNqMmxvdzFjMTAwMHYzM283ZWM3eW5tcDAifQ.ib5SZ9EVjwJe6GSKve0bcg</string>
@ -214,6 +228,8 @@
<string name="login_to_your_account">Login to your account</string> <string name="login_to_your_account">Login to your account</string>
<string name="send_log_file">Send log file</string> <string name="send_log_file">Send log file</string>
<string name="send_log_file_description">Send log file to developers via email</string> <string name="send_log_file_description">Send log file to developers via email</string>
<string name="no_web_browser">No web browser found to open URL</string>
<string name="null_url">Error! URL not found</string>
<string name="nearby_location_has_not_changed">Location has not changed.</string> <string name="nearby_location_has_not_changed">Location has not changed.</string>
<string name="nearby_location_not_available">Location not available.</string> <string name="nearby_location_not_available">Location not available.</string>
@ -226,4 +242,7 @@
<string name="notifications_thank_you_edit">Thank you for making an edit</string> <string name="notifications_thank_you_edit">Thank you for making an edit</string>
<string name="notifications_mention">%1$s mentioned you on %2$s.</string> <string name="notifications_mention">%1$s mentioned you on %2$s.</string>
<string name="toggle_view_button">Toggle view</string> <string name="toggle_view_button">Toggle view</string>
<string name="about_rate_us"><u>Rate Us</u></string>
<string name="about_faq">Frequently Asked Questions</string>
<string name="welcome_skip_button">Skip Tutorial</string>
</resources> </resources>

View file

@ -1,22 +1,56 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android">
>
<PreferenceCategory
android:title="@string/preference_category_appearance">
<SwitchPreference
android:title="@string/preference_theme"
android:defaultValue="false"
android:summary="@string/preference_theme_summary"
android:key="theme" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/preference_category_general">
<ListPreference <ListPreference
android:key="defaultLicense" android:key="defaultLicense"
android:title="@string/preference_license" android:title="@string/preference_license"
android:entries="@array/pref_defaultLicense_entries" android:entries="@array/pref_defaultLicense_entries"
android:entryValues="@array/pref_defaultLicense_values" android:entryValues="@array/pref_defaultLicense_values"
android:defaultValue="@string/license_pref_cc_by_sa_4_0" android:defaultValue="@string/license_pref_cc_by_sa_4_0" />
/>
<CheckBoxPreference <SwitchPreference
android:key="useExternalStorage"
android:title="@string/use_external_storage"
android:defaultValue="true"
android:summary="@string/use_external_storage_summary" />
<EditTextPreference
android:key="uploads"
android:defaultValue="100"
android:title= "@string/set_limit"
android:inputType="numberDecimal"
android:maxLength="3" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/preference_category_location">
<SwitchPreference
android:key="allowGps" android:key="allowGps"
android:title="@string/allow_gps" android:title="@string/allow_gps"
android:defaultValue="false" android:defaultValue="false"
android:summary="@string/allow_gps_summary" android:summary="@string/allow_gps_summary" />
/>
</PreferenceCategory>
<PreferenceCategory
android:title="@string/preference_category_feedback">
<Preference android:title="@string/become_a_tester_title" <Preference android:title="@string/become_a_tester_title"
android:summary="@string/become_a_tester_description"> android:summary="@string/become_a_tester_description">
@ -24,38 +58,11 @@
android:data="@string/beta_opt_in_link" /> android:data="@string/beta_opt_in_link" />
</Preference> </Preference>
<CheckBoxPreference
android:title="@string/preference_theme"
android:defaultValue="false"
android:summary="@string/preference_theme_summary"
android:key="theme"
/>
<CheckBoxPreference
android:key="useWikidata"
android:title="@string/use_wikidata"
android:defaultValue="true"
android:summary="@string/use_wikidata_summary"
/>
<EditTextPreference
android:key="uploads"
android:defaultValue="100"
android:title= "@string/set_limit"
android:inputType="numberDecimal"
android:maxLength="3"
/>
<CheckBoxPreference
android:key="useExternalStorage"
android:title="@string/use_external_storage"
android:defaultValue="true"
android:summary="@string/use_external_storage_summary"
/>
<Preference <Preference
android:key="sendLogFile" android:key="sendLogFile"
android:title="@string/send_log_file" android:title="@string/send_log_file"
android:summary="@string/send_log_file_description"/> android:summary="@string/send_log_file_description"/>
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View file

@ -1,21 +1,29 @@
gradleVersion = 3.0.0 ## Project-wide Gradle settings.
#
SUPPORT_LIB_VERSION = 26.0.2 # For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Thu Mar 01 15:28:48 IST 2018
systemProp.http.proxyPort=0
compileSdkVersion=android-26 compileSdkVersion=android-26
buildToolsVersion = 26.0.2
minSdkVersion = 15
targetSdkVersion = 25
android.useDeprecatedNdk=true android.useDeprecatedNdk=true
# Library dependencies
BUTTERKNIFE_VERSION=8.6.0 BUTTERKNIFE_VERSION=8.6.0
DAGGER_VERSION=2.13
LEAK_CANARY=1.5.4
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
buildToolsVersion=26.0.2
#TODO: Temporary disabled. https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#aapt2 targetSdkVersion=25
#Refer to PR: https://github.com/commons-app/apps-android-commons/pull/932
android.enableAapt2=false android.enableAapt2=false
SUPPORT_LIB_VERSION=26.0.2
minSdkVersion=15
systemProp.http.proxyHost=
LEAK_CANARY=1.5.4
DAGGER_VERSION=2.13
gradleVersion=3.0.0

View file

@ -1,5 +1,6 @@
#Sat Mar 03 13:58:47 IST 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip