mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Debug
This commit is contained in:
parent
196fc25902
commit
871bafe66d
@ -5,6 +5,7 @@ import android.os.Bundle
|
||||
import android.view.ActionMode
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.loader.app.LoaderManager
|
||||
import androidx.loader.content.Loader
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -13,13 +14,14 @@ import kotlinx.android.synthetic.main.activity_conversation_v2_action_bar.*
|
||||
import kotlinx.android.synthetic.main.view_input_bar.view.*
|
||||
import network.loki.messenger.R
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||
import org.thoughtcrime.securesms.conversation.v2.input_bar.InputBarDelegate
|
||||
import org.thoughtcrime.securesms.conversation.v2.menus.ConversationActionModeCallback
|
||||
import org.thoughtcrime.securesms.conversation.v2.menus.ConversationMenuHelper
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord
|
||||
import org.thoughtcrime.securesms.mms.GlideApp
|
||||
|
||||
class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDelegate {
|
||||
private var threadID: Long = -1
|
||||
private var actionMode: ActionMode? = null
|
||||
|
||||
@ -64,6 +66,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
threadID = intent.getLongExtra(THREAD_ID, -1)
|
||||
setUpRecyclerView()
|
||||
setUpToolBar()
|
||||
inputBar.delegate = this
|
||||
}
|
||||
|
||||
private fun setUpRecyclerView() {
|
||||
@ -103,6 +106,14 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Updating
|
||||
override fun inputBarHeightChanged(newValue: Int) {
|
||||
val recyclerViewLayoutParams = conversationRecyclerView.layoutParams as RelativeLayout.LayoutParams
|
||||
recyclerViewLayoutParams.bottomMargin = newValue
|
||||
conversationRecyclerView.layoutParams = recyclerViewLayoutParams
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Interaction
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
// TODO: Implement
|
||||
|
@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.conversation.v2.input_bar
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RelativeLayout
|
||||
@ -12,6 +13,7 @@ import org.thoughtcrime.securesms.loki.utilities.toDp
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class InputBar : LinearLayout, InputBarEditTextDelegate {
|
||||
var delegate: InputBarDelegate? = null
|
||||
|
||||
private val attachmentsButton by lazy { InputBarButton(context, R.drawable.ic_plus_24) }
|
||||
private val microphoneButton by lazy { InputBarButton(context, R.drawable.ic_microphone) }
|
||||
@ -43,10 +45,17 @@ class InputBar : LinearLayout, InputBarEditTextDelegate {
|
||||
// endregion
|
||||
|
||||
override fun inputBarEditTextHeightChanged(newValue: Int) {
|
||||
val vMargin = resources.getDimension(R.dimen.small_spacing).roundToInt()
|
||||
val layoutParams = this.layoutParams as RelativeLayout.LayoutParams
|
||||
layoutParams.height = newValue + 2 * vMargin
|
||||
this.layoutParams = layoutParams
|
||||
val vMargin = toDp(4, resources)
|
||||
val layoutParams = inputBarLinearLayout.layoutParams as LayoutParams
|
||||
val newHeight = newValue + 2 * vMargin
|
||||
layoutParams.height = newHeight
|
||||
inputBarLinearLayout.layoutParams = layoutParams
|
||||
delegate?.inputBarHeightChanged(newHeight)
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
|
||||
interface InputBarDelegate {
|
||||
|
||||
fun inputBarHeightChanged(newValue: Int)
|
||||
}
|
@ -1,9 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/inputBarLinearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/input_bar_height"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:background="@color/input_bar_background">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
x
Reference in New Issue
Block a user