diff --git a/Contributing.md b/Contributing.md index 8784f85fbb..7a7d030170 100644 --- a/Contributing.md +++ b/Contributing.md @@ -3,7 +3,6 @@ If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version). ## Coding Style ---- - [Introduction] (#introduction) - [Styling and formatting] (#styling-and-formatting) @@ -20,14 +19,12 @@ If you make any contributions to Dolphin after December 1st, 2014, you are agree ## Introduction ---- This guide is for developers who wish to contribute to the Dolphin codebase. It will detail how to properly style and format code to fit this project. This guide also offers suggestions on specific functions and other varia that may be used in code. Following this guide and formatting your code as detailed will likely get your pull request merged much faster than if you don't (assuming the written code has no mistakes in itself). ## Styling and formatting ---- ### General - Try to limit lines of code to a maximum of 100 characters. @@ -130,7 +127,6 @@ private: ``` ## Code Specific ---- ### General - Using C++11 features is OK and recommended. @@ -229,3 +225,7 @@ private: // Class definitions }; ``` + +## Java + +The Android project is currently written in Java. If you are using Android Studio to contribute, you can import the project's code style from `code-style-java.jar`, located in `[Dolphin Root]/Source/Android`. Please organize imports before committing. \ No newline at end of file diff --git a/Source/Android/app/src/main/AndroidManifest.xml b/Source/Android/app/src/main/AndroidManifest.xml index d10632b868..9042094c43 100644 --- a/Source/Android/app/src/main/AndroidManifest.xml +++ b/Source/Android/app/src/main/AndroidManifest.xml @@ -30,7 +30,6 @@ android:theme="@style/DolphinWii" android:label="@string/add_directory_title"/> - implements * Initializes the dataset to be displayed, and associates the Adapter with the * Activity as an event listener. * - * @param path A String containing the path to the directory to be shown by this Adapter. + * @param path A String containing the path to the directory to be shown by this Adapter. * @param listener An Activity that can respond to callbacks from this Adapter. */ public FileAdapter(String path, FileClickListener listener) @@ -125,7 +125,8 @@ public class FileAdapter extends RecyclerView.Adapter implements if (fileList.isEmpty()) { Toast.makeText(view.getContext(), R.string.add_directory_empty_folder, Toast.LENGTH_SHORT).show(); - } else + } + else { // Delay the loading of the new directory to give a little bit of time for UI feedback // to happen. Hacky, but good enough for now; this is necessary because we're modifying @@ -141,7 +142,8 @@ public class FileAdapter extends RecyclerView.Adapter implements } }, 200); } - } else + } + else { // Pass the activity the path of the parent directory of the clicked file. mListener.finishSuccessfully(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java index e15516dbaf..69b39438e8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/model/FileListItem.java @@ -26,7 +26,8 @@ public class FileListItem implements Comparable if (file.isDirectory()) { mType = TYPE_FOLDER; - } else + } + else { String fileExtension = mPath.substring(mPath.lastIndexOf('.')); @@ -37,7 +38,8 @@ public class FileListItem implements Comparable if (allowedExtensions.contains(fileExtension)) { mType = NativeLibrary.IsWiiTitle(mPath) ? TYPE_WII : TYPE_GC; - } else + } + else { mType = TYPE_OTHER; } @@ -67,12 +69,14 @@ public class FileListItem implements Comparable if (theOther.getType() == getType()) { return getFilename().toLowerCase().compareTo(theOther.getFilename().toLowerCase()); - } else + } + else { if (getType() > theOther.getType()) { return 1; - } else + } + else { return -1; } diff --git a/Source/Android/code-style-java.jar b/Source/Android/code-style-java.jar new file mode 100644 index 0000000000..8140ad66f9 Binary files /dev/null and b/Source/Android/code-style-java.jar differ