[Android] Shorten FolderBrowserItem's method 'isValidItem()' into 'isValid()' makes more sense and less redundancy in terms of 'item.isValidItem()' -> 'item.isValid()'
This commit is contained in:
parent
5047eeb263
commit
9149b30237
|
@ -95,15 +95,15 @@ public final class FolderBrowser extends Fragment
|
|||
{
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
|
||||
{
|
||||
FolderBrowserItem o = adapter.getItem(position);
|
||||
if(o.isDirectory() || o.getSubtitle().equalsIgnoreCase(getString(R.string.parent_directory)))
|
||||
FolderBrowserItem item = adapter.getItem(position);
|
||||
if(item.isDirectory() || item.getSubtitle().equalsIgnoreCase(getString(R.string.parent_directory)))
|
||||
{
|
||||
currentDir = new File(o.getPath());
|
||||
currentDir = new File(item.getPath());
|
||||
Fill(currentDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (o.isValidItem())
|
||||
if (item.isValid())
|
||||
FolderSelected();
|
||||
else
|
||||
Toast.makeText(m_activity, getString(R.string.cant_use_compressed_filetypes), Toast.LENGTH_LONG).show();
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class FolderBrowserAdapter extends ArrayAdapter<FolderBrowserItem>
|
|||
{
|
||||
mainText.setText(item.getName());
|
||||
|
||||
if (!item.isValidItem())
|
||||
if (!item.isValid())
|
||||
{
|
||||
mainText.setTextColor(0xFFFF0000);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ public final class FolderBrowserItem implements Comparable<FolderBrowserItem>
|
|||
* by this FolderBrowserItem is supported
|
||||
* and can be handled correctly.
|
||||
*/
|
||||
public boolean isValidItem()
|
||||
public boolean isValid()
|
||||
{
|
||||
return isValid;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue