Updated the Material Components library to 1.1.0-alpha04 and fixed some issues presented because of the migration.

This commit is contained in:
Severiano Jaramillo 2019-03-19 18:05:08 -06:00
parent 8ba40899cf
commit 25bab08b5e
9 changed files with 30 additions and 20 deletions

View file

@ -72,7 +72,7 @@ dependencies {
// Google // Google
implementation 'com.google.zxing:core:3.3.1' implementation 'com.google.zxing:core:3.3.1'
implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'com.google.android.gms:play-services-maps:16.1.0' implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.maps.android:android-maps-utils:0.5' implementation 'com.google.maps.android:android-maps-utils:0.5'
// AAC Lifecycle // AAC Lifecycle
@ -103,6 +103,7 @@ dependencies {
implementation 'com.itextpdf:itextpdf:5.5.13' implementation 'com.itextpdf:itextpdf:5.5.13'
implementation 'com.opencsv:opencsv:3.7' implementation 'com.opencsv:opencsv:3.7'
// Others // Others
api 'com.google.guava:guava:27.0.1-android'
implementation 'org.bitcoinj:bitcoinj-core:0.14.3' implementation 'org.bitcoinj:bitcoinj-core:0.14.3'
implementation 'com.moldedbits.r2d2:r2d2:1.0.1' implementation 'com.moldedbits.r2d2:r2d2:1.0.1'
implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'me.dm7.barcodescanner:zxing:1.9.8'
@ -121,3 +122,15 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'com.jraska.livedata:testing-ktx:1.0.0' androidTestImplementation 'com.jraska.livedata:testing-ktx:1.0.0'
} }
// Added to avoid the compilation problem due to a duplicate ListenableFuture library
afterEvaluate {
configurations.all {
def group = 'com.google.guava', name = 'guava', version = '27.0.1-android'
resolutionStrategy.eachDependency { details ->
if (requested.group == group && requested.name == name) {
details.useTarget group: details.requested.group, name: name, version: version
}
}
}
}

View file

@ -173,7 +173,7 @@ abstract class BaseSecurityLockDialog : DialogFragment() {
super.onResume() super.onResume()
// Force dialog fragment to use the full width of the screen // Force dialog fragment to use the full width of the screen
val dialogWindow = dialog.window val dialogWindow = dialog?.window
dialogWindow?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) dialogWindow?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
} }

View file

@ -127,8 +127,8 @@ class EReceiptFragment : Fragment() {
inflater.inflate(R.menu.menu_e_receipt, menu) inflater.inflate(R.menu.menu_e_receipt, menu)
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item?.itemId == R.id.menu_share) { if (item.itemId == R.id.menu_share) {
verifyStoragePermission() verifyStoragePermission()
return true return true
} }

View file

@ -314,8 +314,8 @@ class MerchantsFragment : Fragment(), OnMapReadyCallback, SearchView.OnSuggestio
return true return true
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item?.itemId == R.id.menu_filter) { if (item.itemId == R.id.menu_filter) {
// Try to show or dismiss the custom popup window with the merchants and tellers switches // Try to show or dismiss the custom popup window with the merchants and tellers switches
if (mPopupWindow?.isShowing == false) { if (mPopupWindow?.isShowing == false) {
mPopupWindow?.showAsDropDown(toolbar, screenWidth, 8) mPopupWindow?.showAsDropDown(toolbar, screenWidth, 8)

View file

@ -39,7 +39,7 @@ class PINSecurityLockDialog : BaseSecurityLockDialog() {
// Request focus to the PIN EditText and automatically show the keyboard when the dialog appears. // Request focus to the PIN EditText and automatically show the keyboard when the dialog appears.
tietPIN.requestFocus() tietPIN.requestFocus()
dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
setupScreen() setupScreen()

View file

@ -364,8 +364,8 @@ class ReceiveTransactionFragment : ConnectedFragment() {
inflater.inflate(R.menu.menu_receive_transaction, menu) inflater.inflate(R.menu.menu_receive_transaction, menu)
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item?.itemId == R.id.menu_share) { if (item.itemId == R.id.menu_share) {
verifyStoragePermission() verifyStoragePermission()
return true return true
} }

View file

@ -574,8 +574,8 @@ class SendTransactionFragment : ConnectedFragment(), ZXingScannerView.ResultHand
inflater.inflate(R.menu.menu_send_transaction, menu) inflater.inflate(R.menu.menu_send_transaction, menu)
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
if (item?.itemId == R.id.menu_info) { if (item.itemId == R.id.menu_info) {
MaterialDialog(context!!).show { MaterialDialog(context!!).show {
customView(R.layout.dialog_send_transaction_info, scrollable = true) customView(R.layout.dialog_send_transaction_info, scrollable = true)
positiveButton(android.R.string.ok) { dismiss() } positiveButton(android.R.string.ok) { dismiss() }

View file

@ -121,8 +121,8 @@ class TransactionsFragment : Fragment(), FilterOptionsDialog.OnFilterOptionsSele
searchView.maxWidth = getScreenWidth(activity) * 3 / 5 searchView.maxWidth = getScreenWidth(activity) * 3 / 5
} }
override fun onOptionsItemSelected(item: MenuItem?): Boolean { override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item?.itemId) { return when (item.itemId) {
R.id.menu_filter -> { R.id.menu_filter -> {
val filterOptionsDialog = FilterOptionsDialog.newInstance( val filterOptionsDialog = FilterOptionsDialog.newInstance(
filterTransactionsDirection, filterDateRangeAll, filterStartDate * 1000, filterTransactionsDirection, filterDateRangeAll, filterStartDate * 1000,

View file

@ -31,7 +31,6 @@
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabReceiveTransaction" android:id="@+id/fabReceiveTransaction"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:fabSize="auto" app:fabSize="auto"
@ -39,8 +38,8 @@
app:maxImageSize="70dp" app:maxImageSize="70dp"
app:elevation="@dimen/fab_elevation" app:elevation="@dimen/fab_elevation"
app:borderWidth="0dp" app:borderWidth="0dp"
app:srcCompat="@drawable/ic_receive"
android:backgroundTint="@color/colorReceive" android:backgroundTint="@color/colorReceive"
android:src="@drawable/ic_receive"
app:layout_constraintHorizontal_bias="0.6" app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -64,7 +63,6 @@
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabSendTransaction" android:id="@+id/fabSendTransaction"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:fabSize="auto" app:fabSize="auto"
@ -72,8 +70,8 @@
app:maxImageSize="70dp" app:maxImageSize="70dp"
app:elevation="@dimen/fab_elevation" app:elevation="@dimen/fab_elevation"
app:borderWidth="0dp" app:borderWidth="0dp"
app:srcCompat="@drawable/ic_send"
android:backgroundTint="@color/colorSend" android:backgroundTint="@color/colorSend"
android:src="@drawable/ic_send"
app:layout_constraintHorizontal_bias="0.4" app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/centeredVerticalGuideline" app:layout_constraintStart_toEndOf="@id/centeredVerticalGuideline"
@ -84,7 +82,6 @@
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fabSendTransactionCamera" android:id="@+id/fabSendTransactionCamera"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="52dp" android:layout_marginTop="52dp"
@ -92,10 +89,10 @@
app:fabSize="auto" app:fabSize="auto"
app:fabCustomSize="64dp" app:fabCustomSize="64dp"
app:maxImageSize="40dp" app:maxImageSize="40dp"
app:backgroundTint="?attr/themedColorBackgroundFloating"
android:src="@drawable/ic_camera"
app:elevation="@dimen/fab_elevation" app:elevation="@dimen/fab_elevation"
app:borderWidth="2dp" app:borderWidth="2dp"
app:srcCompat="@drawable/ic_camera"
app:backgroundTint="?attr/themedColorBackgroundFloating"
android:backgroundTint="@color/colorSend" android:backgroundTint="@color/colorSend"
app:layout_constraintTop_toTopOf="@id/fabSendTransaction" app:layout_constraintTop_toTopOf="@id/fabSendTransaction"
app:layout_constraintBottom_toBottomOf="@id/fabSendTransaction" app:layout_constraintBottom_toBottomOf="@id/fabSendTransaction"