routable-android
routable-android copied to clipboard
Extend typed parameter in Uri.
It's a pity that we treat all parameter as String
type. So I introduce type into key declaration, such as
map("users/:defaultIsStringValue/i:intValue/l:longValue/f:floatValue/d:doubleValue/s:stringValue", UserActivity.class)
In this situation, we can get typed parameter from intent. For example, use
.getExtras().getInt("intValue")
to get an Integer
value.
I keep the full compatibility to your original interface, and pass all original testing cases. Besides, I supply my testing cases to verify the typed parameter, and the mixed typed and none typed parameter.
This time, I did three things:
1, Modifty the 'README.md', introduce supporting of typed parameter.
2, Add @deprecated
to some method. The global context is very bad design, and the worse, when used with startActivity
, for more detail, see: http://possiblemobile.com/2013/06/context/
3. Replace TAB
with 4 spaces.
At last, thanks for you good code.