Use Kodi's version stored on the DB to decide which window to display on long press on Info button

This commit is contained in:
Synced Synapse 2016-11-15 19:25:16 +00:00
parent b7ece61951
commit 18811371a7
1 changed files with 10 additions and 24 deletions

View File

@ -203,30 +203,16 @@ public class RemoteFragment extends Fragment
setupDefaultButton(contextButton, new Input.ExecuteAction(Input.ExecuteAction.CONTEXTMENU), null); setupDefaultButton(contextButton, new Input.ExecuteAction(Input.ExecuteAction.CONTEXTMENU), null);
// Info button, v17 uses a different window to display codec info so check version number // Info button, v17 uses a different window to display codec info so check version number
Application.GetProperties getProperties = new Application.GetProperties(Application.GetProperties.VERSION); HostInfo hostInfo = hostManager.getHostInfo();
getProperties.execute(hostManager.getConnection(), new ApiCallback<ApplicationType.PropertyValue>() { if (hostInfo.getKodiVersionMajor() < 17) {
@Override setupDefaultButton(infoButton,
public void onSuccess(ApplicationType.PropertyValue result) { new Input.ExecuteAction(Input.ExecuteAction.INFO),
if (!isAdded()) return; new Input.ExecuteAction(Input.ExecuteAction.CODECINFO));
if (result.version.major < 17) { } else {
setupDefaultButton(infoButton, setupDefaultButton(infoButton,
new Input.ExecuteAction(Input.ExecuteAction.INFO), new Input.ExecuteAction(Input.ExecuteAction.INFO),
new Input.ExecuteAction(Input.ExecuteAction.CODECINFO)); new Input.ExecuteAction(Input.ExecuteAction.PLAYERPROCESSINFO));
} else { }
setupDefaultButton(infoButton,
new Input.ExecuteAction(Input.ExecuteAction.INFO),
new Input.ExecuteAction(Input.ExecuteAction.PLAYERPROCESSINFO));
}
}
@Override
public void onError(int errorCode, String description) {
if (!isAdded()) return;
// Something went wrong
Toast.makeText(getActivity(),
String.format(getString(R.string.error_getting_properties), description),
Toast.LENGTH_SHORT).show();
}
}, callbackHandler);
adjustRemoteButtons(); adjustRemoteButtons();