Skip to content

Commit 4f17d15

Browse files
committed
Remove Session choice from Setup flow
This does NOT yet remove the ability to choose a different session type, this can still be done via the Settings at the end, but it does make it less obvious and likely to be used
1 parent 861423b commit 4f17d15

File tree

5 files changed

+7
-90
lines changed

5 files changed

+7
-90
lines changed

app/src/main/java/ie/macinnes/tvheadend/setup/TvInputSetupActivity.java

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

app/src/main/java/ie/macinnes/tvheadend/tvinput/TvInputService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void onCreate() {
5757
SharedPreferences sharedPreferences = getSharedPreferences(
5858
Constants.PREFERENCE_TVHEADEND, Context.MODE_PRIVATE);
5959

60-
mSessionType = sharedPreferences.getString(Constants.KEY_SESSION, Constants.SESSION_MEDIA_PLAYER);
60+
mSessionType = sharedPreferences.getString(Constants.KEY_SESSION, Constants.SESSION_EXO_PLAYER);
6161

6262
mAccountManager = AccountManager.get(this);
6363
mAccount = AccountUtils.getActiveAccount(this);

app/src/main/res/values/preferences.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<resources>
1919
<!-- Video Player Settings -->
2020
<string-array name="video_player_names">
21-
<item>ExoPlayer</item>
22-
<item>VLC</item>
23-
<item>Media Player</item>
21+
<item>ExoPlayer (Recommended)</item>
22+
<item>VLC (Deprecated)</item>
23+
<item>Media Player (Deprecated)</item>
2424
</string-array>
2525

2626
<string-array name="video_player_values">

app/src/main/res/values/strings.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,11 @@ under the License.
7070
<string name="setup_only_one_account">Only one Tvheadend account is currently supported</string>
7171
<string name="setup_progress_body">Processing</string>
7272
<string name="setup_progress_title">Checking your HTSP account</string>
73-
<string name="setup_session_body">There are several Session implementations, please choose one</string>
74-
<string name="setup_session_title">Session Selector</string>
7573
<string name="setup_settings_body">Advanced Settings</string>
7674
<string name="setup_settings_title">Settings</string>
7775
<string name="setup_sync_body">Just a few seconds please :)</string>
7876
<string name="setup_sync_title">Syncing Channels and Program data</string>
7977

80-
<string name="ExoPlayer_body">Google ExoPlayer (Recommended)</string>
81-
<string name="ExoPlayer_title">ExoPlayer</string>
82-
<string name="mediaplayer_body">Android Media Player (Deprecated)</string>
83-
<string name="mediaplayer_title">Media Player</string>
84-
<string name="VLC_body">VideoLAN LibVLC (Deprecated)</string>
85-
<string name="VLC_title">LibVLC</string>
8678
<string name="video_unsupported_error">Unsupported Video Track Selected</string>
8779
<string name="error_unsupported_audio">Unsupported Audio Track Selected</string>
8880
<string name="error_unsupported_text">Unsupported Text Track Selected</string>

app/src/main/res/xml/preferences.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
android:title="Video Player Choice"
2727
android:dialogTitle="Video Player Choice"
2828
android:entries="@array/video_player_names"
29-
android:entryValues="@array/video_player_values" />
29+
android:entryValues="@array/video_player_values"
30+
android:defaultValue="SESSION-EXO-PLAYER"/>
3031
</PreferenceCategory>
3132

3233
<PreferenceCategory android:title="EPG">

0 commit comments

Comments
 (0)