Skip to content

Commit

Permalink
API 16 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mvarnagiris committed Oct 18, 2014
1 parent a502f85 commit dff409e
Show file tree
Hide file tree
Showing 142 changed files with 518 additions and 747 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###Version: 0.11.0
- ```fix``` Up button is working.
- ```new``` Supporting Ice Cream Sandwich and up.
- ```new``` Supporting Jelly Bean and up.

###Version: 0.10.0
- ```new``` Completely new UI. Material design.
Expand All @@ -9,4 +9,4 @@
- ```new``` Export backup file to device or Google Drive.
- ```new``` Export CSV to phone to device or Google Drive.
- ```new``` Improved CSV format.
- ```change``` No more sub-categories. Use tags instead.
- ```new``` No more sub-categories. Use tags instead.
3 changes: 1 addition & 2 deletions financius/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
defaultConfig {
applicationId 'com.code44.finance'
targetSdkVersion 21
minSdkVersion 14
minSdkVersion 16
versionCode 47
versionName '0.11.0'
buildConfigField "boolean", "USE_LOCAL_SERVER", "true"
Expand Down Expand Up @@ -66,7 +66,6 @@ dependencies {
compile 'me.grantland:autofittextview:0.1.1'
compile 'com.squareup:otto:1.3.5'
compile 'se.emilsjolander:stickylistheaders:2.5.0'
compile 'com.github.citux:datetimepicker:0.1.0'
compile 'com.nononsenseapps:filepicker:1.1.3'
testCompile 'junit:junit:4.11'
testCompile 'org.robolectric:robolectric:2.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static class ViewHolder {

public static ViewHolder setAsTag(View view) {
final ViewHolder holder = new ViewHolder();
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
holder.balance_TV = (TextView) view.findViewById(R.id.balance_TV);
holder.mainCurrencyBalance_TV = (TextView) view.findViewById(R.id.mainCurrencyBalance_TV);
view.setTag(holder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private static class ViewHolder {
public static ViewHolder setAsTag(View view) {
final ViewHolder holder = new ViewHolder();
holder.color_IV = (ImageView) view.findViewById(R.id.color_IV);
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
view.setTag(holder);

return holder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.code44.finance.adapters;

import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.code44.finance.R;
import com.code44.finance.common.model.TransactionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ private int getPercent(long amount) {
}

private static final class ViewHolder {
public ImageView color_IV;
public TextView percent_TV;
public TextView title_TV;
public TextView amount_TV;
public final ImageView color_IV;
public final TextView percent_TV;
public final TextView title_TV;
public final TextView amount_TV;

public ViewHolder(View view) {
color_IV = (ImageView) view.findViewById(R.id.color_IV);
percent_TV = (TextView) view.findViewById(R.id.percent_TV);
title_TV = (TextView) view.findViewById(R.id.title_TV);
title_TV = (TextView) view.findViewById(R.id.title);
amount_TV = (TextView) view.findViewById(R.id.amount_TV);
view.setTag(this);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static class ViewHolder {

public static ViewHolder setAsTag(View view) {
final ViewHolder holder = new ViewHolder();
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
holder.currency_B = (Button) view.findViewById(R.id.currency_B);
holder.currency_B.setAllCaps(false);
view.setTag(holder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected static class ViewHolder {
public final TextView title_TV;

public ViewHolder(View view) {
title_TV = (TextView) view.findViewById(R.id.title_TV);
title_TV = (TextView) view.findViewById(R.id.title);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static class ViewHolder {

public static ViewHolder setAsTag(View view) {
final ViewHolder holder = new ViewHolder();
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
view.setTag(holder);

return holder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public SettingsAdapter(Context context) {
return ViewType.values().length;
}

@Override public int getItemViewType(int position) {
return super.getItemViewType(position);
}

@Override public Object getItem(int position) {
return settingsItems.get(position);
}
Expand Down Expand Up @@ -149,7 +145,7 @@ private static class SettingsItemViewHolder {
private final TextView title_TV;

private SettingsItemViewHolder(View itemView) {
title_TV = (TextView) itemView.findViewById(R.id.title_TV);
title_TV = (TextView) itemView.findViewById(R.id.title);
}

protected void bind(SettingsItem settingsItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static class ViewHolder {
public static ViewHolder setAsTag(View view) {
final ViewHolder holder = new ViewHolder();
holder.select_CB = (CheckBox) view.findViewById(R.id.select_CB);
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
view.setTag(holder);

return holder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static ViewHolder setAsTag(View view) {
holder.color_IV = (ImageView) view.findViewById(R.id.color_IV);
holder.weekday_TV = (TextView) view.findViewById(R.id.weekday_TV);
holder.day_TV = (TextView) view.findViewById(R.id.day_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
holder.subtitle_TV = (TextView) view.findViewById(R.id.subtitle_TV);
holder.amount_TV = (TextView) view.findViewById(R.id.amount_TV);
holder.account_TV = (TextView) view.findViewById(R.id.account_TV);
Expand All @@ -320,7 +320,7 @@ private static class HeaderViewHolder {
public static HeaderViewHolder setAsTag(View view) {
final HeaderViewHolder holder = new HeaderViewHolder();
holder.arrow_IV = (ImageView) view.findViewById(R.id.arrow_IV);
holder.title_TV = (TextView) view.findViewById(R.id.title_TV);
holder.title_TV = (TextView) view.findViewById(R.id.title);
holder.amount_TV = (TextView) view.findViewById(R.id.amount_TV);
view.setTag(holder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.code44.finance.data.providers.CurrenciesProvider;
import com.code44.finance.utils.EventBus;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -48,7 +47,7 @@ public ExchangeRatesRequest(EventBus eventBus, Context context, CurrenciesReques
}
}

private Currency getCurrencyWithUpdatedExchangeRate(String fromCode) throws IOException {
private Currency getCurrencyWithUpdatedExchangeRate(String fromCode) {
final ExchangeRateRequest request = new ExchangeRateRequest(eventBus, context, requestService, fromCode, toCode, false);
request.run();
return request.getCurrency();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public SyncRequest(EventBus eventBus, Context context, DBHelper dbHelper, User u
getTransactions();
}

private void pushCurrencies(SQLiteDatabase database) throws Exception {
private void pushCurrencies(SQLiteDatabase database) {
markInProgress(database, Tables.Currencies.SYNC_STATE);

final Cursor cursor = Query.create()
Expand All @@ -108,11 +108,11 @@ private void pushCurrencies(SQLiteDatabase database) throws Exception {
new PostCurrenciesRequest(gcmRegistration, currenciesService, currencies).run();
}

private void getCurrencies() throws Exception {
private void getCurrencies() {
new GetCurrenciesRequest(context, user, currenciesService).run();
}

private void pushCategories(SQLiteDatabase database) throws Exception {
private void pushCategories(SQLiteDatabase database) {
markInProgress(database, Tables.Categories.SYNC_STATE);

final Cursor cursor = Query.create()
Expand All @@ -130,11 +130,11 @@ private void pushCategories(SQLiteDatabase database) throws Exception {
new PostCategoriesRequest(gcmRegistration, categoriesService, categories).run();
}

private void getCategories() throws Exception {
private void getCategories() {
new GetCategoriesRequest(context, user, categoriesService).run();
}

private void pushTags(SQLiteDatabase database) throws Exception {
private void pushTags(SQLiteDatabase database) {
markInProgress(database, Tables.Tags.SYNC_STATE);

final Cursor cursor = Query.create()
Expand All @@ -152,11 +152,11 @@ private void pushTags(SQLiteDatabase database) throws Exception {
new PostTagsRequest(gcmRegistration, tagsService, tags).run();
}

private void getTags() throws Exception {
private void getTags() {
new GetTagsRequest(context, user, tagsService).run();
}

private void pushAccounts(SQLiteDatabase database) throws Exception {
private void pushAccounts(SQLiteDatabase database) {
markInProgress(database, Tables.Accounts.SYNC_STATE);

final Cursor cursor = Query.create()
Expand All @@ -175,11 +175,11 @@ private void pushAccounts(SQLiteDatabase database) throws Exception {
new PostAccountsRequest(gcmRegistration, accountsService, accounts).run();
}

private void getAccounts() throws Exception {
private void getAccounts() {
new GetAccountsRequest(context, user, accountsService).run();
}

private void pushTransactions(SQLiteDatabase database) throws Exception {
private void pushTransactions(SQLiteDatabase database) {
markInProgress(database, Tables.Transactions.SYNC_STATE);

final Cursor cursor = Query.create()
Expand All @@ -202,7 +202,7 @@ private void pushTransactions(SQLiteDatabase database) throws Exception {
new PostTransactionsRequest(gcmRegistration, transactionsService, transactions).run();
}

private void getTransactions() throws Exception {
private void getTransactions() {
new GetTransactionsRequest(context, user, transactionsService).run();
}

Expand Down
2 changes: 1 addition & 1 deletion financius/src/main/java/com/code44/finance/data/Query.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.code44.finance.data;

import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.support.v4.content.CursorLoader;
import android.text.TextUtils;

import com.code44.finance.common.utils.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
Expand Down Expand Up @@ -78,13 +77,13 @@ public BackupDataImporter(InputStream inputStream, Context context, DBHelper dbH
}
}

private JsonObject inputStreamToJson(InputStream inputStream) throws FileNotFoundException {
private JsonObject inputStreamToJson(InputStream inputStream) {
final JsonParser parser = new JsonParser();
final JsonElement jsonElement = parser.parse(new InputStreamReader(inputStream));
return jsonElement.getAsJsonObject();
}

private void validate(JsonObject json) throws Exception {
private void validate(JsonObject json) {
final int version = json.get("version").getAsInt();
if (version < MIN_VALID_VERSION) {
throw new IllegalArgumentException("Backup version " + version + " is not supported anymore.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ public abstract class DataExporter implements Closeable {

protected DataExporter(OutputStream outputStream) {
this.outputStream = Preconditions.checkNotNull(outputStream, "OutputStream cannot be null.");
;
}

@Override public void close() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ public PieChartView(Context context, AttributeSet attrs) {
}

public PieChartView(Context context, AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}

public PieChartView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);

super(context, attrs, defStyleAttr);
// Init
outlinePaint.setStyle(Paint.Style.STROKE);
inlinePaint.setStyle(Paint.Style.STROKE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
StartupService.class
}
)
public class AccountModule {
class AccountModule {
@Provides @Singleton public User provideUser(@ApplicationContext Context context, DBHelper dbHelper, GcmRegistration gcmRegistration, EventBus eventBus) {
return new User(context, dbHelper, gcmRegistration, eventBus);
}
Expand Down
Loading

0 comments on commit dff409e

Please sign in to comment.