mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-17 21:47:28 +00:00
Add close button to attachment type selector
// FREEBIE
This commit is contained in:
parent
be0ca330f5
commit
09c57f3f44
BIN
res/drawable-hdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
BIN
res/drawable-hdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 344 B |
BIN
res/drawable-mdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
BIN
res/drawable-mdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 284 B |
BIN
res/drawable-xhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
BIN
res/drawable-xhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 411 B |
BIN
res/drawable-xxhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
BIN
res/drawable-xxhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 545 B |
BIN
res/drawable-xxxhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
BIN
res/drawable-xxxhdpi/ic_keyboard_arrow_down_white_36dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 717 B |
@ -141,8 +141,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="16dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -151,8 +150,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="16dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@ -160,8 +158,22 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="16dp">
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.thoughtcrime.securesms.components.CircleColorImageView
|
||||
android:id="@+id/close_button"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:src="@drawable/ic_keyboard_arrow_down_white_36dp"
|
||||
android:scaleType="center"
|
||||
android:elevation="4dp"
|
||||
app:circleColor="@color/gray50"/>
|
||||
|
||||
<TextView android:layout_marginTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AttachmentTypeLabel"
|
||||
android:text=" "/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -43,6 +43,7 @@ public class AttachmentTypeSelector extends PopupWindow {
|
||||
private final @NonNull ImageView videoButton;
|
||||
private final @NonNull ImageView contactButton;
|
||||
private final @NonNull ImageView cameraButton;
|
||||
private final @NonNull ImageView closeButton;
|
||||
|
||||
private @Nullable View currentAnchor;
|
||||
private @Nullable AttachmentClickedListener listener;
|
||||
@ -59,12 +60,14 @@ public class AttachmentTypeSelector extends PopupWindow {
|
||||
this.videoButton = ViewUtil.findById(layout, R.id.video_button);
|
||||
this.contactButton = ViewUtil.findById(layout, R.id.contact_button);
|
||||
this.cameraButton = ViewUtil.findById(layout, R.id.camera_button);
|
||||
this.closeButton = ViewUtil.findById(layout, R.id.close_button);
|
||||
|
||||
this.imageButton.setOnClickListener(new PropagatingClickListener(ADD_IMAGE));
|
||||
this.audioButton.setOnClickListener(new PropagatingClickListener(ADD_SOUND));
|
||||
this.videoButton.setOnClickListener(new PropagatingClickListener(ADD_VIDEO));
|
||||
this.contactButton.setOnClickListener(new PropagatingClickListener(ADD_CONTACT_INFO));
|
||||
this.cameraButton.setOnClickListener(new PropagatingClickListener(TAKE_PHOTO));
|
||||
this.closeButton.setOnClickListener(new CloseClickListener());
|
||||
|
||||
setContentView(layout);
|
||||
setWidth(LinearLayout.LayoutParams.MATCH_PARENT);
|
||||
@ -102,6 +105,7 @@ public class AttachmentTypeSelector extends PopupWindow {
|
||||
animateButtonIn(audioButton, ANIMATION_DURATION / 3);
|
||||
animateButtonIn(videoButton, ANIMATION_DURATION / 4);
|
||||
animateButtonIn(contactButton, 0);
|
||||
animateButtonIn(closeButton, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,6 +240,13 @@ public class AttachmentTypeSelector extends PopupWindow {
|
||||
|
||||
}
|
||||
|
||||
private class CloseClickListener implements View.OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public interface AttachmentClickedListener {
|
||||
public void onClick(int type);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user