anotherim/src/main/java/eu/siacs/conversations/ui/ActionBarActivity.java
Ferdinand Pöll 453ca7c0ed Migrate from Android Support Library to AndroidX
Unignored gradle.properties since androidX requires additions there
See also https://developer.android.com/jetpack/androidx/migrate
2021-01-18 20:49:35 +01:00

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);
}
}