|
|
|
@ -6,10 +6,7 @@ import android.content.res.Resources
|
|
|
|
|
import android.database.Cursor
|
|
|
|
|
import android.graphics.Rect
|
|
|
|
|
import android.os.Bundle
|
|
|
|
|
import android.view.ActionMode
|
|
|
|
|
import android.view.Menu
|
|
|
|
|
import android.view.MenuItem
|
|
|
|
|
import android.view.MotionEvent
|
|
|
|
|
import android.view.*
|
|
|
|
|
import android.widget.RelativeLayout
|
|
|
|
|
import androidx.loader.app.LoaderManager
|
|
|
|
|
import androidx.loader.content.Loader
|
|
|
|
@ -17,6 +14,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_conversation_v2.*
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_conversation_v2.view.*
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_conversation_v2_action_bar.*
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_home.*
|
|
|
|
|
import kotlinx.android.synthetic.main.view_input_bar.view.*
|
|
|
|
|
import kotlinx.android.synthetic.main.view_input_bar_recording.*
|
|
|
|
|
import kotlinx.android.synthetic.main.view_input_bar_recording.view.*
|
|
|
|
@ -98,6 +96,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
setUpToolBar()
|
|
|
|
|
setUpInputBar()
|
|
|
|
|
restoreDraftIfNeeded()
|
|
|
|
|
addOpenGroupGuidelinesIfNeeded()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onResume() {
|
|
|
|
@ -165,6 +164,17 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
|
|
|
|
inputBar.text = text
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun addOpenGroupGuidelinesIfNeeded() {
|
|
|
|
|
val openGroup = DatabaseFactory.getLokiThreadDatabase(this).getOpenGroupChat(threadID) ?: return
|
|
|
|
|
val isOxenHostedOpenGroup = openGroup.room == "session" || openGroup.room == "oxen"
|
|
|
|
|
|| openGroup.room == "lokinet" || openGroup.room == "crypto"
|
|
|
|
|
if (!isOxenHostedOpenGroup) { return }
|
|
|
|
|
openGroupGuidelinesView.visibility = View.VISIBLE
|
|
|
|
|
val recyclerViewLayoutParams = conversationRecyclerView.layoutParams as RelativeLayout.LayoutParams
|
|
|
|
|
recyclerViewLayoutParams.topMargin = toPx(57, resources)
|
|
|
|
|
conversationRecyclerView.layoutParams = recyclerViewLayoutParams
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun onPrepareOptionsMenu(menu: Menu): Boolean {
|
|
|
|
|
ConversationMenuHelper.onPrepareOptionsMenu(menu, menuInflater, thread, this) { onOptionsItemSelected(it) }
|
|
|
|
|
super.onPrepareOptionsMenu(menu)
|
|
|
|
|