Show "up navigate" icon in input method subtype enabler
Since API 16 (and API 14 with support library) and later, we started supporting "up navigation" model. http://developer.android.com/training/implementing-navigation/ancestral.html As a part of Settings app and a part of an IME's settings activity, the input method subtype enabler should have a "up navigate icon on its action bar. Bug: 16595009 Change-Id: Iaaadd970395b9c9254ab60b2e8fee22dffb8c7f6
This commit is contained in:
@@ -15,13 +15,31 @@
|
|||||||
*/
|
*/
|
||||||
package com.android.settings.inputmethod;
|
package com.android.settings.inputmethod;
|
||||||
|
|
||||||
|
import android.app.ActionBar;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.android.settings.SettingsActivity;
|
import com.android.settings.SettingsActivity;
|
||||||
|
|
||||||
public class InputMethodAndSubtypeEnablerActivity extends SettingsActivity {
|
public class InputMethodAndSubtypeEnablerActivity extends SettingsActivity {
|
||||||
private static final String FRAGMENT_NAME = InputMethodAndSubtypeEnabler.class.getName();
|
private static final String FRAGMENT_NAME = InputMethodAndSubtypeEnabler.class.getName();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(final Bundle savedState) {
|
||||||
|
super.onCreate(savedState);
|
||||||
|
final ActionBar actionBar = getActionBar();
|
||||||
|
if (actionBar != null) {
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setHomeButtonEnabled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onNavigateUp() {
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Intent getIntent() {
|
public Intent getIntent() {
|
||||||
final Intent modIntent = new Intent(super.getIntent());
|
final Intent modIntent = new Intent(super.getIntent());
|
||||||
|
Reference in New Issue
Block a user