From 68cded37d9a16f38c2cd50a502f3c7355bee8365 Mon Sep 17 00:00:00 2001 From: Sergey Solovyev Date: Sun, 29 Apr 2018 19:04:13 +0200 Subject: [PATCH] Update Gradle configuration --- app/build.gradle | 86 ++++++++++--------- .../android/calculator/BaseActivity.java | 8 +- .../calculator/CalculatorActivity.java | 8 +- .../android/calculator/DisplayFragment.java | 5 +- .../android/calculator/EditorFragment.java | 4 +- .../calculator/about/AboutFragment.java | 10 +-- .../about/ReleaseNotesFragment.java | 4 +- .../solovyev/android/calculator/ads/AdUi.java | 4 +- .../converter/ConverterFragment.java | 18 ++-- .../entities/BaseEntitiesFragment.java | 8 +- .../functions/BaseFunctionFragment.java | 16 ++-- .../history/BaseHistoryFragment.java | 10 +-- .../history/EditHistoryFragment.java | 7 +- .../calculator/keyboard/KeyboardUi.java | 48 +++++------ .../keyboard/PartialKeyboardUi.java | 12 +-- .../android/calculator/plot/PlotActivity.java | 4 +- .../plot/PlotDimensionsFragment.java | 20 ++--- .../plot/PlotEditFunctionFragment.java | 14 +-- .../plot/PlotFunctionsFragment.java | 6 +- .../preferences/PrecisionPreference.java | 4 +- .../variables/EditVariableFragment.java | 16 ++-- .../android/calculator/view/Tabs.java | 6 +- .../common/text/ValueOfFormatter.java | 1 - build.gradle | 16 ++-- dragbutton/build.gradle | 5 +- gradle/wrapper/gradle-wrapper.properties | 4 +- jscl/build.gradle | 11 ++- .../FixedCapacityListMessageRegistry.java | 2 - translations/build.gradle | 11 ++- 29 files changed, 180 insertions(+), 188 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 370370d7..b3bc1351 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,7 +23,6 @@ apply plugin: 'com.android.application' apply plugin: 'maven' apply plugin: 'signing' -apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion versions.sdk.compile @@ -61,65 +60,68 @@ android { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } + + defaultConfig { + javaCompileOptions { + annotationProcessorOptions { + arguments = ['library': 'true'] + } + } + } } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile "com.android.support:support-v4:${versions.supportLib}" - compile "com.android.support:appcompat-v7:${versions.supportLib}" - compile "com.android.support:design:${versions.supportLib}" - compile('ch.acra:acra:4.7.0') { + implementation "com.android.support:support-v4:${versions.supportLib}" + implementation "com.android.support:appcompat-v7:${versions.supportLib}" + implementation "com.android.support:design:${versions.supportLib}" + implementation('ch.acra:acra:4.7.0') { exclude group: 'org.json' } - compile ':measure:' - compile ':square-otto:1.3.9-SNAPSHOT' - apt ':square-otto-compiler:1.3.9-SNAPSHOT' - apt 'com.squareup:javapoet:1.5.1' - compile project(':dragbutton') - compile(project(':jscl')) { + implementation ':measure:' + implementation ':square-otto:1.3.9-SNAPSHOT' + annotationProcessor ':square-otto:1.3.9-SNAPSHOT' + annotationProcessor ':square-otto-compiler:1.3.9-SNAPSHOT' + annotationProcessor 'com.squareup:javapoet:1.5.1' + implementation project(':dragbutton') + implementation(project(':jscl')) { exclude(module: 'xercesImpl') } - compile 'org.solovyev.android:checkout:1.0.1' - compile 'org.solovyev.android:material:0.1.4@aar' - compile "com.google.android.gms:play-services-ads:${versions.gpsLib}" - compile "com.google.android.gms:play-services-base:${versions.gpsLib}" - compile "com.google.android.gms:play-services-analytics:${versions.gpsLib}" - compile(name: 'plotter', ext: 'aar') - compile 'com.google.guava:guava:20.0' - compile('org.simpleframework:simple-xml:2.6.1') { + implementation 'org.solovyev.android:checkout:1.0.1' + implementation 'org.solovyev.android:material:0.1.4@aar' + implementation "com.google.android.gms:play-services-ads:${versions.gpsLib}" + implementation "com.google.android.gms:play-services-base:${versions.gpsLib}" + implementation "com.google.android.gms:play-services-analytics:${versions.gpsLib}" + implementation(name: 'plotter', ext: 'aar') + implementation 'com.google.guava:guava:20.0' + implementation('org.simpleframework:simple-xml:2.6.1') { exclude(module: 'stax') exclude(module: 'stax-api') exclude(module: 'xpp3') } - compile 'com.jakewharton:butterknife:7.0.1' + implementation 'com.jakewharton:butterknife:8.8.1' + annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' - compile 'com.google.dagger:dagger:2.0.2' - apt "com.google.dagger:dagger-compiler:2.0.2" - compile 'javax.annotation:jsr250-api:1.0' + implementation 'com.google.dagger:dagger:2.0.2' + annotationProcessor "com.google.dagger:dagger-compiler:2.0.2" + implementation 'javax.annotation:jsr250-api:1.0' - testCompile 'junit:junit:4.12' - testCompile 'net.sf.opencsv:opencsv:2.0' - testCompile 'org.mockito:mockito-core:1.9.0' - testCompile 'org.robolectric:robolectric:3.4.2' - testCompile 'org.mockito:mockito-all:1.9.5' - testCompile 'org.skyscreamer:jsonassert:1.2.3' - testCompile(name: 'org.apache.http.legacy', ext: 'jar') + testImplementation 'junit:junit:4.12' + testImplementation 'net.sf.opencsv:opencsv:2.0' + testImplementation 'org.mockito:mockito-core:1.9.0' + testImplementation 'org.robolectric:robolectric:3.4.2' + testImplementation 'org.mockito:mockito-all:1.9.5' + testImplementation 'org.skyscreamer:jsonassert:1.2.3' + testImplementation(name: 'org.apache.http.legacy', ext: 'jar') - androidTestCompile "com.android.support:support-annotations:${versions.supportLib}" - androidTestCompile 'com.android.support.test:runner:0.5' - androidTestCompile 'com.android.support.test:rules:0.5' - androidTestCompile 'org.hamcrest:hamcrest-library:1.3' - androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation "com.android.support:support-annotations:${versions.supportLib}" + androidTestImplementation'com.android.support.test:runner:0.5' + androidTestImplementation'com.android.support.test:rules:0.5' + androidTestImplementation'org.hamcrest:hamcrest-library:1.3' + androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { // use version of jsr305 provided by Checkout exclude group: 'com.google.code.findbugs', module: 'jsr305' })} -apt { - arguments { - 'otto.generate' 'anonymous' - } -} - tasks.withType(Test) { scanForTestClasses = false include "**/*Test.class" diff --git a/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java b/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java index f353aa70..8929243c 100644 --- a/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/BaseActivity.java @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import dagger.Lazy; @@ -58,13 +58,13 @@ public abstract class BaseActivity extends AppCompatActivity implements SharedPr Lazy ga; @Inject Typeface typeface; - @Bind(R.id.main) + @BindView(R.id.main) ViewGroup mainView; @Nullable - @Bind(R.id.toolbar) + @BindView(R.id.toolbar) Toolbar toolbar; @Nullable - @Bind(R.id.fab) + @BindView(R.id.fab) FloatingActionButton fab; @Nonnull private Preferences.Gui.Theme theme = Preferences.Gui.Theme.material_theme; diff --git a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java index eb7b1e9c..6f44507e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/CalculatorActivity.java @@ -38,7 +38,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.FrameLayout; -import butterknife.Bind; +import butterknife.BindView; import jscl.AngleUnit; import jscl.NumeralBase; import org.solovyev.android.calculator.converter.ConverterFragment; @@ -65,11 +65,11 @@ public class CalculatorActivity extends BaseActivity implements View.OnClickList @Inject StartupHelper startupHelper; @Nullable - @Bind(R.id.partial_keyboard) + @BindView(R.id.partial_keyboard) View partialKeyboard; - @Bind(R.id.editor) + @BindView(R.id.editor) FrameLayout editor; - @Bind(R.id.main_menu) + @BindView(R.id.main_menu) View mainMenuButton; private boolean useBackAsPrevious; diff --git a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java index 888aa684..a0bc62bc 100644 --- a/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/DisplayFragment.java @@ -30,7 +30,8 @@ import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.support.v7.app.AlertDialog; import android.view.*; -import butterknife.Bind; + +import butterknife.BindView; import butterknife.ButterKnife; import com.squareup.otto.Bus; import jscl.NumeralBase; @@ -74,7 +75,7 @@ public class DisplayFragment extends BaseFragment implements View.OnClickListene } } - @Bind(R.id.calculator_display) + @BindView(R.id.calculator_display) DisplayView displayView; @Inject SharedPreferences preferences; diff --git a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java index bae8ba17..08e6c1c8 100644 --- a/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/EditorFragment.java @@ -26,7 +26,7 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import javax.annotation.Nonnull; @@ -36,7 +36,7 @@ public class EditorFragment extends BaseFragment { @Inject Editor editor; - @Bind(R.id.calculator_editor) + @BindView(R.id.calculator_editor) EditorView editorView; public EditorFragment() { diff --git a/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java b/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java index 66a8243b..ad83a71f 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/AboutFragment.java @@ -29,7 +29,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import org.solovyev.android.calculator.App; import org.solovyev.android.calculator.BaseFragment; @@ -40,13 +40,13 @@ import static org.solovyev.common.text.Strings.isEmpty; public class AboutFragment extends BaseFragment { - @Bind(R.id.about_image) + @BindView(R.id.about_image) ImageView imageView; - @Bind(R.id.about_text) + @BindView(R.id.about_text) TextView textView; - @Bind(R.id.about_translators_label) + @BindView(R.id.about_translators_label) TextView translatorsLabel; - @Bind(R.id.about_translators) + @BindView(R.id.about_translators) TextView translatorsView; public AboutFragment() { diff --git a/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java b/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java index b493a3c0..78e3e10a 100644 --- a/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/about/ReleaseNotesFragment.java @@ -29,7 +29,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import org.solovyev.android.calculator.BaseFragment; import org.solovyev.android.calculator.R; @@ -37,7 +37,7 @@ import org.solovyev.android.calculator.release.ReleaseNotes; public class ReleaseNotesFragment extends BaseFragment { - @Bind(R.id.releasenotes_text) + @BindView(R.id.releasenotes_text) TextView text; public ReleaseNotesFragment() { diff --git a/app/src/main/java/org/solovyev/android/calculator/ads/AdUi.java b/app/src/main/java/org/solovyev/android/calculator/ads/AdUi.java index c1c57724..a0961827 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ads/AdUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/ads/AdUi.java @@ -16,7 +16,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public class AdUi { @@ -26,7 +26,7 @@ public class AdUi { @NonNull private final Handler handler; @Nullable - @Bind(R.id.cpp_ad) + @BindView(R.id.cpp_ad) AdView adView; @Nullable private Boolean adFree = null; diff --git a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java index c97f1a7d..2cf22c3e 100644 --- a/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/converter/ConverterFragment.java @@ -48,7 +48,7 @@ import org.solovyev.android.calculator.view.EditTextCompat; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import static org.solovyev.android.calculator.UiPreferences.Converter.lastDimension; @@ -77,21 +77,21 @@ public class ConverterFragment extends BaseDialogFragment SharedPreferences uiPreferences; @Inject Editor editor; - @Bind(R.id.converter_dimensions_spinner) + @BindView(R.id.converter_dimensions_spinner) Spinner dimensionsSpinner; - @Bind(R.id.converter_spinner_from) + @BindView(R.id.converter_spinner_from) Spinner spinnerFrom; - @Bind(R.id.converter_label_from) + @BindView(R.id.converter_label_from) TextInputLayout labelFrom; - @Bind(R.id.converter_edittext_from) + @BindView(R.id.converter_edittext_from) EditTextCompat editTextFrom; - @Bind(R.id.converter_spinner_to) + @BindView(R.id.converter_spinner_to) Spinner spinnerTo; - @Bind(R.id.converter_label_to) + @BindView(R.id.converter_label_to) TextInputLayout labelTo; - @Bind(R.id.converter_edittext_to) + @BindView(R.id.converter_edittext_to) EditText editTextTo; - @Bind(R.id.converter_swap_button) + @BindView(R.id.converter_swap_button) ImageButton swapButton; private ArrayAdapter> dimensionsAdapter; private ArrayAdapter> adapterFrom; diff --git a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java index d48e7309..56b432e2 100644 --- a/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/entities/BaseEntitiesFragment.java @@ -57,7 +57,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; @@ -71,7 +71,7 @@ public abstract class BaseEntitiesFragment extends BaseFra } }; - @Bind(R.id.entities_recyclerview) + @BindView(R.id.entities_recyclerview) public RecyclerView recyclerView; @Inject Keyboard keyboard; @@ -204,9 +204,9 @@ public abstract class BaseEntitiesFragment extends BaseFra protected abstract boolean onMenuItemClicked(@Nonnull MenuItem item, @Nonnull E entity); public class EntityViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnCreateContextMenuListener, MenuItem.OnMenuItemClickListener { - @Bind(R.id.entity_text) + @BindView(R.id.entity_text) TextView textView; - @Bind(R.id.entity_description) + @BindView(R.id.entity_description) TextView descriptionView; @Nullable private E entity; diff --git a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java index de07169a..1ff41561 100644 --- a/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/functions/BaseFunctionFragment.java @@ -69,7 +69,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import jscl.math.function.IConstant; @@ -86,20 +86,20 @@ public abstract class BaseFunctionFragment extends BaseDialogFragment implements private final FloatingKeyboardWindow keyboardWindow = new FloatingKeyboardWindow(null); @NonNull private final KeyboardUser keyboardUser = new KeyboardUser(); - @Bind(R.id.function_params) + @BindView(R.id.function_params) public FunctionParamsView paramsView; - @Bind(R.id.function_name_label) + @BindView(R.id.function_name_label) TextInputLayout nameLabel; - @Bind(R.id.function_name) + @BindView(R.id.function_name) public EditText nameView; - @Bind(R.id.function_body_label) + @BindView(R.id.function_body_label) public TextInputLayout bodyLabel; - @Bind(R.id.function_body) + @BindView(R.id.function_body) public EditTextCompat bodyView; - @Bind(R.id.function_description_label) + @BindView(R.id.function_description_label) public TextInputLayout descriptionLabel; - @Bind(R.id.function_description) + @BindView(R.id.function_description) public EditText descriptionView; @Inject Calculator calculator; diff --git a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java index f1c49953..aef25408 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/BaseHistoryFragment.java @@ -62,7 +62,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public abstract class BaseHistoryFragment extends BaseFragment { @@ -75,7 +75,7 @@ public abstract class BaseHistoryFragment extends BaseFragment { Bus bus; @Inject Typeface typeface; - @Bind(R.id.history_recyclerview) + @BindView(R.id.history_recyclerview) RecyclerView recyclerView; private HistoryAdapter adapter; @@ -156,11 +156,11 @@ public abstract class BaseHistoryFragment extends BaseFragment { public class HistoryViewHolder extends RecyclerView.ViewHolder implements View.OnCreateContextMenuListener, View.OnClickListener, MenuItem.OnMenuItemClickListener { private static final int DATETIME_FORMAT = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_MONTH | DateUtils.FORMAT_ABBREV_TIME; - @Bind(R.id.history_item_value) + @BindView(R.id.history_item_value) TextView valueView; - @Bind(R.id.history_item_comment) + @BindView(R.id.history_item_comment) TextView commentView; - @Bind(R.id.history_item_time) + @BindView(R.id.history_item_time) TextView timeView; @Nullable private HistoryState state; diff --git a/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java b/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java index 963b7956..ed9e0dda 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/EditHistoryFragment.java @@ -12,7 +12,8 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import android.widget.TextView; -import butterknife.Bind; + +import butterknife.BindView; import butterknife.ButterKnife; import org.solovyev.android.calculator.AppComponent; import org.solovyev.android.calculator.BaseDialogFragment; @@ -32,10 +33,10 @@ public class EditHistoryFragment extends BaseDialogFragment { boolean newState; - @Bind(R.id.history_expression) + @BindView(R.id.history_expression) TextView expressionView; - @Bind(R.id.history_comment) + @BindView(R.id.history_comment) EditText commentView; public static void show(@NonNull HistoryState state, boolean newState, @NonNull FragmentManager fm) { diff --git a/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java b/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java index bb22fa9a..f6eba6cc 100644 --- a/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/keyboard/KeyboardUi.java @@ -5,7 +5,7 @@ import android.app.Application; import android.content.SharedPreferences; import android.support.annotation.Nullable; import android.view.View; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import com.squareup.otto.Bus; import com.squareup.otto.Subscribe; @@ -24,25 +24,25 @@ import static org.solovyev.android.views.dragbutton.DragDirection.*; public class KeyboardUi extends BaseKeyboardUi { - @Bind(R.id.cpp_button_0) + @BindView(R.id.cpp_button_0) public DirectionDragButton button0; - @Bind(R.id.cpp_button_1) + @BindView(R.id.cpp_button_1) public DirectionDragButton button1; - @Bind(R.id.cpp_button_2) + @BindView(R.id.cpp_button_2) public DirectionDragButton button2; - @Bind(R.id.cpp_button_3) + @BindView(R.id.cpp_button_3) public DirectionDragButton button3; - @Bind(R.id.cpp_button_4) + @BindView(R.id.cpp_button_4) public DirectionDragButton button4; - @Bind(R.id.cpp_button_5) + @BindView(R.id.cpp_button_5) public DirectionDragButton button5; - @Bind(R.id.cpp_button_6) + @BindView(R.id.cpp_button_6) public DirectionDragButton button6; - @Bind(R.id.cpp_button_7) + @BindView(R.id.cpp_button_7) public DirectionDragButton button7; - @Bind(R.id.cpp_button_8) + @BindView(R.id.cpp_button_8) public DirectionDragButton button8; - @Bind(R.id.cpp_button_9) + @BindView(R.id.cpp_button_9) public DirectionDragButton button9; @Inject Engine engine; @@ -52,35 +52,35 @@ public class KeyboardUi extends BaseKeyboardUi { Bus bus; @Inject PartialKeyboardUi partialUi; - @Bind(R.id.cpp_button_vars) + @BindView(R.id.cpp_button_vars) DirectionDragButton variablesButton; @Nullable - @Bind(R.id.cpp_button_operators) + @BindView(R.id.cpp_button_operators) DirectionDragButton operatorsButton; - @Bind(R.id.cpp_button_functions) + @BindView(R.id.cpp_button_functions) DirectionDragButton functionsButton; - @Bind(R.id.cpp_button_history) + @BindView(R.id.cpp_button_history) DirectionDragButton historyButton; - @Bind(R.id.cpp_button_multiplication) + @BindView(R.id.cpp_button_multiplication) DirectionDragButton multiplicationButton; - @Bind(R.id.cpp_button_plus) + @BindView(R.id.cpp_button_plus) DirectionDragButton plusButton; - @Bind(R.id.cpp_button_subtraction) + @BindView(R.id.cpp_button_subtraction) DirectionDragButton subtractionButton; - @Bind(R.id.cpp_button_division) + @BindView(R.id.cpp_button_division) DirectionDragButton divisionButton; - @Bind(R.id.cpp_button_period) + @BindView(R.id.cpp_button_period) DirectionDragButton periodButton; - @Bind(R.id.cpp_button_round_brackets) + @BindView(R.id.cpp_button_round_brackets) DirectionDragButton bracketsButton; @Nullable - @Bind(R.id.cpp_button_like) + @BindView(R.id.cpp_button_like) DirectionDragButton likeButton; @Nullable - @Bind(R.id.cpp_button_percent) + @BindView(R.id.cpp_button_percent) DirectionDragButton percentButton; @Nullable - @Bind(R.id.cpp_button_memory) + @BindView(R.id.cpp_button_memory) DirectionDragButton memoryButton; @Inject diff --git a/app/src/main/java/org/solovyev/android/calculator/keyboard/PartialKeyboardUi.java b/app/src/main/java/org/solovyev/android/calculator/keyboard/PartialKeyboardUi.java index 5fb9feb8..1905d6ec 100644 --- a/app/src/main/java/org/solovyev/android/calculator/keyboard/PartialKeyboardUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/keyboard/PartialKeyboardUi.java @@ -14,7 +14,7 @@ import org.solovyev.android.views.dragbutton.DirectionDragButton; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import static org.solovyev.android.calculator.Preferences.Gui.vibrateOnKeypress; @@ -23,19 +23,19 @@ import static org.solovyev.android.views.dragbutton.DragDirection.down; public class PartialKeyboardUi extends BaseKeyboardUi { @Nullable - @Bind(R.id.cpp_button_right) + @BindView(R.id.cpp_button_right) DirectionDragButton rightButton; @Nullable - @Bind(R.id.cpp_button_left) + @BindView(R.id.cpp_button_left) DirectionDragButton leftButton; @Nullable - @Bind(R.id.cpp_button_clear) + @BindView(R.id.cpp_button_clear) DirectionDragButton clearButton; @Nullable - @Bind(R.id.cpp_button_erase) + @BindView(R.id.cpp_button_erase) DirectionDragButton eraseButton; @Nullable - @Bind(R.id.cpp_button_equals) + @BindView(R.id.cpp_button_equals) DirectionDragButton equalsButton; @Nullable EditorLongClickEraser longClickEraser; diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotActivity.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotActivity.java index 744e6860..4a084e46 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotActivity.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotActivity.java @@ -21,7 +21,7 @@ import org.solovyev.android.plotter.Plotter; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public class PlotActivity extends BaseActivity { @@ -32,7 +32,7 @@ public class PlotActivity extends BaseActivity { @Inject Plotter plotter; - @Bind(R.id.plot_view_frame) + @BindView(R.id.plot_view_frame) PlotViewFrame plotView; public MyFragment() { diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotDimensionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotDimensionsFragment.java index 7636726f..bb03376f 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotDimensionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotDimensionsFragment.java @@ -34,7 +34,7 @@ import java.util.Locale; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public class PlotDimensionsFragment extends BaseDialogFragment @@ -77,23 +77,23 @@ public class PlotDimensionsFragment extends BaseDialogFragment @Inject Plotter plotter; - @Bind(R.id.plot_x_min) + @BindView(R.id.plot_x_min) EditText xMin; - @Bind(R.id.plot_x_min_label) + @BindView(R.id.plot_x_min_label) TextInputLayout xMinLabel; - @Bind(R.id.plot_x_max) + @BindView(R.id.plot_x_max) EditText xMax; - @Bind(R.id.plot_x_max_label) + @BindView(R.id.plot_x_max_label) TextInputLayout xMaxLabel; - @Bind(R.id.plot_y_min) + @BindView(R.id.plot_y_min) EditText yMin; - @Bind(R.id.plot_y_min_label) + @BindView(R.id.plot_y_min_label) TextInputLayout yMinLabel; - @Bind(R.id.plot_y_max) + @BindView(R.id.plot_y_max) EditText yMax; - @Bind(R.id.plot_y_max_label) + @BindView(R.id.plot_y_max_label) TextInputLayout yMaxLabel; - @Bind(R.id.y_bounds) + @BindView(R.id.y_bounds) View yBounds; @NonNull private RectF bounds = new RectF(); diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java index 43b3a276..a388ace6 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotEditFunctionFragment.java @@ -30,7 +30,7 @@ import java.util.List; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import jscl.math.function.CustomFunction; import uz.shift.colorpicker.LineColorPicker; import uz.shift.colorpicker.OnColorChangedListener; @@ -39,17 +39,17 @@ public class PlotEditFunctionFragment extends BaseFunctionFragment implements SeekBar.OnSeekBarChangeListener { @Inject Plotter plotter; - @Bind(R.id.fn_meshspec_views) + @BindView(R.id.fn_meshspec_views) View meshSpecViews; - @Bind(R.id.fn_color_label) + @BindView(R.id.fn_color_label) TextView colorLabel; - @Bind(R.id.fn_color_picker) + @BindView(R.id.fn_color_picker) LineColorPicker colorPicker; - @Bind(R.id.fn_linewidth_label) + @BindView(R.id.fn_linewidth_label) TextView lineWidthLabel; - @Bind(R.id.fn_linewidth_seekbar) + @BindView(R.id.fn_linewidth_seekbar) SeekBar lineWidthSeekBar; - @Bind(R.id.fn_iconview) + @BindView(R.id.fn_iconview) PlotIconView iconView; private PlotFunction plotFunction; diff --git a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java index 6fdada21..062e2e95 100644 --- a/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/plot/PlotFunctionsFragment.java @@ -37,7 +37,7 @@ import java.util.List; import javax.annotation.Nonnull; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; public class PlotFunctionsFragment extends BaseDialogFragment { @@ -107,10 +107,10 @@ public class PlotFunctionsFragment extends BaseDialogFragment { public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener, View.OnCreateContextMenuListener, MenuItem.OnMenuItemClickListener { - @Bind(R.id.function_icon) + @BindView(R.id.function_icon) PlotIconView icon; - @Bind(R.id.function_name) + @BindView(R.id.function_name) TextView name; private PlotFunction function; diff --git a/app/src/main/java/org/solovyev/android/calculator/preferences/PrecisionPreference.java b/app/src/main/java/org/solovyev/android/calculator/preferences/PrecisionPreference.java index 2b62f450..49b7196d 100644 --- a/app/src/main/java/org/solovyev/android/calculator/preferences/PrecisionPreference.java +++ b/app/src/main/java/org/solovyev/android/calculator/preferences/PrecisionPreference.java @@ -7,7 +7,7 @@ import android.os.Build; import android.preference.DialogPreference; import android.util.AttributeSet; import android.view.View; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import org.solovyev.android.calculator.Engine; import org.solovyev.android.calculator.R; @@ -19,7 +19,7 @@ import static org.solovyev.common.NumberFormatter.MIN_PRECISION; @SuppressWarnings("unused") public class PrecisionPreference extends DialogPreference { - @Bind(R.id.precision_seekbar) + @BindView(R.id.precision_seekbar) DiscreteSeekBar seekBar; { diff --git a/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java b/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java index b356784b..43df0b41 100644 --- a/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java +++ b/app/src/main/java/org/solovyev/android/calculator/variables/EditVariableFragment.java @@ -72,7 +72,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import dagger.Lazy; import jscl.math.function.IConstant; @@ -85,9 +85,9 @@ public class EditVariableFragment extends BaseDialogFragment implements View.OnF private final static List ACCEPTABLE_CHARACTERS = Arrays.asList(Strings.toObjects(("1234567890abcdefghijklmnopqrstuvwxyzйцукенгшщзхъфывапролджэячсмитьбюё_" + GreekFloatingKeyboard.ALPHABET).toCharArray())); @NonNull private final KeyboardUser keyboardUser = new KeyboardUser(); - @Bind(R.id.variable_name_label) + @BindView(R.id.variable_name_label) TextInputLayout nameLabel; - @Bind(R.id.variable_name) + @BindView(R.id.variable_name) EditTextCompat nameView; @NonNull private final FloatingKeyboardWindow keyboardWindow = new FloatingKeyboardWindow(new PopupWindow.OnDismissListener() { @@ -96,15 +96,15 @@ public class EditVariableFragment extends BaseDialogFragment implements View.OnF nameView.setShowSoftInputOnFocusCompat(true); } }); - @Bind(R.id.variable_keyboard_button) + @BindView(R.id.variable_keyboard_button) Button keyboardButton; - @Bind(R.id.variable_value_label) + @BindView(R.id.variable_value_label) TextInputLayout valueLabel; - @Bind(R.id.variable_value) + @BindView(R.id.variable_value) EditText valueView; - @Bind(R.id.variable_exponent_button) + @BindView(R.id.variable_exponent_button) Button exponentButton; - @Bind(R.id.variable_description) + @BindView(R.id.variable_description) EditText descriptionView; @Inject Calculator calculator; diff --git a/app/src/main/java/org/solovyev/android/calculator/view/Tabs.java b/app/src/main/java/org/solovyev/android/calculator/view/Tabs.java index 6cb60dc1..c06d18a1 100644 --- a/app/src/main/java/org/solovyev/android/calculator/view/Tabs.java +++ b/app/src/main/java/org/solovyev/android/calculator/view/Tabs.java @@ -11,7 +11,7 @@ import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; import android.view.View; -import butterknife.Bind; +import butterknife.BindView; import butterknife.ButterKnife; import org.solovyev.android.calculator.AppModule; import org.solovyev.android.calculator.FragmentTab; @@ -37,10 +37,10 @@ public class Tabs { @Named(AppModule.PREFS_TABS) SharedPreferences preferences; @Nullable - @Bind(R.id.tabs) + @BindView(R.id.tabs) TabLayout tabLayout; @Nullable - @Bind(R.id.viewPager) + @BindView(R.id.viewPager) ViewPager viewPager; private int defaultSelectedTab = -1; diff --git a/app/src/main/java/org/solovyev/common/text/ValueOfFormatter.java b/app/src/main/java/org/solovyev/common/text/ValueOfFormatter.java index dc965c9c..24a471b4 100644 --- a/app/src/main/java/org/solovyev/common/text/ValueOfFormatter.java +++ b/app/src/main/java/org/solovyev/common/text/ValueOfFormatter.java @@ -52,7 +52,6 @@ public class ValueOfFormatter implements Formatter { return (ValueOfFormatter) nullableFormatter; } - @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = {"NP_LOAD_OF_KNOWN_NULL_VALUE"}, justification = "If 'processNulls' is true => must result 'null'") @Override public String formatValue(@Nullable T t) throws IllegalArgumentException { if (t == null) { diff --git a/build.gradle b/build.gradle index 6071688b..d3250857 100644 --- a/build.gradle +++ b/build.gradle @@ -1,29 +1,23 @@ buildscript { repositories { + google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' + classpath 'com.android.tools.build:gradle:3.1.2' } ext { - versions = [supportLib: "25.3.1", + versions = [supportLib: "27.1.1", gpsLib : "11.0.2", - sdk : [compile: 25, buildTools: "25.0.3", min: 19, target: 25]] + sdk : [compile: 27, buildTools: "27.0.3", min: 19, target: 27]] } } allprojects { repositories { + google() jcenter() - def androidHome = System.getenv("ANDROID_HOME") - maven { - url "$androidHome/extras/android/m2repository/" - } - maven { - url "$androidHome/extras/google/m2repository/" - } flatDir { dirs 'misc/libs' diff --git a/dragbutton/build.gradle b/dragbutton/build.gradle index 6ca31d29..ac4560ff 100644 --- a/dragbutton/build.gradle +++ b/dragbutton/build.gradle @@ -18,7 +18,6 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile "com.android.support:appcompat-v7:${versions.supportLib}" - compile "com.android.support:support-annotations:${versions.supportLib}" + implementation "com.android.support:appcompat-v7:${versions.supportLib}" + implementation "com.android.support:support-annotations:${versions.supportLib}" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 73a89bac..6da14760 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Apr 15 12:12:25 CEST 2017 +#Sun Apr 29 18:31:04 CEST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/jscl/build.gradle b/jscl/build.gradle index 6728e968..0f42e81e 100644 --- a/jscl/build.gradle +++ b/jscl/build.gradle @@ -23,13 +23,12 @@ apply plugin: 'java' dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.google.code.findbugs:annotations:2.0.1' - compile 'xerces:xercesImpl:2.8.0' - compile 'com.google.guava:guava:20.0' + implementation 'com.google.code.findbugs:jsr305:2.0.3' + implementation 'xerces:xercesImpl:2.8.0' + implementation 'com.google.guava:guava:20.0' - testCompile 'junit:junit:4.12' - testCompile 'net.sf.opencsv:opencsv:2.0' + testImplementation 'junit:junit:4.12' + testImplementation 'net.sf.opencsv:opencsv:2.0' } sourceSets { diff --git a/jscl/src/main/java/jscl/FixedCapacityListMessageRegistry.java b/jscl/src/main/java/jscl/FixedCapacityListMessageRegistry.java index 823d3258..d6c39eb0 100644 --- a/jscl/src/main/java/jscl/FixedCapacityListMessageRegistry.java +++ b/jscl/src/main/java/jscl/FixedCapacityListMessageRegistry.java @@ -24,7 +24,6 @@ public class FixedCapacityListMessageRegistry implements MessageRegistry { this.messages = new ArrayList(capacity); } - @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = {"VO_VOLATILE_INCREMENT"}, justification = "NotThreadSafe - outer synchronization") public void addMessage(@Nonnull Message message) { if (!this.messages.contains(message)) { if (this.size <= this.capacity) { @@ -37,7 +36,6 @@ public class FixedCapacityListMessageRegistry implements MessageRegistry { } } - @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = {"VO_VOLATILE_INCREMENT"}, justification = "NotThreadSafe - outer synchronization") @Nonnull public Message getMessage() { if (hasMessage()) { diff --git a/translations/build.gradle b/translations/build.gradle index 08dc914b..0902293e 100644 --- a/translations/build.gradle +++ b/translations/build.gradle @@ -4,10 +4,9 @@ apply plugin: 'application' mainClassName = 'org.solovyev.android.translations.Android' dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'commons-cli:commons-cli:1.3' - compile 'org.apache.httpcomponents:httpclient:4.5.1' - compile 'org.json:json:20151123' - compile 'org.simpleframework:simple-xml:2.7.1' - compile 'commons-cli:commons-cli:1.3.1' + implementation 'commons-cli:commons-cli:1.3' + implementation 'org.apache.httpcomponents:httpclient:4.5.1' + implementation 'org.json:json:20151123' + implementation 'org.simpleframework:simple-xml:2.7.1' + implementation 'commons-cli:commons-cli:1.3.1' } \ No newline at end of file