add ActionBarCompat.setTitle() method
Now the title can be easily set in the ActionBar to reflect the current Activity.
This commit is contained in:
parent
47659b5cec
commit
526c978328
@ -21,6 +21,7 @@ public abstract class ActionBarCompat extends Compatibility {
|
||||
}
|
||||
|
||||
public abstract void setDisplayHomeAsUpEnabled(boolean value);
|
||||
public abstract void setTitle(CharSequence title);
|
||||
|
||||
}
|
||||
|
||||
@ -34,6 +35,12 @@ class OldActionBarCompatImpl extends ActionBarCompat {
|
||||
public void setDisplayHomeAsUpEnabled(boolean value) {
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
// Do nothing...
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(11)
|
||||
@ -50,4 +57,9 @@ class HoneycombActionBarCompatImpl extends ActionBarCompat {
|
||||
public void setDisplayHomeAsUpEnabled(boolean value) {
|
||||
actionBar.setDisplayHomeAsUpEnabled(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTitle(CharSequence title) {
|
||||
actionBar.setTitle(title);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user