From e18c628a0475c2916239cdf6fd6c65a4fd4e58be Mon Sep 17 00:00:00 2001 From: Vanethos Date: Sat, 24 Jun 2017 12:44:10 +0100 Subject: [PATCH] Remove button (#718) * Changed the "Use previous title/description" button so that it does not delete the title and description edit text fields if there is no previous data. https://github.com/commons-app/apps-android-commons/issues/503 * Changed the "Use previous title/description" button so that it does not delete the title and description edit text fields if there is no previous data. * Changed the "Use previous title/description" button so that it does not delete the title and description edit text fields if there is no previous data. * Split the if statement in two lines * Move && to the beginning of the line * Restore order of titleEdit and descEdit --- .../fr/free/nrw/commons/upload/SingleUploadFragment.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java b/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java index 08e2f6050..cb83bc489 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/SingleUploadFragment.java @@ -101,6 +101,12 @@ public class SingleUploadFragment extends Fragment { prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); license = prefs.getString(Prefs.DEFAULT_LICENSE, Prefs.Licenses.CC_BY_SA_3); + // check if this is the first time we have uploaded + if (prefs.getString("Title", "").trim().length() == 0 + && prefs.getString("Desc", "").trim().length() == 0) { + titleDescButton.setVisibility(View.GONE); + } + Timber.d(license); ArrayAdapter adapter;