mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-03 03:25:39 +00:00
More UI
This commit is contained in:
parent
7b68d63534
commit
4855f694e7
@ -248,8 +248,12 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onMicrophoneButtonUp(event: MotionEvent) {
|
override fun onMicrophoneButtonUp(event: MotionEvent) {
|
||||||
|
if (isValidLockViewLocation(event.rawX.roundToInt(), event.rawY.roundToInt())) {
|
||||||
|
inputBarRecordingView.lock()
|
||||||
|
} else {
|
||||||
resetVoiceMessageUI()
|
resetVoiceMessageUI()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun resetVoiceMessageUI() {
|
private fun resetVoiceMessageUI() {
|
||||||
val chevronImageView = inputBarRecordingView.inputBarChevronImageView
|
val chevronImageView = inputBarRecordingView.inputBarChevronImageView
|
||||||
|
@ -7,12 +7,12 @@ import android.content.Context
|
|||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.RelativeLayout
|
import android.widget.RelativeLayout
|
||||||
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import kotlinx.android.synthetic.main.view_input_bar_recording.view.*
|
import kotlinx.android.synthetic.main.view_input_bar_recording.view.*
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.loki.utilities.animateSizeChange
|
import org.thoughtcrime.securesms.loki.utilities.animateSizeChange
|
||||||
import org.thoughtcrime.securesms.loki.utilities.disableClipping
|
import org.thoughtcrime.securesms.loki.utilities.disableClipping
|
||||||
import org.thoughtcrime.securesms.loki.utilities.toDp
|
|
||||||
import org.thoughtcrime.securesms.loki.utilities.toPx
|
import org.thoughtcrime.securesms.loki.utilities.toPx
|
||||||
|
|
||||||
class InputBarRecordingView : RelativeLayout {
|
class InputBarRecordingView : RelativeLayout {
|
||||||
@ -78,4 +78,21 @@ class InputBarRecordingView : RelativeLayout {
|
|||||||
}
|
}
|
||||||
animation.start()
|
animation.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun lock() {
|
||||||
|
val fadeOutAnimation = ValueAnimator.ofObject(FloatEvaluator(), 1.0f, 0.0f)
|
||||||
|
fadeOutAnimation.duration = 250L
|
||||||
|
fadeOutAnimation.addUpdateListener { animator ->
|
||||||
|
inputBarMiddleContentContainer.alpha = animator.animatedValue as Float
|
||||||
|
lockView.alpha = animator.animatedValue as Float
|
||||||
|
}
|
||||||
|
fadeOutAnimation.start()
|
||||||
|
val fadeInAnimation = ValueAnimator.ofObject(FloatEvaluator(), 0.0f, 1.0f)
|
||||||
|
fadeInAnimation.duration = 250L
|
||||||
|
fadeInAnimation.addUpdateListener { animator ->
|
||||||
|
inputBarCancelButton.alpha = animator.animatedValue as Float
|
||||||
|
}
|
||||||
|
fadeInAnimation.start()
|
||||||
|
recordButtonOverlayImageView.setImageDrawable(ResourcesCompat.getDrawable(resources, R.drawable.ic_arrow_up, context.theme))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,19 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- The cancel button -->
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/inputBarCancelButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:alpha="0"
|
||||||
|
android:text="@string/cancel"
|
||||||
|
android:textSize="@dimen/small_font_size"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<!-- Separator -->
|
<!-- Separator -->
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@ -123,6 +136,7 @@
|
|||||||
android:backgroundTint="@color/destructive" >
|
android:backgroundTint="@color/destructive" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/recordButtonOverlayImageView"
|
||||||
android:layout_width="16dp"
|
android:layout_width="16dp"
|
||||||
android:layout_height="16dp"
|
android:layout_height="16dp"
|
||||||
app:tint="@color/white"
|
app:tint="@color/white"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user