forked from mirror/monocles_chat_clean
Update to viewBinding
This commit is contained in:
parent
59106db23f
commit
c125651d9f
22 changed files with 24 additions and 23 deletions
|
@ -263,6 +263,7 @@ android {
|
|||
}
|
||||
buildFeatures {
|
||||
buildConfig true
|
||||
viewBinding true
|
||||
}
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity im
|
|||
public void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_choose_contact);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.binding.chooseContactList.setFastScrollEnabled(true);
|
||||
mListItemsAdapter = new ListItemAdapter(this, listItems);
|
||||
|
|
|
@ -96,7 +96,7 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_channel_discovery);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar(), true);
|
||||
binding.list.setAdapter(this.adapter);
|
||||
this.adapter.setOnChannelSearchResultSelectedListener(this);
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ConferenceContactDetailsActivity extends XmppActivity {
|
|||
}
|
||||
}
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_muc_contact_details);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
this.binding.destroy.setOnClickListener(destroyListener);
|
||||
this.binding.leaveMuc.setVisibility(View.GONE);
|
||||
this.binding.addContactButton.setVisibility(View.GONE);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.binding.editNickButton.setOnClickListener(v -> {
|
||||
try {
|
||||
|
|
|
@ -299,7 +299,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
|
|||
}
|
||||
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_contact_details);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
binding.showInactiveDevices.setOnClickListener(v -> {
|
||||
showInactiveOmemo = !showInactiveOmemo;
|
||||
|
|
|
@ -697,7 +697,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
|||
ConversationMenuConfigurator.reloadFeatures(this);
|
||||
OmemoSetting.load(this);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_conversations);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.getFragmentManager().addOnBackStackChangedListener(this::invalidateActionBarTitle);
|
||||
this.getFragmentManager().addOnBackStackChangedListener(this::showDialogsIfMainIsOverview);
|
||||
|
@ -1157,7 +1157,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
|||
findViewById(R.id.toolbar_avatar_square).setVisibility(View.VISIBLE);
|
||||
}
|
||||
ActionBarUtil.setCustomActionBarOnClickListener(
|
||||
binding.toolbar,
|
||||
binding.toolbar.getRoot(),
|
||||
(v) -> openConversationDetails(conversation)
|
||||
);
|
||||
return;
|
||||
|
@ -1171,7 +1171,7 @@ public class ConversationsActivity extends XmppActivity implements OnConversatio
|
|||
actionBar.setDisplayShowCustomEnabled(false);
|
||||
actionBar.setTitle(app_title);
|
||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||
ActionBarUtil.resetCustomActionBarOnClickListeners(binding.toolbar);
|
||||
ActionBarUtil.resetCustomActionBarOnClickListeners(binding.toolbar.getRoot());
|
||||
}
|
||||
|
||||
private void openConversationDetails(final Conversation conversation) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public class EasyOnboardingInviteActivity extends XmppActivity implements EasyOn
|
|||
public void onCreate(final Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_easy_invite);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar(), true);
|
||||
if (bundle != null && bundle.containsKey("invite")) {
|
||||
this.easyOnboardingInvite = bundle.getParcelable("invite");
|
||||
|
|
|
@ -687,7 +687,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
|
|||
this.mSavedInstanceInit = savedInstanceState.getBoolean("initMode", false);
|
||||
}
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_edit_account);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.binding.accountJid.addTextChangedListener(this.mTextWatcher);
|
||||
this.binding.accountJid.setOnFocusChangeListener(this.mEditTextFocusListener);
|
||||
|
|
|
@ -26,7 +26,7 @@ public class EnterNameActivity extends XmppActivity implements XmppConnectionSer
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_enter_name);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
this.binding.next.setOnClickListener(this::next);
|
||||
this.binding.skip.setOnClickListener(this::skip);
|
||||
updateNextButton();
|
||||
|
|
|
@ -55,7 +55,7 @@ public class ImportBackupActivity extends XmppActivity implements ServiceConnect
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_import_backup);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
setLoadingState(savedInstanceState != null && savedInstanceState.getBoolean("loading_state", false));
|
||||
this.backupFileAdapter = new BackupFileAdapter();
|
||||
this.binding.list.setAdapter(this.backupFileAdapter);
|
||||
|
|
|
@ -109,7 +109,7 @@ public class MagicCreateActivity extends XmppActivity implements TextWatcher, Ad
|
|||
binding.server.setSelection(defaultServer);
|
||||
binding.server.setOnItemSelectedListener(this);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar(), this.domain == null);
|
||||
if (username != null && domain != null) {
|
||||
binding.title.setText(R.string.your_server_invitation);
|
||||
|
|
|
@ -69,7 +69,7 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded
|
|||
this.mSavedInstanceJid = savedInstanceState.getString("jid");
|
||||
}
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_media_browser);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
mMediaAdapter = new MediaAdapter(this, R.dimen.media_size);
|
||||
this.binding.media.setAdapter(mMediaAdapter);
|
||||
|
|
|
@ -104,7 +104,7 @@ public class MucUsersActivity extends XmppActivity implements XmppConnectionServ
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ActivityMucUsersBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_muc_users);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar(), true);
|
||||
this.userAdapter = new UserAdapter(getPreferences().getBoolean("advanced_muc_mode", false));
|
||||
binding.list.setAdapter(this.userAdapter);
|
||||
|
|
|
@ -101,7 +101,7 @@ public class PublishGroupChatProfilePictureActivity extends XmppActivity impleme
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_publish_profile_picture);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.binding.cancelButton.setOnClickListener((v) -> this.finish());
|
||||
this.binding.secondaryHint.setVisibility(View.GONE);
|
||||
|
|
|
@ -98,7 +98,7 @@ public class SearchActivity extends XmppActivity implements TextWatcher, OnSearc
|
|||
}
|
||||
super.onCreate(bundle);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_search);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
this.messageListAdapter = new MessageAdapter(this, this.messages, uuid == null);
|
||||
this.messageListAdapter.setOnContactPictureClicked(this);
|
||||
|
|
|
@ -59,7 +59,7 @@ public class SetSettingsActivity extends XmppActivity implements XmppConnectionS
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_set_settings);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
this.binding.next.setOnClickListener(this::next);
|
||||
createInfoMenu();
|
||||
getDefaults();
|
||||
|
|
|
@ -75,7 +75,7 @@ public class ShareLocationActivity extends LocationActivity implements LocationL
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_share_locaction);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
setupMapView(binding.map, LocationProvider.getGeoPoint(this));
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ShowLocationActivity extends LocationActivity implements LocationLi
|
|||
super.onCreate(savedInstanceState);
|
||||
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_show_location);
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
|
||||
configureActionBar(getSupportActionBar());
|
||||
setupMapView(this.binding.map, this.loc);
|
||||
|
|
|
@ -305,7 +305,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_start_conversation);
|
||||
Toolbar toolbar = (Toolbar) binding.toolbar;
|
||||
Toolbar toolbar = (Toolbar) binding.toolbar.getRoot();
|
||||
setSupportActionBar(toolbar);
|
||||
configureActionBar(getSupportActionBar());
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
|
|||
binding.cancelButton.setOnClickListener(mCancelButtonListener);
|
||||
binding.saveButton.setOnClickListener(mSaveButtonListener);
|
||||
|
||||
setSupportActionBar((Toolbar) binding.toolbar);
|
||||
setSupportActionBar((Toolbar) binding.toolbar.getRoot());
|
||||
configureActionBar(getSupportActionBar());
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
|
|
|
@ -26,7 +26,7 @@ public class EnterNameActivity extends XmppActivity implements XmppConnectionSer
|
|||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
this.binding = DataBindingUtil.setContentView(this, R.layout.activity_enter_name);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar);
|
||||
setSupportActionBar((Toolbar) this.binding.toolbar.getRoot());
|
||||
this.binding.next.setOnClickListener(this::next);
|
||||
this.setNick.set(savedInstanceState != null && savedInstanceState.getBoolean("set_nick",false));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue