diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6dd70110..7fef33fa 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -36,7 +36,7 @@ android:banner="@drawable/atv_banner" android:appCategory="game" android:icon="@mipmap/ic_launcher" - android:roundIcon="@mipmap/ic_launcher_round" + android:roundIcon="@mipmap/ic_launcher" android:theme="@style/AppTheme"> diff --git a/app/src/main/java/com/limelight/AppView.java b/app/src/main/java/com/limelight/AppView.java index 5624a014..42f0362b 100644 --- a/app/src/main/java/com/limelight/AppView.java +++ b/app/src/main/java/com/limelight/AppView.java @@ -2,7 +2,6 @@ package com.limelight; import java.io.StringReader; import java.util.List; -import java.util.Locale; import java.util.UUID; import com.limelight.computers.ComputerManagerListener; @@ -27,7 +26,6 @@ import android.app.Service; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; -import android.content.res.Configuration; import android.os.Bundle; import android.os.IBinder; import android.view.ContextMenu; @@ -250,7 +248,7 @@ public class AppView extends Activity implements AdapterFragmentCallbacks { String computerName = getIntent().getStringExtra(NAME_EXTRA); String labelText = getResources().getString(R.string.title_applist)+" "+computerName; - TextView label = (TextView) findViewById(R.id.appListText); + TextView label = findViewById(R.id.appListText); setTitle(labelText); label.setText(labelText); diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index ddfffce3..d4df26ac 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -167,7 +167,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, prefConfig = PreferenceConfiguration.readPreferences(this); // Listen for events on the game surface - streamView = (StreamView) findViewById(R.id.surfaceView); + streamView = findViewById(R.id.surfaceView); streamView.setOnGenericMotionListener(this); streamView.setOnTouchListener(this); @@ -274,7 +274,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, if (prefConfig.onscreenController) { // create virtual onscreen controller virtualController = new VirtualController(conn, - (FrameLayout)findViewById(R.id.surfaceView).getParent(), + (FrameLayout)streamView.getParent(), this); virtualController.refreshLayout(); } @@ -596,9 +596,8 @@ public class Game extends Activity implements SurfaceHolder.Callback, boolean handled = false; - boolean detectedGamepad = event.getDevice() == null ? false : - ((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || - (event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD); + boolean detectedGamepad = event.getDevice() != null && ((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || + (event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD); if (detectedGamepad || (event.getDevice() == null || event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC )) { @@ -638,9 +637,8 @@ public class Game extends Activity implements SurfaceHolder.Callback, } boolean handled = false; - boolean detectedGamepad = event.getDevice() == null ? false : - ((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || - (event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD); + boolean detectedGamepad = event.getDevice() != null && ((event.getDevice().getSources() & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK || + (event.getDevice().getSources() & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD); if (detectedGamepad || (event.getDevice() == null || event.getDevice().getKeyboardType() != InputDevice.KEYBOARD_TYPE_ALPHABETIC )) { diff --git a/app/src/main/java/com/limelight/HelpActivity.java b/app/src/main/java/com/limelight/HelpActivity.java index 3be731b2..fe06e5b6 100644 --- a/app/src/main/java/com/limelight/HelpActivity.java +++ b/app/src/main/java/com/limelight/HelpActivity.java @@ -51,14 +51,8 @@ public class HelpActivity extends Activity { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { - if (url.toUpperCase().startsWith("https://github.com/moonlight-stream/moonlight-docs/wiki/".toUpperCase()) || - url.toUpperCase().startsWith("http://github.com/moonlight-stream/moonlight-docs/wiki/".toUpperCase())) { - // Allow navigation to Moonlight docs - return false; - } - else { - return true; - } + return !(url.toUpperCase().startsWith("https://github.com/moonlight-stream/moonlight-docs/wiki/".toUpperCase()) || + url.toUpperCase().startsWith("http://github.com/moonlight-stream/moonlight-docs/wiki/".toUpperCase())); } }); diff --git a/app/src/main/java/com/limelight/PcView.java b/app/src/main/java/com/limelight/PcView.java index f048d20b..1f934cc3 100644 --- a/app/src/main/java/com/limelight/PcView.java +++ b/app/src/main/java/com/limelight/PcView.java @@ -2,9 +2,7 @@ package com.limelight; import java.io.FileNotFoundException; import java.io.IOException; -import java.net.InetAddress; import java.net.UnknownHostException; -import java.util.Locale; import com.limelight.binding.PlatformBinding; import com.limelight.binding.crypto.AndroidCryptoProvider; @@ -110,9 +108,9 @@ public class PcView extends Activity implements AdapterFragmentCallbacks { PreferenceManager.setDefaultValues(this, R.xml.preferences, false); // Setup the list view - ImageButton settingsButton = (ImageButton) findViewById(R.id.settingsButton); - ImageButton addComputerButton = (ImageButton) findViewById(R.id.manuallyAddPc); - ImageButton helpButton = (ImageButton) findViewById(R.id.helpButton); + ImageButton settingsButton = findViewById(R.id.settingsButton); + ImageButton addComputerButton = findViewById(R.id.manuallyAddPc); + ImageButton helpButton = findViewById(R.id.helpButton); settingsButton.setOnClickListener(new OnClickListener() { @Override @@ -138,7 +136,7 @@ public class PcView extends Activity implements AdapterFragmentCallbacks { .replace(R.id.pcFragmentContainer, new AdapterFragment()) .commitAllowingStateLoss(); - noPcFoundLayout = (RelativeLayout) findViewById(R.id.no_pc_found_layout); + noPcFoundLayout = findViewById(R.id.no_pc_found_layout); if (pcGridAdapter.getCount() == 0) { noPcFoundLayout.setVisibility(View.VISIBLE); } diff --git a/app/src/main/java/com/limelight/binding/input/KeyboardTranslator.java b/app/src/main/java/com/limelight/binding/input/KeyboardTranslator.java index 839cb500..a23d0767 100644 --- a/app/src/main/java/com/limelight/binding/input/KeyboardTranslator.java +++ b/app/src/main/java/com/limelight/binding/input/KeyboardTranslator.java @@ -2,8 +2,6 @@ package com.limelight.binding.input; import android.view.KeyEvent; -import com.limelight.nvstream.NvConnection; - /** * Class to translate a Android key code into the codes GFE is expecting * @author Diego Waxemberg diff --git a/app/src/main/java/com/limelight/binding/input/evdev/EvdevListener.java b/app/src/main/java/com/limelight/binding/input/evdev/EvdevListener.java index 926a637d..c5cf10ab 100644 --- a/app/src/main/java/com/limelight/binding/input/evdev/EvdevListener.java +++ b/app/src/main/java/com/limelight/binding/input/evdev/EvdevListener.java @@ -1,12 +1,12 @@ package com.limelight.binding.input.evdev; public interface EvdevListener { - public static final int BUTTON_LEFT = 1; - public static final int BUTTON_MIDDLE = 2; - public static final int BUTTON_RIGHT = 3; + int BUTTON_LEFT = 1; + int BUTTON_MIDDLE = 2; + int BUTTON_RIGHT = 3; - public void mouseMove(int deltaX, int deltaY); - public void mouseButtonEvent(int buttonId, boolean down); - public void mouseScroll(byte amount); - public void keyboardEvent(boolean buttonDown, short keyCode); + void mouseMove(int deltaX, int deltaY); + void mouseButtonEvent(int buttonId, boolean down); + void mouseScroll(byte amount); + void keyboardEvent(boolean buttonDown, short keyCode); } diff --git a/app/src/main/java/com/limelight/computers/ComputerManagerListener.java b/app/src/main/java/com/limelight/computers/ComputerManagerListener.java index 43083602..263f9fb3 100644 --- a/app/src/main/java/com/limelight/computers/ComputerManagerListener.java +++ b/app/src/main/java/com/limelight/computers/ComputerManagerListener.java @@ -3,5 +3,5 @@ package com.limelight.computers; import com.limelight.nvstream.http.ComputerDetails; public interface ComputerManagerListener { - public void notifyComputerUpdated(ComputerDetails details); + void notifyComputerUpdated(ComputerDetails details); } diff --git a/app/src/main/java/com/limelight/computers/ComputerManagerService.java b/app/src/main/java/com/limelight/computers/ComputerManagerService.java index 36e04732..0dd2d022 100644 --- a/app/src/main/java/com/limelight/computers/ComputerManagerService.java +++ b/app/src/main/java/com/limelight/computers/ComputerManagerService.java @@ -3,7 +3,6 @@ package com.limelight.computers; import java.io.IOException; import java.io.OutputStream; import java.io.StringReader; -import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.util.LinkedList; diff --git a/app/src/main/java/com/limelight/grid/GenericGridAdapter.java b/app/src/main/java/com/limelight/grid/GenericGridAdapter.java index 9e574a33..981a3883 100644 --- a/app/src/main/java/com/limelight/grid/GenericGridAdapter.java +++ b/app/src/main/java/com/limelight/grid/GenericGridAdapter.java @@ -55,10 +55,10 @@ public abstract class GenericGridAdapter extends BaseAdapter { convertView = inflater.inflate(layoutId, viewGroup, false); } - ImageView imgView = (ImageView) convertView.findViewById(R.id.grid_image); - ImageView overlayView = (ImageView) convertView.findViewById(R.id.grid_overlay); - TextView txtView = (TextView) convertView.findViewById(R.id.grid_text); - ProgressBar prgView = (ProgressBar) convertView.findViewById(R.id.grid_spinner); + ImageView imgView = convertView.findViewById(R.id.grid_image); + ImageView overlayView = convertView.findViewById(R.id.grid_overlay); + TextView txtView = convertView.findViewById(R.id.grid_text); + ProgressBar prgView = convertView.findViewById(R.id.grid_spinner); if (imgView != null) { if (!populateImageView(imgView, prgView, itemList.get(i))) { diff --git a/app/src/main/java/com/limelight/grid/assets/NetworkAssetLoader.java b/app/src/main/java/com/limelight/grid/assets/NetworkAssetLoader.java index 7e8adea7..9042d099 100644 --- a/app/src/main/java/com/limelight/grid/assets/NetworkAssetLoader.java +++ b/app/src/main/java/com/limelight/grid/assets/NetworkAssetLoader.java @@ -4,13 +4,11 @@ import android.content.Context; import com.limelight.LimeLog; import com.limelight.binding.PlatformBinding; -import com.limelight.nvstream.http.ComputerDetails; import com.limelight.nvstream.http.NvHTTP; import com.limelight.utils.ServerHelper; import java.io.IOException; import java.io.InputStream; -import java.net.InetAddress; public class NetworkAssetLoader { private final Context context; diff --git a/app/src/main/java/com/limelight/preferences/AddComputerManually.java b/app/src/main/java/com/limelight/preferences/AddComputerManually.java index 26e0f81f..b46c331b 100644 --- a/app/src/main/java/com/limelight/preferences/AddComputerManually.java +++ b/app/src/main/java/com/limelight/preferences/AddComputerManually.java @@ -1,8 +1,5 @@ package com.limelight.preferences; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.Locale; import java.util.concurrent.LinkedBlockingQueue; import com.limelight.computers.ComputerManagerService; @@ -17,7 +14,6 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; -import android.content.res.Configuration; import android.os.Bundle; import android.os.IBinder; import android.view.KeyEvent; @@ -136,7 +132,7 @@ public class AddComputerManually extends Activity { UiHelper.notifyNewRootView(this); - this.hostText = (TextView) findViewById(R.id.hostTextView); + this.hostText = findViewById(R.id.hostTextView); hostText.setImeOptions(EditorInfo.IME_ACTION_DONE); hostText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override diff --git a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java index 97bcdb2a..e6b53c44 100644 --- a/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java +++ b/app/src/main/java/com/limelight/preferences/PreferenceConfiguration.java @@ -3,7 +3,6 @@ package com.limelight.preferences; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageManager; -import android.content.res.Configuration; import android.os.Build; import android.preference.PreferenceManager; diff --git a/app/src/main/java/com/limelight/preferences/StreamSettings.java b/app/src/main/java/com/limelight/preferences/StreamSettings.java index 6bc05380..67842dae 100644 --- a/app/src/main/java/com/limelight/preferences/StreamSettings.java +++ b/app/src/main/java/com/limelight/preferences/StreamSettings.java @@ -2,7 +2,6 @@ package com.limelight.preferences; import android.content.Intent; import android.content.SharedPreferences; -import android.content.res.Configuration; import android.os.Bundle; import android.app.Activity; import android.preference.Preference; @@ -15,8 +14,6 @@ import com.limelight.PcView; import com.limelight.R; import com.limelight.utils.UiHelper; -import java.util.Locale; - public class StreamSettings extends Activity { private PreferenceConfiguration previousPrefs; diff --git a/app/src/main/java/com/limelight/ui/AdapterFragmentCallbacks.java b/app/src/main/java/com/limelight/ui/AdapterFragmentCallbacks.java index 4ebade79..8a6db396 100644 --- a/app/src/main/java/com/limelight/ui/AdapterFragmentCallbacks.java +++ b/app/src/main/java/com/limelight/ui/AdapterFragmentCallbacks.java @@ -3,6 +3,6 @@ package com.limelight.ui; import android.widget.AbsListView; public interface AdapterFragmentCallbacks { - public int getAdapterFragmentLayoutId(); - public void receiveAbsListView(AbsListView gridView); + int getAdapterFragmentLayoutId(); + void receiveAbsListView(AbsListView gridView); } diff --git a/app/src/main/java/com/limelight/ui/GameGestures.java b/app/src/main/java/com/limelight/ui/GameGestures.java index 4589ecc9..17b942fe 100644 --- a/app/src/main/java/com/limelight/ui/GameGestures.java +++ b/app/src/main/java/com/limelight/ui/GameGestures.java @@ -1,5 +1,5 @@ package com.limelight.ui; public interface GameGestures { - public void showKeyboard(); + void showKeyboard(); } diff --git a/app/src/main/java/com/limelight/utils/HelpLauncher.java b/app/src/main/java/com/limelight/utils/HelpLauncher.java index e027c1f4..6e33d00a 100644 --- a/app/src/main/java/com/limelight/utils/HelpLauncher.java +++ b/app/src/main/java/com/limelight/utils/HelpLauncher.java @@ -1,6 +1,5 @@ package com.limelight.utils; -import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.net.Uri; diff --git a/app/src/main/java/com/limelight/utils/ServerHelper.java b/app/src/main/java/com/limelight/utils/ServerHelper.java index db339843..87883753 100644 --- a/app/src/main/java/com/limelight/utils/ServerHelper.java +++ b/app/src/main/java/com/limelight/utils/ServerHelper.java @@ -14,7 +14,6 @@ import com.limelight.nvstream.http.NvApp; import com.limelight.nvstream.http.NvHTTP; import java.io.FileNotFoundException; -import java.net.InetAddress; import java.net.UnknownHostException; public class ServerHelper { diff --git a/app/src/main/res/layout/activity_add_computer_manually.xml b/app/src/main/res/layout/activity_add_computer_manually.xml index fcc46533..a96e5985 100644 --- a/app/src/main/res/layout/activity_add_computer_manually.xml +++ b/app/src/main/res/layout/activity_add_computer_manually.xml @@ -6,7 +6,7 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" - tools:context=".AddComputerManually" > + tools:context=".preferences.AddComputerManually" > - - - - diff --git a/app/src/main/res/layout/activity_stream_settings.xml b/app/src/main/res/layout/activity_stream_settings.xml index 08c39447..9705162d 100644 --- a/app/src/main/res/layout/activity_stream_settings.xml +++ b/app/src/main/res/layout/activity_stream_settings.xml @@ -7,6 +7,6 @@ android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin" android:id="@+id/stream_settings" - tools:context=".StreamSettings"> + tools:context=".preferences.StreamSettings"> \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 036d09bc..00000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_pc_scut_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_pc_scut_round.xml deleted file mode 100644 index d13e006c..00000000 --- a/app/src/main/res/mipmap-anydpi-v26/ic_pc_scut_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index ee146e88..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-hdpi/ic_pc_scut_round.png b/app/src/main/res/mipmap-hdpi/ic_pc_scut_round.png deleted file mode 100644 index 493b3aed..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_pc_scut_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 4b93e1a5..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_pc_scut_round.png b/app/src/main/res/mipmap-mdpi/ic_pc_scut_round.png deleted file mode 100644 index 6d928386..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_pc_scut_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index b8021d2f..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_pc_scut_round.png b/app/src/main/res/mipmap-xhdpi/ic_pc_scut_round.png deleted file mode 100644 index 4fb91ec1..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_pc_scut_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 08082e3a..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_pc_scut_round.png b/app/src/main/res/mipmap-xxhdpi/ic_pc_scut_round.png deleted file mode 100644 index cb8d5972..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_pc_scut_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index dd60674a..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_pc_scut_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_pc_scut_round.png deleted file mode 100644 index eb91fc3e..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_pc_scut_round.png and /dev/null differ diff --git a/moonlight-common b/moonlight-common index 2c431919..4fe228c7 160000 --- a/moonlight-common +++ b/moonlight-common @@ -1 +1 @@ -Subproject commit 2c4319196f62bac1d12d498914b0f4b6f1086e99 +Subproject commit 4fe228c719c34e7b22067991f656f86b4249055a