diff options
author | Andrew Dolgov <[email protected]> | 2012-12-01 15:35:42 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-12-01 15:35:42 +0400 |
commit | 022b17a79b02d1199b4c6fe3b98d98ad3c2ef1e7 (patch) | |
tree | 208ddd8f729781c8dd9858470e09c8ce6d5f6755 | |
parent | 1e637e4011224be09a859baafe63ff1ad0ca76a3 (diff) |
improve readability of comics list
-rw-r--r-- | res/values/strings.xml | 6 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicListFragment.java | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 8a5788d..c8324e8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9,11 +9,11 @@ <string name="prefs_comics_directory">Comics directory</string>
<string name="prefs_general">General</string>
<string name="prefs_dim_status_bar">Dim status bar</string>
- <string name="file_progress_info">%1$d of %2$d</string>
+ <string name="file_progress_info">%1$d of %2$d (%3$d%%)</string>
<string name="menu_rescan">Reload</string>
<string name="tab_all_comics">All comics</string>
<string name="tab_unread">Unread</string>
- <string name="tab_read">Read</string>
+ <string name="tab_read">Finished</string>
<string name="dialog_need_prefs_message">Please configure base directory for comics archives.</string>
<string name="dialog_need_prefs_preferences">Preferences</string>
<string name="cancel">Cancel</string>
@@ -54,4 +54,6 @@ <string name="open_parent">Open parent</string>
<string name="prefs_enable_rar_archives">Enable RAR archives</string>
<string name="prefs_enable_rar_summary">Using RAR (CBR) files is not recommended because of underlying RAR library issues. Enable at your own risk.</string>
+ <string name="file_unread">Unread (%1$d pages)</string>
+ <string name="file_finished">Finished</string>
</resources>
\ No newline at end of file diff --git a/src/org/fox/ttcomics/ComicListFragment.java b/src/org/fox/ttcomics/ComicListFragment.java index fce1959..9eb1d1f 100644 --- a/src/org/fox/ttcomics/ComicListFragment.java +++ b/src/org/fox/ttcomics/ComicListFragment.java @@ -4,9 +4,6 @@ import java.io.File; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
-
-import com.github.junrar.exception.RarException;
import android.app.Activity;
import android.content.Context;
@@ -17,7 +14,6 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory;
import android.os.AsyncTask;
import android.os.Bundle;
-import android.os.Environment;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SimpleCursorAdapter;
@@ -31,13 +27,14 @@ import android.view.ViewGroup; import android.widget.AdapterView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
+import com.github.junrar.exception.RarException;
+
public class ComicListFragment extends Fragment implements OnItemClickListener {
private final String TAG = this.getClass().getSimpleName();
@@ -106,7 +103,13 @@ public class ComicListFragment extends Fragment implements OnItemClickListener { if (info != null) {
if (size != -1 && size != SIZE_DIR) {
- info.setText(getString(R.string.file_progress_info, lastPos+1, size));
+ if (lastPos == size - 1) {
+ info.setText(getString(R.string.file_finished));
+ } else if (lastPos > 0) {
+ info.setText(getString(R.string.file_progress_info, lastPos+1, size, size/lastPos+1));
+ } else {
+ info.setText(getString(R.string.file_unread, size));
+ }
info.setVisibility(View.VISIBLE);
} else {
info.setVisibility(View.GONE);
|