453ca7c0ed
Unignored gradle.properties since androidX requires additions there See also https://developer.android.com/jetpack/androidx/migrate
29 lines
867 B
Java
29 lines
867 B
Java
package eu.siacs.conversations.ui;
|
|
|
|
import androidx.appcompat.app.ActionBar;
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
import android.view.MenuItem;
|
|
|
|
|
|
public abstract class ActionBarActivity extends AppCompatActivity {
|
|
public static void configureActionBar(ActionBar actionBar) {
|
|
configureActionBar(actionBar, true);
|
|
}
|
|
|
|
public static void configureActionBar(ActionBar actionBar, boolean upNavigation) {
|
|
if (actionBar != null) {
|
|
actionBar.setHomeButtonEnabled(upNavigation);
|
|
actionBar.setDisplayHomeAsUpEnabled(upNavigation);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean onOptionsItemSelected(final MenuItem item) {
|
|
switch (item.getItemId()) {
|
|
case android.R.id.home:
|
|
finish();
|
|
break;
|
|
}
|
|
return super.onOptionsItemSelected(item);
|
|
}
|
|
} |