Skip to content

Commit

Permalink
Merge pull request #4384 from SeannyM/android-uplevel
Browse files Browse the repository at this point in the history
Android: Fix "up one level" button
  • Loading branch information
degasus committed Oct 25, 2016
2 parents b0e2642 + 12db4e4 commit 1b824da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Expand Up @@ -10,10 +10,10 @@
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;
Expand Down Expand Up @@ -41,7 +41,7 @@ protected void onCreate(Bundle savedInstanceState)
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);

Expand Down
@@ -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;
Expand Down Expand Up @@ -197,12 +198,15 @@ public void setPath(String path)

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);
}
}

/**
Expand Down
Expand Up @@ -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"
Expand Down

0 comments on commit 1b824da

Please sign in to comment.