From 2fc814bf39ed6a8ba7d26b1c1741a5aee8c855f2 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 27 Sep 2021 12:53:48 +0200 Subject: [PATCH] lint: Using android:onClick on older version of the platform is broken Signed-off-by: Andy Scherzinger --- .../com/nextcloud/client/onboarding/FirstRunActivity.java | 6 +++++- src/main/res/layout/first_run_activity.xml | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java b/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java index 8eb68e5aea..779556038b 100644 --- a/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java +++ b/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java @@ -115,6 +115,10 @@ public class FirstRunActivity extends BaseActivity implements ViewPager.OnPageCh hostOwnServerTextView.setTextColor(getResources().getColor(R.color.login_text_color)); hostOwnServerTextView.setVisibility(isProviderOrOwnInstallationVisible ? View.VISIBLE : View.GONE); + if(!isProviderOrOwnInstallationVisible) { + hostOwnServerTextView.setOnClickListener(v -> onHostYourOwnServerClick()); + } + progressIndicator = findViewById(R.id.progressIndicator); ViewPager viewPager = findViewById(R.id.contentPanel); @@ -200,7 +204,7 @@ public class FirstRunActivity extends BaseActivity implements ViewPager.OnPageCh // unused but to be implemented due to abstract parent } - public void onHostYourOwnServerClick(View view) { + public void onHostYourOwnServerClick() { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.url_server_install))); DisplayUtils.startIntentIfAppAvailable(intent, this, R.string.no_browser_available); } diff --git a/src/main/res/layout/first_run_activity.xml b/src/main/res/layout/first_run_activity.xml index ad764b9d44..0935b92667 100644 --- a/src/main/res/layout/first_run_activity.xml +++ b/src/main/res/layout/first_run_activity.xml @@ -101,7 +101,6 @@ android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:gravity="center_horizontal" - android:onClick="onHostYourOwnServerClick" android:text="@string/host_your_own_server"/>