@@ -263,89 +263,13 @@ public void run(AccountManagerFuture<Bundle> result) {
263263 public void onGuidedActionClicked (GuidedAction action ) {
264264 if (ACTION_ID_CONFIRM == action .getId ()) {
265265 // Move onto the next step
266- GuidedStepFragment fragment = new SessionSelectorFragment ();
266+ GuidedStepFragment fragment = new SyncingFragment ();
267267 fragment .setArguments (getArguments ());
268268 add (getFragmentManager (), fragment );
269269 }
270270 }
271271 }
272272
273- public static class SessionSelectorFragment extends BaseGuidedStepFragment {
274- private static final int ACTION_ID_MEDIA_PLAYER = 1 ;
275- private static final int ACTION_ID_EXO_PLAYER = 2 ;
276- private static final int ACTION_ID_VLC = 3 ;
277-
278- @ NonNull
279- @ Override
280- public GuidanceStylist .Guidance onCreateGuidance (Bundle savedInstanceState ) {
281- GuidanceStylist .Guidance guidance = new GuidanceStylist .Guidance (
282- getString (R .string .setup_session_title ),
283- getString (R .string .setup_session_body ),
284- getString (R .string .account_label ),
285- null );
286-
287- return guidance ;
288- }
289-
290- @ Override
291- public void onCreateActions (@ NonNull List <GuidedAction > actions , Bundle savedInstanceState ) {
292- GuidedAction action = new GuidedAction .Builder (getActivity ())
293- .id (ACTION_ID_EXO_PLAYER )
294- .title (R .string .ExoPlayer_title )
295- .description (R .string .ExoPlayer_body )
296- .editable (false )
297- .build ();
298-
299- actions .add (action );
300-
301- action = new GuidedAction .Builder (getActivity ())
302- .id (ACTION_ID_VLC )
303- .title (R .string .VLC_title )
304- .description (R .string .VLC_body )
305- .editable (false )
306- .build ();
307-
308- actions .add (action );
309-
310- action = new GuidedAction .Builder (getActivity ())
311- .id (ACTION_ID_MEDIA_PLAYER )
312- .title (R .string .mediaplayer_title )
313- .description (R .string .mediaplayer_body )
314- .editable (false )
315- .build ();
316-
317- actions .add (action );
318- }
319-
320- @ Override
321- public void onGuidedActionClicked (GuidedAction action ) {
322- String session ;
323-
324- if (action .getId () == ACTION_ID_MEDIA_PLAYER ) {
325- session = Constants .SESSION_MEDIA_PLAYER ;
326- } else if (action .getId () == ACTION_ID_EXO_PLAYER ) {
327- session = Constants .SESSION_EXO_PLAYER ;
328- } else if (action .getId () == ACTION_ID_VLC ) {
329- session = Constants .SESSION_VLC ;
330- } else {
331- return ;
332- }
333-
334- // Store the chosen session type
335- SharedPreferences sharedPreferences = getActivity ().getSharedPreferences (
336- Constants .PREFERENCE_TVHEADEND , Context .MODE_PRIVATE );
337-
338- SharedPreferences .Editor editor = sharedPreferences .edit ();
339- editor .putString (Constants .KEY_SESSION , session );
340- editor .apply ();
341-
342- // Move onto the next step
343- GuidedStepFragment fragment = new SyncingFragment ();
344- fragment .setArguments (getArguments ());
345- add (getFragmentManager (), fragment );
346- }
347- }
348-
349273 public static class SyncingFragment extends BaseGuidedStepFragment implements EpgSyncTask .Listener {
350274 protected SimpleHtspConnection mConnection ;
351275 protected EpgSyncTask mEpgSyncTask ;
0 commit comments