Browse Source

Added CAD symbol; List sort as alphabet; Selected Currency now shown as default in list

chat
N1CK145 5 years ago
parent
commit
4cc0c2066a
  1. 1
      app/src/main/java/org/myhush/silentdragon/ConnectionManager.kt
  2. 6
      app/src/main/java/org/myhush/silentdragon/DataModel.kt
  3. 10
      app/src/main/java/org/myhush/silentdragon/SettingsActivity.kt

1
app/src/main/java/org/myhush/silentdragon/ConnectionManager.kt

@ -120,6 +120,7 @@ object ConnectionManager {
DataModel.currencySymbols["SGD"] = "$"
DataModel.currencySymbols["GBP"] = "£"
DataModel.currencySymbols["AUD"] = "$"
DataModel.currencySymbols["CAD"] = "$"
Thread {
val client = OkHttpClient()

6
app/src/main/java/org/myhush/silentdragon/DataModel.kt

@ -23,9 +23,9 @@ object DataModel {
var transactions : List<TransactionItem>? = null
val fee: Double = 0.0001
var currencyValues: HashMap<String, Double?> = HashMap()
var currencySymbols: HashMap<String, String> = HashMap()
var selectedCurrency: String = ""
val currencyValues: HashMap<String, Double?> = HashMap()
val currencySymbols: HashMap<String, String> = HashMap()
var selectedCurrency = ""
fun isTestnet(): Boolean {
return mainResponseData?.tokenName != "HUSH"

10
app/src/main/java/org/myhush/silentdragon/SettingsActivity.kt

@ -59,11 +59,21 @@ class SettingsActivity : AppCompatActivity() {
private fun fillSpinner(){
val items = DataModel.currencyValues.keys.toMutableList()
var selectedIndex = 0
items.sort()
for (i in items){
if(i == DataModel.selectedCurrency)
break
selectedIndex++
}
var adapter: ArrayAdapter<String> = ArrayAdapter(this, android.R.layout.simple_spinner_item, items)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_item)
spinnerCurrency.adapter = adapter
spinnerCurrency.setSelection(selectedIndex)
}
fun updateUI() {

Loading…
Cancel
Save