Rebuild LandingActivity
parent
eb691eded9
commit
fc3063140e
@ -1,79 +0,0 @@
|
||||
package org.thoughtcrime.securesms.onboarding
|
||||
|
||||
import android.animation.FloatEvaluator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ScrollView
|
||||
import network.loki.messenger.R
|
||||
import network.loki.messenger.databinding.ViewFakeChatBinding
|
||||
import org.thoughtcrime.securesms.util.disableClipping
|
||||
|
||||
class FakeChatView : ScrollView {
|
||||
private lateinit var binding: ViewFakeChatBinding
|
||||
// region Settings
|
||||
private val spacing = context.resources.getDimension(R.dimen.medium_spacing)
|
||||
private val startDelay: Long = 1000
|
||||
private val delayBetweenMessages: Long = 1500
|
||||
private val animationDuration: Long = 400
|
||||
// endregion
|
||||
|
||||
// region Lifecycle
|
||||
constructor(context: Context) : super(context) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {
|
||||
setUpViewHierarchy()
|
||||
}
|
||||
|
||||
private fun setUpViewHierarchy() {
|
||||
binding = ViewFakeChatBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
binding.root.disableClipping()
|
||||
isVerticalScrollBarEnabled = false
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Animation
|
||||
fun startAnimating() {
|
||||
listOf( binding.bubble1, binding.bubble2, binding.bubble3, binding.bubble4, binding.bubble5 ).forEach { it.alpha = 0.0f }
|
||||
fun show(bubble: View) {
|
||||
val animation = ValueAnimator.ofObject(FloatEvaluator(), 0.0f, 1.0f)
|
||||
animation.duration = animationDuration
|
||||
animation.addUpdateListener { animator ->
|
||||
bubble.alpha = animator.animatedValue as Float
|
||||
}
|
||||
animation.start()
|
||||
}
|
||||
Handler().postDelayed({
|
||||
show(binding.bubble1)
|
||||
Handler().postDelayed({
|
||||
show(binding.bubble2)
|
||||
Handler().postDelayed({
|
||||
show(binding.bubble3)
|
||||
smoothScrollTo(0, (binding.bubble1.height + spacing).toInt())
|
||||
Handler().postDelayed({
|
||||
show(binding.bubble4)
|
||||
smoothScrollTo(0, (binding.bubble1.height + spacing).toInt() + (binding.bubble2.height + spacing).toInt())
|
||||
Handler().postDelayed({
|
||||
show(binding.bubble5)
|
||||
smoothScrollTo(0, (binding.bubble1.height + spacing).toInt() + (binding.bubble2.height + spacing).toInt() + (binding.bubble3.height + spacing).toInt())
|
||||
}, delayBetweenMessages)
|
||||
}, delayBetweenMessages)
|
||||
}, delayBetweenMessages)
|
||||
}, delayBetweenMessages)
|
||||
}, startDelay)
|
||||
}
|
||||
// endregion
|
||||
}
|
@ -1,9 +1,9 @@
|
||||
<vector android:height="24dp" android:viewportHeight="448.40668"
|
||||
android:viewportWidth="404.08533" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<group>
|
||||
<clip-path android:pathData="M0,0L404.085,0L404.085,448.407L0,448.407Z M 0,0"/>
|
||||
<path android:fillAlpha="1" android:fillColor="#00f782"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="m288.607,420.376l-196.335,-0c-33.576,-0 -62.508,-25.748 -64.164,-59.281 -1.771,-35.847 26.883,-65.576 62.353,-65.576l113.072,-0c6.919,-0 12.527,-5.608 12.527,-12.525l0,-92.305L327.307,252.333C356.723,268.633 375.241,299.335 376.027,332.848 377.161,380.975 336.746,420.376 288.607,420.376m-211.829,-224.303c-29.416,-16.3 -47.933,-47.001 -48.721,-80.515 -1.132,-48.127 39.283,-87.528 87.42,-87.528L311.811,28.031c33.576,-0 62.508,25.748 64.165,59.283 1.771,35.845 -26.883,65.575 -62.352,65.575 0,-0 -81.316,0.013 -113.077,0.019 -6.915,0.001 -12.499,5.608 -12.501,12.523l-0.021,92.289zM340.891,227.816 L256.254,180.919l57.371,-0c49.877,-0 90.46,-40.579 90.46,-90.457 0,-49.877 -40.583,-90.461 -90.46,-90.461l-200.299,-0c-62.485,-0 -113.327,50.841 -113.327,113.327 0,44.567 24.216,85.664 63.195,107.265l84.636,46.896l-57.368,-0c-49.88,-0 -90.463,40.58 -90.463,90.457 0,49.877 40.583,90.461 90.463,90.461L290.758,448.407c62.488,-0 113.327,-50.84 113.327,-113.327 0,-44.567 -24.216,-85.664 -63.193,-107.264" android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="31dp"
|
||||
android:height="35dp"
|
||||
android:viewportWidth="31"
|
||||
android:viewportHeight="35">
|
||||
<path
|
||||
android:pathData="M26.165,17.975L19.689,14.419H24.078C25.914,14.419 27.674,13.697 28.973,12.41C30.271,11.124 31,9.379 31,7.56C31,5.741 30.271,3.996 28.973,2.71C27.674,1.424 25.914,0.701 24.078,0.701L8.752,0.701C6.453,0.704 4.249,1.61 2.623,3.221C0.998,4.832 0.083,7.016 0.081,9.294C0.081,10.954 0.531,12.584 1.382,14.014C2.233,15.444 3.455,16.623 4.92,17.427L11.398,20.983H7.002C6.087,20.973 5.178,21.142 4.329,21.482C3.48,21.822 2.707,22.326 2.056,22.964C1.405,23.602 0.888,24.361 0.535,25.199C0.182,26.036 0,26.935 0,27.842C0,28.75 0.182,29.648 0.535,30.485C0.888,31.323 1.405,32.082 2.056,32.72C2.707,33.358 3.48,33.862 4.329,34.202C5.178,34.542 6.087,34.711 7.002,34.701H22.329C24.628,34.698 26.832,33.792 28.458,32.181C30.083,30.57 30.997,28.386 31,26.108C31,24.448 30.551,22.819 29.701,21.388C28.851,19.958 27.63,18.78 26.165,17.975ZM5.955,15.568C4.851,14.961 3.925,14.078 3.271,13.007C2.618,11.936 2.258,10.714 2.228,9.463C2.141,5.814 5.233,2.826 8.917,2.826H23.94C26.509,2.826 28.722,4.775 28.85,7.322C28.882,7.963 28.782,8.603 28.556,9.204C28.331,9.806 27.985,10.356 27.539,10.82C27.092,11.285 26.556,11.655 25.961,11.909C25.366,12.162 24.726,12.293 24.078,12.293H15.427C15.173,12.295 14.93,12.395 14.751,12.574C14.573,12.752 14.473,12.993 14.473,13.245V20.242L5.955,15.568ZM22.164,32.576H7.141C4.572,32.576 2.358,30.627 2.232,28.081C2.2,27.44 2.299,26.8 2.525,26.198C2.75,25.597 3.096,25.047 3.542,24.582C3.988,24.117 4.525,23.747 5.12,23.494C5.715,23.24 6.355,23.109 7.002,23.109H15.655C15.781,23.109 15.906,23.084 16.022,23.036C16.138,22.989 16.244,22.919 16.333,22.83C16.422,22.742 16.492,22.637 16.54,22.522C16.588,22.407 16.613,22.283 16.613,22.158V15.16L25.125,19.834C26.231,20.441 27.157,21.324 27.811,22.396C28.465,23.469 28.824,24.691 28.854,25.944C28.941,29.588 25.848,32.576 22.164,32.576Z"
|
||||
android:fillColor="#31F196"/>
|
||||
</vector>
|
||||
|
@ -1,67 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:textSize="@dimen/very_large_font_size"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/activity_landing_title_2" />
|
||||
|
||||
<org.thoughtcrime.securesms.onboarding.FakeChatView
|
||||
android:id="@+id/fakeChatView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/fake_chat_view_height"
|
||||
android:layout_marginTop="@dimen/medium_spacing" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.ProminentFilled"
|
||||
android:contentDescription="@string/AccessibilityId_create_session_id"
|
||||
android:id="@+id/registerButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:text="@string/activity_landing_register_button_title" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.ProminentOutline"
|
||||
android:id="@+id/restoreButton"
|
||||
android:contentDescription="@string/AccessibilityId_restore_your_session"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:text="@string/activity_landing_restore_button_title" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.Borderless"
|
||||
android:id="@+id/linkButton"
|
||||
android:contentDescription="@string/AccessibilityId_link_a_device"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/onboarding_button_bottom_offset"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:gravity="center"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="@dimen/medium_font_size"
|
||||
android:text="@string/activity_link_device_link_device" />
|
||||
|
||||
</LinearLayout>
|
@ -1,66 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:textSize="@dimen/large_font_size"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/activity_landing_title_2" />
|
||||
|
||||
<org.thoughtcrime.securesms.onboarding.FakeChatView
|
||||
android:id="@+id/fakeChatView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/fake_chat_view_height"
|
||||
android:layout_marginTop="@dimen/small_spacing" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.ProminentFilled"
|
||||
android:contentDescription="@string/AccessibilityId_create_session_id"
|
||||
android:id="@+id/registerButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:text="@string/activity_landing_register_button_title" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.ProminentOutline"
|
||||
android:contentDescription="@string/AccessibilityId_restore_your_session"
|
||||
android:id="@+id/restoreButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginTop="@dimen/small_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:text="@string/activity_landing_restore_button_title" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.Session.Button.Common.Borderless"
|
||||
android:contentDescription="@string/AccessibilityId_link_a_device"
|
||||
android:id="@+id/linkButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/onboarding_button_bottom_offset"
|
||||
android:layout_marginHorizontal="@dimen/massive_spacing"
|
||||
android:gravity="center"
|
||||
android:textAllCaps="false"
|
||||
android:textSize="@dimen/medium_font_size"
|
||||
android:text="@string/activity_link_device_link_device" />
|
||||
|
||||
</LinearLayout>
|
@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/very_large_spacing"
|
||||
android:paddingRight="@dimen/very_large_spacing"
|
||||
android:paddingBottom="@dimen/medium_spacing"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/FakeChatViewMessageBubble.Outgoing"
|
||||
android:id="@+id/bubble1"
|
||||
android:layout_width="@dimen/fake_chat_view_bubble_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:text="@string/view_fake_chat_bubble_1"
|
||||
android:layout_gravity="right" />
|
||||
|
||||
<TextView
|
||||
style="@style/FakeChatViewMessageBubble.Incoming"
|
||||
android:id="@+id/bubble2"
|
||||
android:layout_width="@dimen/fake_chat_view_bubble_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:text="@string/view_fake_chat_bubble_2"
|
||||
android:layout_gravity="left" />
|
||||
|
||||
<TextView
|
||||
style="@style/FakeChatViewMessageBubble.Outgoing"
|
||||
android:id="@+id/bubble3"
|
||||
android:layout_width="@dimen/fake_chat_view_bubble_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:text="@string/view_fake_chat_bubble_3"
|
||||
android:layout_gravity="right" />
|
||||
|
||||
<TextView
|
||||
style="@style/FakeChatViewMessageBubble.Incoming"
|
||||
android:id="@+id/bubble4"
|
||||
android:layout_width="@dimen/fake_chat_view_bubble_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:text="@string/view_fake_chat_bubble_4"
|
||||
android:layout_gravity="left" />
|
||||
|
||||
<TextView
|
||||
style="@style/FakeChatViewMessageBubble.Incoming"
|
||||
android:id="@+id/bubble5"
|
||||
android:layout_width="@dimen/fake_chat_view_bubble_width"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/medium_spacing"
|
||||
android:text="@string/view_fake_chat_bubble_5"
|
||||
android:layout_gravity="left" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue