mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
clean
This commit is contained in:
parent
7b8a025947
commit
1d5f7957ab
@ -172,9 +172,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.loki.activities.ChatSettingsActivity"
|
android:name="org.thoughtcrime.securesms.loki.activities.ChatSettingsActivity"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait" />
|
||||||
<activity
|
|
||||||
android:name="org.thoughtcrime.securesms.loki.activities.LinkedDevicesActivity"
|
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
<!-- Session -->
|
<!-- Session -->
|
||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.ShareActivity"
|
android:name="org.thoughtcrime.securesms.ShareActivity"
|
||||||
@ -224,24 +221,6 @@
|
|||||||
android:resource="@mipmap/ic_launcher" />
|
android:resource="@mipmap/ic_launcher" />
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name="org.thoughtcrime.securesms.stickers.StickerPackPreviewActivity"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:noHistory="true"
|
|
||||||
android:theme="@style/Theme.TextSecure.DayNight.NoActionBar"
|
|
||||||
android:windowSoftInputMode="stateHidden">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
|
|
||||||
<data
|
|
||||||
android:host="addstickers"
|
|
||||||
android:scheme="sgnl" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.conversation.ConversationActivity"
|
android:name="org.thoughtcrime.securesms.conversation.ConversationActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
@ -278,23 +257,11 @@
|
|||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar" />
|
android:theme="@style/NoAnimation.Theme.AppCompat.Light.DarkActionBar" />
|
||||||
<activity
|
|
||||||
android:name="org.thoughtcrime.securesms.PassphraseCreateActivity"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
|
||||||
android:label="@string/AndroidManifest__create_passphrase"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:theme="@style/Theme.Session.DayNight.NoActionBar"
|
|
||||||
android:windowSoftInputMode="stateUnchanged" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.PassphrasePromptActivity"
|
android:name="org.thoughtcrime.securesms.PassphrasePromptActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/Theme.Session.DayNight.NoActionBar"/>
|
android:theme="@style/Theme.Session.DayNight.NoActionBar"/>
|
||||||
<activity
|
|
||||||
android:name="org.thoughtcrime.securesms.PushContactSelectionActivity"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
|
||||||
android:label="@string/AndroidManifest__select_contacts"
|
|
||||||
android:windowSoftInputMode="stateHidden" />
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.thoughtcrime.securesms.giph.ui.GiphyActivity"
|
android:name="org.thoughtcrime.securesms.giph.ui.GiphyActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
|
@ -9,6 +9,7 @@ import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import kotlinx.android.synthetic.main.fragment_user_details_bottom_sheet.*
|
import kotlinx.android.synthetic.main.fragment_user_details_bottom_sheet.*
|
||||||
@ -36,6 +37,7 @@ public class UserDetailsBottomSheet : BottomSheetDialogFragment() {
|
|||||||
nameTextViewContainer.setOnClickListener {
|
nameTextViewContainer.setOnClickListener {
|
||||||
nameTextViewContainer.visibility = View.INVISIBLE
|
nameTextViewContainer.visibility = View.INVISIBLE
|
||||||
nameEditContainer.visibility = View.VISIBLE
|
nameEditContainer.visibility = View.VISIBLE
|
||||||
|
nameEditText.text = null
|
||||||
nameEditText.requestFocus()
|
nameEditText.requestFocus()
|
||||||
showSoftKeyboard()
|
showSoftKeyboard()
|
||||||
}
|
}
|
||||||
@ -44,19 +46,18 @@ public class UserDetailsBottomSheet : BottomSheetDialogFragment() {
|
|||||||
hideSoftKeyboard()
|
hideSoftKeyboard()
|
||||||
nameTextViewContainer.visibility = View.VISIBLE
|
nameTextViewContainer.visibility = View.VISIBLE
|
||||||
nameEditContainer.visibility = View.INVISIBLE
|
nameEditContainer.visibility = View.INVISIBLE
|
||||||
nameEditText.text = null
|
|
||||||
}
|
}
|
||||||
btnSaveNickNameEdit.setOnClickListener {
|
btnSaveNickNameEdit.setOnClickListener {
|
||||||
nameEditText.clearFocus()
|
saveNickName(recipient)
|
||||||
hideSoftKeyboard()
|
}
|
||||||
nameTextViewContainer.visibility = View.VISIBLE
|
nameEditText.setOnEditorActionListener { _, actionId, _ ->
|
||||||
nameEditContainer.visibility = View.INVISIBLE
|
when (actionId) {
|
||||||
var newNickName: String? = null
|
EditorInfo.IME_ACTION_DONE -> {
|
||||||
if (!nameEditText.text.isEmpty()) {
|
saveNickName(recipient)
|
||||||
newNickName = nameEditText.text.toString()
|
return@setOnEditorActionListener true
|
||||||
|
}
|
||||||
|
else -> return@setOnEditorActionListener false
|
||||||
}
|
}
|
||||||
SSKEnvironment.shared.profileManager.setDisplayName(requireContext(), recipient, newNickName)
|
|
||||||
nameTextView.text = SSKEnvironment.shared.profileManager.getDisplayName(requireContext(), recipient) ?: "Anonymous"
|
|
||||||
}
|
}
|
||||||
nameTextView.text = SSKEnvironment.shared.profileManager.getDisplayName(requireContext(), recipient) ?: "Anonymous"
|
nameTextView.text = SSKEnvironment.shared.profileManager.getDisplayName(requireContext(), recipient) ?: "Anonymous"
|
||||||
publicKeyTextView.text = publicKey
|
publicKeyTextView.text = publicKey
|
||||||
@ -68,6 +69,19 @@ public class UserDetailsBottomSheet : BottomSheetDialogFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun saveNickName(recipient: Recipient) {
|
||||||
|
nameEditText.clearFocus()
|
||||||
|
hideSoftKeyboard()
|
||||||
|
nameTextViewContainer.visibility = View.VISIBLE
|
||||||
|
nameEditContainer.visibility = View.INVISIBLE
|
||||||
|
var newNickName: String? = null
|
||||||
|
if (!nameEditText.text.isEmpty()) {
|
||||||
|
newNickName = nameEditText.text.toString()
|
||||||
|
}
|
||||||
|
SSKEnvironment.shared.profileManager.setDisplayName(requireContext(), recipient, newNickName)
|
||||||
|
nameTextView.text = SSKEnvironment.shared.profileManager.getDisplayName(requireContext(), recipient) ?: "Anonymous"
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("ServiceCast")
|
@SuppressLint("ServiceCast")
|
||||||
fun showSoftKeyboard() {
|
fun showSoftKeyboard() {
|
||||||
val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
|
val imm = context?.getSystemService(Context.INPUT_METHOD_SERVICE) as? InputMethodManager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user