mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Ditch rebuild path button
This commit is contained in:
parent
1217e5278f
commit
6cb6714893
@ -45,10 +45,10 @@
|
||||
|
||||
<Button
|
||||
style="@style/MediumProminentOutlineButton"
|
||||
android:id="@+id/rebuildPathButton"
|
||||
android:id="@+id/learnMoreButton"
|
||||
android:layout_width="196dp"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:text="@string/activity_path_rebuild_path_button_title" />
|
||||
android:text="@string/activity_path_learn_more_button_title" />
|
||||
|
||||
</LinearLayout>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/learnMoreButton"
|
||||
android:icon="@drawable/ic_question_mark"
|
||||
app:showAsAction="always" />
|
||||
|
||||
</menu>
|
@ -1747,7 +1747,7 @@
|
||||
<string name="activity_path_guard_node_row_title">Guard Node</string>
|
||||
<string name="activity_path_service_node_row_title">Service Node</string>
|
||||
<string name="activity_path_destination_row_title">Destination</string>
|
||||
<string name="activity_path_rebuild_path_button_title">Rebuild Path</string>
|
||||
<string name="activity_path_learn_more_button_title">Learn More</string>
|
||||
|
||||
<string name="activity_create_private_chat_title">New Session</string>
|
||||
<string name="activity_create_private_chat_enter_session_id_tab_title">Enter Session ID</string>
|
||||
|
@ -11,8 +11,6 @@ import android.support.v4.content.LocalBroadcastManager
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.RelativeLayout
|
||||
@ -21,7 +19,6 @@ import android.widget.Toast
|
||||
import kotlinx.android.synthetic.main.activity_path.*
|
||||
import network.loki.messenger.R
|
||||
import org.thoughtcrime.securesms.PassphraseRequiredActionBarActivity
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||
import org.thoughtcrime.securesms.loki.utilities.*
|
||||
import org.whispersystems.signalservice.loki.api.Snode
|
||||
import org.whispersystems.signalservice.loki.api.onionrequests.OnionRequestAPI
|
||||
@ -34,7 +31,7 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
|
||||
super.onCreate(savedInstanceState, isReady)
|
||||
setContentView(R.layout.activity_path)
|
||||
supportActionBar!!.title = resources.getString(R.string.activity_path_title)
|
||||
rebuildPathButton.setOnClickListener { rebuildPath() }
|
||||
learnMoreButton.setOnClickListener { learnMore() }
|
||||
update(false)
|
||||
registerObservers()
|
||||
}
|
||||
@ -58,11 +55,6 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(pathsBuiltReceiver, IntentFilter("pathsBuilt"))
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_path, menu)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
for (receiver in broadcastReceivers) {
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(receiver)
|
||||
@ -145,15 +137,6 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
|
||||
// endregion
|
||||
|
||||
// region Interaction
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
val id = item.itemId
|
||||
when(id) {
|
||||
R.id.learnMoreButton -> learnMore()
|
||||
else -> { /* Do nothing */ }
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
private fun learnMore() {
|
||||
try {
|
||||
val url = "https://getsession.org/faq/#onion-routing"
|
||||
@ -163,13 +146,6 @@ class PathActivity : PassphraseRequiredActionBarActivity() {
|
||||
Toast.makeText(this, R.string.invalid_url, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun rebuildPath() {
|
||||
DatabaseFactory.getLokiAPIDatabase(this).clearOnionRequestPaths()
|
||||
OnionRequestAPI.guardSnodes = setOf()
|
||||
OnionRequestAPI.paths = listOf()
|
||||
OnionRequestAPI.buildPaths()
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Line View
|
||||
|
Loading…
x
Reference in New Issue
Block a user