Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
lioncash committed Aug 14, 2013
1 parent 1826fce commit 9c27fed
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Android/res/layout/folderbrowser.xml
Expand Up @@ -39,5 +39,5 @@

android:gravity="center_vertical"
android:text="Title"
android:textStyle="bold" />/>
android:textStyle="bold" />
</RelativeLayout>
Expand Up @@ -45,7 +45,7 @@ private void Fill(File currDir)
{
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
{
Expand Down
@@ -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;
Expand Down Expand Up @@ -58,7 +59,15 @@ public View getView(int position, View convertView, ViewGroup parent)

if(subtitleText != null)
{
subtitleText.setText(item.getSubtitle());
// 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)
Expand Down
Expand Up @@ -37,6 +37,24 @@ public FolderBrowserItem(Context ctx, String name, String subtitle, String path,
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.
*
Expand Down

0 comments on commit 9c27fed

Please sign in to comment.