Skip to content

Commit

Permalink
Merge pull request #16 from Reline/development
Browse files Browse the repository at this point in the history
Version 1.0.1
  • Loading branch information
reline authored Mar 5, 2017
2 parents 0bd9ed6 + 43f1d7d commit 8a1fbaf
Show file tree
Hide file tree
Showing 50 changed files with 362 additions and 135 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ local.properties
.idea
build
*.jks
*.keystore
keystore.properties
projectFilesBackup*
66 changes: 0 additions & 66 deletions app/build.gradle

This file was deleted.

67 changes: 67 additions & 0 deletions jisho/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apply plugin: 'com.android.application'

android {
signingConfigs {
release {
keyAlias 'android'
keyPassword 'android'
storeFile file('jisho.jks')
storePassword 'android'
}
}

compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.github.reline.jisho"
minSdkVersion 19
targetSdkVersion 25
versionCode 2
versionName "1.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix = ".debug"
}
}
lintOptions {
abortOnError false
}
}

configurations {
compile.exclude group: 'stax'
compile.exclude group: 'xpp3'
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'

compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:design:25.2.0'

compile 'com.bluelinelabs:conductor:2.1.1'

compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
compile 'com.squareup.retrofit2:converter-moshi:2.2.0'

compile 'io.reactivex.rxjava2:rxjava:2.0.6'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'

compile 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
}
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@

package com.github.reline.jisho.injection.components;

import javax.inject.Singleton;

import dagger.Component;
import com.github.reline.jisho.injection.modules.NetworkModule;
import com.github.reline.jisho.injection.modules.PresenterModule;
import com.github.reline.jisho.ui.controllers.HomeController;

import javax.inject.Singleton;

import dagger.Component;

@Singleton
@Component(modules = {PresenterModule.class, NetworkModule.class})
public interface InjectionComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@

import android.support.annotation.NonNull;

import com.github.reline.jisho.BuildConfig;
import com.github.reline.jisho.network.services.SearchApi;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import io.reactivex.schedulers.Schedulers;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.moshi.MoshiConverterFactory;
import rx.schedulers.Schedulers;
import com.github.reline.jisho.BuildConfig;
import com.github.reline.jisho.network.services.SearchApi;

@Module
public class NetworkModule {
Expand Down Expand Up @@ -59,7 +60,7 @@ static Retrofit provideRetrofit(@NonNull OkHttpClient okHttpClient) {
if (retrofit == null) {
retrofit = new Retrofit.Builder()
.baseUrl(BASE_URL)
.addCallAdapterFactory(RxJavaCallAdapterFactory.createWithScheduler(Schedulers.io()))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.addConverterFactory(MoshiConverterFactory.create())
.callFactory(okHttpClient)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

package com.github.reline.jisho.injection.modules;

import dagger.Module;
import dagger.Provides;
import com.github.reline.jisho.network.services.SearchApi;
import com.github.reline.jisho.presenters.HomePresenter;

import dagger.Module;
import dagger.Provides;

@Module
public class PresenterModule {
@Provides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,32 @@

package com.github.reline.jisho.models;

class Attribution {
import android.os.Parcel;
import android.os.Parcelable;

class Attribution implements Parcelable {
private boolean jmdict;
private boolean jmnedict;
// Issue #14: data is lost when parceled
private Object dbpedia; // String or boolean

private Attribution(Parcel in) {
jmdict = in.readByte() != 0;
jmnedict = in.readByte() != 0;
}

public static final Creator<Attribution> CREATOR = new Creator<Attribution>() {
@Override
public Attribution createFromParcel(Parcel in) {
return new Attribution(in);
}

@Override
public Attribution[] newArray(int size) {
return new Attribution[size];
}
};

public boolean isJmdict() {
return jmdict;
}
Expand All @@ -32,4 +53,15 @@ public boolean isJmnedict() {
public Object isDbpedia() {
return dbpedia;
}

@Override
public int describeContents() {
return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeByte((byte) (jmdict ? 1 : 0));
dest.writeByte((byte) (jmnedict ? 1 : 0));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,46 @@

package com.github.reline.jisho.models;

public class Japanese {
import android.os.Parcel;
import android.os.Parcelable;

public class Japanese implements Parcelable {
private String word;
private String reading;

private Japanese(Parcel in) {
word = in.readString();
reading = in.readString();
}

public static final Creator<Japanese> CREATOR = new Creator<Japanese>() {
@Override
public Japanese createFromParcel(Parcel in) {
return new Japanese(in);
}

@Override
public Japanese[] newArray(int size) {
return new Japanese[size];
}
};

public String getWord() {
return word;
}

public String getReading() {
return reading;
}

@Override
public int describeContents() {
return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(word);
dest.writeString(reading);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,46 @@

package com.github.reline.jisho.models;

class Link {
import android.os.Parcel;
import android.os.Parcelable;

class Link implements Parcelable {
private String text;
private String url;

private Link(Parcel in) {
text = in.readString();
url = in.readString();
}

public static final Creator<Link> CREATOR = new Creator<Link>() {
@Override
public Link createFromParcel(Parcel in) {
return new Link(in);
}

@Override
public Link[] newArray(int size) {
return new Link[size];
}
};

public String getText() {
return text;
}

public String getUrl() {
return url;
}

@Override
public int describeContents() {
return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(text);
dest.writeString(url);
}
}
Loading

0 comments on commit 8a1fbaf

Please sign in to comment.