Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A large number of small changes to improve readability and maintainability #28

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
0448deb
Added comments to make it easier to understand
kwhitefoot Oct 24, 2016
bb4e96e
Added comments.
kwhitefoot Oct 24, 2016
f3f6a0a
Reformatted all files to get consistent indentation, etc.
kwhitefoot Oct 26, 2016
5e80fc1
Corrected Accont -> Account.
kwhitefoot Nov 2, 2016
e955086
Added proto and acceptcrt properties to Security enum so that there i…
kwhitefoot Nov 4, 2016
8ae08e7
Folder override can never be null so do not check for it.
kwhitefoot Nov 5, 2016
e70bb21
Add notes to README.md to explain the reason for the fork and briefly…
kwhitefoot Nov 6, 2016
76eebf3
Start moving arguments from execute to constructor to avoid the need …
kwhitefoot Nov 6, 2016
357d6f2
Created ConfigurationFieldNames class to name the fields in the confi…
kwhitefoot Nov 7, 2016
2968839
Fixed bug introduced by changes. Bug was incorrect casting of useSti…
kwhitefoot Nov 7, 2016
74e5e2e
Make patterns for analysing sticky notes static final so that we do n…
kwhitefoot Nov 7, 2016
f8816bb
Made notesFolder local instead of argument in DeleteNote.
kwhitefoot Nov 7, 2016
fb7d5fc
Move arguments from execute to constructor of UpdateThread to enforce…
kwhitefoot Nov 7, 2016
fc35bfa
Ran Field can be local analysis and fixed almost all.
kwhitefoot Nov 8, 2016
60036d3
ConstantConditions analyser. Some possible null references remain. …
kwhitefoot Nov 8, 2016
ea7c88c
Code Maturity analysis.
kwhitefoot Nov 8, 2016
c455f19
Pass arguments via constructor instead of execute; thi means that we …
kwhitefoot Nov 8, 2016
50e9d13
Removed all unused imports.
kwhitefoot Nov 8, 2016
20c7ac5
Removed redundant local variables.
kwhitefoot Nov 8, 2016
2283aa8
Use class instead of instance to refer to static fields.
kwhitefoot Nov 8, 2016
42a2756
Accepted all Declaration access can be weaker suggestions.
kwhitefoot Nov 8, 2016
1a6006c
Applied fix Make Final to all suggested lines.
kwhitefoot Nov 8, 2016
2986e11
Removed all redundant throws.
kwhitefoot Nov 8, 2016
52eb61f
Use <> instead of explicit type arguments.
kwhitefoot Nov 8, 2016
42fe7d4
Fixed empty XML elements.
kwhitefoot Nov 8, 2016
20328e7
Oops, forgot the progree dialog in doInBackground. Fixed.
kwhitefoot Nov 8, 2016
1ed7b17
Added intent item names to make it easier to understand and enforce p…
kwhitefoot Nov 9, 2016
c7fdc34
Put all the sticky colour related values together in the Colors enum.
kwhitefoot Nov 9, 2016
3f50eff
Removed unused constructor from Sticky.
kwhitefoot Nov 10, 2016
8f1de3a
Added comments to manifest to ask why we have met-data elements.
kwhitefoot Nov 11, 2016
2cbfb71
Use strings resource instead of literal strings to enable translation.
kwhitefoot Nov 11, 2016
4b0b96d
Ran the Infer nullity analyser to annotate the code with @Nullable to…
kwhitefoot Nov 12, 2016
215af82
Removed Imaper.sfolder because it was only assigned but never read.
kwhitefoot Nov 12, 2016
5021979
Fixed bug associated with background colour. None should have White …
kwhitefoot Nov 12, 2016
e7050a2
Added Utilities class. Only members so far are to define the interna…
kwhitefoot Nov 12, 2016
1078b43
Use try with resource to ensure that cursors are closed after use.
kwhitefoot Nov 12, 2016
0c3c427
No more warnings in NotesDb!
kwhitefoot Nov 12, 2016
c791e34
Only unused method warnings left in NotesListAdapter.
kwhitefoot Nov 12, 2016
d36fec2
Almost all warning fixed in UpdateThread.
kwhitefoot Nov 12, 2016
57abe43
Made StubProvider package local. Added TODO reminder to find out wha…
kwhitefoot Nov 13, 2016
b21a811
AndroidDomInspection suppressed,
kwhitefoot Nov 13, 2016
ddc04da
Most literal strings have now been replaced with string resources.
kwhitefoot Nov 13, 2016
e6cdc73
Partial translation to Norwegian (bokmal)
kwhitefoot Nov 14, 2016
80aa22c
Moved classes to different packages to remove cyclic dependencies.
kwhitefoot Nov 14, 2016
3eefa36
Moved classes to different packages to remove cyclic dependencies.
kwhitefoot Nov 15, 2016
372d90d
All warnings fixed or suppressed with explanations.
kwhitefoot Nov 15, 2016
b4fec98
Initialize security field to None so that we can ensure NonNull.
kwhitefoot Nov 15, 2016
d65c03b
Created function for creating a progress dialog, shortens the code. …
kwhitefoot Nov 16, 2016
69490c2
Deleted unused arguments.
kwhitefoot Nov 16, 2016
bd3defe
Renamed SyncAdapter.context to applicationContext to make it clear th…
kwhitefoot Nov 17, 2016
5681cd1
Use constants for column names instead of literal strings.
kwhitefoot Nov 18, 2016
f7fb071
Use File constructor instead of string concatenation to create file a…
kwhitefoot Nov 26, 2016
c9e0fca
Added log messages.
kwhitefoot Nov 26, 2016
f5868b1
Created a function to create an intent to notify the listview of sync…
kwhitefoot Nov 26, 2016
ed455e9
Ran Android Lint and fixed a few minor complaints.
kwhitefoot Nov 26, 2016
03f84b9
Acted on all Declaration Redundancy issues.
kwhitefoot Nov 26, 2016
4efb398
Acted on and suppressed some probable bugs reported by the analyser.
kwhitefoot Nov 27, 2016
9fa32c3
Make res local because it was only the error message that needed to b…
kwhitefoot Nov 28, 2016
ce23741
Ensure that security can never be null.
kwhitefoot Nov 28, 2016
7301ec1
Various possible error reports fixed.
kwhitefoot Nov 28, 2016
89d3f1d
Put repeated code into a function.
kwhitefoot Nov 28, 2016
2f6f021
Add functions to remove the need for local variables.
kwhitefoot Nov 28, 2016
85cbb41
Removed unused position argument. Added javadoc comments. Corrected…
kwhitefoot Nov 28, 2016
793b3e4
Announce that future changes will probably break compatibility with I…
kwhitefoot Nov 28, 2016
06cdb24
Split GetOneNote into SaveNote and SaveNoteAndUpdatDatabase so that w…
kwhitefoot Nov 29, 2016
dbbab7f
Don't store application context in a static field. Such storage caus…
kwhitefoot Dec 1, 2016
379323c
Fixed a lot of easy warnings, suppressed warnings that seem unnecessary.
kwhitefoot Dec 1, 2016
76d2c8d
Fixed possible nulls by making status local.
kwhitefoot Dec 1, 2016
db0554b
Make sSyncAdapter an instance field instead of static to remove a pot…
kwhitefoot Dec 2, 2016
9421bb5
Removed unnecessary if statement.
kwhitefoot Dec 2, 2016
5837083
Made some fields final.
kwhitefoot Dec 2, 2016
22067c2
Acted on some declaration redundancy inspection results.
kwhitefoot Dec 2, 2016
f3d225f
Acted on some declaration redundancy inspection results.
kwhitefoot Dec 2, 2016
e4458fe
Fixed spelling: accountName - accountName, etc. Reduced visibility o…
kwhitefoot Dec 3, 2016
576b90b
Made account non-static in SyncAdapter.
kwhitefoot Dec 3, 2016
d3790f3
Begin encapsulating directory names in ImapNotes2Account to reduce re…
kwhitefoot Dec 3, 2016
8db7d56
Fixed case of search label -> Search as in Chris Graham's ocControl f…
kwhitefoot Dec 19, 2016
19874b8
Added notes about vector clocks and merging.
kwhitefoot Dec 19, 2016
749707d
Added SetAccount overloads to hide more of the Data implementation. …
kwhitefoot Dec 19, 2016
8a42b03
Implemented Chris Graham's heading change for edit account but added …
kwhitefoot Dec 19, 2016
56e0e1a
Implemented Chris Graham's confirmation dialog for deletion. Once we…
kwhitefoot Dec 19, 2016
3aee097
Implemented Chris Graham's clarification "Select account" -> "Select …
kwhitefoot Dec 19, 2016
7db8d0b
Implemented Chris Graham's clarification autosync on save.
kwhitefoot Dec 19, 2016
189af9e
Implemented Chris Graham's corection for height.
kwhitefoot Dec 19, 2016
13b688b
Use maxLines=1 instead of singleLine.
kwhitefoot Dec 19, 2016
b3e8797
Fixed null reference error caused by over enthusiastic refactoring.
kwhitefoot Dec 29, 2016
854d9f1
Now using wasabeef rich editor in a branch,
kwhitefoot Dec 29, 2016
0497694
Now using wasabeef rich editor in master. Seems to work so far. Nee…
kwhitefoot Jan 4, 2017
f958582
Now using wasabeef rich editor in master. Seems to work so far. Nee…
kwhitefoot Jan 18, 2017
b71b39b
Fix bug that meant that a failed login showed and empty Toast instead…
kwhitefoot Jan 18, 2017
8485219
Moved ImapNotes2Result instance to local created in return statement.…
kwhitefoot Jan 19, 2017
ec9574d
Moved ImapNotes2Result instance to local created in return statement.…
kwhitefoot Jan 19, 2017
b75f6b1
Added icons for the wasabeef rich text editor. Thank you nbenm for p…
kwhitefoot Jan 22, 2017
c9391c9
Fixed typo in SQL create table that was causing an uncaught exception…
kwhitefoot Jan 27, 2017
f8cc7bb
Added new constructor to ImapNotes2Account to avoid using setters. R…
kwhitefoot Feb 9, 2017
bf91694
Added note about travis.
kwhitefoot Feb 14, 2017
1c7d136
Moved Result class to its own file because the same pattern was used …
kwhitefoot Feb 15, 2017
bfc28ce
Merge remote-tracking branch 'origin/master'
kwhitefoot Feb 15, 2017
f0a314a
Made fields of ImapNotes2Account public and final, removed the functi…
kwhitefoot Feb 16, 2017
3da49b1
Fixed errors due to removing getters.
kwhitefoot Feb 16, 2017
0389e5d
Fixed bug in GetSynchronizationInterval, forgot to set status = true …
kwhitefoot Feb 17, 2017
16faee9
Replace syncinterval textview with a number picker and removed valida…
kwhitefoot Feb 18, 2017
52d93fa
Added notes on device id, started implementing device id. Removed un…
kwhitefoot Feb 20, 2017
f37b264
Fixed device id generator bug.
kwhitefoot Feb 25, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ImapNote2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "23.0.2"
buildToolsVersion "23.0.3"

//noinspection GroovyMissingReturnStatement
defaultConfig {
applicationId "com.Pau.ImapNotes2"
minSdkVersion 16
targetSdkVersion 16
minSdkVersion 19
targetSdkVersion 19
}

buildTypes {
Expand All @@ -17,6 +18,7 @@ android {
}
}

//noinspection GroovyMissingReturnStatement
packagingOptions {
exclude 'META-INF/LICENSE.txt'
}
Expand All @@ -29,4 +31,7 @@ dependencies {
compile files('libs/commons-io-2.4.jar')
compile files('libs/javamaildir-0.6.jar')
compile files('libs/mail.jar')
compile 'jdiff:jdiff:1.0.9'
compile 'jp.wasabeef:richeditor-android:1.2.1'

}
163 changes: 97 additions & 66 deletions ImapNote2/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,75 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.Pau.ImapNotes2"
android:versionCode="40"
android:versionName="4.9" xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_SYNC_STATS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>

<application
android:icon="@drawable/ic_launcher"
android:name=".ImapNotes2"
android:label="@string/app_name"
android:theme="@style/ImapNotesTheme">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Pau.ImapNotes2"
android:versionCode="40"
android:versionName="4.9">

<activity android:name=".Listactivity"
android:label="@string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>
<!--
<uses-sdk android:minSdkVersion="19" />
-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />

<activity android:name=".AccontConfigurationActivity"
android:exported="true"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>
<application
android:name=".ImapNotes2k"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/ImapNotesTheme"
android:allowBackup="true">

<activity android:name=".NoteDetailActivity"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>
<activity
android:name=".Listactivity"
android:label="@string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>

<activity android:name=".NewNoteActivity"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>

<service android:name="com.Pau.ImapNotes2.Miscs.ImapNotesAuthenticatorService" android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<activity
android:name=".AccountConfigurationActivity"
android:exported="true"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>

<provider
android:name="com.Pau.ImapNotes2.Sync.StubProvider"
android:authorities="com.Pau.ImapNotes2.provider"
android:exported="false" />
<activity
android:name=".NoteDetailActivity"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>

<service android:name="com.Pau.ImapNotes2.Sync.SyncService" android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
</application>
<activity
android:name=".NewNoteActivity"
android:parentActivityName="com.Pau.ImapNotes2.Listactivity">
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.Pau.ImapNotes2.Listactivity" />
</activity>

<service
android:name="com.Pau.ImapNotes2.Sync.ImapNotesAuthenticatorService"
android:exported="true"
android:permission="">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>

<!-- TODO: What is StubProvider for? This is the only reference to it.
Also AndroidDom Inspection complains about it not being public, yet the application still
works.-->
<!--suppress AndroidDomInspection -->
<provider
android:name="com.Pau.ImapNotes2.Sync.StubProvider"
android:authorities="com.Pau.ImapNotes2.provider"
android:exported="false" />

<service
android:name="com.Pau.ImapNotes2.Sync.SyncService"
android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<!-- What is this meta-data for? There doesn't seem to be any code that uses it -->
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter" />
</service>
</application>
</manifest>
Loading