unique colors for attachments
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 974 B |
Before Width: | Height: | Size: 988 B |
Before Width: | Height: | Size: 837 B |
Before Width: | Height: | Size: 769 B |
Before Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
|
@ -56,9 +56,7 @@
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
android:paddingLeft="@dimen/message_bubble_horizontal_padding"
|
android:paddingLeft="@dimen/message_bubble_horizontal_padding"
|
||||||
android:paddingRight="@dimen/message_bubble_horizontal_padding"
|
android:paddingRight="@dimen/message_bubble_horizontal_padding"
|
||||||
android:background="@drawable/message_bubble_background_sent_alone"
|
android:background="@drawable/message_bubble_background_sent_alone"/>
|
||||||
app:doc_titleColor="?attr/conversation_item_outgoing_text_primary_color"
|
|
||||||
app:doc_captionColor="?attr/conversation_item_outgoing_text_secondary_color"/>
|
|
||||||
|
|
||||||
</org.thoughtcrime.securesms.components.RemovableEditableMediaView>
|
</org.thoughtcrime.securesms.components.RemovableEditableMediaView>
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,4 @@
|
||||||
android:layout_width="210dp"
|
android:layout_width="210dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:doc_titleColor="?conversation_item_incoming_text_primary_color"
|
|
||||||
app:doc_captionColor="?conversation_item_incoming_text_secondary_color"
|
|
||||||
tools:visibility="visible"/>
|
tools:visibility="visible"/>
|
||||||
|
|
|
@ -7,6 +7,4 @@
|
||||||
android:layout_width="210dp"
|
android:layout_width="210dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:doc_titleColor="?conversation_item_outgoing_text_primary_color"
|
|
||||||
app:doc_captionColor="?conversation_item_outgoing_text_secondary_color"
|
|
||||||
tools:visibility="visible"/>
|
tools:visibility="visible"/>
|
||||||
|
|
|
@ -12,52 +12,17 @@
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
<org.thoughtcrime.securesms.components.CircleColorImageView
|
||||||
android:id="@+id/control_toggle"
|
android:id="@+id/document_button"
|
||||||
android:layout_width="wrap_content"
|
android:padding="4dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="40dp"
|
||||||
android:layout_gravity="center"
|
android:layout_height="40dp"
|
||||||
android:clickable="false"
|
android:layout_marginLeft="5dp"
|
||||||
android:focusable="false"
|
android:layout_marginRight="5dp"
|
||||||
android:gravity="center">
|
android:src="@drawable/ic_insert_drive_file_white_24dp"
|
||||||
|
android:scaleType="center"
|
||||||
<FrameLayout
|
android:contentDescription="@string/file"
|
||||||
android:id="@+id/icon_container"
|
app:circleColor="@color/document_icon"/>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:layout_marginLeft="-4dp"
|
|
||||||
android:layout_marginStart="-4dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:visibility="visible"
|
|
||||||
android:clickable="false"
|
|
||||||
android:focusable="false">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/icon"
|
|
||||||
android:layout_width="38dp"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:src="?attachment_document_icon_large"/>
|
|
||||||
|
|
||||||
<TextView android:id="@+id/document"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:gravity="center"
|
|
||||||
android:clickable="false"
|
|
||||||
android:visibility="visible"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
style="@style/Signal.Text.Caption"
|
|
||||||
android:textAllCaps="true"
|
|
||||||
android:textSize="10sp"
|
|
||||||
android:textColor="@color/core_black"
|
|
||||||
tools:visibility="visible"
|
|
||||||
tools:text="PDF" />
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</org.thoughtcrime.securesms.components.AnimatingToggle>
|
|
||||||
|
|
||||||
<LinearLayout android:layout_width="match_parent"
|
<LinearLayout android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -75,6 +40,7 @@
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
|
android:textColor="@color/document_icon_text"
|
||||||
tools:text="The-Anarchist-Tension-by-Alfredo-Bonanno.pdf"/>
|
tools:text="The-Anarchist-Tension-by-Alfredo-Bonanno.pdf"/>
|
||||||
|
|
||||||
<TextView android:id="@+id/file_size"
|
<TextView android:id="@+id/file_size"
|
||||||
|
@ -82,6 +48,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
style="@style/Signal.Text.Caption"
|
style="@style/Signal.Text.Caption"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
|
android:textColor="@color/document_icon_text"
|
||||||
tools:text="24kb"/>
|
tools:text="24kb"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
<attr name="theme_type" format="string"/>
|
<attr name="theme_type" format="string"/>
|
||||||
|
|
||||||
<attr name="attachment_type_selector_background" format="color"/>
|
<attr name="attachment_type_selector_background" format="color"/>
|
||||||
<attr name="attachment_document_icon_small" format="reference" />
|
|
||||||
<attr name="attachment_document_icon_large" format="reference" />
|
|
||||||
|
|
||||||
<attr name="conversation_list_item_background" format="reference"/>
|
<attr name="conversation_list_item_background" format="reference"/>
|
||||||
<attr name="conversation_list_deaddrop_bg_color" format="reference|color"/>
|
<attr name="conversation_list_deaddrop_bg_color" format="reference|color"/>
|
||||||
|
@ -211,11 +209,6 @@
|
||||||
<attr name="summaryHasRingtone" format="string|reference" />
|
<attr name="summaryHasRingtone" format="string|reference" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="DocumentView">
|
|
||||||
<attr name="doc_titleColor" format="color" />
|
|
||||||
<attr name="doc_captionColor" format="color" />
|
|
||||||
</declare-styleable>
|
|
||||||
|
|
||||||
<declare-styleable name="ConversationItemFooter">
|
<declare-styleable name="ConversationItemFooter">
|
||||||
<attr name="footer_text_color" format="color" />
|
<attr name="footer_text_color" format="color" />
|
||||||
<attr name="footer_icon_color" format="color" />
|
<attr name="footer_icon_color" format="color" />
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<color name="audio_icon">#f68751</color>
|
<color name="audio_icon">#f68751</color>
|
||||||
<color name="audio_icon_text">#ed824e</color>
|
<color name="audio_icon_text">#ed824e</color>
|
||||||
<color name="document_icon">#34a0f4</color>
|
<color name="document_icon">#34a0f4</color>
|
||||||
<color name="document_icon_text">#3093e0</color>
|
<color name="document_icon_text">#34a0f4</color>
|
||||||
<color name="contact_icon">#608496</color>
|
<color name="contact_icon">#608496</color>
|
||||||
<color name="gallery_icon">#a47ad9</color>
|
<color name="gallery_icon">#a47ad9</color>
|
||||||
<color name="location_icon">#66BB6A</color>
|
<color name="location_icon">#66BB6A</color>
|
||||||
|
|
|
@ -87,8 +87,6 @@
|
||||||
<!--<item name="android:windowContentOverlay">@drawable/compat_actionbar_shadow_background</item>-->
|
<!--<item name="android:windowContentOverlay">@drawable/compat_actionbar_shadow_background</item>-->
|
||||||
|
|
||||||
<item name="attachment_type_selector_background">@color/white</item>
|
<item name="attachment_type_selector_background">@color/white</item>
|
||||||
<item name="attachment_document_icon_small">@drawable/ic_document_small_light</item>
|
|
||||||
<item name="attachment_document_icon_large">@drawable/ic_document_large_light</item>
|
|
||||||
|
|
||||||
<item name="conversation_list_item_background">@drawable/conversation_list_item_background</item>
|
<item name="conversation_list_item_background">@drawable/conversation_list_item_background</item>
|
||||||
<item name="conversation_list_deaddrop_bg_color">@color/gray20</item>
|
<item name="conversation_list_deaddrop_bg_color">@color/gray20</item>
|
||||||
|
@ -239,8 +237,6 @@
|
||||||
<item name="android:alertDialogTheme">@style/AppCompatDialogStyleDark</item>
|
<item name="android:alertDialogTheme">@style/AppCompatDialogStyleDark</item>
|
||||||
|
|
||||||
<item name="attachment_type_selector_background">@color/gray95</item>
|
<item name="attachment_type_selector_background">@color/gray95</item>
|
||||||
<item name="attachment_document_icon_small">@drawable/ic_document_small_dark</item>
|
|
||||||
<item name="attachment_document_icon_large">@drawable/ic_document_large_dark</item>
|
|
||||||
|
|
||||||
<item name="conversation_list_item_background">@drawable/conversation_list_item_background_dark</item>
|
<item name="conversation_list_item_background">@drawable/conversation_list_item_background_dark</item>
|
||||||
<item name="conversation_list_deaddrop_bg_color">@color/import_export_item_background_dark</item>
|
<item name="conversation_list_deaddrop_bg_color">@color/import_export_item_background_dark</item>
|
||||||
|
|
|
@ -23,12 +23,9 @@ public class DocumentView extends FrameLayout {
|
||||||
|
|
||||||
private static final String TAG = DocumentView.class.getSimpleName();
|
private static final String TAG = DocumentView.class.getSimpleName();
|
||||||
|
|
||||||
private final @NonNull AnimatingToggle controlToggle;
|
|
||||||
private final @NonNull View container;
|
private final @NonNull View container;
|
||||||
private final @NonNull ViewGroup iconContainer;
|
|
||||||
private final @NonNull TextView fileName;
|
private final @NonNull TextView fileName;
|
||||||
private final @NonNull TextView fileSize;
|
private final @NonNull TextView fileSize;
|
||||||
private final @NonNull TextView document;
|
|
||||||
|
|
||||||
private @Nullable SlideClickListener viewListener;
|
private @Nullable SlideClickListener viewListener;
|
||||||
private @Nullable DocumentSlide documentSlide;
|
private @Nullable DocumentSlide documentSlide;
|
||||||
|
@ -46,21 +43,8 @@ public class DocumentView extends FrameLayout {
|
||||||
inflate(context, R.layout.document_view, this);
|
inflate(context, R.layout.document_view, this);
|
||||||
|
|
||||||
this.container = findViewById(R.id.document_container);
|
this.container = findViewById(R.id.document_container);
|
||||||
this.iconContainer = findViewById(R.id.icon_container);
|
|
||||||
this.controlToggle = findViewById(R.id.control_toggle);
|
|
||||||
this.fileName = findViewById(R.id.file_name);
|
this.fileName = findViewById(R.id.file_name);
|
||||||
this.fileSize = findViewById(R.id.file_size);
|
this.fileSize = findViewById(R.id.file_size);
|
||||||
this.document = findViewById(R.id.document);
|
|
||||||
|
|
||||||
if (attrs != null) {
|
|
||||||
TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.DocumentView, 0, 0);
|
|
||||||
int titleColor = typedArray.getInt(R.styleable.DocumentView_doc_titleColor, Color.BLACK);
|
|
||||||
int captionColor = typedArray.getInt(R.styleable.DocumentView_doc_captionColor, Color.BLACK);
|
|
||||||
typedArray.recycle();
|
|
||||||
|
|
||||||
fileName.setTextColor(titleColor);
|
|
||||||
fileSize.setTextColor(captionColor);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDocumentClickListener(@Nullable SlideClickListener listener) {
|
public void setDocumentClickListener(@Nullable SlideClickListener listener) {
|
||||||
|
@ -69,13 +53,15 @@ public class DocumentView extends FrameLayout {
|
||||||
|
|
||||||
public void setDocument(final @NonNull DocumentSlide documentSlide)
|
public void setDocument(final @NonNull DocumentSlide documentSlide)
|
||||||
{
|
{
|
||||||
controlToggle.displayQuick(iconContainer);
|
|
||||||
|
|
||||||
this.documentSlide = documentSlide;
|
this.documentSlide = documentSlide;
|
||||||
|
|
||||||
this.fileName.setText(documentSlide.getFileName().or(getContext().getString(R.string.unknown)));
|
this.fileName.setText(documentSlide.getFileName().or(getContext().getString(R.string.unknown)));
|
||||||
this.fileSize.setText(Util.getPrettyFileSize(documentSlide.getFileSize()));
|
|
||||||
this.document.setText(getFileType(documentSlide.getFileName()));
|
String fileSize = Util.getPrettyFileSize(documentSlide.getFileSize())
|
||||||
|
+ " " + getFileType(documentSlide.getFileName()).toUpperCase();
|
||||||
|
this.fileSize.setText(fileSize);
|
||||||
|
|
||||||
this.setOnClickListener(new OpenClickedListener(documentSlide));
|
this.setOnClickListener(new OpenClickedListener(documentSlide));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|