Commit 7a66c734 authored by Geoffrey Métais's avatar Geoffrey Métais

Code cleaning

parent 611d0e63
...@@ -80,7 +80,7 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi ...@@ -80,7 +80,7 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
mMedialibrary = VLCApplication.getMLInstance(); mMedialibrary = VLCApplication.getMLInstance();
mAdapter = new AudioBrowserAdapter(getActivity(),MediaLibraryItem.TYPE_PLAYLIST, this, false); mAdapter = new AudioBrowserAdapter(getActivity(), MediaLibraryItem.TYPE_PLAYLIST, this, false);
mAdapter.addAll(new ArrayList<MediaLibraryItem>(Arrays.asList(mMedialibrary.getPlaylists()))); mAdapter.addAll(new ArrayList<MediaLibraryItem>(Arrays.asList(mMedialibrary.getPlaylists())));
mTracks = (MediaWrapper[]) getArguments().getParcelableArray(KEY_TRACKS); mTracks = (MediaWrapper[]) getArguments().getParcelableArray(KEY_TRACKS);
mNewTrack = (MediaWrapper[]) getArguments().getParcelableArray(KEY_NEW_TRACKS); mNewTrack = (MediaWrapper[]) getArguments().getParcelableArray(KEY_NEW_TRACKS);
...@@ -101,13 +101,18 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi ...@@ -101,13 +101,18 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dialog_playlist, container); return inflater.inflate(R.layout.dialog_playlist, container);
}
mListView = (RecyclerView) view.findViewById(android.R.id.list); @Override
mSaveButton = (Button) view.findViewById(R.id.dialog_playlist_save); public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
mCancelButton = (Button) view.findViewById(R.id.dialog_playlist_cancel); super.onViewCreated(view, savedInstanceState);
mEmptyView = (TextView) view.findViewById(android.R.id.empty);
TextInputLayout mLayout = (TextInputLayout)view.findViewById(R.id.dialog_playlist_name); mListView = view.findViewById(android.R.id.list);
mSaveButton = view.findViewById(R.id.dialog_playlist_save);
mCancelButton = view.findViewById(R.id.dialog_playlist_cancel);
mEmptyView = view.findViewById(android.R.id.empty);
TextInputLayout mLayout = view.findViewById(R.id.dialog_playlist_name);
mEditText = mLayout.getEditText(); mEditText = mLayout.getEditText();
mSaveButton.setOnClickListener(this); mSaveButton.setOnClickListener(this);
mCancelButton.setOnClickListener(new View.OnClickListener() { mCancelButton.setOnClickListener(new View.OnClickListener() {
...@@ -121,7 +126,6 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi ...@@ -121,7 +126,6 @@ public class SavePlaylistDialog extends DialogFragment implements View.OnClickLi
mListView.setLayoutManager(new LinearLayoutManager(view.getContext())); mListView.setLayoutManager(new LinearLayoutManager(view.getContext()));
mListView.setAdapter(mAdapter); mListView.setAdapter(mAdapter);
updateEmptyView(); updateEmptyView();
return view;
} }
void updateEmptyView() { void updateEmptyView() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment