From f3aec526b14faa34af0b99996998dabfb2637ac2 Mon Sep 17 00:00:00 2001 From: Eder Bastos Date: Sun, 10 May 2015 17:48:46 -0400 Subject: [PATCH] Add an IntelliJ settings file describing the Dolphin project code style. --- Contributing.md | 8 ++++---- Source/Android/app/src/main/AndroidManifest.xml | 1 - .../dolphinemu/adapters/FileAdapter.java | 8 +++++--- .../dolphinemu/model/FileListItem.java | 12 ++++++++---- Source/Android/code-style-java.jar | Bin 0 -> 1534 bytes 5 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 Source/Android/code-style-java.jar 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 0000000000000000000000000000000000000000..8140ad66f9d0318f07681facaddb87e9cc037492 GIT binary patch literal 1534 zcmWIWW@Zs#VBp|j(Cu2~R_l6&v66v-VLA}YF|aV?7nEe?=N0QG=clCV6_-@z0LkQx z)ZEl!y^7qNf2SB2Hhb!5oH*&@r*rbm`OS}m0ycP_JFk1(^R!IUo^kH)E=F7JauvZ8zF`Opu@R<4rgEx+_Kya=w3MB z2C_g72D`UdAEXfBL*s(f-S3zf7^=k?7^G1Zy5#2+WMt;)dL@=6g1q-O;&k3@2a&tq zwFO>j1=)ID_0`GAWD;(l;?A<8clV2qM=KXTOgw1OzyCdJa+36%BUzapujW2Kcc=Kd z%zbu+%9B$rp7|Vkq~%8M4Tq3P1@G8DwtIiSCffd<#nJ1TjmM*+-!ZDQoOss=SEWuY z{u(8ccejAidZNaHUzL%ExA~?P=U7}Ze0f7HS z4(pxm;`XQR<|uqBIq0JJSdV{Ckkj@o$gv9 z+iFyzH`~7DOxhgwk2>0ma}GS+s@I=;{K`sS8Fy2+vesQ?iJZ30+Oe;rgzaXmbaRWC z7xE)DU(u_0fsn_iZHGA)N}m^7@Wx@!k@yWaMBbe_WVCRbabw?Rr~eV1_pVfY|9GLZ zI8m#5rvNWYn_kw0^&!E$mySr*G*z5R$`hLxIaP6MJy(?GRDFXZ|*qpc-pr9^0e!d7UtYOFw6h;!&;GJk^ARF z2x;YfU0nH1{IKLPZAmEy>*jX{ez{It|2Bu+ZR-i4Rk49ivt3j|ly4jTy?61o!FglN zxtmHV%rqA)h!#8D*KyhU)qV^0nsd)dQLbvK>Em>Bmjy-u(HMY)W?Uwm%8(Pa@naBsC`|(@VkA#nn;4JtsdYF-IXdwWK67 zFTFUxn~_O`0g+$POC-2SU*ag6tz~ pL5nbmlLalHksXgMBoSIefm#WKD=QmFIV%uGFfuSq0BT@h003GOMzsI{ literal 0 HcmV?d00001