[Android] Remove the subtitles on all folders in the folder browser. No need to have the subtitle "Folder" when it's visibly indicated by the icon of a folder next to it.

Now it looks like this: http://i.imgur.com/CbUSqgg.png
This commit is contained in:
Lioncash 2013-08-14 19:49:39 -04:00
parent 1826fce946
commit 9c27fedd6d
4 changed files with 30 additions and 3 deletions

View File

@ -39,5 +39,5 @@
android:gravity="center_vertical"
android:text="Title"
android:textStyle="bold" />/>
android:textStyle="bold" />
</RelativeLayout>

View File

@ -45,7 +45,7 @@ public final class FolderBrowser extends Fragment
{
if(entry.isDirectory())
{
dir.add(new FolderBrowserItem(m_activity, entryName, getString(R.string.folder), entry.getAbsolutePath(), true));
dir.add(new FolderBrowserItem(m_activity, entryName, entry.getAbsolutePath(), true));
}
else
{

View File

@ -1,6 +1,7 @@
package org.dolphinemu.dolphinemu;
import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -57,9 +58,17 @@ public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
}
if(subtitleText != null)
{
// Remove the subtitle for all folders, except for the parent directory folder.
if (item.isDirectory() && !item.getSubtitle().equals(c.getResources().getString(R.string.parent_directory)))
{
subtitleText.setVisibility(View.GONE);
}
else
{
subtitleText.setText(item.getSubtitle());
}
}
if (iconView != null)
{

View File

@ -37,6 +37,24 @@ public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
this.underlyingFile = new File(path);
}
/**
* Constructor. Initializes a FolderBrowserItem with an empty subtitle.
*
* @param ctx Context this FolderBrowserItem is being used in.
* @param name The name of the file/folder represented by this item.
* @param path The path of the file/folder represented by this item.
* @param isValid Whether or not this item represents a file type that can be handled.
*/
public FolderBrowserItem(Context ctx, String name, String path, boolean isValid)
{
this.ctx = ctx;
this.name = name;
this.subtitle = "";
this.path = path;
this.isValid = isValid;
this.underlyingFile = new File(path);
}
/**
* Gets the name of the file/folder represented by this FolderBrowserItem.
*