Skip to content

Commit

Permalink
Add version numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapk00 committed Jan 31, 2019
1 parent b71cec3 commit ec06992
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
versionName "0.0.1-beta"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/adityapk/zcash/zqwandroid/DataModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import java.math.BigInteger


object DataModel {
class MainResponse(val balance: Double, val saplingAddress: String, val tAddress: String, val zecprice: Double, val tokenName: String)
class MainResponse(val balance: Double, val maxspendable:Double , val saplingAddress: String,
val tAddress: String, val zecprice: Double, val tokenName: String, val serverversion: String)
class TransactionItem(val type: String, val datetime: Long, val amount: String, val memo: String?,
val addr: String, val txid: String?, val confirmations: Long)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ class SendActivity : AppCompatActivity() {
showErrorDialog("Invalid amount!")
return@setOnClickListener
}
if (parsedAmt.toDouble() > DataModel.mainResponseData?.maxspendable ?: 0.0) {
showErrorDialog("Can't spend more than ${DataModel.mainResponseData?.maxspendable} in a single Tx")
return@setOnClickListener
}

val memo = txtSendMemo.text.toString()
if (memo.length > 512) {
Expand All @@ -132,6 +136,7 @@ class SendActivity : AppCompatActivity() {
return@setOnClickListener
}


val intent = Intent(this, TxDetailsActivity::class.java)
val tx = DataModel.TransactionItem("confirm", 0, parsedAmt, memo,
toAddr, "", 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ class SettingsActivity : AppCompatActivity() {

fun updateUI() {
txtSettingsConnString.text = DataModel.getConnString(ZQWApp.appContext!!) ?: "Not Connected"

lblVersionName.text = BuildConfig.VERSION_NAME
lblServerVersion.text = DataModel.mainResponseData?.serverversion ?: "Not Connected"
}
}
37 changes: 37 additions & 0 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,42 @@
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:visibility="visible" android:layout_height="2dp"
android:layout_marginTop="8dp"/>
<TextView
android:text="ZecQT Wallet android version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView3" android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/divider" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp" android:textStyle="bold"/>
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/lblVersionName" android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/textView3" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp"/>
<TextView
android:text="zec-qt-wallet server version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView10" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp" android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/lblVersionName" android:textStyle="bold"/>
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/lblServerVersion" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="16dp" android:layout_marginTop="16dp"
app:layout_constraintTop_toBottomOf="@+id/textView10"/>
<View
android:id="@+id/divider2"
android:layout_width="395dp"
android:background="?android:attr/listDivider"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="8dp" android:visibility="visible" android:layout_height="2dp"
app:layout_constraintHorizontal_bias="0.0"
android:layout_marginTop="16dp" app:layout_constraintTop_toBottomOf="@+id/lblServerVersion"/>
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

0 comments on commit ec06992

Please sign in to comment.