aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-11-23 21:00:55 +0100
committerChristian Schneppe <christian@pix-art.de>2017-11-23 21:03:38 +0100
commit25056d10a6648aedd0d77fccf80a33adf65d0f8b (patch)
treec84ca2b71fc474850af1fbfc22e4daf9236a5838 /src/main/java/de/pixart
parenta42f6ec1caad233ec9b878ebfa7ba5070ffd67ef (diff)
code cleanup
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/persistance/FileBackend.java6
-rw-r--r--src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java2
-rw-r--r--src/main/java/de/pixart/messenger/services/AudioPlayer.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/BlockContactDialog.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java12
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java44
-rw-r--r--src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java46
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationActivity.java14
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java12
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java92
-rw-r--r--src/main/java/de/pixart/messenger/ui/EnterJidDialog.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/OmemoActivity.java18
-rw-r--r--src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java12
-rw-r--r--src/main/java/de/pixart/messenger/ui/RecordingActivity.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java18
-rw-r--r--src/main/java/de/pixart/messenger/ui/SettingsFragment.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java12
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShareWithActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java8
-rw-r--r--src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java20
-rw-r--r--src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java22
-rw-r--r--src/main/java/de/pixart/messenger/ui/UpdaterActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java22
-rw-r--r--src/main/java/de/pixart/messenger/ui/WelcomeActivity.java10
-rw-r--r--src/main/java/de/pixart/messenger/ui/XmppActivity.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java6
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java8
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/forms/FormBooleanFieldWrapper.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/forms/FormTextFieldWrapper.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java2
-rw-r--r--src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java5
-rw-r--r--src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java2
-rw-r--r--src/main/java/de/pixart/messenger/utils/UIHelper.java4
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnBindListener.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java4
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/PacketReceived.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java4
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/pep/Avatar.java2
50 files changed, 238 insertions, 247 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
index 0db865236..ce8219f6e 100644
--- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java
+++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java
@@ -542,7 +542,7 @@ public class FileBackend {
}
public Uri getTakePhotoUri() {
- File file = new File(getTakeFromCameraPath() + "IMG_" + this.fileDateFormat.format(new Date()) + ".jpg");
+ File file = new File(getTakeFromCameraPath() + "IMG_" + fileDateFormat.format(new Date()) + ".jpg");
file.getParentFile().mkdirs();
return getUriForFile(mXmppConnectionService, file);
}
@@ -574,7 +574,7 @@ public class FileBackend {
}
public Uri getTakeVideoUri() {
- File file = new File(getTakeFromCameraPath() + "VID_" + this.fileDateFormat.format(new Date()) + ".mp4");
+ File file = new File(getTakeFromCameraPath() + "VID_" + fileDateFormat.format(new Date()) + ".mp4");
file.getParentFile().mkdirs();
return getUriForFile(mXmppConnectionService, file);
}
@@ -885,7 +885,7 @@ public class FileBackend {
pi.applicationInfo.publicSourceDir = file.toString();
//icon = pi.applicationInfo.loadIcon(pm);
final String AppName = (String) pi.applicationInfo.loadLabel(pm);
- final String AppVersion = (String) pi.versionName;
+ final String AppVersion = pi.versionName;
Log.d(Config.LOGTAG, "APK name: " + AppName);
APKName = " (" + AppName + " " + AppVersion + ")";
try {
diff --git a/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java b/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java
index d5253f227..6c7b0e52c 100644
--- a/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java
+++ b/src/main/java/de/pixart/messenger/persistance/OnPhoneContactsMerged.java
@@ -1,5 +1,5 @@
package de.pixart.messenger.persistance;
public interface OnPhoneContactsMerged {
- public void phoneContactsMerged();
+ void phoneContactsMerged();
}
diff --git a/src/main/java/de/pixart/messenger/services/AudioPlayer.java b/src/main/java/de/pixart/messenger/services/AudioPlayer.java
index 6c3b55344..3cc2fe1be 100644
--- a/src/main/java/de/pixart/messenger/services/AudioPlayer.java
+++ b/src/main/java/de/pixart/messenger/services/AudioPlayer.java
@@ -265,9 +265,9 @@ public class AudioPlayer implements View.OnClickListener, MediaPlayer.OnCompleti
ViewHolder viewHolder = (ViewHolder) audioPlayer.getTag(R.id.TAG_AUDIO_PLAYER_VIEW_HOLDER);
if (viewHolder == null) {
viewHolder = new ViewHolder();
- viewHolder.runtime = (TextView) audioPlayer.findViewById(R.id.runtime);
- viewHolder.progress = (SeekBar) audioPlayer.findViewById(R.id.progress);
- viewHolder.playPause = (ImageButton) audioPlayer.findViewById(R.id.play_pause);
+ viewHolder.runtime = audioPlayer.findViewById(R.id.runtime);
+ viewHolder.progress = audioPlayer.findViewById(R.id.progress);
+ viewHolder.playPause = audioPlayer.findViewById(R.id.play_pause);
audioPlayer.setTag(R.id.TAG_AUDIO_PLAYER_VIEW_HOLDER, viewHolder);
}
return viewHolder;
diff --git a/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java b/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
index df0708f7e..4852c5961 100644
--- a/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/AbstractSearchableListItemActivity.java
@@ -93,7 +93,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose_contact);
- mListView = (ListView) findViewById(R.id.choose_contact_list);
+ mListView = findViewById(R.id.choose_contact_list);
mListView.setFastScrollEnabled(true);
mListItemsAdapter = new ListItemAdapter(this, listItems);
mListView.setAdapter(mListItemsAdapter);
@@ -104,7 +104,7 @@ public abstract class AbstractSearchableListItemActivity extends XmppActivity {
getMenuInflater().inflate(R.menu.choose_contact, menu);
final MenuItem menuSearchView = menu.findItem(R.id.action_search);
final View mSearchView = menuSearchView.getActionView();
- mSearchEditText = (EditText) mSearchView
+ mSearchEditText = mSearchView
.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
menuSearchView.setOnActionExpandListener(mOnActionExpandListener);
diff --git a/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java b/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java
index 9cc0a4ddf..5a911298f 100644
--- a/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java
+++ b/src/main/java/de/pixart/messenger/ui/BlockContactDialog.java
@@ -25,8 +25,8 @@ public final class BlockContactDialog {
builder.setNegativeButton(R.string.cancel, null);
LayoutInflater inflater = (LayoutInflater) xmppActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout view = (LinearLayout) inflater.inflate(R.layout.dialog_block_contact, null);
- TextView message = (TextView) view.findViewById(R.id.text);
- final CheckBox report = (CheckBox) view.findViewById(R.id.report_spam);
+ TextView message = view.findViewById(R.id.text);
+ final CheckBox report = view.findViewById(R.id.report_spam);
final boolean reporting = blockable.getAccount().getXmppConnection().getFeatures().spamReporting();
report.setVisibility(!isBlocked && reporting ? View.VISIBLE : View.GONE);
builder.setView(view);
diff --git a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java
index ddbbbca36..49a826f29 100644
--- a/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ChangePasswordActivity.java
@@ -65,19 +65,19 @@ public class ChangePasswordActivity extends XmppActivity implements XmppConnecti
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_change_password);
- Button mCancelButton = (Button) findViewById(R.id.left_button);
+ Button mCancelButton = findViewById(R.id.left_button);
mCancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
- this.mChangePasswordButton = (Button) findViewById(R.id.right_button);
+ this.mChangePasswordButton = findViewById(R.id.right_button);
this.mChangePasswordButton.setOnClickListener(this.mOnChangePasswordButtonClicked);
- this.mCurrentPasswordLabel = (TextView) findViewById(R.id.current_password_label);
- this.mCurrentPassword = (EditText) findViewById(R.id.current_password);
- this.mNewPassword = (EditText) findViewById(R.id.new_password);
- this.mNewPasswordConfirm = (EditText) findViewById(R.id.new_password_confirm);
+ this.mCurrentPasswordLabel = findViewById(R.id.current_password_label);
+ this.mCurrentPassword = findViewById(R.id.current_password);
+ this.mNewPassword = findViewById(R.id.new_password);
+ this.mNewPasswordConfirm = findViewById(R.id.new_password_confirm);
}
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
index 134f82a5e..b6f151b5d 100644
--- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
@@ -247,20 +247,20 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_muc_details);
- ConferenceName = (TextView) findViewById(R.id.conference_name);
- mYourNick = (TextView) findViewById(R.id.muc_your_nick);
- mYourPhoto = (ImageView) findViewById(R.id.your_photo);
- ImageButton mEditNickButton = (ImageButton) findViewById(R.id.edit_nick_button);
- mFullJid = (TextView) findViewById(R.id.muc_jabberid);
- membersView = (LinearLayout) findViewById(R.id.muc_members);
- mAccountJid = (TextView) findViewById(R.id.details_account);
- mMoreDetails = (LinearLayout) findViewById(R.id.muc_more_details);
- mChangeConferenceSettingsButton = (ImageButton) findViewById(R.id.change_conference_button);
+ ConferenceName = findViewById(R.id.conference_name);
+ mYourNick = findViewById(R.id.muc_your_nick);
+ mYourPhoto = findViewById(R.id.your_photo);
+ ImageButton mEditNickButton = findViewById(R.id.edit_nick_button);
+ mFullJid = findViewById(R.id.muc_jabberid);
+ membersView = findViewById(R.id.muc_members);
+ mAccountJid = findViewById(R.id.details_account);
+ mMoreDetails = findViewById(R.id.muc_more_details);
+ mChangeConferenceSettingsButton = findViewById(R.id.change_conference_button);
mChangeConferenceSettingsButton.setOnClickListener(this.mChangeConferenceSettings);
- mInviteButton = (Button) findViewById(R.id.invite);
+ mInviteButton = findViewById(R.id.invite);
mInviteButton.setVisibility(View.GONE);
mInviteButton.setOnClickListener(inviteListener);
- mConferenceType = (TextView) findViewById(R.id.muc_conference_type);
+ mConferenceType = findViewById(R.id.muc_conference_type);
if (getActionBar() != null) {
getActionBar().setHomeButtonEnabled(true);
getActionBar().setDisplayHomeAsUpEnabled(true);
@@ -281,12 +281,12 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
});
this.mAdvancedMode = getPreferences().getBoolean("advanced_muc_mode", false);
- this.mConferenceInfoTable = (LinearLayout) findViewById(R.id.muc_info_more);
+ this.mConferenceInfoTable = findViewById(R.id.muc_info_more);
mConferenceInfoTable.setVisibility(this.mAdvancedMode ? View.VISIBLE : View.GONE);
- this.mConferenceInfoMam = (TextView) findViewById(R.id.muc_info_mam);
- this.mNotifyStatusButton = (ImageButton) findViewById(R.id.notification_status_button);
+ this.mConferenceInfoMam = findViewById(R.id.muc_info_mam);
+ this.mNotifyStatusButton = findViewById(R.id.notification_status_button);
this.mNotifyStatusButton.setOnClickListener(this.mNotifyStatusClickListener);
- this.mNotifyStatusText = (TextView) findViewById(R.id.notification_status_text);
+ this.mNotifyStatusText = findViewById(R.id.notification_status_text);
}
@Override
@@ -554,8 +554,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
final ActionBar ab = getActionBar();
ab.setCustomView(R.layout.ab_title);
ab.setDisplayShowCustomEnabled(true);
- TextView abtitle = (TextView) findViewById(android.R.id.text1);
- TextView absubtitle = (TextView) findViewById(android.R.id.text2);
+ TextView abtitle = findViewById(android.R.id.text1);
+ TextView absubtitle = findViewById(android.R.id.text2);
abtitle.setText(mConversation.getName());
abtitle.setSelected(true);
abtitle.setClickable(false);
@@ -568,7 +568,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
setTitle(mConversation.getName());
mFullJid.setText(mConversation.getJid().toBareJid().toString());
mYourNick.setText(mucOptions.getActualNick());
- TextView mRoleAffiliaton = (TextView) findViewById(R.id.muc_role);
+ TextView mRoleAffiliaton = findViewById(R.id.muc_role);
if (mucOptions.online()) {
mMoreDetails.setVisibility(View.VISIBLE);
final String status = getStatus(self);
@@ -628,9 +628,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
registerForContextMenu(view);
view.setTag(user);
- TextView tvDisplayName = (TextView) view.findViewById(R.id.contact_display_name);
- TextView tvKey = (TextView) view.findViewById(R.id.key);
- TextView tvStatus = (TextView) view.findViewById(R.id.contact_jid);
+ TextView tvDisplayName = view.findViewById(R.id.contact_display_name);
+ TextView tvKey = view.findViewById(R.id.key);
+ TextView tvStatus = view.findViewById(R.id.contact_jid);
if (mAdvancedMode && user.getPgpKeyId() != 0) {
tvKey.setVisibility(View.VISIBLE);
tvKey.setOnClickListener(new OnClickListener() {
@@ -651,7 +651,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
tvStatus.setText(getStatus(user));
}
- ImageView iv = (ImageView) view.findViewById(R.id.contact_photo);
+ ImageView iv = view.findViewById(R.id.contact_photo);
iv.setImageBitmap(avatarService().get(user, getPixel(48), false));
if (user.getRole() == MucOptions.Role.NONE) {
tvDisplayName.setAlpha(INACTIVE_ALPHA);
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
index 024e92b02..e42f6b49b 100644
--- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
@@ -274,20 +274,20 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
setContentView(R.layout.activity_contact_details);
- contactDisplayName = (TextView) findViewById(R.id.contact_display_name);
- contactJidTv = (TextView) findViewById(R.id.details_contactjid);
- accountJidTv = (TextView) findViewById(R.id.details_account);
- lastseen = (TextView) findViewById(R.id.details_lastseen);
- statusMessage = (TextView) findViewById(R.id.status_message);
- resource = (TextView) findViewById(R.id.resource);
- send = (CheckBox) findViewById(R.id.details_send_presence);
- receive = (CheckBox) findViewById(R.id.details_receive_presence);
- badge = (QuickContactBadge) findViewById(R.id.details_contact_badge);
- addContactButton = (Button) findViewById(R.id.add_contact_button);
- keys = (LinearLayout) findViewById(R.id.details_contact_keys);
- keysWrapper = (LinearLayout) findViewById(R.id.keys_wrapper);
- tags = (FlowLayout) findViewById(R.id.tags);
- mShowInactiveDevicesButton = (Button) findViewById(R.id.show_inactive_devices);
+ contactDisplayName = findViewById(R.id.contact_display_name);
+ contactJidTv = findViewById(R.id.details_contactjid);
+ accountJidTv = findViewById(R.id.details_account);
+ lastseen = findViewById(R.id.details_lastseen);
+ statusMessage = findViewById(R.id.status_message);
+ resource = findViewById(R.id.resource);
+ send = findViewById(R.id.details_send_presence);
+ receive = findViewById(R.id.details_receive_presence);
+ badge = findViewById(R.id.details_contact_badge);
+ addContactButton = findViewById(R.id.add_contact_button);
+ keys = findViewById(R.id.details_contact_keys);
+ 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);
@@ -299,9 +299,9 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
populateView();
}
});
- this.mNotifyStatusButton = (ImageButton) findViewById(R.id.notification_status_button);
+ this.mNotifyStatusButton = findViewById(R.id.notification_status_button);
this.mNotifyStatusButton.setOnClickListener(this.mNotifyStatusClickListener);
- this.mNotifyStatusText = (TextView) findViewById(R.id.notification_status_text);
+ this.mNotifyStatusText = findViewById(R.id.notification_status_text);
}
@Override
@@ -413,8 +413,8 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
final ActionBar ab = getActionBar();
ab.setCustomView(R.layout.ab_title);
ab.setDisplayShowCustomEnabled(true);
- TextView abtitle = (TextView) findViewById(android.R.id.text1);
- TextView absubtitle = (TextView) findViewById(android.R.id.text2);
+ TextView abtitle = findViewById(android.R.id.text1);
+ TextView absubtitle = findViewById(android.R.id.text2);
abtitle.setText(contact.getDisplayName());
abtitle.setSelected(true);
abtitle.setClickable(false);
@@ -564,9 +564,9 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
for (final String otrFingerprint : contact.getOtrFingerprints()) {
hasKeys = true;
View view = inflater.inflate(R.layout.contact_key, keys, false);
- TextView key = (TextView) view.findViewById(R.id.key);
- TextView keyType = (TextView) view.findViewById(R.id.key_type);
- ImageButton removeButton = (ImageButton) view
+ TextView key = view.findViewById(R.id.key);
+ TextView keyType = view.findViewById(R.id.key_type);
+ ImageButton removeButton = view
.findViewById(R.id.button_remove);
removeButton.setVisibility(View.VISIBLE);
key.setText(CryptoHelper.prettifyFingerprint(otrFingerprint));
@@ -617,8 +617,8 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
if (Config.supportOpenPgp() && contact.getPgpKeyId() != 0) {
hasKeys = true;
View view = inflater.inflate(R.layout.contact_key, keys, false);
- TextView key = (TextView) view.findViewById(R.id.key);
- TextView keyType = (TextView) view.findViewById(R.id.key_type);
+ TextView key = view.findViewById(R.id.key);
+ TextView keyType = view.findViewById(R.id.key_type);
keyType.setText(R.string.openpgp_key_id);
if ("pgp".equals(messageFingerprint)) {
keyType.setTextColor(ContextCompat.getColor(this, R.color.accent));
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
index 3205b1439..ad8566693 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java
@@ -191,11 +191,7 @@ public class ConversationActivity extends XmppActivity
}
public boolean isConversationsOverviewHideable() {
- if (mContentView instanceof SlidingPaneLayout) {
- return true;
- } else {
- return false;
- }
+ return mContentView instanceof SlidingPaneLayout;
}
public boolean isConversationsOverviewVisable() {
@@ -241,7 +237,7 @@ public class ConversationActivity extends XmppActivity
transaction.replace(R.id.selected_conversation, this.mConversationFragment, "conversation");
transaction.commit();
- listView = (EnhancedListView) findViewById(R.id.list);
+ listView = findViewById(R.id.list);
this.listAdapter = new ConversationAdapter(this, conversationList);
listView.setAdapter(this.listAdapter);
@@ -432,8 +428,8 @@ public class ConversationActivity extends XmppActivity
ab.setDisplayShowTitleEnabled(false);
ab.setDisplayShowCustomEnabled(true);
ab.setCustomView(R.layout.ab_title);
- TextView abtitle = (TextView) findViewById(android.R.id.text1);
- TextView absubtitle = (TextView) findViewById(android.R.id.text2);
+ TextView abtitle = findViewById(android.R.id.text1);
+ TextView absubtitle = findViewById(android.R.id.text2);
abtitle.setText(conversation.getName());
abtitle.setOnClickListener(this);
abtitle.setSelected(true);
@@ -936,7 +932,7 @@ public class ConversationActivity extends XmppActivity
builder.setTitle(getString(R.string.clear_conversation_history));
View dialogView = getLayoutInflater().inflate(
R.layout.dialog_clear_history, null);
- final CheckBox endConversationCheckBox = (CheckBox) dialogView
+ final CheckBox endConversationCheckBox = dialogView
.findViewById(R.id.end_conversation_checkbox);
if (conversation.getMode() == Conversation.MODE_SINGLE) {
endConversationCheckBox.setVisibility(View.VISIBLE);
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index eca10e8f4..8a5863313 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -547,7 +547,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_conversation, container, false);
view.setOnClickListener(null);
- mEditMessage = (EditMessage) view.findViewById(R.id.textinput);
+ mEditMessage = view.findViewById(R.id.textinput);
mEditMessage.setOnClickListener(new OnClickListener() {
@Override
@@ -561,15 +561,15 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
mEditMessage.setOnEditorActionListener(mEditorActionListener);
mEditMessage.setRichContentListener(new String[]{"image/*"}, mEditorContentListener);
- mSendButton = (ImageButton) view.findViewById(R.id.textSendButton);
+ mSendButton = view.findViewById(R.id.textSendButton);
mSendButton.setOnClickListener(this.mSendButtonListener);
mSendButton.setOnLongClickListener(this.mSendButtonLongListener);
- snackbar = (RelativeLayout) view.findViewById(R.id.snackbar);
- snackbarMessage = (TextView) view.findViewById(R.id.snackbar_message);
- snackbarAction = (TextView) view.findViewById(R.id.snackbar_action);
+ snackbar = view.findViewById(R.id.snackbar);
+ snackbarMessage = view.findViewById(R.id.snackbar_message);
+ snackbarAction = view.findViewById(R.id.snackbar_action);
- messagesView = (ListView) view.findViewById(R.id.messages_view);
+ messagesView = view.findViewById(R.id.messages_view);
messagesView.setOnScrollListener(mOnScrollListener);
messagesView.setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL);
messageListAdapter = new MessageAdapter((ConversationActivity) getActivity(), this.messageList);
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 2875bfabd..842a37aca 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -514,63 +514,63 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
this.mSavedInstanceInit = savedInstanceState.getBoolean("initMode", false);
}
setContentView(R.layout.activity_edit_account);
- this.mAccountJid = (AutoCompleteTextView) findViewById(R.id.account_jid);
+ this.mAccountJid = findViewById(R.id.account_jid);
this.mAccountJid.addTextChangedListener(this.mTextWatcher);
- this.mAccountJidLabel = (TextView) findViewById(R.id.account_jid_label);
- this.mPassword = (EditText) findViewById(R.id.account_password);
+ this.mAccountJidLabel = findViewById(R.id.account_jid_label);
+ this.mPassword = findViewById(R.id.account_password);
this.mPassword.addTextChangedListener(this.mTextWatcher);
- this.mPasswordConfirm = (EditText) findViewById(R.id.account_password_confirm);
- this.mAvatar = (ImageView) findViewById(R.id.avater);
+ this.mPasswordConfirm = findViewById(R.id.account_password_confirm);
+ this.mAvatar = findViewById(R.id.avater);
this.mAvatar.setOnClickListener(this.mAvatarClickListener);
- this.mRegisterNew = (CheckBox) findViewById(R.id.account_register_new);
- this.mStats = (LinearLayout) findViewById(R.id.stats);
- this.mOsOptimizations = (RelativeLayout) findViewById(R.id.os_optimization);
- this.mDisableOsOptimizationsButton = (Button) findViewById(R.id.os_optimization_disable);
- this.mDisableOsOptimizationsHeadline = (TextView) findViewById(R.id.os_optimization_headline);
- this.getmDisableOsOptimizationsBody = (TextView) findViewById(R.id.os_optimization_body);
- this.mSessionEst = (TextView) findViewById(R.id.session_est);
- this.mServerInfoRosterVersion = (TextView) findViewById(R.id.server_info_roster_version);
- this.mServerInfoCarbons = (TextView) findViewById(R.id.server_info_carbons);
- this.mServerInfoMam = (TextView) findViewById(R.id.server_info_mam);
- this.mServerInfoCSI = (TextView) findViewById(R.id.server_info_csi);
- this.mServerInfoBlocking = (TextView) findViewById(R.id.server_info_blocking);
- this.mServerInfoSm = (TextView) findViewById(R.id.server_info_sm);
- this.mServerInfoPep = (TextView) findViewById(R.id.server_info_pep);
- this.mServerInfoHttpUpload = (TextView) findViewById(R.id.server_info_http_upload);
- this.mPushRow = (TableRow) findViewById(R.id.push_row);
- this.mServerInfoPush = (TextView) findViewById(R.id.server_info_push);
- this.mPgpFingerprintBox = (RelativeLayout) findViewById(R.id.pgp_fingerprint_box);
- this.mPgpFingerprint = (TextView) findViewById(R.id.pgp_fingerprint);
- this.getmPgpFingerprintDesc = (TextView) findViewById(R.id.pgp_fingerprint_desc);
- this.mPgpDeleteFingerprintButton = (ImageButton) findViewById(R.id.action_delete_pgp);
- this.mOtrFingerprint = (TextView) findViewById(R.id.otr_fingerprint);
- this.mOtrFingerprintDesc = (TextView) findViewById(R.id.otr_fingerprint_desc);
- this.mOtrFingerprintBox = (RelativeLayout) findViewById(R.id.otr_fingerprint_box);
- this.mOtrFingerprintToClipboardButton = (ImageButton) findViewById(R.id.action_copy_to_clipboard);
- this.mAxolotlFingerprint = (TextView) findViewById(R.id.axolotl_fingerprint);
- this.mAxolotlFingerprintBox = (RelativeLayout) findViewById(R.id.axolotl_fingerprint_box);
- this.mAxolotlFingerprintToClipboardButton = (ImageButton) findViewById(R.id.action_copy_axolotl_to_clipboard);
- this.mOwnFingerprintDesc = (TextView) findViewById(R.id.own_fingerprint_desc);
- this.keysCard = (LinearLayout) findViewById(R.id.other_device_keys_card);
- this.keys = (LinearLayout) findViewById(R.id.other_device_keys);
- this.mNamePort = (LinearLayout) findViewById(R.id.name_port);
- this.mHostname = (EditText) findViewById(R.id.hostname);
+ this.mRegisterNew = findViewById(R.id.account_register_new);
+ this.mStats = findViewById(R.id.stats);
+ this.mOsOptimizations = findViewById(R.id.os_optimization);
+ this.mDisableOsOptimizationsButton = findViewById(R.id.os_optimization_disable);
+ this.mDisableOsOptimizationsHeadline = findViewById(R.id.os_optimization_headline);
+ this.getmDisableOsOptimizationsBody = findViewById(R.id.os_optimization_body);
+ this.mSessionEst = findViewById(R.id.session_est);
+ this.mServerInfoRosterVersion = findViewById(R.id.server_info_roster_version);
+ this.mServerInfoCarbons = findViewById(R.id.server_info_carbons);
+ this.mServerInfoMam = findViewById(R.id.server_info_mam);
+ this.mServerInfoCSI = findViewById(R.id.server_info_csi);
+ this.mServerInfoBlocking = findViewById(R.id.server_info_blocking);
+ this.mServerInfoSm = findViewById(R.id.server_info_sm);
+ this.mServerInfoPep = findViewById(R.id.server_info_pep);
+ this.mServerInfoHttpUpload = findViewById(R.id.server_info_http_upload);
+ this.mPushRow = findViewById(R.id.push_row);
+ this.mServerInfoPush = findViewById(R.id.server_info_push);
+ this.mPgpFingerprintBox = findViewById(R.id.pgp_fingerprint_box);
+ this.mPgpFingerprint = findViewById(R.id.pgp_fingerprint);
+ this.getmPgpFingerprintDesc = findViewById(R.id.pgp_fingerprint_desc);
+ this.mPgpDeleteFingerprintButton = findViewById(R.id.action_delete_pgp);
+ this.mOtrFingerprint = findViewById(R.id.otr_fingerprint);
+ this.mOtrFingerprintDesc = findViewById(R.id.otr_fingerprint_desc);
+ this.mOtrFingerprintBox = findViewById(R.id.otr_fingerprint_box);
+ this.mOtrFingerprintToClipboardButton = findViewById(R.id.action_copy_to_clipboard);
+ this.mAxolotlFingerprint = findViewById(R.id.axolotl_fingerprint);
+ this.mAxolotlFingerprintBox = findViewById(R.id.axolotl_fingerprint_box);
+ this.mAxolotlFingerprintToClipboardButton = findViewById(R.id.action_copy_axolotl_to_clipboard);
+ this.mOwnFingerprintDesc = findViewById(R.id.own_fingerprint_desc);
+ this.keysCard = findViewById(R.id.other_device_keys_card);
+ this.keys = findViewById(R.id.other_device_keys);
+ this.mNamePort = findViewById(R.id.name_port);
+ this.mHostname = findViewById(R.id.hostname);
this.mHostname.addTextChangedListener(mTextWatcher);
- this.mClearDevicesButton = (Button) findViewById(R.id.clear_devices);
+ this.mClearDevicesButton = findViewById(R.id.clear_devices);
this.mClearDevicesButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showWipePepDialog();
}
});
- this.mPort = (EditText) findViewById(R.id.port);
+ this.mPort = findViewById(R.id.port);
this.mPort.setText("5222");
this.mPort.addTextChangedListener(mTextWatcher);
- this.mSaveButton = (Button) findViewById(R.id.save_button);
- this.mCancelButton = (Button) findViewById(R.id.cancel_button);
+ this.mSaveButton = findViewById(R.id.save_button);
+ this.mCancelButton = findViewById(R.id.cancel_button);
this.mSaveButton.setOnClickListener(this.mSaveButtonClickListener);
this.mCancelButton.setOnClickListener(this.mCancelButtonClickListener);
- this.mMoreTable = (TableLayout) findViewById(R.id.server_info_more);
+ this.mMoreTable = findViewById(R.id.server_info_more);
if (savedInstanceState != null && savedInstanceState.getBoolean("showMoreTable")) {
changeMoreTableVisibility(true);
}
@@ -1156,7 +1156,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
private void showPassword() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = getLayoutInflater().inflate(R.layout.dialog_show_password, null);
- TextView password = (TextView) view.findViewById(R.id.password);
+ TextView password = view.findViewById(R.id.password);
password.setText(mAccount.getPassword());
builder.setTitle(R.string.password);
builder.setView(view);
@@ -1179,8 +1179,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
}
final AlertDialog.Builder builder = new AlertDialog.Builder(EditAccountActivity.this);
final View view = getLayoutInflater().inflate(R.layout.captcha, null);
- final ImageView imageView = (ImageView) view.findViewById(R.id.captcha);
- final EditText input = (EditText) view.findViewById(R.id.input);
+ final ImageView imageView = view.findViewById(R.id.captcha);
+ final EditText input = view.findViewById(R.id.input);
imageView.setImageBitmap(captcha);
builder.setTitle(getString(R.string.captcha_required));
diff --git a/src/main/java/de/pixart/messenger/ui/EnterJidDialog.java b/src/main/java/de/pixart/messenger/ui/EnterJidDialog.java
index 3dca5ccef..4fabd3e89 100644
--- a/src/main/java/de/pixart/messenger/ui/EnterJidDialog.java
+++ b/src/main/java/de/pixart/messenger/ui/EnterJidDialog.java
@@ -47,10 +47,10 @@ public class EnterJidDialog {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(title);
View dialogView = LayoutInflater.from(context).inflate(R.layout.enter_jid_dialog, null);
- final TextView jabberIdDesc = (TextView) dialogView.findViewById(R.id.jabber_id);
+ final TextView jabberIdDesc = dialogView.findViewById(R.id.jabber_id);
jabberIdDesc.setText(R.string.account_settings_jabber_id);
- final Spinner spinner = (Spinner) dialogView.findViewById(R.id.account);
- final AutoCompleteTextView jid = (AutoCompleteTextView) dialogView.findViewById(R.id.jid);
+ final Spinner spinner = dialogView.findViewById(R.id.account);
+ final AutoCompleteTextView jid = dialogView.findViewById(R.id.jid);
jid.setAdapter(new KnownHostsAdapter(context, R.layout.simple_list_item, knownHosts));
if (prefilledJid != null) {
jid.append(prefilledJid);
diff --git a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java
index 0d5759b6a..b3dc782ad 100644
--- a/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/MagicCreateActivity.java
@@ -54,10 +54,10 @@ public class MagicCreateActivity extends XmppActivity implements TextWatcher {
}
super.onCreate(savedInstanceState);
setContentView(R.layout.magic_create);
- mFullJidDisplay = (TextView) findViewById(R.id.full_jid);
- mUsername = (EditText) findViewById(R.id.username);
+ mFullJidDisplay = findViewById(R.id.full_jid);
+ mUsername = findViewById(R.id.username);
mRandom = new SecureRandom();
- Button next = (Button) findViewById(R.id.create_account);
+ Button next = findViewById(R.id.create_account);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java
index cfb982c0f..4c36d2681 100644
--- a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java
@@ -89,7 +89,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda
}
}
- accountListView = (ListView) findViewById(R.id.account_list);
+ accountListView = findViewById(R.id.account_list);
this.mAccountAdapter = new AccountAdapter(this, accountList);
accountListView.setAdapter(this.mAccountAdapter);
accountListView.setOnItemClickListener(new OnItemClickListener() {
diff --git a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
index e7eca173a..b5869efa1 100644
--- a/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/OmemoActivity.java
@@ -135,8 +135,8 @@ public abstract class OmemoActivity extends XmppActivity {
onCheckedChangeListener) {
View view = getLayoutInflater().inflate(R.layout.contact_key, keys, false);
- TextView key = (TextView) view.findViewById(R.id.key);
- TextView keyType = (TextView) view.findViewById(R.id.key_type);
+ TextView key = view.findViewById(R.id.key);
+ TextView keyType = view.findViewById(R.id.key_type);
if (Config.X509_VERIFICATION && status.getTrust() == FingerprintStatus.Trust.VERIFIED_X509) {
View.OnClickListener listener = new View.OnClickListener() {
@Override
@@ -147,8 +147,8 @@ public abstract class OmemoActivity extends XmppActivity {
key.setOnClickListener(listener);
keyType.setOnClickListener(listener);
}
- Switch trustToggle = (Switch) view.findViewById(R.id.tgl_trust);
- ImageView verifiedFingerprintSymbol = (ImageView) view.findViewById(R.id.verified_fingerprint);
+ Switch trustToggle = view.findViewById(R.id.tgl_trust);
+ ImageView verifiedFingerprintSymbol = view.findViewById(R.id.verified_fingerprint);
trustToggle.setVisibility(View.VISIBLE);
registerForContextMenu(view);
view.setTag(R.id.TAG_ACCOUNT, account);
@@ -268,11 +268,11 @@ public abstract class OmemoActivity extends XmppActivity {
private void showCertificateInformationDialog(Bundle bundle) {
View view = getLayoutInflater().inflate(R.layout.certificate_information, null);
final String not_available = getString(R.string.certicate_info_not_available);
- TextView subject_cn = (TextView) view.findViewById(R.id.subject_cn);
- TextView subject_o = (TextView) view.findViewById(R.id.subject_o);
- TextView issuer_cn = (TextView) view.findViewById(R.id.issuer_cn);
- TextView issuer_o = (TextView) view.findViewById(R.id.issuer_o);
- TextView sha1 = (TextView) view.findViewById(R.id.sha1);
+ TextView subject_cn = view.findViewById(R.id.subject_cn);
+ TextView subject_o = view.findViewById(R.id.subject_o);
+ TextView issuer_cn = view.findViewById(R.id.issuer_cn);
+ TextView issuer_o = view.findViewById(R.id.issuer_o);
+ TextView sha1 = view.findViewById(R.id.sha1);
subject_cn.setText(bundle.getString("subject_cn", not_available));
subject_o.setText(bundle.getString("subject_o", not_available));
diff --git a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java
index 7a142a7d3..2bb388531 100644
--- a/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/PublishProfilePictureActivity.java
@@ -98,12 +98,12 @@ public class PublishProfilePictureActivity extends XmppActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_publish_profile_picture);
- this.avatar = (ImageView) findViewById(R.id.account_image);
- this.cancelButton = (Button) findViewById(R.id.cancel_button);
- this.publishButton = (Button) findViewById(R.id.publish_button);
- this.accountTextView = (TextView) findViewById(R.id.account);
- this.hintOrWarning = (TextView) findViewById(R.id.hint_or_warning);
- this.secondaryHint = (TextView) findViewById(R.id.secondary_hint);
+ this.avatar = findViewById(R.id.account_image);
+ this.cancelButton = findViewById(R.id.cancel_button);
+ this.publishButton = findViewById(R.id.publish_button);
+ this.accountTextView = findViewById(R.id.account);
+ this.hintOrWarning = findViewById(R.id.hint_or_warning);
+ this.secondaryHint = findViewById(R.id.secondary_hint);
this.publishButton.setOnClickListener(new OnClickListener() {
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
index 29fcf6a5b..cfa743c69 100644
--- a/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/RecordingActivity.java
@@ -50,10 +50,10 @@ public class RecordingActivity extends Activity implements View.OnClickListener
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recording);
- this.mTimerTextView = (TextView) this.findViewById(R.id.timer);
- this.mCancelButton = (Button) this.findViewById(R.id.cancel_button);
+ this.mTimerTextView = this.findViewById(R.id.timer);
+ this.mCancelButton = this.findViewById(R.id.cancel_button);
this.mCancelButton.setOnClickListener(this);
- this.mStopButton = (Button) this.findViewById(R.id.share_button);
+ this.mStopButton = this.findViewById(R.id.share_button);
this.mStopButton.setOnClickListener(this);
this.setFinishOnTouchOutside(false);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
diff --git a/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java b/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java
index b4e88e5cc..c57f1e3ea 100644
--- a/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/SetPresenceActivity.java
@@ -51,17 +51,17 @@ public class SetPresenceActivity extends XmppActivity implements View.OnClickLis
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_presence);
- mScrollView = (ScrollView) findViewById(R.id.scroll_view);
- mShowSpinner = (Spinner) findViewById(R.id.presence_show);
+ mScrollView = findViewById(R.id.scroll_view);
+ mShowSpinner = findViewById(R.id.presence_show);
ArrayAdapter adapter = ArrayAdapter.createFromResource(this,
R.array.presence_show_options,
R.layout.simple_list_item);
mShowSpinner.setAdapter(adapter);
mShowSpinner.setSelection(1);
- mStatusMessage = (EditText) findViewById(R.id.presence_status_message);
- mAllAccounts = (CheckBox) findViewById(R.id.all_accounts);
- mTemplatesView = (LinearLayout) findViewById(R.id.templates);
- final Button changePresence = (Button) findViewById(R.id.change_presence);
+ mStatusMessage = findViewById(R.id.presence_status_message);
+ mAllAccounts = findViewById(R.id.all_accounts);
+ mTemplatesView = findViewById(R.id.templates);
+ final Button changePresence = findViewById(R.id.change_presence);
changePresence.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -193,9 +193,9 @@ public class SetPresenceActivity extends XmppActivity implements View.OnClickLis
templateLayout.setTag(template);
setListItemBackgroundOnView(templateLayout);
templateLayout.setOnClickListener(this);
- TextView message = (TextView) templateLayout.findViewById(R.id.presence_status_message);
- TextView status = (TextView) templateLayout.findViewById(R.id.status);
- ImageButton button = (ImageButton) templateLayout.findViewById(R.id.delete_button);
+ TextView message = templateLayout.findViewById(R.id.presence_status_message);
+ TextView status = templateLayout.findViewById(R.id.status);
+ ImageButton button = templateLayout.findViewById(R.id.delete_button);
button.setTag(template);
button.setOnClickListener(this);
ListItem.Tag tag = UIHelper.getTagForStatus(this, template.getStatus());
diff --git a/src/main/java/de/pixart/messenger/ui/SettingsFragment.java b/src/main/java/de/pixart/messenger/ui/SettingsFragment.java
index 119e79fb7..ea9ce7371 100644
--- a/src/main/java/de/pixart/messenger/ui/SettingsFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/SettingsFragment.java
@@ -35,7 +35,7 @@ public class SettingsFragment extends PreferenceFragment {
if (homeBtnContainer instanceof FrameLayout) {
ViewGroup containerParent = (ViewGroup) homeBtnContainer.getParent();
if (containerParent instanceof LinearLayout) {
- ((LinearLayout) containerParent).setOnClickListener(dismissDialogClickListener);
+ containerParent.setOnClickListener(dismissDialogClickListener);
} else {
((FrameLayout) homeBtnContainer).setOnClickListener(dismissDialogClickListener);
}
diff --git a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
index 842fcb7dd..a9bfabff9 100644
--- a/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShareLocationActivity.java
@@ -69,7 +69,7 @@ public class ShareLocationActivity extends Activity implements OnMapReadyCallbac
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
- mCancelButton = (Button) findViewById(R.id.cancel_button);
+ mCancelButton = findViewById(R.id.cancel_button);
mCancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -77,7 +77,7 @@ public class ShareLocationActivity extends Activity implements OnMapReadyCallbac
finish();
}
});
- mShareButton = (Button) findViewById(R.id.share_button);
+ mShareButton = findViewById(R.id.share_button);
mShareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -92,10 +92,10 @@ public class ShareLocationActivity extends Activity implements OnMapReadyCallbac
}
}
});
- mSnackbar = (RelativeLayout) findViewById(R.id.snackbar);
- mLocationInfo = (RelativeLayout) findViewById(R.id.snackbar_location);
- mSnackbarLocation = (TextView) findViewById(R.id.snackbar_location_message);
- mSnackbarAction = (TextView) findViewById(R.id.snackbar_action);
+ mSnackbar = findViewById(R.id.snackbar);
+ mLocationInfo = findViewById(R.id.snackbar_location);
+ mSnackbarLocation = findViewById(R.id.snackbar_location_message);
+ mSnackbarAction = findViewById(R.id.snackbar_action);
mSnackbarAction.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
diff --git a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
index cba91d108..af1f0e77e 100644
--- a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java
@@ -181,7 +181,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer
setContentView(R.layout.share_with);
setTitle(getString(R.string.title_activity_sharewith));
- mListView = (ListView) findViewById(R.id.choose_conversation_list);
+ mListView = findViewById(R.id.choose_conversation_list);
mAdapter = new ConversationAdapter(this, this.mConversations);
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(new OnItemClickListener() {
diff --git a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
index 3aba479e5..17fe144d7 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowFullscreenMessageActivity.java
@@ -62,10 +62,10 @@ public class ShowFullscreenMessageActivity extends Activity {
getWindow().setAttributes(layout);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_fullscreen_message);
- mImage = (PhotoView) findViewById(R.id.message_image_view);
- mVideo = (FullscreenVideoLayout) findViewById(R.id.message_video_view);
- mFullscreenbutton = (ImageView) findViewById(R.id.vcv_img_fullscreen);
- mFAB = (ImageButton) findViewById(R.id.imageButton);
+ mImage = findViewById(R.id.message_image_view);
+ mVideo = findViewById(R.id.message_video_view);
+ mFullscreenbutton = findViewById(R.id.vcv_img_fullscreen);
+ mFAB = findViewById(R.id.imageButton);
mFAB.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
index f6c174a2f..b871f5440 100644
--- a/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ShowLocationActivity.java
@@ -57,9 +57,9 @@ public class ShowLocationActivity extends Activity implements OnMapReadyCallback
@Override
public View getInfoContents(Marker marker) {
- TextView Title = ((TextView) InfoWindow.findViewById(R.id.title));
+ TextView Title = InfoWindow.findViewById(R.id.title);
Title.setText(marker.getTitle());
- TextView Snippet = ((TextView) InfoWindow.findViewById(R.id.snippet));
+ TextView Snippet = InfoWindow.findViewById(R.id.snippet);
Snippet.setText(marker.getSnippet());
return InfoWindow;
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index c1e6be256..642296c31 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -273,7 +273,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_start_conversation);
- mViewPager = (ViewPager) findViewById(R.id.start_conversation_view_pager);
+ mViewPager = findViewById(R.id.start_conversation_view_pager);
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
@@ -290,7 +290,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
mConferenceAdapter = new ListItemAdapter(this, conferences);
mContactsAdapter = new ListItemAdapter(this, contacts);
- ((ListItemAdapter) mContactsAdapter).setOnTagClickedListener(this.mOnTagClickedListener);
+ mContactsAdapter.setOnTagClickedListener(this.mOnTagClickedListener);
this.mHideOfflineContacts = getPreferences().getBoolean("hide_offline", false);
}
@@ -479,9 +479,9 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.join_conference);
final View dialogView = getLayoutInflater().inflate(R.layout.join_conference_dialog, null);
- final Spinner spinner = (Spinner) dialogView.findViewById(R.id.account);
- final AutoCompleteTextView jid = (AutoCompleteTextView) dialogView.findViewById(R.id.jid);
- final TextView jabberIdDesc = (TextView) dialogView.findViewById(R.id.jabber_id);
+ final Spinner spinner = dialogView.findViewById(R.id.account);
+ final AutoCompleteTextView jid = dialogView.findViewById(R.id.jid);
+ final TextView jabberIdDesc = dialogView.findViewById(R.id.jabber_id);
jabberIdDesc.setText(R.string.conference_address);
jid.setHint(R.string.conference_address_example);
jid.setAdapter(new KnownHostsAdapter(this, R.layout.simple_list_item, mKnownConferenceHosts));
@@ -551,8 +551,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.create_conference);
final View dialogView = getLayoutInflater().inflate(R.layout.create_conference_dialog, null);
- final Spinner spinner = (Spinner) dialogView.findViewById(R.id.account);
- final EditText subject = (EditText) dialogView.findViewById(R.id.subject);
+ final Spinner spinner = dialogView.findViewById(R.id.account);
+ final EditText subject = dialogView.findViewById(R.id.subject);
populateAccountSpinner(this, mActivatedAccounts, spinner);
builder.setView(dialogView);
builder.setPositiveButton(R.string.choose_participants, new OnClickListener() {
@@ -613,7 +613,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
mMenuSearchView = menu.findItem(R.id.action_search);
mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener);
View mSearchView = mMenuSearchView.getActionView();
- mSearchEditText = (EditText) mSearchView
+ mSearchEditText = mSearchView
.findViewById(R.id.search_field);
mSearchEditText.addTextChangedListener(mSearchTextWatcher);
mSearchEditText.setOnEditorActionListener(mSearchDone);
@@ -920,8 +920,8 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.verify_omemo_keys);
View view = getLayoutInflater().inflate(R.layout.dialog_verify_fingerprints, null);
- final CheckBox isTrustedSource = (CheckBox) view.findViewById(R.id.trusted_source);
- TextView warning = (TextView) view.findViewById(R.id.warning);
+ final CheckBox isTrustedSource = view.findViewById(R.id.trusted_source);
+ TextView warning = view.findViewById(R.id.warning);
String jid = contact.getJid().toBareJid().toString();
SpannableString spannable = new SpannableString(getString(R.string.verifying_omemo_keys_trusted_source,jid,contact.getDisplayName()));
int start = spannable.toString().indexOf(jid);
diff --git a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
index de45554f0..40b67d12f 100644
--- a/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/TrustKeysActivity.java
@@ -98,15 +98,15 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
}
}
- keyErrorMessageCard = (LinearLayout) findViewById(R.id.key_error_message_card);
- keyErrorMessage = (TextView) findViewById(R.id.key_error_message);
- ownKeysTitle = (TextView) findViewById(R.id.own_keys_title);
- ownKeys = (LinearLayout) findViewById(R.id.own_keys_details);
- ownKeysCard = (LinearLayout) findViewById(R.id.own_keys_card);
- foreignKeys = (LinearLayout) findViewById(R.id.foreign_keys);
- mCancelButton = (Button) findViewById(R.id.cancel_button);
+ keyErrorMessageCard = findViewById(R.id.key_error_message_card);
+ keyErrorMessage = findViewById(R.id.key_error_message);
+ ownKeysTitle = findViewById(R.id.own_keys_title);
+ ownKeys = findViewById(R.id.own_keys_details);
+ ownKeysCard = findViewById(R.id.own_keys_card);
+ foreignKeys = findViewById(R.id.foreign_keys);
+ mCancelButton = findViewById(R.id.cancel_button);
mCancelButton.setOnClickListener(mCancelButtonListener);
- mSaveButton = (Button) findViewById(R.id.save_button);
+ mSaveButton = findViewById(R.id.save_button);
mSaveButton.setOnClickListener(mSaveButtonListener);
@@ -211,9 +211,9 @@ public class TrustKeysActivity extends OmemoActivity implements OnKeyStatusUpdat
hasForeignKeys = true;
final LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.keys_card, foreignKeys, false);
final Jid jid = entry.getKey();
- final TextView header = (TextView) layout.findViewById(R.id.foreign_keys_title);
- final LinearLayout keysContainer = (LinearLayout) layout.findViewById(R.id.foreign_keys_details);
- final TextView informNoKeys = (TextView) layout.findViewById(R.id.no_keys_to_accept);
+ final TextView header = layout.findViewById(R.id.foreign_keys_title);
+ final LinearLayout keysContainer = layout.findViewById(R.id.foreign_keys_details);
+ final TextView informNoKeys = layout.findViewById(R.id.no_keys_to_accept);
header.setText(jid.toString());
header.setOnClickListener(new OnClickListener() {
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
index 5ab90ca7f..37497ee6a 100644
--- a/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/UpdaterActivity.java
@@ -47,7 +47,7 @@ public class UpdaterActivity extends Activity {
//set activity
setContentView(R.layout.activity_updater);
- TextView textView = (TextView) findViewById(R.id.updater);
+ TextView textView = findViewById(R.id.updater);
textView.setText(R.string.update_info);
}
diff --git a/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java b/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java
index 1bd8e20f7..69747a5e7 100644
--- a/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/VerifyOTRActivity.java
@@ -395,17 +395,17 @@ public class VerifyOTRActivity extends XmppActivity implements XmppConnectionSer
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verify_otr);
- this.mRemoteFingerprint = (TextView) findViewById(R.id.remote_fingerprint);
- this.mYourFingerprint = (TextView) findViewById(R.id.your_fingerprint);
- this.mLeftButton = (Button) findViewById(R.id.left_button);
- this.mRightButton = (Button) findViewById(R.id.right_button);
- this.mVerificationExplain = (TextView) findViewById(R.id.verification_explanation);
- this.mStatusMessage = (TextView) findViewById(R.id.status_message);
- this.mSharedSecretSecret = (EditText) findViewById(R.id.shared_secret_secret);
- this.mSharedSecretHintEditable = (EditText) findViewById(R.id.shared_secret_hint_editable);
- this.mSharedSecretHint = (TextView) findViewById(R.id.shared_secret_hint);
- this.mManualVerificationArea = (LinearLayout) findViewById(R.id.manual_verification_area);
- this.mSmpVerificationArea = (LinearLayout) findViewById(R.id.smp_verification_area);
+ this.mRemoteFingerprint = findViewById(R.id.remote_fingerprint);
+ this.mYourFingerprint = findViewById(R.id.your_fingerprint);
+ this.mLeftButton = findViewById(R.id.left_button);
+ this.mRightButton = findViewById(R.id.right_button);
+ this.mVerificationExplain = findViewById(R.id.verification_explanation);
+ this.mStatusMessage = findViewById(R.id.status_message);
+ this.mSharedSecretSecret = findViewById(R.id.shared_secret_secret);
+ this.mSharedSecretHintEditable = findViewById(R.id.shared_secret_hint_editable);
+ this.mSharedSecretHint = findViewById(R.id.shared_secret_hint);
+ this.mManualVerificationArea = findViewById(R.id.manual_verification_area);
+ this.mSmpVerificationArea = findViewById(R.id.smp_verification_area);
}
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
index 6c0f38363..a764a5d8e 100644
--- a/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/WelcomeActivity.java
@@ -81,8 +81,8 @@ public class WelcomeActivity extends XmppActivity {
}
- final Button ImportDatabase = (Button) findViewById(R.id.import_database);
- final TextView ImportText = (TextView) findViewById(R.id.import_text);
+ final Button ImportDatabase = findViewById(R.id.import_database);
+ final TextView ImportText = findViewById(R.id.import_text);
if (BackupAvailable()) {
ImportDatabase.setVisibility(View.VISIBLE);
@@ -96,7 +96,7 @@ public class WelcomeActivity extends XmppActivity {
}
});
- final Button createAccount = (Button) findViewById(R.id.create_account);
+ final Button createAccount = findViewById(R.id.create_account);
createAccount.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -105,7 +105,7 @@ public class WelcomeActivity extends XmppActivity {
startActivity(intent);
}
});
- final Button useOwnProvider = (Button) findViewById(R.id.use_existing_account);
+ final Button useOwnProvider = findViewById(R.id.use_existing_account);
useOwnProvider.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -128,7 +128,7 @@ public class WelcomeActivity extends XmppActivity {
View promptsView = li.inflate(R.layout.password, null);
final AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(WelcomeActivity.this);
alertDialogBuilder.setView(promptsView);
- final EditText userInput = (EditText) promptsView
+ final EditText userInput = promptsView
.findViewById(R.id.password);
alertDialogBuilder.setTitle(R.string.enter_password);
alertDialogBuilder.setMessage(R.string.enter_account_password);
diff --git a/src/main/java/de/pixart/messenger/ui/XmppActivity.java b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
index 0716e2da0..36c4e20b3 100644
--- a/src/main/java/de/pixart/messenger/ui/XmppActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/XmppActivity.java
@@ -175,11 +175,11 @@ public abstract class XmppActivity extends Activity {
abstract protected void refreshUiReal();
protected interface OnValueEdited {
- public void onValueEdited(String value);
+ void onValueEdited(String value);
}
public interface OnPresenceSelected {
- public void onPresenceSelected();
+ void onPresenceSelected();
}
protected ServiceConnection mConnection = new ServiceConnection() {
@@ -748,7 +748,7 @@ public abstract class XmppActivity extends Activity {
boolean password) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = getLayoutInflater().inflate(R.layout.quickedit, null);
- final EditText editor = (EditText) view.findViewById(R.id.editor);
+ final EditText editor = view.findViewById(R.id.editor);
OnClickListener mClickListener = new OnClickListener() {
@Override
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java
index f2186d1d8..0c1c5cc0a 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java
@@ -40,14 +40,14 @@ public class AccountAdapter extends ArrayAdapter<Account> {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.account_row, parent, false);
}
- TextView jid = (TextView) view.findViewById(R.id.account_jid);
+ TextView jid = view.findViewById(R.id.account_jid);
if (Config.DOMAIN_LOCK != null) {
jid.setText(account.getJid().getLocalpart());
} else {
jid.setText(account.getJid().toBareJid().toString());
}
- TextView statusView = (TextView) view.findViewById(R.id.account_status);
- ImageView imageView = (ImageView) view.findViewById(R.id.account_image);
+ TextView statusView = view.findViewById(R.id.account_status);
+ ImageView imageView = view.findViewById(R.id.account_image);
loadAvatar(account,imageView);
statusView.setText(getContext().getString(account.getStatus().getReadableId()));
switch (account.getStatus()) {
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java
index dd3ef8faf..8d6b2d03e 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/ListItemAdapter.java
@@ -66,10 +66,10 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> {
if (view == null) {
view = inflater.inflate(R.layout.contact, parent, false);
}
- TextView tvName = (TextView) view.findViewById(R.id.contact_display_name);
- TextView tvJid = (TextView) view.findViewById(R.id.contact_jid);
- ImageView picture = (ImageView) view.findViewById(R.id.contact_photo);
- FlowLayout tagLayout = (FlowLayout) view.findViewById(R.id.tags);
+ TextView tvName = view.findViewById(R.id.contact_display_name);
+ TextView tvJid = view.findViewById(R.id.contact_jid);
+ ImageView picture = view.findViewById(R.id.contact_photo);
+ FlowLayout tagLayout = view.findViewById(R.id.tags);
List<ListItem.Tag> tags = item.getTags(activity);
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 4653ee3de..80d2b8f3a 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -1016,7 +1016,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
}
public interface OnQuoteListener {
- public void onQuote(String text);
+ void onQuote(String text);
}
private class MessageBodyActionModeCallback implements ActionMode.Callback {
diff --git a/src/main/java/de/pixart/messenger/ui/forms/FormBooleanFieldWrapper.java b/src/main/java/de/pixart/messenger/ui/forms/FormBooleanFieldWrapper.java
index 51ac79c66..b403f619c 100644
--- a/src/main/java/de/pixart/messenger/ui/forms/FormBooleanFieldWrapper.java
+++ b/src/main/java/de/pixart/messenger/ui/forms/FormBooleanFieldWrapper.java
@@ -16,7 +16,7 @@ public class FormBooleanFieldWrapper extends FormFieldWrapper {
protected FormBooleanFieldWrapper(Context context, Field field) {
super(context, field);
- checkBox = (CheckBox) view.findViewById(R.id.field);
+ checkBox = view.findViewById(R.id.field);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@@ -28,7 +28,7 @@ public class FormBooleanFieldWrapper extends FormFieldWrapper {
@Override
protected void setLabel(String label, boolean required) {
- CheckBox checkBox = (CheckBox) view.findViewById(R.id.field);
+ CheckBox checkBox = view.findViewById(R.id.field);
checkBox.setText(createSpannableLabelString(label, required));
}
diff --git a/src/main/java/de/pixart/messenger/ui/forms/FormTextFieldWrapper.java b/src/main/java/de/pixart/messenger/ui/forms/FormTextFieldWrapper.java
index 5635bc7b4..54f3439cc 100644
--- a/src/main/java/de/pixart/messenger/ui/forms/FormTextFieldWrapper.java
+++ b/src/main/java/de/pixart/messenger/ui/forms/FormTextFieldWrapper.java
@@ -19,7 +19,7 @@ public class FormTextFieldWrapper extends FormFieldWrapper {
protected FormTextFieldWrapper(Context context, Field field) {
super(context, field);
- editText = (EditText) view.findViewById(R.id.field);
+ editText = view.findViewById(R.id.field);
editText.setSingleLine(!"text-multi".equals(field.getType()));
if ("text-private".equals(field.getType())) {
editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
@@ -43,7 +43,7 @@ public class FormTextFieldWrapper extends FormFieldWrapper {
@Override
protected void setLabel(String label, boolean required) {
- TextView textView = (TextView) view.findViewById(R.id.label);
+ TextView textView = view.findViewById(R.id.label);
textView.setText(createSpannableLabelString(label, required));
}
diff --git a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java
index 59223adcd..ebd268bd0 100644
--- a/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java
+++ b/src/main/java/de/pixart/messenger/ui/widget/CopyTextView.java
@@ -30,7 +30,7 @@ public class CopyTextView extends EmojiTextView {
}
public interface CopyHandler {
- public String transformTextForCopy(CharSequence text, int start, int end);
+ String transformTextForCopy(CharSequence text, int start, int end);
}
private CopyHandler copyHandler;
diff --git a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
index 5ac6f9134..f86357308 100644
--- a/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
+++ b/src/main/java/de/pixart/messenger/ui/widget/ListSelectionManager.java
@@ -141,10 +141,7 @@ public class ListSelectionManager {
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
- if (additionalCallback != null && additionalCallback.onActionItemClicked(mode, item)) {
- return true;
- }
- return false;
+ return additionalCallback != null && additionalCallback.onActionItemClicked(mode, item);
}
@Override
diff --git a/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java b/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java
index f19258dda..3a55b24a7 100644
--- a/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java
+++ b/src/main/java/de/pixart/messenger/utils/OnPhoneContactsLoadedListener.java
@@ -5,5 +5,5 @@ import android.os.Bundle;
import java.util.List;
public interface OnPhoneContactsLoadedListener {
- public void onPhoneContactsLoaded(List<Bundle> phoneContacts);
+ void onPhoneContactsLoaded(List<Bundle> phoneContacts);
}
diff --git a/src/main/java/de/pixart/messenger/utils/UIHelper.java b/src/main/java/de/pixart/messenger/utils/UIHelper.java
index b95c08e38..617044f43 100644
--- a/src/main/java/de/pixart/messenger/utils/UIHelper.java
+++ b/src/main/java/de/pixart/messenger/utils/UIHelper.java
@@ -520,9 +520,9 @@ public class UIHelper {
field.setAccessible(true);
Object menuPopupHelper = field.get(attachFilePopup);
Class<?> cls = Class.forName("com.android.internal.view.menu.MenuPopupHelper");
- Method method = cls.getDeclaredMethod("setForceShowIcon", new Class[]{boolean.class});
+ Method method = cls.getDeclaredMethod("setForceShowIcon", boolean.class);
method.setAccessible(true);
- method.invoke(menuPopupHelper, new Object[]{true});
+ method.invoke(menuPopupHelper, true);
return true;
} catch (Exception e) {
return false;
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java b/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java
index 3ca11c068..788370e41 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnAdvancedStreamFeaturesLoaded.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.entities.Account;
public interface OnAdvancedStreamFeaturesLoaded {
- public void onAdvancedStreamFeaturesAvailable(final Account account);
+ void onAdvancedStreamFeaturesAvailable(final Account account);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java b/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java
index 710a807dd..4c81adb68 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnBindListener.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.entities.Account;
public interface OnBindListener {
- public void onBind(Account account);
+ void onBind(Account account);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java b/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java
index 66cd24858..fa99b4964 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnContactStatusChanged.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.entities.Contact;
public interface OnContactStatusChanged {
- public void onContactStatusChanged(final Contact contact, final boolean online);
+ void onContactStatusChanged(final Contact contact, final boolean online);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java b/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java
index 925a2544d..d55fb6890 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnKeyStatusUpdated.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.crypto.axolotl.AxolotlService;
public interface OnKeyStatusUpdated {
- public void onKeyStatusUpdated(AxolotlService.FetchStatus report);
+ void onKeyStatusUpdated(AxolotlService.FetchStatus report);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java b/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java
index 7ff5658a8..6b9cf7c1d 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnMessageAcknowledged.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.entities.Account;
public interface OnMessageAcknowledged {
- public void onMessageAcknowledged(Account account, String id);
+ void onMessageAcknowledged(Account account, String id);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java
index d4d54f8df..6c2af70fe 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnMessagePacketReceived.java
@@ -4,5 +4,5 @@ import de.pixart.messenger.entities.Account;
import de.pixart.messenger.xmpp.stanzas.MessagePacket;
public interface OnMessagePacketReceived extends PacketReceived {
- public void onMessagePacketReceived(Account account, MessagePacket packet);
+ void onMessagePacketReceived(Account account, MessagePacket packet);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java
index 2df725ff7..53160d4d0 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnPresencePacketReceived.java
@@ -4,5 +4,5 @@ import de.pixart.messenger.entities.Account;
import de.pixart.messenger.xmpp.stanzas.PresencePacket;
public interface OnPresencePacketReceived extends PacketReceived {
- public void onPresencePacketReceived(Account account, PresencePacket packet);
+ void onPresencePacketReceived(Account account, PresencePacket packet);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java b/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java
index 40b7b313a..8e86d5dcb 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnStatusChanged.java
@@ -3,5 +3,5 @@ package de.pixart.messenger.xmpp;
import de.pixart.messenger.entities.Account;
public interface OnStatusChanged {
- public void onStatusChanged(Account account);
+ void onStatusChanged(Account account);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java b/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java
index bf02e2f29..981c79388 100644
--- a/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java
+++ b/src/main/java/de/pixart/messenger/xmpp/OnUpdateBlocklist.java
@@ -3,11 +3,11 @@ package de.pixart.messenger.xmpp;
public interface OnUpdateBlocklist {
// Use an enum instead of a boolean to make sure we don't run into the boolean trap
// (`onUpdateBlocklist(true)' doesn't read well, and could be confusing).
- public static enum Status {
+ enum Status {
BLOCKED,
UNBLOCKED
}
@SuppressWarnings("MethodNameSameAsClassName")
- public void OnUpdateBlocklist(final Status status);
+ void OnUpdateBlocklist(final Status status);
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java b/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java
index b5b02b147..a39ba4549 100644
--- a/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java
+++ b/src/main/java/de/pixart/messenger/xmpp/PacketReceived.java
@@ -1,5 +1,5 @@
package de.pixart.messenger.xmpp;
-public abstract interface PacketReceived {
+public interface PacketReceived {
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java b/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java
index 11a3eed5e..bb8bf98a0 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/OnTransportConnected.java
@@ -1,7 +1,7 @@
package de.pixart.messenger.xmpp.jingle;
public interface OnTransportConnected {
- public void failed();
+ void failed();
- public void established();
+ void established();
}
diff --git a/src/main/java/de/pixart/messenger/xmpp/pep/Avatar.java b/src/main/java/de/pixart/messenger/xmpp/pep/Avatar.java
index 655eabfc8..05b41c610 100644
--- a/src/main/java/de/pixart/messenger/xmpp/pep/Avatar.java
+++ b/src/main/java/de/pixart/messenger/xmpp/pep/Avatar.java
@@ -9,8 +9,6 @@ public class Avatar {
public enum Origin {PEP, VCARD}
- ;
-
public String type;
public String sha1sum;
public String image;