diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-09 20:44:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-09 20:44:45 +0100 |
commit | e3fa33a1bfca1160ae0818be8227771e125cf766 (patch) | |
tree | 94915b2a744872c3b01274879ea8087ba706c196 /src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | |
parent | 6fb4eb97510b6e980c95daa35664c46c45f5234d (diff) |
reference support actionbar in all activities
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index ca435d6a5..a9ede6729 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -1,6 +1,5 @@ package de.pixart.messenger.ui; -import android.app.ActionBar; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -14,6 +13,7 @@ import android.provider.ContactsContract.CommonDataKinds; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.Intents; import android.support.v4.content.ContextCompat; +import android.support.v7.app.ActionBar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -288,9 +288,9 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp keysWrapper = findViewById(R.id.keys_wrapper); tags = findViewById(R.id.tags); mShowInactiveDevicesButton = findViewById(R.id.show_inactive_devices); - if (getActionBar() != null) { - getActionBar().setHomeButtonEnabled(true); - getActionBar().setDisplayHomeAsUpEnabled(true); + if (getSupportActionBar() != null) { + getSupportActionBar().setHomeButtonEnabled(true); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); } mShowInactiveDevicesButton.setOnClickListener(new OnClickListener() { @Override @@ -409,17 +409,19 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp mNotifyStatusButton.setImageResource(R.drawable.ic_notifications_grey600_24dp); mNotifyStatusText.setText(R.string.notify_on_all_messages); } - if (getActionBar() != null) { - final ActionBar ab = getActionBar(); - ab.setCustomView(R.layout.ab_title); - ab.setDisplayShowCustomEnabled(true); - TextView abtitle = findViewById(android.R.id.text1); - TextView absubtitle = findViewById(android.R.id.text2); - abtitle.setText(contact.getDisplayName()); - abtitle.setSelected(true); - abtitle.setClickable(false); - absubtitle.setVisibility(View.GONE); - absubtitle.setClickable(false); + if (getSupportActionBar() != null) { + final ActionBar ab = getSupportActionBar(); + if (ab != null) { + ab.setCustomView(R.layout.ab_title); + ab.setDisplayShowCustomEnabled(true); + TextView abtitle = findViewById(android.R.id.text1); + TextView absubtitle = findViewById(android.R.id.text2); + abtitle.setText(contact.getDisplayName()); + abtitle.setSelected(true); + abtitle.setClickable(false); + absubtitle.setVisibility(View.GONE); + absubtitle.setClickable(false); + } } invalidateOptionsMenu(); |