remove some unused cast

This commit is contained in:
Michael 2014-10-26 18:54:10 +01:00
parent 284ad1b053
commit 020dc863b1
10 changed files with 25 additions and 32 deletions

View File

@ -113,7 +113,7 @@ public class ChooseContactActivity extends XmppActivity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.choose_contact, menu);
MenuItem menuSearchView = (MenuItem) menu.findItem(R.id.action_search);
MenuItem menuSearchView = menu.findItem(R.id.action_search);
View mSearchView = menuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView
.findViewById(R.id.search_field);

View File

@ -227,7 +227,7 @@ public class ConferenceDetailsActivity extends XmppActivity {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
membersView.removeAllViews();
for (final User user : conversation.getMucOptions().getUsers()) {
View view = (View) inflater.inflate(R.layout.contact, membersView,
View view = inflater.inflate(R.layout.contact, membersView,
false);
TextView name = (TextView) view
.findViewById(R.id.contact_display_name);

View File

@ -325,8 +325,7 @@ public class ContactDetailsActivity extends XmppActivity {
.iterator(); iterator.hasNext();) {
hasKeys = true;
final String otrFingerprint = iterator.next();
View view = (View) inflater.inflate(R.layout.contact_key, keys,
false);
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 remove = (ImageButton) view
@ -345,8 +344,7 @@ public class ContactDetailsActivity extends XmppActivity {
}
if (contact.getPgpKeyId() != 0) {
hasKeys = true;
View view = (View) inflater.inflate(R.layout.contact_key, keys,
false);
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);
keyType.setText("PGP Key ID");

View File

@ -241,19 +241,15 @@ public class ConversationActivity extends XmppActivity implements
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.conversations, menu);
MenuItem menuSecure = (MenuItem) menu.findItem(R.id.action_security);
MenuItem menuArchive = (MenuItem) menu.findItem(R.id.action_archive);
MenuItem menuMucDetails = (MenuItem) menu
.findItem(R.id.action_muc_details);
MenuItem menuContactDetails = (MenuItem) menu
.findItem(R.id.action_contact_details);
MenuItem menuAttach = (MenuItem) menu.findItem(R.id.action_attach_file);
MenuItem menuClearHistory = (MenuItem) menu
.findItem(R.id.action_clear_history);
MenuItem menuAdd = (MenuItem) menu.findItem(R.id.action_add);
MenuItem menuInviteContact = (MenuItem) menu
.findItem(R.id.action_invite);
MenuItem menuMute = (MenuItem) menu.findItem(R.id.action_mute);
MenuItem menuSecure = menu.findItem(R.id.action_security);
MenuItem menuArchive = menu.findItem(R.id.action_archive);
MenuItem menuMucDetails = menu.findItem(R.id.action_muc_details);
MenuItem menuContactDetails = menu.findItem(R.id.action_contact_details);
MenuItem menuAttach = menu.findItem(R.id.action_attach_file);
MenuItem menuClearHistory = menu.findItem(R.id.action_clear_history);
MenuItem menuAdd = menu.findItem(R.id.action_add);
MenuItem menuInviteContact = menu.findItem(R.id.action_invite);
MenuItem menuMute = menu.findItem(R.id.action_mute);
if (isConversationsOverviewVisable()
&& isConversationsOverviewHideable()) {

View File

@ -463,11 +463,11 @@ public class StartConversationActivity extends XmppActivity {
public boolean onCreateOptionsMenu(Menu menu) {
this.mOptionsMenu = menu;
getMenuInflater().inflate(R.menu.start_conversation, menu);
MenuItem menuCreateContact = (MenuItem) menu
MenuItem menuCreateContact = menu
.findItem(R.id.action_create_contact);
MenuItem menuCreateConference = (MenuItem) menu
MenuItem menuCreateConference = menu
.findItem(R.id.action_join_conference);
mMenuSearchView = (MenuItem) menu.findItem(R.id.action_search);
mMenuSearchView = menu.findItem(R.id.action_search);
mMenuSearchView.setOnActionExpandListener(mOnActionExpandListener);
View mSearchView = mMenuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView

View File

@ -402,8 +402,7 @@ public abstract class XmppActivity extends Activity {
private void quickEdit(final String previousValue,
final OnValueEdited callback, boolean password) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
View view = (View) getLayoutInflater()
.inflate(R.layout.quickedit, null);
View view = getLayoutInflater().inflate(R.layout.quickedit, null);
final EditText editor = (EditText) view.findViewById(R.id.editor);
OnClickListener mClickListener = new OnClickListener() {
@ -450,7 +449,7 @@ public abstract class XmppActivity extends Activity {
listener.onPresenceSelected();
}
} else if (presences.size() == 1) {
String presence = (String) presences.asStringArray()[0];
String presence = presences.asStringArray()[0];
conversation.setNextPresence(presence);
listener.onPresenceSelected();
} else {

View File

@ -28,7 +28,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
if (view == null) {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (View) inflater.inflate(R.layout.account_row, parent, false);
view = inflater.inflate(R.layout.account_row, parent, false);
}
TextView jid = (TextView) view.findViewById(R.id.account_jid);
jid.setText(account.getJid());

View File

@ -35,7 +35,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
if (view == null) {
LayoutInflater inflater = (LayoutInflater) activity
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (View) inflater.inflate(R.layout.conversation_list_row,
view = inflater.inflate(R.layout.conversation_list_row,
parent, false);
}
Conversation conversation = getItem(position);

View File

@ -28,7 +28,7 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ListItem item = getItem(position);
if (view == null) {
view = (View) inflater.inflate(R.layout.contact, parent, false);
view = inflater.inflate(R.layout.contact, parent, false);
}
TextView name = (TextView) view.findViewById(R.id.contact_display_name);
TextView jid = (TextView) view.findViewById(R.id.contact_jid);

View File

@ -314,11 +314,11 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder = new ViewHolder();
switch (type) {
case NULL:
view = (View) activity.getLayoutInflater().inflate(
view = activity.getLayoutInflater().inflate(
R.layout.message_null, parent, false);
break;
case SENT:
view = (View) activity.getLayoutInflater().inflate(
view = activity.getLayoutInflater().inflate(
R.layout.message_sent, parent, false);
viewHolder.message_box = (LinearLayout) view
.findViewById(R.id.message_box);
@ -343,7 +343,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
view.setTag(viewHolder);
break;
case RECEIVED:
view = (View) activity.getLayoutInflater().inflate(
view = activity.getLayoutInflater().inflate(
R.layout.message_received, parent, false);
viewHolder.message_box = (LinearLayout) view
.findViewById(R.id.message_box);
@ -367,7 +367,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
view.setTag(viewHolder);
break;
case STATUS:
view = (View) activity.getLayoutInflater().inflate(
view = activity.getLayoutInflater().inflate(
R.layout.message_status, parent, false);
viewHolder.contact_picture = (ImageView) view
.findViewById(R.id.message_photo);