Create SendTransactionFragment menu, which consists of only an info icon.

This commit is contained in:
Severiano Jaramillo 2019-01-03 11:09:19 -06:00
parent 2643b0af4d
commit bee79976b5
4 changed files with 32 additions and 13 deletions

View file

@ -10,9 +10,7 @@ import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.preference.PreferenceManager import android.preference.PreferenceManager
import android.util.Log import android.util.Log
import android.view.LayoutInflater import android.view.*
import android.view.View
import android.view.ViewGroup
import android.widget.AdapterView import android.widget.AdapterView
import android.widget.Toast import android.widget.Toast
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
@ -108,6 +106,8 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv
private var destinationPublicKey: PublicKey? = null private var destinationPublicKey: PublicKey? = null
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
setHasOptionsMenu(true)
return inflater.inflate(R.layout.fragment_send_transaction, container, false) return inflater.inflate(R.layout.fragment_send_transaction, container, false)
} }
@ -447,6 +447,18 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv
Log.d(TAG, "Network Service is not connected") Log.d(TAG, "Network Service is not connected")
} }
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.menu_send_transaction, menu)
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
if (item?.itemId == R.id.menu_info) {
context?.toast("Info")
return true
}
return super.onOptionsItemSelected(item)
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (isCameraPreviewVisible) if (isCameraPreviewVisible)

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>

View file

@ -0,0 +1,11 @@
<?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/menu_info"
android:icon="@drawable/ic_info"
android:title="@string/title_info"
app:showAsAction="always"/>
</menu>

View file

@ -6,16 +6,6 @@
<string name="button__agree">Agree</string> <string name="button__agree">Agree</string>
<string name="button__disagree">Disagree</string> <string name="button__disagree">Disagree</string>
<!-- Database Load Activity-->
<string name="title__loading_assets">Loading Assets…</string>
<string name="text__performing_requests">Performing a series of requests in order to get the complete list of all
existing assets
</string>
<string name="text__loading_assets">Loaded %1$d assets into the database</string>
<string name="title__assets_loaded">Assets Loaded</string>
<string name="text__assets_loaded">Next, please setup your account…</string>
<string name="button__next">Next</string>
<!-- Import Brainkey Activity --> <!-- Import Brainkey Activity -->
<string name="text_field__6_digit_pin">6+ digits PIN</string> <string name="text_field__6_digit_pin">6+ digits PIN</string>
<string name="error__pin_too_short">PIN too short</string> <string name="error__pin_too_short">PIN too short</string>
@ -50,6 +40,7 @@
<string name="title_export">Export</string> <string name="title_export">Export</string>
<!-- Send Transaction --> <!-- Send Transaction -->
<string name="title_info">Info</string>
<string name="text__to">To</string> <string name="text__to">To</string>
<string name="text__amount">Amount</string> <string name="text__amount">Amount</string>
<string name="text__memo">Memo</string> <string name="text__memo">Memo</string>