gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-android] 02/04: [wallet] move dev mode and TESTKUDOS into p


From: gnunet
Subject: [taler-taler-android] 02/04: [wallet] move dev mode and TESTKUDOS into proper settings screen
Date: Wed, 15 Apr 2020 18:56:03 +0200

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a commit to branch master
in repository taler-android.

commit 8e4f85d467c8e8109026a7195757ce9448ad7b19
Author: Torsten Grote <address@hidden>
AuthorDate: Wed Apr 15 10:25:20 2020 -0300

    [wallet] move dev mode and TESTKUDOS into proper settings screen
---
 wallet/build.gradle                                |   1 +
 .../main/java/net/taler/wallet/BalanceAdapter.kt   |   2 +-
 .../src/main/java/net/taler/wallet/MainActivity.kt |  12 +-
 .../src/main/java/net/taler/wallet/MainFragment.kt |  33 +----
 .../main/java/net/taler/wallet/SettingsFragment.kt | 144 +++++++--------------
 .../src/main/res/drawable/ic_cash_usd_outline.xml  |   1 +
 wallet/src/main/res/drawable/ic_developer_mode.xml |  10 ++
 wallet/src/main/res/layout/fragment_settings.xml   | 104 ---------------
 wallet/src/main/res/menu/balance.xml               |   9 --
 wallet/src/main/res/values/strings.xml             |   6 +-
 wallet/src/main/res/xml/settings_main.xml          |  41 ++++++
 11 files changed, 106 insertions(+), 257 deletions(-)

diff --git a/wallet/build.gradle b/wallet/build.gradle
index 3d51477..0095b27 100644
--- a/wallet/build.gradle
+++ b/wallet/build.gradle
@@ -67,6 +67,7 @@ dependencies {
     implementation project(":taler-kotlin-common")
     implementation 'net.taler:akono:0.1'
 
+    implementation 'androidx.preference:preference:1.1.0'
     implementation 'com.google.android.material:material:1.1.0'
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
 
diff --git a/wallet/src/main/java/net/taler/wallet/BalanceAdapter.kt 
b/wallet/src/main/java/net/taler/wallet/BalanceAdapter.kt
index 96cfb99..b7b2ef0 100644
--- a/wallet/src/main/java/net/taler/wallet/BalanceAdapter.kt
+++ b/wallet/src/main/java/net/taler/wallet/BalanceAdapter.kt
@@ -59,7 +59,7 @@ class BalanceAdapter(private val listener: 
BalanceClickListener) : Adapter<Balan
         private val balanceInboundLabel: TextView = 
v.findViewById(R.id.balanceInboundLabel)
 
         fun bind(item: BalanceItem) {
-            v.setOnClickListener { listener.onBalanceClick() }
+            v.setOnClickListener { 
listener.onBalanceClick(item.available.currency) }
             currencyView.text = item.available.currency
             amountView.text = item.available.amountStr
 
diff --git a/wallet/src/main/java/net/taler/wallet/MainActivity.kt 
b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
index a43cbf2..fa78b16 100644
--- a/wallet/src/main/java/net/taler/wallet/MainActivity.kt
+++ b/wallet/src/main/java/net/taler/wallet/MainActivity.kt
@@ -54,8 +54,7 @@ import 
net.taler.wallet.HostCardEmulatorService.Companion.TRIGGER_PAYMENT_ACTION
 import net.taler.wallet.refund.RefundStatus
 import java.util.Locale.ROOT
 
-class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener,
-    ResetDialogEventListener {
+class MainActivity : AppCompatActivity(), OnNavigationItemSelectedListener {
 
     private val model: MainViewModel by viewModels()
 
@@ -205,13 +204,4 @@ class MainActivity : AppCompatActivity(), 
OnNavigationItemSelectedListener,
         }
     }
 
-    override fun onResetConfirmed() {
-        model.dangerouslyReset()
-        Snackbar.make(nav_view, "Wallet has been reset", LENGTH_SHORT).show()
-    }
-
-    override fun onResetCancelled() {
-        Snackbar.make(nav_view, "Reset cancelled", LENGTH_SHORT).show()
-    }
-
 }
diff --git a/wallet/src/main/java/net/taler/wallet/MainFragment.kt 
b/wallet/src/main/java/net/taler/wallet/MainFragment.kt
index a0eb8ff..f587aca 100644
--- a/wallet/src/main/java/net/taler/wallet/MainFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/MainFragment.kt
@@ -38,15 +38,13 @@ import 
com.google.zxing.integration.android.IntentIntegrator.QR_CODE
 import kotlinx.android.synthetic.main.fragment_show_balance.*
 
 interface BalanceClickListener {
-    fun onBalanceClick()
+    fun onBalanceClick(currency: String)
 }
 
 class MainFragment : Fragment(), BalanceClickListener {
 
     private val model: MainViewModel by activityViewModels()
-    private val withdrawManager by lazy { model.withdrawManager }
 
-    private var reloadBalanceMenuItem: MenuItem? = null
     private val balancesAdapter = BalanceAdapter(this)
 
     override fun onCreate(savedInstanceState: Bundle?) {
@@ -73,20 +71,6 @@ class MainFragment : Fragment(), BalanceClickListener {
             onBalancesChanged(it)
         })
 
-//        model.devMode.observe(viewLifecycleOwner, Observer { enabled ->
-//            delayedTransition()
-//            testWithdrawButton.visibility = if (enabled) VISIBLE else GONE
-//            reloadBalanceMenuItem?.isVisible = enabled
-//        })
-//        testWithdrawButton.setOnClickListener {
-//            withdrawManager.withdrawTestkudos()
-//        }
-//        withdrawManager.testWithdrawalInProgress.observe(viewLifecycleOwner, 
Observer { loading ->
-//            Log.v("taler-wallet", "observing balance loading $loading in 
show balance")
-//            testWithdrawButton.isEnabled = !loading
-//            model.showProgressBar.value = loading
-//        })
-
         mainFab.setOnClickListener {
             onScanButtonClicked()
         }
@@ -99,25 +83,12 @@ class MainFragment : Fragment(), BalanceClickListener {
 
     override fun onOptionsItemSelected(item: MenuItem): Boolean {
         return when (item.itemId) {
-            R.id.reload_balance -> {
-                model.loadBalances()
-                true
-            }
-            R.id.developer_mode -> {
-                item.isChecked = !item.isChecked
-                model.devMode.value = item.isChecked
-                true
-            }
             else -> super.onOptionsItemSelected(item)
         }
     }
 
     override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
         inflater.inflate(R.menu.balance, menu)
-        menu.findItem(R.id.developer_mode).isChecked = model.devMode.value!!
-        reloadBalanceMenuItem = menu.findItem(R.id.reload_balance).apply {
-            isVisible = model.devMode.value!!
-        }
         super.onCreateOptionsMenu(menu, inflater)
     }
 
@@ -145,7 +116,7 @@ class MainFragment : Fragment(), BalanceClickListener {
         beginDelayedTransition(view as ViewGroup)
     }
 
-    override fun onBalanceClick() {
+    override fun onBalanceClick(currency: String) {
         findNavController().navigate(R.id.walletHistory)
     }
 
diff --git a/wallet/src/main/java/net/taler/wallet/SettingsFragment.kt 
b/wallet/src/main/java/net/taler/wallet/SettingsFragment.kt
index 559b162..a38a5a3 100644
--- a/wallet/src/main/java/net/taler/wallet/SettingsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/SettingsFragment.kt
@@ -16,127 +16,73 @@
 
 package net.taler.wallet
 
-import android.app.Dialog
-import android.content.Context
-import android.content.Intent
-import android.content.Intent.ACTION_CREATE_DOCUMENT
-import android.content.Intent.ACTION_OPEN_DOCUMENT
-import android.content.Intent.CATEGORY_OPENABLE
-import android.content.Intent.EXTRA_TITLE
 import android.os.Bundle
-import android.util.Log
-import android.view.LayoutInflater
 import android.view.View
-import android.view.View.GONE
-import android.view.View.VISIBLE
-import android.view.ViewGroup
 import androidx.appcompat.app.AlertDialog
-import androidx.fragment.app.DialogFragment
-import androidx.fragment.app.Fragment
 import androidx.fragment.app.activityViewModels
 import androidx.lifecycle.Observer
-import kotlinx.android.synthetic.main.fragment_settings.*
+import androidx.preference.Preference
+import androidx.preference.PreferenceFragmentCompat
+import androidx.preference.SwitchPreferenceCompat
+import com.google.android.material.snackbar.BaseTransientBottomBar.LENGTH_SHORT
+import com.google.android.material.snackbar.Snackbar
 
 
-interface ResetDialogEventListener {
-    fun onResetConfirmed()
-    fun onResetCancelled()
-}
-
-
-class ResetDialogFragment : DialogFragment() {
-    private lateinit var listener: ResetDialogEventListener
-
-    override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
-        return activity?.let {
-            // Use the Builder class for convenient dialog construction
-            val builder = AlertDialog.Builder(it)
-            builder.setMessage("Do you really want to reset the wallet and 
lose all coins and purchases?  Consider making a backup first.")
-                .setPositiveButton("Reset") { _, _ ->
-                    listener.onResetConfirmed()
-                }
-                .setNegativeButton("Cancel") { _, _ ->
-                    listener.onResetCancelled()
-                }
-            // Create the AlertDialog object and return it
-            builder.create()
-        } ?: throw IllegalStateException("Activity cannot be null")
-    }
-
-    override fun onAttach(context: Context) {
-        super.onAttach(context)
-        // Verify that the host activity implements the callback interface
-        try {
-            // Instantiate the NoticeDialogListener so we can send events to 
the host
-            listener = context as ResetDialogEventListener
-        } catch (e: ClassCastException) {
-            // The activity doesn't implement the interface, throw exception
-            throw ClassCastException(
-                (context.toString() +
-                        " must implement ResetDialogEventListener")
-            )
-        }
-    }
-}
-
-class SettingsFragment : Fragment() {
-
-    companion object {
-        private const val TAG = "taler-wallet"
-        private const val CREATE_FILE = 1
-        private const val PICK_FILE = 2
-    }
+class SettingsFragment : PreferenceFragmentCompat() {
 
     private val model: MainViewModel by activityViewModels()
+    private val withdrawManager by lazy { model.withdrawManager }
+
+    private lateinit var prefDevMode: SwitchPreferenceCompat
+    private lateinit var prefWithdrawTest: Preference
+    private lateinit var prefReset: Preference
 
-    override fun onCreateView(
-        inflater: LayoutInflater, container: ViewGroup?,
-        savedInstanceState: Bundle?
-    ): View? {
-        return inflater.inflate(R.layout.fragment_settings, container, false)
+    override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: 
String?) {
+        setPreferencesFromResource(R.xml.settings_main, rootKey)
+        prefDevMode = findPreference("pref_dev_mode")!!
+        prefWithdrawTest = findPreference("pref_testkudos")!!
+        prefReset = findPreference("pref_reset")!!
     }
 
     override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+        super.onViewCreated(view, savedInstanceState)
+
         model.devMode.observe(viewLifecycleOwner, Observer { enabled ->
-            val visibility = if (enabled) VISIBLE else GONE
-            devSettingsTitle.visibility = visibility
-            button_reset_wallet_dangerously.visibility = visibility
+            prefDevMode.isChecked = enabled
+            prefWithdrawTest.isVisible = enabled
+            prefReset.isVisible = enabled
         })
-
-        textView4.text = BuildConfig.VERSION_NAME
-        button_reset_wallet_dangerously.setOnClickListener {
-            val d = ResetDialogFragment()
-            d.show(parentFragmentManager, "walletResetDialog")
+        prefDevMode.setOnPreferenceChangeListener { _, newValue ->
+            model.devMode.value = newValue as Boolean
+            true
         }
-        button_backup_export.setOnClickListener {
-            val intent = Intent(ACTION_CREATE_DOCUMENT).apply {
-                addCategory(CATEGORY_OPENABLE)
-                type = "application/json"
-                putExtra(EXTRA_TITLE, "taler-wallet-backup.json")
 
-                // Optionally, specify a URI for the directory that should be 
opened in
-                // the system file picker before your app creates the document.
-                //putExtra(DocumentsContract.EXTRA_INITIAL_URI, 
pickerInitialUri)
-            }
-            startActivityForResult(intent, CREATE_FILE)
+        withdrawManager.testWithdrawalInProgress.observe(viewLifecycleOwner, 
Observer { loading ->
+            prefWithdrawTest.isEnabled = !loading
+            model.showProgressBar.value = loading
+        })
+        prefWithdrawTest.setOnPreferenceClickListener {
+            withdrawManager.withdrawTestkudos()
+            true
         }
-        button_backup_import.setOnClickListener {
-            val intent = Intent(ACTION_OPEN_DOCUMENT).apply {
-                addCategory(CATEGORY_OPENABLE)
-                type = "application/json"
 
-                //putExtra(DocumentsContract.EXTRA_INITIAL_URI, 
pickerInitialUri)
-            }
-            startActivityForResult(intent, PICK_FILE)
+        prefReset.setOnPreferenceClickListener {
+            showResetDialog()
+            true
         }
     }
 
-    override fun onActivityResult(requestCode: Int, resultCode: Int, data: 
Intent?) {
-        if (data == null) return
-        when (requestCode) {
-            CREATE_FILE -> Log.i(TAG, "got createFile result with URL 
${data.data}")
-            PICK_FILE -> Log.i(TAG, "got pickFile result with URL 
${data.data}")
-        }
+    private fun showResetDialog() {
+        AlertDialog.Builder(requireContext())
+            .setMessage("Do you really want to reset the wallet and lose all 
coins and purchases?")
+            .setPositiveButton("Reset") { _, _ ->
+                model.dangerouslyReset()
+                Snackbar.make(view!!, "Wallet has been reset", 
LENGTH_SHORT).show()
+            }
+            .setNegativeButton("Cancel") { _, _ ->
+                Snackbar.make(view!!, "Reset cancelled", LENGTH_SHORT).show()
+            }
+            .show()
     }
 
 }
diff --git a/wallet/src/main/res/drawable/ic_cash_usd_outline.xml 
b/wallet/src/main/res/drawable/ic_cash_usd_outline.xml
index 0e26eef..aa5b85f 100644
--- a/wallet/src/main/res/drawable/ic_cash_usd_outline.xml
+++ b/wallet/src/main/res/drawable/ic_cash_usd_outline.xml
@@ -17,6 +17,7 @@
 <vector xmlns:android="http://schemas.android.com/apk/res/android";
     android:width="24dp"
     android:height="24dp"
+    android:tint="?attr/colorControlNormal"
     android:viewportWidth="24"
     android:viewportHeight="24">
     <path
diff --git a/wallet/src/main/res/drawable/ic_developer_mode.xml 
b/wallet/src/main/res/drawable/ic_developer_mode.xml
new file mode 100644
index 0000000..c401182
--- /dev/null
+++ b/wallet/src/main/res/drawable/ic_developer_mode.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android";
+    android:width="24dp"
+    android:height="24dp"
+    android:tint="?attr/colorControlNormal"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M7,5h10v2h2L19,3c0,-1.1 -0.9,-1.99 
-2,-1.99L7,1c-1.1,0 -2,0.9 -2,2v4h2L7,5zM15.41,16.59L20,12l-4.59,-4.59L14,8.83 
17.17,12 14,15.17l1.41,1.42zM10,15.17L6.83,12 10,8.83 8.59,7.41 
4,12l4.59,4.59L10,15.17zM17,19L7,19v-2L5,17v4c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 
2,-2v-4h-2v2z" />
+</vector>
diff --git a/wallet/src/main/res/layout/fragment_settings.xml 
b/wallet/src/main/res/layout/fragment_settings.xml
deleted file mode 100644
index 27c5f57..0000000
--- a/wallet/src/main/res/layout/fragment_settings.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-  ~ This file is part of GNU Taler
-  ~ (C) 2020 Taler Systems S.A.
-  ~
-  ~ GNU Taler is free software; you can redistribute it and/or modify it under 
the
-  ~ terms of the GNU General Public License as published by the Free Software
-  ~ Foundation; either version 3, or (at your option) any later version.
-  ~
-  ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT 
ANY
-  ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
-  ~ A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-  ~
-  ~ You should have received a copy of the GNU General Public License along 
with
-  ~ GNU Taler; see the file COPYING.  If not, see 
<http://www.gnu.org/licenses/>
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
-    xmlns:tools="http://schemas.android.com/tools";
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:layout_margin="10dp"
-    android:orientation="vertical"
-    tools:context=".SettingsFragment">
-
-
-    <TextView
-        android:id="@+id/editText2"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="@string/settings_version"
-        android:textSize="18sp" />
-
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal">
-
-        <TextView
-            android:id="@+id/textView5"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:text="@string/app_name" />
-
-        <TextView
-            android:id="@+id/textView4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            tools:text="0.6.0pre8" />
-
-    </LinearLayout>
-
-    <Space
-        android:layout_width="0dp"
-        android:layout_height="15dp" />
-
-    <TextView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="@string/settings_backups"
-        android:textSize="18sp"
-        android:visibility="gone" />
-
-    <Button
-        android:id="@+id/button_backup_export"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/settings_export_to_file"
-        android:visibility="gone" />
-
-    <Button
-        android:id="@+id/button_backup_import"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/settings_import_from_file"
-        android:visibility="gone" />
-
-
-    <TextView
-        android:id="@+id/devSettingsTitle"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:ems="10"
-        android:text="@string/settings_developer"
-        android:textSize="18sp" />
-
-    <!--
-    <Button
-            android:text="Withdraw TESTKUDOS"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:id="@+id/button_withdraw_testkudos"/>-->
-
-    <Button
-        android:id="@+id/button_reset_wallet_dangerously"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="@string/settings_reset" />
-
-</LinearLayout>
diff --git a/wallet/src/main/res/menu/balance.xml 
b/wallet/src/main/res/menu/balance.xml
index 1685526..d4568d4 100644
--- a/wallet/src/main/res/menu/balance.xml
+++ b/wallet/src/main/res/menu/balance.xml
@@ -16,13 +16,4 @@
 
 <menu xmlns:android="http://schemas.android.com/apk/res/android";
     xmlns:app="http://schemas.android.com/apk/res-auto";>
-    <item
-        android:id="@+id/reload_balance"
-        android:title="@string/menu_balance_reload"
-        app:showAsAction="never" />
-    <item
-        android:id="@+id/developer_mode"
-        android:checkable="true"
-        android:title="@string/menu_developer_mode"
-        app:showAsAction="never" />
 </menu>
diff --git a/wallet/src/main/res/values/strings.xml 
b/wallet/src/main/res/values/strings.xml
index 357aedc..8eec297 100644
--- a/wallet/src/main/res/values/strings.xml
+++ b/wallet/src/main/res/values/strings.xml
@@ -97,7 +97,6 @@
     <string name="withdraw_total">Withdraw</string>
     <string name="withdraw_fees">Fee</string>
     <string name="withdraw_exchange">Exchange</string>
-    <string name="withdraw_button_testkudos">Withdraw TESTKUDOS</string>
     <string name="withdraw_button_confirm">Confirm Withdraw</string>
     <string name="withdraw_button_tos">Review Terms</string>
     <string name="withdraw_error_title">Withdrawal Error</string>
@@ -129,8 +128,11 @@
     <string name="settings_backups">Backups</string>
     <string name="settings_export_to_file">Export wallet to file</string>
     <string name="settings_import_from_file">Import from file</string>
-    <string name="settings_developer">Developer Settings (use with 
caution!)</string>
+    <string name="settings_withdraw_testkudos">Withdraw TESTKUDOS</string>
+    <string name="settings_withdraw_testkudos_summary">Get money for 
testing</string>
     <string name="settings_reset">Reset Wallet (dangerous!)</string>
+    <string name="settings_reset_summary">Throws away your money</string>
+    <string name="settings_dev_mode_summary">Shows more information intended 
for debugging</string>
 
     <string name="refund_error">Error processing refund</string>
     <string name="refund_success">Refund received</string>
diff --git a/wallet/src/main/res/xml/settings_main.xml 
b/wallet/src/main/res/xml/settings_main.xml
new file mode 100644
index 0000000..90f5f6c
--- /dev/null
+++ b/wallet/src/main/res/xml/settings_main.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ This file is part of GNU Taler
+  ~ (C) 2020 Taler Systems S.A.
+  ~
+  ~ GNU Taler is free software; you can redistribute it and/or modify it under 
the
+  ~ terms of the GNU General Public License as published by the Free Software
+  ~ Foundation; either version 3, or (at your option) any later version.
+  ~
+  ~ GNU Taler is distributed in the hope that it will be useful, but WITHOUT 
ANY
+  ~ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+  ~ A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License along 
with
+  ~ GNU Taler; see the file COPYING.  If not, see 
<http://www.gnu.org/licenses/>
+  -->
+
+<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto";
+    xmlns:tools="http://schemas.android.com/tools";>
+
+    <SwitchPreferenceCompat
+        app:icon="@drawable/ic_developer_mode"
+        app:key="pref_dev_mode"
+        app:summary="@string/settings_dev_mode_summary"
+        app:title="@string/menu_developer_mode" />
+
+    <Preference
+        app:icon="@drawable/ic_cash_usd_outline"
+        app:isPreferenceVisible="false"
+        app:key="pref_testkudos"
+        app:summary="@string/settings_withdraw_testkudos_summary"
+        app:title="@string/settings_withdraw_testkudos"
+        tools:isPreferenceVisible="true" />
+
+    <Preference
+        app:isPreferenceVisible="false"
+        app:key="pref_reset"
+        app:summary="@string/settings_reset_summary"
+        app:title="@string/settings_reset"
+        tools:isPreferenceVisible="true" />
+
+</PreferenceScreen>

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]