@TargetApi(Build.VERSION_CODES.HONEYCOMB) @Test public void testWithDirectory() { final DirectoryChooserFragment fragment = DirectoryChooserFragment.newInstance( DirectoryChooserConfig.builder().newDirectoryName("mydir").build()); startFragment(fragment, DirectoryChooserActivityMock.class); final View chooseBtn = fragment.getActivity().findViewById(R.id.btnConfirm); assertThat(chooseBtn).isEnabled(); assertThat(chooseBtn.performClick()).isTrue(); assertThat(((DirectoryChooserActivityMock) fragment.getActivity()).selectedDirectory) .isNotNull(); }
public static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config) { final DirectoryChooserFragment fragment = new DirectoryChooserFragment(); final Bundle args = new Bundle(); args.putParcelable(ARG_CONFIG, config); fragment.setArguments(args); return fragment; }
DirectoryChooserFragment extends DialogFragment { public static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config) { final DirectoryChooserFragment fragment = new DirectoryChooserFragment(); final Bundle args = new Bundle(); args.putParcelable(ARG_CONFIG, config); fragment.setArguments(args); return fragment; } }
DirectoryChooserFragment extends DialogFragment { public static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config) { final DirectoryChooserFragment fragment = new DirectoryChooserFragment(); final Bundle args = new Bundle(); args.putParcelable(ARG_CONFIG, config); fragment.setArguments(args); return fragment; } DirectoryChooserFragment(); }
DirectoryChooserFragment extends DialogFragment { public static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config) { final DirectoryChooserFragment fragment = new DirectoryChooserFragment(); final Bundle args = new Bundle(); args.putParcelable(ARG_CONFIG, config); fragment.setArguments(args); return fragment; } DirectoryChooserFragment(); static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config); @Override void onSaveInstanceState(@NonNull final Bundle outState); @Override void onCreate(final Bundle savedInstanceState); @Override View onCreateView(final LayoutInflater inflater, final ViewGroup container,
            final Bundle savedInstanceState); @Override void onAttach(final Activity activity); @Override void onDetach(); @Override void onPause(); @Override void onResume(); @Override void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater); @Override boolean onOptionsItemSelected(final MenuItem item); @Nullable OnFragmentInteractionListener getDirectoryChooserListener(); void setDirectoryChooserListener(@Nullable final OnFragmentInteractionListener listener); }
DirectoryChooserFragment extends DialogFragment { public static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config) { final DirectoryChooserFragment fragment = new DirectoryChooserFragment(); final Bundle args = new Bundle(); args.putParcelable(ARG_CONFIG, config); fragment.setArguments(args); return fragment; } DirectoryChooserFragment(); static DirectoryChooserFragment newInstance(@NonNull final DirectoryChooserConfig config); @Override void onSaveInstanceState(@NonNull final Bundle outState); @Override void onCreate(final Bundle savedInstanceState); @Override View onCreateView(final LayoutInflater inflater, final ViewGroup container,
            final Bundle savedInstanceState); @Override void onAttach(final Activity activity); @Override void onDetach(); @Override void onPause(); @Override void onResume(); @Override void onCreateOptionsMenu(final Menu menu, final MenuInflater inflater); @Override boolean onOptionsItemSelected(final MenuItem item); @Nullable OnFragmentInteractionListener getDirectoryChooserListener(); void setDirectoryChooserListener(@Nullable final OnFragmentInteractionListener listener); static final String KEY_CURRENT_DIRECTORY; }