Cleanup attach dialog.

This commit is contained in:
B. Petersen
2016-12-02 00:53:56 +01:00
parent c73d3564d4
commit 3da3325c9b
53 changed files with 68 additions and 59 deletions
@@ -24,6 +24,7 @@ import android.os.Build;
import com.b44t.messenger.AndroidUtilities;
import com.b44t.messenger.ApplicationLoader;
import com.b44t.messenger.R;
import com.b44t.ui.Components.ChatAttachAlert;
public class Theme {
@@ -310,14 +311,14 @@ public class Theme {
public static void loadChatResources(Context context) {
if (attachButtonDrawables[0] == null) {
attachButtonDrawables[0] = context.getResources().getDrawable(R.drawable.attach_camera_states);
attachButtonDrawables[1] = context.getResources().getDrawable(R.drawable.attach_gallery_states);
attachButtonDrawables[2] = context.getResources().getDrawable(R.drawable.attach_video_states);
attachButtonDrawables[3] = context.getResources().getDrawable(R.drawable.attach_audio_states);
attachButtonDrawables[4] = context.getResources().getDrawable(R.drawable.attach_file_states);
attachButtonDrawables[5] = context.getResources().getDrawable(R.drawable.attach_contact_states);
attachButtonDrawables[6] = context.getResources().getDrawable(R.drawable.attach_location_states);
attachButtonDrawables[7] = context.getResources().getDrawable(R.drawable.attach_hide_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA] = context.getResources().getDrawable(R.drawable.attach_camera_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_GALLERY] = context.getResources().getDrawable(R.drawable.attach_gallery_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_VIDEO] = context.getResources().getDrawable(R.drawable.attach_video_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_MUSIC] = context.getResources().getDrawable(R.drawable.attach_audio_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_FILE] = context.getResources().getDrawable(R.drawable.attach_file_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_CONTACT] = context.getResources().getDrawable(R.drawable.attach_contact_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_LOCATION] = context.getResources().getDrawable(R.drawable.attach_location_states);
attachButtonDrawables[ChatAttachAlert.ATTACH_BUTTON_IDX_SENDSELECTED]= context.getResources().getDrawable(R.drawable.attach_hide_states);
}
}
@@ -295,14 +295,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
private final static int id_reply = 19;
private final static int id_info = 20;
private final static int attach_photo = 0;
private final static int attach_gallery = 1;
private final static int attach_video = 2;
private final static int attach_audio = 3;
private final static int attach_document = 4;
private final static int attach_contact = 5;
private final static int attach_location = 6;
private final static int search = 40;
private final static int id_chat_compose_panel = 1000;
@@ -2064,7 +2056,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
if (getParentActivity() == null) {
return;
}
if (button == 7) {
if (button == ChatAttachAlert.ATTACH_BUTTON_IDX_SENDSELECTED) {
chatAttachAlert.dismiss();
HashMap<Integer, MediaController.PhotoEntry> selectedPhotos = chatAttachAlert.getSelectedPhotos();
if (!selectedPhotos.isEmpty()) {
@@ -2320,7 +2312,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
private void processSelectedAttach(int which) {
if (which == attach_photo || which == attach_gallery || which == attach_document || which == attach_video) {
if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA || which == ChatAttachAlert.ATTACH_BUTTON_IDX_GALLERY
|| which == ChatAttachAlert.ATTACH_BUTTON_IDX_FILE || which == ChatAttachAlert.ATTACH_BUTTON_IDX_VIDEO ) {
String action;
if (currentChat != null) {
/*if (currentChat.participants_count > MessagesController.getInstance().groupBigSize) {
@@ -2330,14 +2323,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
action = "bigchat_upload_document";
}
} else*/ {
if (which == attach_photo || which == attach_gallery) {
if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA || which == ChatAttachAlert.ATTACH_BUTTON_IDX_GALLERY) {
action = "chat_upload_photo";
} else {
action = "chat_upload_document";
}
}
} else {
if (which == attach_photo || which == attach_gallery) {
if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA || which == ChatAttachAlert.ATTACH_BUTTON_IDX_GALLERY) {
action = "pm_upload_photo";
} else {
action = "pm_upload_document";
@@ -2345,7 +2338,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
}
if (which == attach_photo) {
if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CAMERA ) {
try {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File image = AndroidUtilities.generatePicturePath();
@@ -2357,7 +2350,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} catch (Exception e) {
FileLog.e("messenger", e);
}
} else if (which == attach_gallery) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_GALLERY ) {
if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
getParentActivity().requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 4);
return;
@@ -2404,7 +2397,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
});
presentFragment(fragment);
} else if (which == attach_video) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_VIDEO) {
try {
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
File video = AndroidUtilities.generateVideoPath();
@@ -2419,7 +2412,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
} catch (Exception e) {
FileLog.e("messenger", e);
}
} else if (which == attach_location ) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_LOCATION ) {
/* Telegram-FOSS Disabled for now.*/
Toast.makeText(getParentActivity(), LocaleController.getString("NotYetImplemented", R.string.NotYetImplemented), Toast.LENGTH_LONG).show();
/*AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
@@ -2437,7 +2430,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
builder.setMessage("Send current Location?");
showDialog(builder.create());*/
} else if (which == attach_document) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_FILE ) {
if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
getParentActivity().requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 4);
return;
@@ -2464,7 +2457,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
});
presentFragment(fragment);
} else if (which == attach_audio) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_MUSIC ) {
if (Build.VERSION.SDK_INT >= 23 && getParentActivity().checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
getParentActivity().requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 4);
return;
@@ -2479,7 +2472,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
}
});
presentFragment(fragment);
} else if (which == attach_contact) {
} else if (which == ChatAttachAlert.ATTACH_BUTTON_IDX_CONTACT ) {
if (Build.VERSION.SDK_INT >= 23) {
if (getParentActivity().checkSelfPermission(Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
getParentActivity().requestPermissions(new String[]{Manifest.permission.READ_CONTACTS}, 5);
@@ -68,6 +68,16 @@ import java.util.HashMap;
public class ChatAttachAlert extends BottomSheet implements NotificationCenter.NotificationCenterDelegate, PhotoViewer.PhotoViewerProvider, BottomSheet.BottomSheetDelegateInterface {
public final static int ATTACH_BUTTON_IDX_CAMERA = 0;
public final static int ATTACH_BUTTON_IDX_VIDEO = 1;
public final static int ATTACH_BUTTON_IDX_LOCATION = 2;
public final static int ATTACH_BUTTON_IDX_CONTACT = 3;
public final static int ATTACH_BUTTON_IDX_GALLERY = 4;
public final static int ATTACH_BUTTON_IDX_MUSIC = 5;
public final static int ATTACH_BUTTON_IDX_FILE = 6;
public final static int ATTACH_BUTTON_IDX_SENDSELECTED = 7;
public final static int ATTACH_BUTTON_COUNT = 8;
public interface ChatAttachViewDelegate {
void didPressedButton(int button);
View getRevealView();
@@ -93,12 +103,12 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
private Drawable shadowDrawable;
private ViewGroup attachView;
private ListAdapter adapter;
private TextView hintTextView;
//private TextView hintTextView;
private ArrayList<InnerAnimator> innerAnimators = new ArrayList<>();
private AnimatorSet currentHintAnimation;
private boolean hintShowed;
private Runnable hideHintRunnable;
//private AnimatorSet currentHintAnimation;
//private boolean hintShowed;
//private Runnable hideHintRunnable;
private boolean deviceHasGoodCamera = false;//Build.VERSION.SDK_INT >= 16;
@@ -411,13 +421,13 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
if (listView.getChildCount() <= 0) {
return;
}
if (hintShowed) {
/*if (hintShowed) {
if (layoutManager.findLastVisibleItemPosition() > 1) {
hideHint();
hintShowed = false;
ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE).edit().putBoolean("bothint", true).commit();
}
}
}*/
updateLayout();
}
});
@@ -437,7 +447,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
attachPhotoRecyclerView.layout(0, t, width, t + attachPhotoRecyclerView.getMeasuredHeight());
progressView.layout(0, t, width, t + progressView.getMeasuredHeight());
lineView.layout(0, AndroidUtilities.dp(96), width, AndroidUtilities.dp(96) + lineView.getMeasuredHeight());
hintTextView.layout(width - hintTextView.getMeasuredWidth() - AndroidUtilities.dp(5), height - hintTextView.getMeasuredHeight() - AndroidUtilities.dp(5), width - AndroidUtilities.dp(5), height - AndroidUtilities.dp(5));
//hintTextView.layout(width - hintTextView.getMeasuredWidth() - AndroidUtilities.dp(5), height - hintTextView.getMeasuredHeight() - AndroidUtilities.dp(5), width - AndroidUtilities.dp(5), height - AndroidUtilities.dp(5));
int diff = (width - AndroidUtilities.dp(85 * 4 + 20)) / 3;
for (int a = 0; a < 8; a++) {
@@ -548,23 +558,24 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
};
lineView.setBackgroundColor(0xffd2d2d2);
attachView.addView(lineView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1, Gravity.TOP | Gravity.LEFT));
CharSequence[] items = new CharSequence[]{
LocaleController.getString("ChatCamera", R.string.ChatCamera),
LocaleController.getString("ChatGallery", R.string.ChatGallery),
LocaleController.getString("ChatVideo", R.string.ChatVideo),
LocaleController.getString("AttachMusic", R.string.AttachMusic),
LocaleController.getString("ChatDocument", R.string.ChatDocument),
LocaleController.getString("AttachContact", R.string.AttachContact),
LocaleController.getString("ChatLocation", R.string.ChatLocation),
""
};
for (int a = 0; a < 8; a++) {
CharSequence[] labels = new CharSequence[ATTACH_BUTTON_COUNT];
labels[ATTACH_BUTTON_IDX_CAMERA] = LocaleController.getString("ChatCamera", R.string.ChatCamera);
labels[ATTACH_BUTTON_IDX_GALLERY] = LocaleController.getString("ChatGallery", R.string.ChatGallery);
labels[ATTACH_BUTTON_IDX_VIDEO] = LocaleController.getString("ChatVideo", R.string.ChatVideo);
labels[ATTACH_BUTTON_IDX_MUSIC] = LocaleController.getString("AttachMusic", R.string.AttachMusic);
labels[ATTACH_BUTTON_IDX_FILE] = LocaleController.getString("ChatDocument", R.string.ChatDocument);
labels[ATTACH_BUTTON_IDX_CONTACT] = LocaleController.getString("AttachContact", R.string.AttachContact);
labels[ATTACH_BUTTON_IDX_LOCATION] = LocaleController.getString("ChatLocation", R.string.ChatLocation);
labels[ATTACH_BUTTON_IDX_SENDSELECTED]= "";
for (int a = 0; a < ATTACH_BUTTON_COUNT; a++) {
AttachButton attachButton = new AttachButton(context);
attachButton.setTextAndIcon(items[a], Theme.attachButtonDrawables[a]);
attachButton.setTextAndIcon(labels[a], Theme.attachButtonDrawables[a]);
attachView.addView(attachButton, LayoutHelper.createFrame(85, 90, Gravity.LEFT | Gravity.TOP));
attachButton.setTag(a);
views[a] = attachButton;
if (a == 7) {
if (a == ATTACH_BUTTON_IDX_SENDSELECTED) {
sendPhotosButton = attachButton;
sendPhotosButton.imageView.setPadding(0, AndroidUtilities.dp(4), 0, 0);
}
@@ -576,6 +587,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
});
}
/*
hintTextView = new TextView(context);
hintTextView.setBackgroundResource(R.drawable.tooltip);
hintTextView.setTextColor(Theme.CHAT_GIF_HINT_TEXT_COLOR);
@@ -587,6 +599,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
hintTextView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.scroll_tip, 0, 0, 0);
hintTextView.setCompoundDrawablePadding(AndroidUtilities.dp(8));
attachView.addView(hintTextView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, 32, Gravity.RIGHT | Gravity.BOTTOM, 5, 0, 5, 5));
*/
for (int a = 0; a < 8; a++) {
viewsCache.add(photoAttachAdapter.createHolder());
@@ -599,6 +612,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
}
}
/*
private void hideHint() {
if (hideHintRunnable != null) {
AndroidUtilities.cancelRunOnUIThread(hideHintRunnable);
@@ -680,6 +694,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
currentHintAnimation.setDuration(300);
currentHintAnimation.start();
}
*/
@Override
public void didReceivedNotification(int id, Object... args) {
@@ -726,13 +741,11 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
if (count == 0) {
sendPhotosButton.imageView.setPadding(0, AndroidUtilities.dp(4), 0, 0);
sendPhotosButton.imageView.setBackgroundResource(R.drawable.attach_hide_states);
sendPhotosButton.imageView.setImageResource(R.drawable.attach_hide2);
sendPhotosButton.textView.setText("");
} else {
sendPhotosButton.imageView.setPadding(AndroidUtilities.dp(2), 0, 0, 0);
sendPhotosButton.imageView.setBackgroundResource(R.drawable.attach_send_states);
sendPhotosButton.imageView.setImageResource(R.drawable.attach_send2);
sendPhotosButton.textView.setText(LocaleController.formatString("SendItems", R.string.SendItems, String.format("(%d)", count)));
sendPhotosButton.textView.setText(LocaleController.formatString("SendItems", R.string.SendItems, String.format("%d", count)));
}
if (Build.VERSION.SDK_INT >= 23 && getContext().checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
@@ -763,12 +776,14 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
photoEntry.thumbPath = null;
}
}
/*
if (currentHintAnimation != null) {
currentHintAnimation.cancel();
currentHintAnimation = null;
}
hintTextView.setAlpha(0.0f);
hintTextView.setVisibility(View.INVISIBLE);
*/
attachPhotoLayoutManager.scrollToPositionWithOffset(0, 1000000);
photoAttachAdapter.clearSelectedPhotos();
baseFragment = parentFragment;
@@ -919,7 +934,7 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
MediaController.PhotoEntry photoEntry = MediaController.allPhotosAlbumEntry.photos.get(index);
photoAttachAdapter.getSelectedPhotos().put(photoEntry.imageId, photoEntry);
}
delegate.didPressedButton(7);
delegate.didPressedButton(ATTACH_BUTTON_IDX_SENDSELECTED);
}
@Override
@@ -933,9 +948,9 @@ public class ChatAttachAlert extends BottomSheet implements NotificationCenter.N
if (open && Build.VERSION.SDK_INT <= 19 && MediaController.allPhotosAlbumEntry == null) {
MediaController.loadGalleryPhotosAlbums(0);
}
if (open) {
/*if (open) {
showHint();
}
}*/
}
@Override
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/attach_hide1_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/attach_hide1_pressed" android:state_selected="true" />
<item android:drawable="@drawable/attach_hide1" android:state_pressed="true" />
<item android:drawable="@drawable/attach_hide1" android:state_selected="true" />
<item android:drawable="@drawable/attach_hide1" />
</selector>
</selector>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/attach_send1_pressed" android:state_pressed="true" />
<item android:drawable="@drawable/attach_send1_pressed" android:state_selected="true" />
<item android:drawable="@drawable/attach_send1" android:state_pressed="true" />
<item android:drawable="@drawable/attach_send1" android:state_selected="true" />
<item android:drawable="@drawable/attach_send1" />
</selector>
</selector>