-
Notifications
You must be signed in to change notification settings - Fork 539
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
495 additions
and
373 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
import android.content.res.Configuration; | ||
import android.database.Cursor; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.v4.app.Fragment; | ||
import android.support.v4.app.LoaderManager.LoaderCallbacks; | ||
import android.support.v4.content.Loader; | ||
|
@@ -42,6 +43,7 @@ | |
import android.widget.TextView; | ||
|
||
import org.gnucash.android.R; | ||
import org.gnucash.android.app.GnuCashApplication; | ||
import org.gnucash.android.db.AccountsDbAdapter; | ||
import org.gnucash.android.db.DatabaseCursorLoader; | ||
import org.gnucash.android.db.DatabaseSchema; | ||
|
@@ -57,8 +59,10 @@ | |
import org.gnucash.android.ui.util.CursorRecyclerAdapter; | ||
import org.gnucash.android.ui.util.Refreshable; | ||
import org.gnucash.android.ui.util.widget.EmptyRecyclerView; | ||
import org.joda.time.LocalDate; | ||
|
||
import java.text.DateFormat; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
|
@@ -196,7 +200,6 @@ public void onLoaderReset(Loader<Cursor> loader) { | |
mTransactionRecyclerAdapter.swapCursor(null); | ||
} | ||
|
||
|
||
/** | ||
* {@link DatabaseCursorLoader} for loading transactions asynchronously from the database | ||
* @author Ngewi Fet <[email protected]> | ||
|
@@ -221,8 +224,6 @@ public Cursor loadInBackground() { | |
|
||
public class TransactionRecyclerAdapter extends CursorRecyclerAdapter<TransactionRecyclerAdapter.ViewHolder>{ | ||
|
||
DateFormat simpleDateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM); | ||
|
||
public TransactionRecyclerAdapter(Cursor cursor) { | ||
super(cursor); | ||
} | ||
|
@@ -264,7 +265,8 @@ public void onBindViewHolderCursor(ViewHolder holder, Cursor cursor) { | |
holder.transactionNote.setText(text); | ||
|
||
long dateMillis = cursor.getLong(cursor.getColumnIndexOrThrow(DatabaseSchema.TransactionEntry.COLUMN_TIMESTAMP)); | ||
String dateText = DateUtils.getRelativeTimeSpanString(dateMillis, System.currentTimeMillis(), DateUtils.DAY_IN_MILLIS).toString(); | ||
String dateText = TransactionsActivity.getPrettyDateFormat(getActivity(), dateMillis); | ||
|
||
holder.transactionDate.setText(dateText); | ||
|
||
final long id = holder.transactionId; | ||
|
@@ -288,7 +290,6 @@ public void onClick(View v) { | |
|
||
} | ||
|
||
|
||
public class ViewHolder extends RecyclerView.ViewHolder implements PopupMenu.OnMenuItemClickListener{ | ||
@Bind(R.id.primary_text) public TextView transactionDescription; | ||
@Bind(R.id.secondary_text) public TextView transactionNote; | ||
|
Oops, something went wrong.