From ceffd197a97fd74d144c2861530a8e37d0f242cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Gonz=C3=A1lez=20Cabrero?= Date: Mon, 14 Mar 2016 14:02:45 +0100 Subject: [PATCH] Refactor calls to find views in ShareFileFragment --- .../android/ui/fragment/ShareFileFragment.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/owncloud/android/ui/fragment/ShareFileFragment.java b/src/com/owncloud/android/ui/fragment/ShareFileFragment.java index be3bbbf991..9cf5597848 100644 --- a/src/com/owncloud/android/ui/fragment/ShareFileFragment.java +++ b/src/com/owncloud/android/ui/fragment/ShareFileFragment.java @@ -252,7 +252,7 @@ public class ShareFileFragment extends Fragment */ private void initShareViaLinkListener(View shareView) { mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener(); - Switch shareViaLinkSwitch = (Switch) shareView.findViewById(R.id.shareViaLinkSectionSwitch); + Switch shareViaLinkSwitch = getShareViaLinkSwitch(); shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener); } @@ -314,13 +314,13 @@ public class ShareFileFragment extends Fragment private void initExpirationListener(View shareView) { mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener(); - ((Switch) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)). + getExpirationDateSwitch(). setOnCheckedChangeListener(mOnExpirationDateInteractionListener); shareView.findViewById(R.id.shareViaLinkExpirationLabel). setOnClickListener(mOnExpirationDateInteractionListener); - shareView.findViewById(R.id.shareViaLinkExpirationValue). + getExpirationDateValue(). setOnClickListener(mOnExpirationDateInteractionListener); } @@ -398,13 +398,13 @@ public class ShareFileFragment extends Fragment private void initPasswordListener(View shareView) { mOnPasswordInteractionListener = new OnPasswordInteractionListener(); - ((Switch) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)). + getPasswordSwitch(). setOnCheckedChangeListener(mOnPasswordInteractionListener); shareView.findViewById(R.id.shareViaLinkPasswordLabel). setOnClickListener(mOnPasswordInteractionListener); - shareView.findViewById(R.id.shareViaLinkPasswordValue). + getPasswordValue(). setOnClickListener(mOnPasswordInteractionListener); } @@ -466,7 +466,7 @@ public class ShareFileFragment extends Fragment private void initEditPermissionListener(View shareView) { mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener(); - ((Switch) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)). + getEditPermissionSwitch(). setOnCheckedChangeListener(mOnEditPermissionInteractionListener); } @@ -742,7 +742,7 @@ public class ShareFileFragment extends Fragment /// update state of the edit permission switch Switch editPermissionSwitch = getEditPermissionSwitch(); - if(getEditPermissionSection().getVisibility() == View.VISIBLE) { + if (getEditPermissionSection().getVisibility() == View.VISIBLE) { // set null listener before setChecked() to prevent infinite loop of calls editPermissionSwitch.setOnCheckedChangeListener(null); if (mPublicShare.getPermissions() > OCShare.READ_PERMISSION_FLAG) {