From a75d132e2c8552694a9c7398303bdfa3ea26f153 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Mon, 17 Feb 2020 15:15:09 +0800 Subject: [PATCH] android:fix import error --- .../main/java/pub/doric/loader/DoricHttpJSLoader.java | 8 +++----- .../src/main/java/pub/doric/plugin/NetworkPlugin.java | 7 ++++--- .../java/pub/doric/shader/slider/NestedSliderNode.java | 9 ++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/loader/DoricHttpJSLoader.java b/doric-android/doric/src/main/java/pub/doric/loader/DoricHttpJSLoader.java index ca3732a6..293320ad 100644 --- a/doric-android/doric/src/main/java/pub/doric/loader/DoricHttpJSLoader.java +++ b/doric-android/doric/src/main/java/pub/doric/loader/DoricHttpJSLoader.java @@ -15,9 +15,7 @@ */ package pub.doric.loader; -import com.bumptech.glide.RequestBuilder; - -import org.jetbrains.annotations.NotNull; +import androidx.annotation.NonNull; import java.io.IOException; @@ -46,12 +44,12 @@ public class DoricHttpJSLoader implements IDoricJSLoader { final AsyncResult ret = new AsyncResult<>(); okHttpClient.newCall(new Request.Builder().url(scheme).build()).enqueue(new Callback() { @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { + public void onFailure(@NonNull Call call, @NonNull IOException e) { ret.setError(e); } @Override - public void onResponse(@NotNull Call call, @NotNull Response response) { + public void onResponse(@NonNull Call call, @NonNull Response response) { try { ret.setResult(response.body().string()); } catch (Exception e) { diff --git a/doric-android/doric/src/main/java/pub/doric/plugin/NetworkPlugin.java b/doric-android/doric/src/main/java/pub/doric/plugin/NetworkPlugin.java index 072d5cd0..a5abe8c8 100644 --- a/doric-android/doric/src/main/java/pub/doric/plugin/NetworkPlugin.java +++ b/doric-android/doric/src/main/java/pub/doric/plugin/NetworkPlugin.java @@ -17,12 +17,13 @@ package pub.doric.plugin; import android.text.TextUtils; +import androidx.annotation.NonNull; + import com.github.pengfeizhou.jscore.JSONBuilder; import com.github.pengfeizhou.jscore.JSObject; import com.github.pengfeizhou.jscore.JSValue; import com.github.pengfeizhou.jscore.JavaValue; -import org.jetbrains.annotations.NotNull; import org.json.JSONObject; import java.io.IOException; @@ -88,12 +89,12 @@ public class NetworkPlugin extends DoricJavaPlugin { } okHttpClient.newCall(requestBuilder.build()).enqueue(new Callback() { @Override - public void onFailure(@NotNull Call call, @NotNull IOException e) { + public void onFailure(@NonNull Call call, @NonNull IOException e) { promise.reject(new JavaValue(e.getLocalizedMessage())); } @Override - public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + public void onResponse(@NonNull Call call, @NonNull Response response) throws IOException { JSONBuilder header = new JSONBuilder(); for (String key : response.headers().names()) { header.put(key, response.headers().get(key)); diff --git a/doric-android/doric/src/main/java/pub/doric/shader/slider/NestedSliderNode.java b/doric-android/doric/src/main/java/pub/doric/shader/slider/NestedSliderNode.java index e214bb05..a8b7eed8 100644 --- a/doric-android/doric/src/main/java/pub/doric/shader/slider/NestedSliderNode.java +++ b/doric-android/doric/src/main/java/pub/doric/shader/slider/NestedSliderNode.java @@ -26,7 +26,6 @@ import androidx.viewpager.widget.ViewPager; import com.github.pengfeizhou.jscore.JSObject; import com.github.pengfeizhou.jscore.JSValue; -import org.jetbrains.annotations.NotNull; import java.util.ArrayList; @@ -61,18 +60,18 @@ public class NestedSliderNode extends GroupNode implements ViewPager. } @Override - public boolean isViewFromObject(@NonNull View view, @NotNull Object object) { + public boolean isViewFromObject(@NonNull View view, @NonNull Object object) { return view == object; } @Override - public void destroyItem(@NotNull ViewGroup container, int position, @NotNull Object object) { + public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { container.removeView(slideItems.get(position)); } - @NotNull + @NonNull @Override - public Object instantiateItem(@NotNull ViewGroup container, int position) { + public Object instantiateItem(@NonNull ViewGroup container, int position) { container.addView(slideItems.get(position)); return slideItems.get(position); }