Browse Source

Lint fixes, remove use of assert from code, update to latest support library

master
Anthony Restaino 9 years ago
parent
commit
71d6da0eee
  1. 27
      app/app.iml
  2. 8
      app/build.gradle
  3. 4
      app/src/main/java/acr/browser/lightning/dialog/BookmarksDialogBuilder.java
  4. 8
      app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java
  5. 1
      app/src/main/res/layout/activity_main.xml

27
app/app.iml

@ -31,6 +31,7 @@
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/lightningPlus/debug" /> <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/lightningPlus/debug" />
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/lightningPlus/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/lightningPlus/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/lightningPlus/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/lightningPlus/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/lightningPlus/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/lightningPlus/debug" isTestSource="false" generated="true" /> <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/lightningPlus/debug" isTestSource="false" generated="true" />
@ -92,11 +93,11 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/23.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/palette-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.0/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/net.i2p.android/client/0.7/jars" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/net.i2p.android/client/0.7/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
@ -116,13 +117,17 @@
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="client-0.7" level="project" /> <orderEntry type="library" exported="" name="client-0.7" level="project" />
<orderEntry type="library" exported="" name="design-23.0.0" level="project" /> <orderEntry type="library" exported="" name="design-23.0.1" level="project" />
<orderEntry type="library" exported="" name="palette-v7-23.0.0" level="project" /> <orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.0" level="project" /> <orderEntry type="library" exported="" name="jsr250-api-1.0" level="project" />
<orderEntry type="library" exported="" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="dagger-2.0.1" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.8.1" level="project" /> <orderEntry type="library" exported="" name="jsoup-1.8.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.0" level="project" /> <orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.0" level="project" /> <orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" /> <orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="otto-1.3.8" level="project" />
<orderEntry type="library" exported="" name="palette-v7-23.0.1" level="project" />
<orderEntry type="module" module-name="libnetcipher" exported="" /> <orderEntry type="module" module-name="libnetcipher" exported="" />
</component> </component>
</module> </module>

8
app/build.gradle

@ -44,10 +44,10 @@ android {
} }
dependencies { dependencies {
compile 'com.android.support:palette-v7:23.0.0' compile 'com.android.support:palette-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.0' compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.0' compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'org.jsoup:jsoup:1.8.1' compile 'org.jsoup:jsoup:1.8.1'
compile 'com.squareup:otto:1.3.8' compile 'com.squareup:otto:1.3.8'
compile 'com.google.dagger:dagger:2.0.1' compile 'com.google.dagger:dagger:2.0.1'

4
app/src/main/java/acr/browser/lightning/dialog/BookmarksDialogBuilder.java

@ -138,7 +138,7 @@ public class BookmarksDialogBuilder {
} }
public void showBookmarkFolderLongPressedDialog(final Context context, final HistoryItem item) { public void showBookmarkFolderLongPressedDialog(final Context context, final HistoryItem item) {
assert item.isFolder(); // assert item.isFolder();
final DialogInterface.OnClickListener dialogClickListener = final DialogInterface.OnClickListener dialogClickListener =
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
@ -167,7 +167,7 @@ public class BookmarksDialogBuilder {
} }
public void showRenameFolderDialog(final Context context, final HistoryItem item) { public void showRenameFolderDialog(final Context context, final HistoryItem item) {
assert item.isFolder(); // assert item.isFolder();
final AlertDialog.Builder editFolderDialog = new AlertDialog.Builder(context); final AlertDialog.Builder editFolderDialog = new AlertDialog.Builder(context);
editFolderDialog.setTitle(R.string.title_rename_folder); editFolderDialog.setTitle(R.string.title_rename_folder);
final EditText getTitle = new EditText(context); final EditText getTitle = new EditText(context);

8
app/src/main/java/acr/browser/lightning/fragment/BookmarksFragment.java

@ -192,9 +192,9 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
@Subscribe @Subscribe
public void bookmarkChanged(BookmarkEvents.BookmarkChanged event) { public void bookmarkChanged(BookmarkEvents.BookmarkChanged event) {
final int size = mBookmarks.size(); // final int size = mBookmarks.size();
mBookmarks.remove(event.oldBookmark); mBookmarks.remove(event.oldBookmark);
assert mBookmarks.size() < size; // assert mBookmarks.size() < size;
mBookmarks.add(event.newBookmark); mBookmarks.add(event.newBookmark);
mBookmarkAdapter.notifyDataSetChanged(); mBookmarkAdapter.notifyDataSetChanged();
Collections.sort(mBookmarks, new BookmarkManager.SortIgnoreCase()); Collections.sort(mBookmarks, new BookmarkManager.SortIgnoreCase());
@ -223,9 +223,9 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
@Subscribe @Subscribe
public void bookmarkDeleted(final BookmarkEvents.Deleted event) { public void bookmarkDeleted(final BookmarkEvents.Deleted event) {
final HistoryItem item = event.item; final HistoryItem item = event.item;
final int size = mBookmarks.size(); // final int size = mBookmarks.size();
mBookmarks.remove(event.item); mBookmarks.remove(event.item);
assert mBookmarks.size() < size; // assert mBookmarks.size() < size;
mBookmarkAdapter.notifyDataSetChanged(); mBookmarkAdapter.notifyDataSetChanged();
} }

1
app/src/main/res/layout/activity_main.xml

@ -36,6 +36,7 @@
android:layout_width="@dimen/navigation_width" android:layout_width="@dimen/navigation_width"
android:layout_height="match_parent"> android:layout_height="match_parent">
<fragment <fragment
android:id="@+id/bookmark_fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
class="acr.browser.lightning.fragment.BookmarksFragment" /> class="acr.browser.lightning.fragment.BookmarksFragment" />

Loading…
Cancel
Save