Skip to content

Commit

Permalink
Changed exported file mime to multipart/xml
Browse files Browse the repository at this point in the history
Code refactoring
  • Loading branch information
codinguser committed Jul 14, 2012
1 parent ed19727 commit fe4a658
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
26 changes: 6 additions & 20 deletions GnucashMobile/res/layout/dialog_export_ofx.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,24 @@
<CheckBox android:id="@+id/checkbox_export_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/export_all_transactions"
/>
<TextView
android:text="@string/label_export_choice"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="-8dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
<!-- style="@style/TextAppearance.EditTransaction_LabelSmall" /> -->
android:text="@string/hint_export_choice"
style="@style/TextAppearance.Hint" />

<CheckBox android:id="@+id/checkbox_post_export_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/confirm_post_export_delete"
/>

<TextView
android:text="@string/label_delete_after_export"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginBottom="-8dp"
android:layout_marginTop="-8dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" />
android:text="@string/hint_delete_after_export"
style="@style/TextAppearance.Hint" />

<LinearLayout
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion GnucashMobile/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
<resources>
<color name="debit_red">#c11b17</color>
<color name="credit_green">#4cc552</color>

<color name="light_gray">#FFAAAAAA</color>
</resources>
3 changes: 2 additions & 1 deletion GnucashMobile/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

<resources>
<dimen name="add_button_padding">3dp</dimen>

<dimen name="dialog_padding">10dp</dimen>
<dimen name="hint_margin">-8dp</dimen>
<dimen name="text_size_small">14sp</dimen>
<dimen name="text_size_medium">18sp</dimen>
<dimen name="text_size_large">18sp</dimen>
Expand Down
5 changes: 3 additions & 2 deletions GnucashMobile/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@
<string name="label_export_destination">Export Destination</string>
<string name="title_export_dialog">Export OFX</string>
<string name="export_all_transactions">Export all transactions</string>
<string name="label_export_choice">By default, only new transactions since last export will be exported. Check this option to export all transactions</string>
<string name="hint_export_choice">By default, only new transactions since last export will be exported. Check this option to export all transactions</string>
<string name="error_exporting">Error exporting OFX data</string>
<string name="btn_export">Export</string>
<string name="confirm_post_export_delete">Delete after export</string>
<string name="label_delete_after_export">All exported transactions will be deleted when exporting is completed</string>
<string name="hint_delete_after_export">All exported transactions will be deleted when exporting is completed</string>

<string-array name="export_destinations">
<item>Share file&#8230;</item>
Expand All @@ -75,5 +75,6 @@
<string name="title_move_transactions">Move %1$d transactions</string>
<string name="label_move_destination">Destination Account</string>
<string name="permission_access_sdcard">Access SD Card</string>
<string name="title_share_ofx_with">Share OFX export with...</string>

</resources>
15 changes: 14 additions & 1 deletion GnucashMobile/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Boston, MA 02110-1301, USA gnu@gnu.org
-->

<resources>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="ListItemContainerBase">
<item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
</style>
Expand Down Expand Up @@ -69,4 +69,17 @@
<item name="android:paddingRight">8dp</item>
<item name="android:layout_marginBottom">-12dp</item>
</style>

<style name="TextAppearance.Hint">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingLeft">@dimen/dialog_padding</item>
<item name="android:paddingRight">@dimen/dialog_padding</item>
<item name="android:paddingBottom">@dimen/dialog_padding</item>
<item name="android:layout_marginTop">@dimen/hint_margin</item>
<item name="android:layout_marginBottom">@dimen/hint_margin</item>
<item name="android:textColor">@color/light_gray</item>
<item name="android:textSize">12sp</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {

private void shareFile(String path){
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("multipart/x-ofx");
shareIntent.setType("multipart/xml");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+ path));
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Gnucash OFX export");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm");
shareIntent.putExtra(Intent.EXTRA_TEXT, "Gnucash accounts export from "
+ formatter.format(new Date(System.currentTimeMillis())));
startActivity(Intent.createChooser(shareIntent, "Sharing OFX file..."));
startActivity(Intent.createChooser(shareIntent, getString(R.string.title_share_ofx_with)));
}

public static void copyFile(File src, File dst) throws IOException
Expand Down

0 comments on commit fe4a658

Please sign in to comment.