Android: remove save icon and add up button
This commit is contained in:
parent
4c0dcf42b8
commit
0a82bb51bd
|
@ -7,7 +7,6 @@ import android.content.Intent;
|
|||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
|
@ -94,6 +93,9 @@ public class CheatsActivity extends AppCompatActivity
|
|||
onSelectedCheatChanged(mViewModel.getSelectedCheat().getValue());
|
||||
|
||||
mViewModel.getOpenDetailsViewEvent().observe(this, this::openDetailsView);
|
||||
|
||||
// show up button
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -105,18 +107,6 @@ public class CheatsActivity extends AppCompatActivity
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item)
|
||||
{
|
||||
if (item.getItemId() == R.id.menu_save_exit)
|
||||
{
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop()
|
||||
{
|
||||
|
@ -179,6 +169,13 @@ public class CheatsActivity extends AppCompatActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp()
|
||||
{
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void openDetailsView(boolean open)
|
||||
{
|
||||
if (open)
|
||||
|
|
|
@ -75,6 +75,9 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
|
|||
|
||||
mPresenter = new SettingsActivityPresenter(this, getSettings());
|
||||
mPresenter.onCreate(savedInstanceState, menuTag, gameID, revision, isWii, this);
|
||||
|
||||
// show up button
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,12 +89,6 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item)
|
||||
{
|
||||
return mPresenter.handleOptionsItem(item.getItemId());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(@NonNull Bundle outState)
|
||||
{
|
||||
|
@ -294,6 +291,13 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
|
|||
mPresenter.onExtensionSettingChanged(menuTag, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSupportNavigateUp()
|
||||
{
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
private SettingsFragment getFragment()
|
||||
{
|
||||
return (SettingsFragment) getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG);
|
||||
|
|
|
@ -120,17 +120,6 @@ public final class SettingsActivityPresenter
|
|||
}
|
||||
}
|
||||
|
||||
public boolean handleOptionsItem(int itemId)
|
||||
{
|
||||
if (itemId == R.id.menu_save_exit)
|
||||
{
|
||||
mView.finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onSettingChanged()
|
||||
{
|
||||
mShouldSave = true;
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_save_exit"
|
||||
android:title="@string/preferences_save_exit"
|
||||
android:icon="@drawable/ic_quicksave"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
</menu>
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"/>
|
||||
|
|
Loading…
Reference in New Issue