Skip to content

Commit

Permalink
#11: [Folder-Picker] Folder name in bold and counts in non-bold
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed Sep 12, 2015
1 parent 58e797d commit 6278545
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
3 changes: 3 additions & 0 deletions ToDo.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
TODO

#10 Fast swiping through images does not work
load preview images.on zoom start load original image

#6 geo-picker
extera_stream-uri(s) => blue: selected items via geo:, content: or file:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
package de.k3b.android.androFotoFinder.directory;

import android.content.Context;
import android.text.Html;
import android.text.Spanned;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
Expand Down Expand Up @@ -125,12 +127,15 @@ public View getGroupView(int groupIndex, boolean b, View view, ViewGroup viewGro
}

/** getFrom tree display text */
static String getDirectoryDisplayText(String prefix, IDirectory directory, int options) {
static Spanned getDirectoryDisplayText(String prefix, IDirectory directory, int options) {
StringBuilder result = new StringBuilder();
boolean asHtml = (options & Directory.OPT_AS_HTML) != 0;
if (asHtml) result.append("<b>");
if (prefix != null) result.append(prefix);
result.append(directory.getRelPath()).append(" ");
if (asHtml) result.append("</b>");
Directory.appendCount(result, directory, options);
return result.toString();
return Html.fromHtml(result.toString());
}

@Override
Expand Down
10 changes: 7 additions & 3 deletions fotolib2/src/main/java/de/k3b/io/Directory.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class Directory implements IDirectory {
public static final int OPT_SUB_DIR = 2;
public static final int OPT_ITEM = 4;
public static final int OPT_SUB_ITEM = 8;
public static final int OPT_AS_HTML = 0x100;
public static final int OPT_ALL = 0xffff;
public static final int OPT_NONE = 0;

Expand Down Expand Up @@ -147,17 +148,20 @@ public static void appendCount(StringBuilder result, IDirectory _item, int optio
int nonDirItemCount = ((options & OPT_ITEM) == 0) ? 0 : item.getNonDirItemCount();
int nonDirSubItemCount = ((options & OPT_SUB_ITEM) == 0) ? 0 : item.getNonDirSubItemCount();

appendCount(result, "(", dirCount, subDirCount, ")");
appendCount(result, ":(", nonDirItemCount, nonDirSubItemCount, ")");
boolean asHtml = (options & OPT_AS_HTML) != 0;
appendCount(result, "(", dirCount, subDirCount, ")", asHtml);
appendCount(result, ":(", nonDirItemCount, nonDirSubItemCount, ")", asHtml);
}
}

private static void appendCount(StringBuilder result, String prefix, int count, int subCount, String suffix) {
private static void appendCount(StringBuilder result, String prefix, int count, int subCount, String suffix, boolean asHtml) {
if ((count > 0) || (subCount > count)) {
if (asHtml) result.append("<font color='gray'><small>");
result.append(prefix);
if (count > 0) result.append(count);
if (subCount > count) result.append("+").append(subCount - count);
result.append(suffix);
if (asHtml) result.append("</small></font>");
}
}

Expand Down
6 changes: 3 additions & 3 deletions statistics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Unique visitors https://github.com/k3b/AndroFotoFinder/graphs/traffic
0906 5
0907 5
0908 4
0909 v0.4.1.150909 in github
0910
0911
0909 3 v0.4.1.150909 in github
0910 5 v0.4.1.150910 in github
0911 12 v0.4.1.150911 in github
0912
0913
0914
Expand Down
9 changes: 5 additions & 4 deletions wiki/History.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
## next version not released yet

## v0.4.2.* (not released yet)
## [v0.4.2.*](https://github.com/k3b/AndroFotoFinder/issues?q=milestone%3Av0.4.2) (not released yet)

* [Geografic-Map](https://github.com/k3b/AndroFotoFinder/wiki/geographic-map) :
* menu to open [Filter-View](https://github.com/k3b/AndroFotoFinder/wiki/Filter-View)
* purpose: Filter the photos that are visible in the map.
* if [Geografic-Map](geographic-map) is opened without [intent-extra-de.k3b.extra.FILTER parameter](intentapi#filter) the map is opend with the last used filter.
* improved menu "zoom to fit"
* [Intent API](https://github.com/k3b/AndroFotoFinder/wiki/intentapi): support for [de.k3b.extra.FILTER string](intentapi#filter)
* [Folder- or Date-Picker](https://github.com/k3b/AndroFotoFinder/wiki/Folder-Picker)'s long-tapping-folder-contextmenu:
* menu "Show in new Gallery" opens a new prefiltered [Gallery-View](https://github.com/k3b/AndroFotoFinder/wiki/Gallery-View)
* [Folder- or Date-Picker](https://github.com/k3b/AndroFotoFinder/wiki/Folder-Picker):
* long-tapping-folder-contextmenu "Show in new Gallery" opens a new prefiltered [Gallery-View](https://github.com/k3b/AndroFotoFinder/wiki/Gallery-View)
* [#11](https://github.com/k3b/AndroFotoFinder/issues/11) Folder name in bold and counts in non-bold.
* [Intent API](https://github.com/k3b/AndroFotoFinder/wiki/intentapi): intent VIEW mime="image/*" + data=file:xxx or android.intent.extra.STREAM=file:xxx
* [Image-View](https://github.com/k3b/AndroFotoFinder/wiki/Image-View) if xxx is an existing image file.
* else [Gallery-View](https://github.com/k3b/AndroFotoFinder/wiki/Gallery-View) where xxx is used as a path filter

## [v0.4.1.150911](https://github.com/k3b/AndroFotoFinder/releases/tag/v0.4.1.150911)
## [v0.4.1.150911](https://github.com/k3b/AndroFotoFinder/issues?q=milestone%3Av0.4.1)

* [Gallery-View](https://github.com/k3b/AndroFotoFinder/wiki/Gallery-View) :
* [Selection](Gallery-View#Multiselection): add/remove [all visible](Gallery-View#CurrentSet)
Expand Down

0 comments on commit 6278545

Please sign in to comment.