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 @Override
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.choose_contact, 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(); View mSearchView = menuSearchView.getActionView();
mSearchEditText = (EditText) mSearchView mSearchEditText = (EditText) mSearchView
.findViewById(R.id.search_field); .findViewById(R.id.search_field);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,7 +28,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
if (view == null) { if (view == null) {
LayoutInflater inflater = (LayoutInflater) getContext() LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); .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); TextView jid = (TextView) view.findViewById(R.id.account_jid);
jid.setText(account.getJid()); jid.setText(account.getJid());

View File

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

View File

@ -28,7 +28,7 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ListItem item = getItem(position); ListItem item = getItem(position);
if (view == null) { 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 name = (TextView) view.findViewById(R.id.contact_display_name);
TextView jid = (TextView) view.findViewById(R.id.contact_jid); TextView jid = (TextView) view.findViewById(R.id.contact_jid);

View File

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