Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
fixed linking
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwasonga committed Aug 12, 2019
1 parent c5c0b13 commit a7fbd20
Show file tree
Hide file tree
Showing 31 changed files with 203 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.lang.reflect.Type;
import java.util.Map;

import promise.promisenet.utils.Converter;
import promise.util.DoubleConverter;


Expand All @@ -39,7 +40,7 @@ public DoubleConverter<T, JSONObject, Map<String, Object>> converter() {
@Override
public Map<String, Object> serialize(T t) {
try {
return promise.util.Converter.toMap(new JSONObject(new Gson().toJson(t)));
return Converter.toMap(new JSONObject(new Gson().toJson(t)));
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

import java.util.Map;

import promise.promisenet.utils.Converter;

/**
* Created on 2/14/18 by yoctopus.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import promise.data.net.http.Streaming;
import promise.promisenet.http.Streaming;

final class CommonConverters extends Converter.Factory {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

import okhttp3.Request;

import static promise.data.net.net.Utils.checkNotNull;
import static promise.promisenet.net.Utils.checkNotNull;


final class ExecutorCallAdapterFactory extends CallAdapter.Factory {
final Executor callbackExecutor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import promise.promisenet.http.Url;

import static java.util.Collections.unmodifiableList;
import static promise.data.net.net.Utils.checkNotNull;
import static promise.promisenet.net.Utils.checkNotNull;

/**
* FastParserEngine adapts a Java interface to HTTP calls by using annotations on the declared methods to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
*/
package promise.promisenet.net;

import static promise.data.net.net.Utils.checkNotNull;

import static promise.promisenet.net.Utils.checkNotNull;

/** Exception for an unexpected, non-2xx HTTP response. */
public class HttpException extends RuntimeException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
import okio.ForwardingSource;
import okio.Okio;

import static promise.data.net.net.Utils.checkNotNull;
import static promise.data.net.net.Utils.throwIfFatal;
import static promise.promisenet.net.Utils.checkNotNull;
import static promise.promisenet.net.Utils.throwIfFatal;


/*import javax.annotation.concurrent.GuardedBy;*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
import okhttp3.MultipartBody;
import okhttp3.RequestBody;

import static promise.data.net.net.Utils.checkNotNull;
import static promise.promisenet.net.Utils.checkNotNull;


abstract class ParameterHandler<T> {
abstract void apply(RequestBuilder builder, @Nullable T value) throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
import okhttp3.Request;
import okhttp3.ResponseBody;

import static promise.data.net.net.Utils.checkNotNull;
import static promise.promisenet.net.Utils.checkNotNull;


/** An HTTP response. */
public final class Response<T> {
Expand Down
48 changes: 24 additions & 24 deletions promisenet/src/main/java/promise/promisenet/net/ServiceMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,28 @@
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import promise.data.net.http.Body;
import promise.data.net.http.DELETE;
import promise.data.net.http.Field;
import promise.data.net.http.FieldMap;
import promise.data.net.http.FormUrlEncoded;
import promise.data.net.http.GET;
import promise.data.net.http.HEAD;
import promise.data.net.http.HTTP;
import promise.data.net.http.Header;
import promise.data.net.http.HeaderMap;
import promise.data.net.http.Multipart;
import promise.data.net.http.OPTIONS;
import promise.data.net.http.PATCH;
import promise.data.net.http.POST;
import promise.data.net.http.PUT;
import promise.data.net.http.Part;
import promise.data.net.http.PartMap;
import promise.data.net.http.Path;
import promise.data.net.http.Query;
import promise.data.net.http.QueryMap;
import promise.data.net.http.QueryName;
import promise.data.net.http.Url;
import promise.promisenet.http.Body;
import promise.promisenet.http.DELETE;
import promise.promisenet.http.Field;
import promise.promisenet.http.FieldMap;
import promise.promisenet.http.FormUrlEncoded;
import promise.promisenet.http.GET;
import promise.promisenet.http.HEAD;
import promise.promisenet.http.HTTP;
import promise.promisenet.http.Header;
import promise.promisenet.http.HeaderMap;
import promise.promisenet.http.Multipart;
import promise.promisenet.http.OPTIONS;
import promise.promisenet.http.PATCH;
import promise.promisenet.http.POST;
import promise.promisenet.http.PUT;
import promise.promisenet.http.Part;
import promise.promisenet.http.PartMap;
import promise.promisenet.http.Path;
import promise.promisenet.http.Query;
import promise.promisenet.http.QueryMap;
import promise.promisenet.http.QueryName;
import promise.promisenet.http.Url;

/** Adapts an invocation of an interface method into an HTTP call. */
final class ServiceMethod<R, T> {
Expand Down Expand Up @@ -261,8 +261,8 @@ private void parseMethodAnnotation(Annotation annotation) {
} else if (annotation instanceof HTTP) {
HTTP http = (HTTP) annotation;
parseHttpMethodAndPath(http.method(), http.path(), http.hasBody());
} else if (annotation instanceof promise.data.net.http.Headers) {
String[] headersToParse = ((promise.data.net.http.Headers) annotation).value();
} else if (annotation instanceof promise.promisenet.http.Headers) {
String[] headersToParse = ((promise.promisenet.http.Headers) annotation).value();
if (headersToParse.length == 0) {
throw methodError("@Headers annotation is empty.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import androidx.appcompat.app.AppCompatActivity;

import promise.promisenet.R;
import promise.promisenet.utils.NetworkUtil;

public class NetworkErrorActivity extends AppCompatActivity {

Expand Down
Binary file added promisenet/src/main/res/drawable/server_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions promiseui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ dependencies {
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.3@aar'
implementation "com.android.support:exifinterface:$project.ext.supportLibVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$project.ext.kotlin_version"
compileOnly "com.android.support:recyclerview-v7:$project.ext.supportLibVersion"
compileOnly 'androidx.appcompat:appcompat:1.0.2'
compileOnly 'io.reactivex.rxjava2:rxjava:2.2.7'
compileOnly project(path: ':promisecommons')
implementation "com.android.support:recyclerview-v7:$project.ext.supportLibVersion"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
implementation project(path: ':promisecommons')
implementation 'eu.davidea:flexible-adapter:5.1.0'
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
implementation 'eu.davidea:flexible-adapter-livedata:1.0.0-b3'
// From 1.0.0-b3, library is compiled with data binding v2
implementation 'eu.davidea:flexible-adapter-databinding:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down
5 changes: 4 additions & 1 deletion promiseui/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="promise.promiseui" />
package="promise.promiseui" >

<uses-permission android:name="android.permission.VIBRATE" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import eu.davidea.flexibleadapter.items.IFilterable;
import eu.davidea.flexibleadapter.items.IFlexible;
import eu.davidea.viewholders.FlexibleViewHolder;
import promise.model.Searchable;
import promise.promiseui.model.Searchable;

public class Holder<T extends Searchable> extends AbstractFlexibleItem<Holder<T>.MyHolder> implements IFilterable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@

import eu.davidea.flexibleadapter.FlexibleAdapter;
import promise.model.List;
import promise.model.Searchable;
import promise.model.function.MapFunction;
import promise.promiseui.AdapterDivider;
import promise.promiseui.model.Searchable;
import promise.util.Conditions;
import promise.view.AdapterDivider;

public class SingleAdapter<T extends Searchable> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

import android.app.Activity;

import promise.cac.anim.Anim;
import promise.cac.anim.AnimDuration;
import promise.cac.anim.Animator;

/**
* Created by octopus on 10/19/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
import androidx.core.view.GravityCompat;
import androidx.drawerlayout.widget.DrawerLayout;

import promise.cac.anim.Anim;
import promise.cac.anim.AnimDuration;
import promise.cac.anim.Animator;

/**
* Created by octopus on 10/1/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

import android.view.View;

import promise.cac.anim.Anim;
import promise.cac.anim.AnimDuration;
import promise.cac.anim.Animator;

/**
* Created by octopus on 9/30/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

import android.view.View;

import promise.cac.anim.Anim;
import promise.cac.anim.AnimDuration;

/**
* Created by octopus on 10/1/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

import android.view.View;

import promise.cac.anim.Anim;
import promise.cac.anim.AnimDuration;
import promise.cac.anim.Animator;

/**
* Created by octopus on 10/1/16.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import java.util.List;

import promise.model.Viewable;
import promise.promiseui.model.Viewable;


public interface LoadingListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import android.view.View;
import android.widget.ProgressBar;

import promise.R;
import promise.model.Viewable;
import promise.promiseui.R;
import promise.promiseui.model.Viewable;

public class LoadingViewable implements Viewable {
protected ProgressBar progressBarLoading;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import java.util.Collections;
import java.util.List;

import promise.R;
import promise.model.Viewable;
import promise.promiseui.R;
import promise.promiseui.model.Viewable;

public class ProgressLayout extends FrameLayout implements LoadingListener {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import androidx.annotation.DrawableRes;

import promise.data.log.LogUtil;
import promise.promiseui.utils.ApiHelper;

public class Notification {
private String TAG = LogUtil.makeTag(Notification.class);
Expand Down
6 changes: 6 additions & 0 deletions promiseui/src/main/res/layout/loading_viewable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/progress_bar_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
40 changes: 40 additions & 0 deletions promiseui/src/main/res/layout/view_empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">

<ImageView
android:id="@+id/image_icon"
android:layout_width="108dp"
android:layout_height="108dp"
tools:background="#000000"
tools:ignore="ContentDescription" />

<TextView
android:id="@+id/text_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:textSize="15sp"
android:textStyle="bold"
tools:text="@string/progressActivityEmptyTitlePlaceholder" />

<TextView
android:id="@+id/text_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="56dp"
android:layout_marginRight="56dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:lineSpacingExtra="5.5dp"
tools:text="@string/progressActivityEmptyContentPlaceholder" />

</LinearLayout>
Loading

0 comments on commit a7fbd20

Please sign in to comment.