Revert "Refactor calls to find views in ShareFileFragment"

This reverts commit 6143872543d30569e46fb4c5edc559f26cdd8bd6.
This commit is contained in:
Juan Carlos González Cabrero 2016-03-14 14:08:03 +01:00
parent ceffd197a9
commit 3d8195795b

View file

@ -252,7 +252,7 @@ public class ShareFileFragment extends Fragment
*/ */
private void initShareViaLinkListener(View shareView) { private void initShareViaLinkListener(View shareView) {
mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener(); mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener();
Switch shareViaLinkSwitch = getShareViaLinkSwitch(); Switch shareViaLinkSwitch = (Switch) shareView.findViewById(R.id.shareViaLinkSectionSwitch);
shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener); shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener);
} }
@ -314,13 +314,13 @@ public class ShareFileFragment extends Fragment
private void initExpirationListener(View shareView) { private void initExpirationListener(View shareView) {
mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener(); mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener();
getExpirationDateSwitch(). ((Switch) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)).
setOnCheckedChangeListener(mOnExpirationDateInteractionListener); setOnCheckedChangeListener(mOnExpirationDateInteractionListener);
shareView.findViewById(R.id.shareViaLinkExpirationLabel). shareView.findViewById(R.id.shareViaLinkExpirationLabel).
setOnClickListener(mOnExpirationDateInteractionListener); setOnClickListener(mOnExpirationDateInteractionListener);
getExpirationDateValue(). shareView.findViewById(R.id.shareViaLinkExpirationValue).
setOnClickListener(mOnExpirationDateInteractionListener); setOnClickListener(mOnExpirationDateInteractionListener);
} }
@ -398,13 +398,13 @@ public class ShareFileFragment extends Fragment
private void initPasswordListener(View shareView) { private void initPasswordListener(View shareView) {
mOnPasswordInteractionListener = new OnPasswordInteractionListener(); mOnPasswordInteractionListener = new OnPasswordInteractionListener();
getPasswordSwitch(). ((Switch) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)).
setOnCheckedChangeListener(mOnPasswordInteractionListener); setOnCheckedChangeListener(mOnPasswordInteractionListener);
shareView.findViewById(R.id.shareViaLinkPasswordLabel). shareView.findViewById(R.id.shareViaLinkPasswordLabel).
setOnClickListener(mOnPasswordInteractionListener); setOnClickListener(mOnPasswordInteractionListener);
getPasswordValue(). shareView.findViewById(R.id.shareViaLinkPasswordValue).
setOnClickListener(mOnPasswordInteractionListener); setOnClickListener(mOnPasswordInteractionListener);
} }
@ -466,7 +466,7 @@ public class ShareFileFragment extends Fragment
private void initEditPermissionListener(View shareView) { private void initEditPermissionListener(View shareView) {
mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener(); mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener();
getEditPermissionSwitch(). ((Switch) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)).
setOnCheckedChangeListener(mOnEditPermissionInteractionListener); setOnCheckedChangeListener(mOnEditPermissionInteractionListener);
} }
@ -742,7 +742,7 @@ public class ShareFileFragment extends Fragment
/// update state of the edit permission switch /// update state of the edit permission switch
Switch editPermissionSwitch = getEditPermissionSwitch(); Switch editPermissionSwitch = getEditPermissionSwitch();
if (getEditPermissionSection().getVisibility() == View.VISIBLE) { if(getEditPermissionSection().getVisibility() == View.VISIBLE) {
// set null listener before setChecked() to prevent infinite loop of calls // set null listener before setChecked() to prevent infinite loop of calls
editPermissionSwitch.setOnCheckedChangeListener(null); editPermissionSwitch.setOnCheckedChangeListener(null);
if (mPublicShare.getPermissions() > OCShare.READ_PERMISSION_FLAG) { if (mPublicShare.getPermissions() > OCShare.READ_PERMISSION_FLAG) {