Android: Fix "up one level" button

This commit is contained in:
Sean Maas 2016-10-24 22:41:13 -04:00
parent b0e2642883
commit 12db4e4882
3 changed files with 12 additions and 8 deletions

View File

@ -10,10 +10,10 @@ import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toolbar;
import org.dolphinemu.dolphinemu.BuildConfig;
import org.dolphinemu.dolphinemu.R;
@ -41,7 +41,7 @@ public class AddDirectoryActivity extends AppCompatActivity implements FileAdapt
setContentView(R.layout.activity_add_directory);
mToolbar = (Toolbar) findViewById(R.id.toolbar_folder_list);
setActionBar(mToolbar);
setSupportActionBar(mToolbar);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list_files);

View File

@ -1,5 +1,6 @@
package org.dolphinemu.dolphinemu.adapters;
import android.os.Environment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
@ -197,12 +198,15 @@ public final class FileAdapter extends RecyclerView.Adapter<FileViewHolder> impl
public void upOneLevel()
{
File currentDirectory = new File(mPath);
File parentDirectory = currentDirectory.getParentFile();
if (!mPath.equals(Environment.getExternalStorageDirectory().getPath()))
{
File currentDirectory = new File(mPath);
File parentDirectory = currentDirectory.getParentFile();
mFileList = generateFileList(parentDirectory);
notifyDataSetChanged();
mListener.updateSubtitle(mPath);
mFileList = generateFileList(parentDirectory);
notifyDataSetChanged();
mListener.updateSubtitle(mPath);
}
}
/**

View File

@ -5,7 +5,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<Toolbar
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar_folder_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"