Skip to content

Commit

Permalink
Fixed: transaction is inverted when open for editing
Browse files Browse the repository at this point in the history
Fixed: Home button in recurring transactions view does not work
Fixed: Settings menu now visible in recurring transactions view
Fixed: crash when opening Settings on Android versions < HONEYCOMB
Updated copyright notices
Prepare strings for v1.3.0.beta2 release
  • Loading branch information
codinguser committed Feb 6, 2014
1 parent 5d17c1c commit 8e7b974
Show file tree
Hide file tree
Showing 27 changed files with 120 additions and 54 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Change Log
===============================================================================
Version 1.3.0 *(2014-02-07)*
Version 1.3.0 *(2014-02-10)*
----------------------------
* Fixed: Some file managers do not display all files available for import
* Fixed: Crash when deleting account from accounts list
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Nicolas Barranger <wicowyn@gmail.com>
Sigurd Gartmann <sigurdga-github@sigurdga.no>
Pedro Abel <pedroabel@gmail.com>
windwarrior <lennartbuit@gmail.com>
lxbzmy <lxbzmy@gmail.com>
Lei Xiao Bao <lxbzmy@gmail.com>
4 changes: 2 additions & 2 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.gnucash.android"
android:versionCode="23"
android:versionName="1.3.0.beta1" >
android:versionCode="24"
android:versionName="1.3.0.beta2" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/>

Expand Down
2 changes: 1 addition & 1 deletion app/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
Copyright (c) 2012 - 2014 Christian Stimming <christian@stimming.de>
Copyright (c) 2012 - 2013 Christian Stimming <christian@stimming.de>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions app/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--
Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
Copyright (c) 2013 - 2014 Lei Xiao Bao <lxbzmy@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
15 changes: 15 additions & 0 deletions app/src/org/gnucash/android/app/GnuCashApplication.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gnucash.android.app;

import android.app.Application;
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/data/Money.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/data/Transaction.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/db/AccountsDbAdapter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/db/DatabaseAdapter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/db/DatabaseCursorLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/db/DatabaseHelper.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/db/TransactionsDbAdapter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/org/gnucash/android/export/ofx/OfxExporter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
15 changes: 15 additions & 0 deletions app/src/org/gnucash/android/export/qif/QifExporter.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gnucash.android.export.qif;

import android.content.Context;
Expand Down
16 changes: 16 additions & 0 deletions app/src/org/gnucash/android/export/qif/QifHelper.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.gnucash.android.export.qif;

import org.gnucash.android.R;
Expand Down
22 changes: 11 additions & 11 deletions app/src/org/gnucash/android/ui/accounts/AccountsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.gnucash.android.R;
import org.gnucash.android.data.Money;
import org.gnucash.android.ui.Refreshable;
import org.gnucash.android.ui.settings.SettingsActivity;
import org.gnucash.android.ui.transactions.RecurringTransactionsListFragment;
import org.gnucash.android.ui.transactions.TransactionsActivity;
import org.gnucash.android.ui.transactions.TransactionsListFragment;
Expand Down Expand Up @@ -242,14 +243,15 @@ private void init() {

Money.DEFAULT_CURRENCY_CODE = currencyCode;

if (hasNewFeatures()){
showWhatsNewDialog(this);
}

boolean firstRun = prefs.getBoolean(getString(R.string.key_first_run), true);
if (firstRun){
createDefaultAccounts();
}

if (hasNewFeatures()){
showWhatsNewDialog(this);
}

}

@Override
Expand Down Expand Up @@ -321,18 +323,16 @@ public boolean onCreateOptionsMenu(Menu menu) {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
FragmentManager fm = getSupportFragmentManager();
if (fm.getBackStackEntryCount() > 0) {
fm.popBackStack();
}
return true;

case R.id.menu_recurring_transactions:
Intent intent = new Intent(this, AccountsActivity.class);
intent.setAction(ACTION_VIEW_RECURRING);
startActivity(intent);
return true;

case R.id.menu_settings:
startActivity(new Intent(this, SettingsActivity.class));
return true;

default:
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,6 @@ public boolean onOptionsItemSelected(MenuItem item) {
showExportDialog();
return true;

case R.id.menu_settings:
startActivity(new Intent(getActivity(), SettingsActivity.class));
return true;

default:
return false;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 4 additions & 2 deletions app/src/org/gnucash/android/ui/settings/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ protected void onCreate(Bundle savedInstanceState) {
pref = findPreference(getString(R.string.key_build_version));
pref.setOnPreferenceClickListener(this);

pref = findPreference(getString(R.string.key_create_default_accounts));
pref.setOnPreferenceClickListener(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB){
pref = findPreference(getString(R.string.key_create_default_accounts));
pref.setOnPreferenceClickListener(this);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,16 +319,11 @@ public void onItemClick(AdapterView<?> adapterView, View view, int position, lon
private void initializeViewsWithTransaction(){
mNameEditText.setText(mTransaction.getName());

//FIXME: Better handle the different kinds of accounts and how transfers between the different types affect balance
//FIXME: You need to revisit me when splits are introduced
//checking the type button means the amount will be shown as negative (in red) to user
// if (mAccountType.hasDebitNormalBalance()){
// mTransactionTypeButton.setChecked();
// mTransactionTypeButton.setChecked(mTransaction.getTransactionType() == TransactionType.CREDIT);
// }
// else {
// mTransactionTypeButton.setChecked(mTransaction.getTransactionType() == TransactionType.DEBIT);
// }
mTransactionTypeButton.setChecked(mTransaction.getTransactionType() == TransactionType.DEBIT);

mTransactionTypeButton.setChecked(mTransaction.getAmount().isNegative());

if (!mAmountManuallyEdited){
//when autocompleting, only change the amount if the user has not manually changed it already
mAmountEditText.setText(mTransaction.getAmount().toPlainString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class RecurringTransactionsListFragment extends SherlockListFragment impl
/**
* Logging tag
*/
protected static final String TAG = "TransactionsListFragment";
protected static final String TAG = "RecurringTransactionsFragment";

private TransactionsDbAdapter mTransactionsDbAdapter;
private SimpleCursorAdapter mCursorAdapter;
Expand Down Expand Up @@ -112,7 +112,7 @@ public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
alarmManager.cancel(recurringPendingIntent);
if (mTransactionsDbAdapter.deleteRecord(id)){
Toast.makeText(getActivity(), R.string.toast_recurring_transaction_deleted, Toast.LENGTH_SHORT).show();
};
}
}
refreshList();
mode.finish();
Expand Down Expand Up @@ -148,10 +148,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

ActionBar aBar = getSherlockActivity().getSupportActionBar();
aBar.setDisplayShowTitleEnabled(true);
aBar.setDisplayHomeAsUpEnabled(true);
aBar.setTitle("Recurring Transactions");
ActionBar actionBar = getSherlockActivity().getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setTitle("Recurring Transactions");

setHasOptionsMenu(true);
getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
Expand Down Expand Up @@ -209,7 +210,18 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// inflater.inflate(R.menu.transactions_list_actions, menu);
//remove menu items from the AccountsActivity
menu.removeItem(R.id.menu_search);
menu.removeItem(R.id.menu_settings);
// menu.removeItem(R.id.menu_settings);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
getActivity().finish();
return true;
default:
return false;
}
}

@Override
Expand Down Expand Up @@ -284,10 +296,9 @@ private void startActionMode(){
*/
private void stopActionMode(){
int checkedCount = getListView().getCheckedItemIds().length;
if (checkedCount > 0 || mActionMode == null)
return;
else
if (checkedCount <= 0 && mActionMode != null) {
mActionMode.finish();
}
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.gnucash.android.ui.transactions;

import org.gnucash.android.R;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2012 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013 Ngewi Fet <ngewif@gmail.com>
* Copyright (c) 2013 - 2014 Ngewi Fet <ngewif@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 8e7b974

Please sign in to comment.