mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
Add scroll to bottom button
This commit is contained in:
parent
75d58677e4
commit
6533fdb64b
5 changed files with 39 additions and 3 deletions
|
@ -197,6 +197,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||
val attachmentOptionsContainerLayoutParams = attachmentOptionsContainer.layoutParams as RelativeLayout.LayoutParams
|
||||
attachmentOptionsContainerLayoutParams.bottomMargin = bottomMargin + attachmentButtonHeight + margin
|
||||
attachmentOptionsContainer.layoutParams = attachmentOptionsContainerLayoutParams
|
||||
// Scroll to bottom button
|
||||
val scrollToBottomButtonLayoutParams = scrollToBottomButton.layoutParams as RelativeLayout.LayoutParams
|
||||
scrollToBottomButtonLayoutParams.bottomMargin = newValue + additionalContentContainer.height + toPx(12, resources)
|
||||
scrollToBottomButton.layoutParams = scrollToBottomButtonLayoutParams
|
||||
}
|
||||
|
||||
override fun inputBarEditTextContentChanged(newContent: CharSequence) {
|
||||
|
@ -313,7 +317,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||
val rawAlpha = (bottomOffset.toFloat() - scrollButtonNoVisibilityThreshold) /
|
||||
(scrollButtonFullVisibilityThreshold - scrollButtonNoVisibilityThreshold)
|
||||
val alpha = max(min(rawAlpha, 1.0f), 0.0f)
|
||||
Log.d("Test", "$alpha")
|
||||
scrollToBottomButton.alpha = alpha
|
||||
}
|
||||
// endregion
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/scroll_to_bottom_button_background" />
|
||||
<stroke android:width="1px" android:color="@color/scroll_to_bottom_button_border" />
|
||||
</shape>
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/contentView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -70,6 +70,27 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/scrollToBottomButton"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginBottom="72dp"
|
||||
android:alpha="0"
|
||||
android:background="@drawable/view_scroll_to_bottom_button_background">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_chevron_up"
|
||||
android:layout_centerInParent="true"
|
||||
android:rotation="180"
|
||||
app:tint="@color/text" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.input_bar.InputBarRecordingView
|
||||
android:id="@+id/inputBarRecordingView"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
<color name="mention_candidates_view_background">#FCFCFC</color>
|
||||
<color name="mention_candidates_view_background_ripple">#DFDFDF</color>
|
||||
<color name="link_preview_background">#0F000000</color>
|
||||
<color name="scroll_to_bottom_button_background">#FCFCFC</color>
|
||||
<color name="scroll_to_bottom_button_border">#99000000</color>
|
||||
|
||||
<color name="default_background_start">#ffffff</color>
|
||||
<color name="default_background_end">#fcfcfc</color>
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
<color name="mention_candidates_view_background">#171717</color>
|
||||
<color name="mention_candidates_view_background_ripple">#0C0C0C</color>
|
||||
<color name="link_preview_background">#000000</color>
|
||||
<color name="scroll_to_bottom_button_background">#171717</color>
|
||||
<color name="scroll_to_bottom_button_border">#99FFFFFF</color>
|
||||
|
||||
<array name="profile_picture_placeholder_colors">
|
||||
<item>#5ff8b0</item>
|
||||
|
|
Loading…
Reference in a new issue