Implement Settings buttons

This commit is contained in:
Stypox 2020-02-22 10:36:10 +01:00
parent d25dd96ad0
commit 431be4003d
5 changed files with 28 additions and 12 deletions

View file

@ -12,6 +12,7 @@ import android.view.MenuItem;
import android.view.ViewTreeObserver;
import org.schabi.newpipe.R;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ThemeHelper;
import us.shandian.giga.service.DownloadManagerService;
@ -76,11 +77,12 @@ public class DownloadActivity extends AppCompatActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home: {
case android.R.id.home:
onBackPressed();
return true;
}
case R.id.action_settings:
NavigationHelper.openSettings(this);
return true;
default:
return super.onOptionsItemSelected(item);
}