-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix version checker, add unused topic functionality, bump version to …
…0.2.0.5 (#4) Fix version checker, add unused topic functionality, bump version to 0.2.0.5
- Loading branch information
1 parent
52e5022
commit 0431e1d
Showing
22 changed files
with
608 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
{ | ||
"topics": [ | ||
{ | ||
"name": "Random", | ||
"slug": "random", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Dorms", | ||
"slug": "dorm", | ||
"drawable": "", | ||
"subtopics": [ | ||
{ | ||
"name": "West Village", | ||
"slug": "wv", | ||
"drawable": "", | ||
"subtopics": [ | ||
{ | ||
"name": "West Village A", | ||
"slug": "a", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village B", | ||
"slug": "b", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village C", | ||
"slug": "c", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village E", | ||
"slug": "e", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village F", | ||
"slug": "f", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village G", | ||
"slug": "g", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "West Village H", | ||
"slug": "h", | ||
"drawable": "" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Huntington Ave Apts", | ||
"slug": "huntington", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Mission Hill Apts", | ||
"slug": "mission_hill", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "St. Stephen Street Apts", | ||
"slug": "st_stephen", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "10 Coventry", | ||
"slug": "10_coventry", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "153 Hemenway Street", | ||
"slug": "153_hemenway", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "780 Columbus Ave", | ||
"slug": "780_columbus ", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Burstein Hall", | ||
"slug": "burnstein", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Davenport Commons", | ||
"slug": "davenport", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "East Village", | ||
"slug": "east_village", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Hastings Hall", | ||
"slug": "hastings", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "International Village", | ||
"slug": "international_village", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Kennedy Hall", | ||
"slug": "kennedy", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Kerr Hall", | ||
"slug": "kerr", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Light Hall", | ||
"slug": "light", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Loftman Hall", | ||
"slug": "loftman", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Melvin Hall", | ||
"slug": "melven", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Rubenstein Hall", | ||
"slug": "rubenstein", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Smith Hall", | ||
"slug": "smith", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Speare Hall", | ||
"slug": "speare", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Stetson East Hall", | ||
"slug": "stetson_east", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Stetson West Hall", | ||
"slug": "steson_west", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "White Hall", | ||
"slug": "white", | ||
"drawable": "" | ||
}, | ||
{ | ||
"name": "Willis Hall", | ||
"slug": "willis", | ||
"drawable": "" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 5 additions & 28 deletions
33
app/src/main/java/com/tonyjhuang/cheddar/api/models/value/ValueTypeAdapterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,12 @@ | ||
package com.tonyjhuang.cheddar.api.models.value; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.TypeAdapter; | ||
import com.google.gson.TypeAdapterFactory; | ||
import com.google.gson.reflect.TypeToken; | ||
import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; | ||
|
||
import java.lang.reflect.Method; | ||
@GsonTypeAdapterFactory | ||
public abstract class ValueTypeAdapterFactory implements TypeAdapterFactory { | ||
|
||
/** | ||
* Created by tonyjhuang on 4/27/16. | ||
*/ | ||
public class ValueTypeAdapterFactory implements TypeAdapterFactory { | ||
|
||
@SuppressWarnings("unchecked") | ||
public <T> TypeAdapter<T> create(Gson gson, final TypeToken<T> type) { | ||
Class<? super T> rawType = type.getRawType(); | ||
try { | ||
if(rawType.equals(AutoValue_User.class)) { | ||
return (TypeAdapter<T>) AutoValue_User.typeAdapter(gson); | ||
} else if (rawType.equals(AutoValue_Alias.class)) { | ||
return (TypeAdapter<T>) AutoValue_Alias.typeAdapter(gson); | ||
} else if (rawType.equals(AutoValue_ChatEvent.class)) { | ||
return (TypeAdapter<T>) AutoValue_ChatEvent.typeAdapter(gson); | ||
} | ||
// Call static typeAdapter method on class if it exists, otherwise | ||
// return the default type adapter. | ||
Method typeAdapterMethod = rawType.getDeclaredMethod("typeAdapter", Gson.class); | ||
return (TypeAdapter<T>) typeAdapterMethod.invoke(null, gson); | ||
} catch (Exception e) { | ||
//Timber.v("couldn't invoke static typeAdapter method on " + rawType + ": " + e); | ||
return gson.getDelegateAdapter(this, type).nullSafe(); | ||
} | ||
public static TypeAdapterFactory create() { | ||
return new AutoValueGson_ValueTypeAdapterFactory(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.