Upgraded to AndroidX AppCompat

This commit is contained in:
dankito 2020-04-22 17:40:12 +02:00
parent d026244871
commit 8eae569d69
22 changed files with 136 additions and 108 deletions

View File

@ -12,12 +12,28 @@ ext {
hbci4jVersion = '3.1.37'
/* Android */
androidUtilsVersion = '1.1.0'
clansFloatingActionButtonVersion = '1.6.4'
multiDexVersion = "2.0.1"
appCompatVersion = "1.1.0"
constraintLayoutVersion = "1.1.3"
materialComponentsVersion = "1.1.0"
/* JavaFX */
javaFxUtilsVersion = '1.0.3'
/* Test */
junitVersion = '4.12'
assertJVersion = '3.12.2'

View File

@ -13,7 +13,9 @@ android {
versionCode appVersionCode
versionName appVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@ -66,12 +68,19 @@ dependencies {
implementation "org.slf4j:slf4j-android:$slf4JVersion"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
implementation 'android.arch.navigation:navigation-ui:1.0.0'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0'
implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0'
implementation "androidx.multidex:multidex:$multiDexVersion"
implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation "androidx.recyclerview:recyclerview:$appCompatVersion"
implementation "androidx.annotation:annotation:$appCompatVersion"
implementation "com.google.android.material:material:$materialComponentsVersion"
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
implementation 'androidx.navigation:navigation-fragment:2.0.0-rc02'
implementation 'androidx.navigation:navigation-ui:2.0.0-rc02'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0-rc02'
implementation 'androidx.navigation:navigation-ui-ktx:2.0.0-rc02'
}

View File

@ -1,19 +1,18 @@
package net.dankito.banking.fints4java.android
import android.os.Bundle
import android.support.design.widget.NavigationView
import android.support.v4.view.GravityCompat
import android.support.v4.widget.DrawerLayout
import android.support.v7.app.ActionBarDrawerToggle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.Toolbar
import android.view.Menu
import android.view.MenuItem
import android.view.MotionEvent
import android.view.SubMenu
import android.widget.TextView
import androidx.navigation.findNavController
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import com.github.clans.fab.FloatingActionMenu
import com.google.android.material.navigation.NavigationView
import kotlinx.android.synthetic.main.action_view_account_menu_item.view.*
import net.dankito.banking.fints4java.android.ui.views.MainActivityFloatingActionMenuButton
import net.dankito.banking.fints4java.android.util.Base64ServiceAndroid
@ -62,7 +61,7 @@ class MainActivity : AppCompatActivity() {
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
val navigationView: NavigationView = findViewById(R.id.nav_view)
val navController = findNavController(R.id.nav_host_fragment)
// val navController = findNavController(R.id.nav_host_fragment)
// // Passing each menu ID as a set of Ids because each
// // menu should be considered as top level destinations.

View File

@ -1,6 +1,6 @@
package net.dankito.banking.fints4java.android
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import net.dankito.banking.fints4java.android.ui.dialogs.AddAccountDialog
import net.dankito.banking.fints4java.android.ui.dialogs.EnterAtcDialog
import net.dankito.banking.fints4java.android.ui.dialogs.EnterTanDialog

View File

@ -1,8 +1,8 @@
package net.dankito.banking.fints4java.android.ui.adapter.viewholder
import android.support.v7.widget.RecyclerView
import android.view.View
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import kotlinx.android.synthetic.main.list_item_account_transaction.view.*

View File

@ -3,15 +3,15 @@ package net.dankito.banking.fints4java.android.ui.dialogs
import android.content.Context
import android.content.DialogInterface
import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
import kotlinx.android.synthetic.main.dialog_add_account.*
import kotlinx.android.synthetic.main.dialog_add_account.view.*
import net.dankito.banking.fints4java.android.R

View File

@ -1,13 +1,13 @@
package net.dankito.banking.fints4java.android.ui.dialogs
import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.text.Html
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
import kotlinx.android.synthetic.main.dialog_enter_atc.view.*
import net.dankito.banking.fints4java.android.R
import net.dankito.banking.ui.model.tan.EnterTanGeneratorAtcResult

View File

@ -4,14 +4,14 @@ import android.content.Context
import android.graphics.BitmapFactory
import android.os.Bundle
import android.os.Handler
import android.support.v4.app.DialogFragment
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.text.InputType
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Spinner
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
import kotlinx.android.synthetic.main.dialog_enter_tan.view.*
import kotlinx.android.synthetic.main.view_tan_image.view.*
import net.dankito.banking.fints4java.android.R

View File

@ -1,14 +1,14 @@
package net.dankito.banking.fints4java.android.ui.dialogs
import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.text.Editable
import android.text.TextWatcher
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.DialogFragment
import kotlinx.android.synthetic.main.dialog_transfer_money.*
import kotlinx.android.synthetic.main.dialog_transfer_money.view.*
import net.dankito.banking.fints4java.android.R

View File

@ -1,17 +1,17 @@
package net.dankito.banking.fints4java.android.ui.home
import android.app.SearchManager
import android.arch.lifecycle.ViewModelProviders
import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v7.app.AlertDialog
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.support.v7.widget.SearchView
import android.view.*
import android.view.inputmethod.EditorInfo
import android.widget.EditText
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.SearchView
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import net.dankito.banking.fints4java.android.MainActivity
import net.dankito.banking.fints4java.android.R
import net.dankito.banking.fints4java.android.ui.adapter.AccountTransactionAdapter
@ -68,19 +68,17 @@ class HomeFragment : Fragment() {
}
override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) {
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
super.onCreateOptionsMenu(menu, inflater)
menu?.let {
mnitmBalance = menu.findItem(R.id.mnitmBalance)
mnitmBalance = menu.findItem(R.id.mnitmBalance)
mnitmSearchTransactions = menu.findItem(R.id.mnitmSearchTransactions)
mnitmUpdateTransactions = menu.findItem(R.id.mnitmUpdateTransactions)
mnitmSearchTransactions = menu.findItem(R.id.mnitmSearchTransactions)
mnitmUpdateTransactions = menu.findItem(R.id.mnitmUpdateTransactions)
initSearchView()
initSearchView()
initLogicAfterUiInitialized()
}
initLogicAfterUiInitialized()
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
@ -102,7 +100,7 @@ class HomeFragment : Fragment() {
// if imeOptions aren't set like this searchView would take whole remaining screen when focused in landscape mode (see https://stackoverflow.com/questions/15296129/searchview-and-keyboard)
val searchInput =
searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text) as? EditText
searchView.findViewById(androidx.appcompat.R.id.search_src_text) as? EditText
searchInput?.imeOptions = EditorInfo.IME_ACTION_SEARCH or EditorInfo.IME_FLAG_NO_EXTRACT_UI
searchView.setOnQueryTextListener(searchAccountTransactionsTextListener)

View File

@ -1,8 +1,8 @@
package net.dankito.banking.fints4java.android.ui.home
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.ViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
class HomeViewModel : ViewModel() {

View File

@ -1,6 +1,6 @@
package net.dankito.banking.fints4java.android.ui.views
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import com.github.clans.fab.FloatingActionButton
import com.github.clans.fab.FloatingActionMenu
import kotlinx.android.synthetic.main.view_floating_action_button_main.view.*

View File

@ -1,19 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<androidx.drawerlayout.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start"
>
<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
@ -25,4 +27,4 @@
android:background="@color/backgroundColor_Dark"
/>
</android.support.v4.widget.DrawerLayout>
</androidx.drawerlayout.widget.DrawerLayout>

View File

@ -1,24 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
>
<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" />
@ -33,4 +35,4 @@
app:layout_behavior="@string/move_upward_behaviour"
/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
@ -17,4 +17,4 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navGraph="@navigation/mobile_navigation" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,7 +6,7 @@
android:padding="@dimen/dialog_add_account_padding"
>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin"
@ -20,17 +20,17 @@
android:inputType="text"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin"
android:hint="@string/dialog_add_account_enter_fints_server_address"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtFinTsServerAddress"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_add_account_edit_text_height"
@ -38,41 +38,41 @@
android:enabled="false"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin"
android:hint="@string/dialog_add_account_enter_customer_id"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtCustomerId"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_add_account_edit_text_height"
android:inputType="text"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dialog_add_account_field_bottom_margin"
android:hint="@string/dialog_add_account_enter_pin"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtPin"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_add_account_edit_text_height"
android:inputType="textPassword"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<RelativeLayout

View File

@ -41,13 +41,13 @@
</LinearLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_remittee_name"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtRemitteeName"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
@ -55,34 +55,34 @@
>
<requestFocus />
</android.support.design.widget.TextInputEditText>
</com.google.android.material.textfield.TextInputEditText>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_remittee_iban"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtRemitteeIban"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_autocomplete_fields_height"
android:inputType="text"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_remittee_bank"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtRemitteeBank"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
@ -90,16 +90,16 @@
android:enabled="false"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_remittee_bic"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtRemitteeBic"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
@ -107,39 +107,39 @@
android:enabled="false"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_amount"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtAmount"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="numberDecimal"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<android.support.design.widget.TextInputLayout
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/dialog_transfer_money_usage"
>
<android.support.design.widget.TextInputEditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtxtUsage"
android:layout_width="match_parent"
android:layout_height="@dimen/dialog_transfer_money_input_fields_height"
android:inputType="text"
/>
</android.support.design.widget.TextInputLayout>
</com.google.android.material.textfield.TextInputLayout>
<RelativeLayout

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rcyvwAccountTransactions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -16,4 +16,4 @@
app:layout_constraintTop_toTopOf="parent"
/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -7,7 +7,7 @@
android:layout_gravity="center_vertical"
>
<android.support.v7.widget.AppCompatImageView
<ImageView
android:id="@+id/imgSupportsFints30"
android:layout_width="@dimen/list_item_bank_info_icon_supports_fints_30_width"
android:layout_height="@dimen/list_item_bank_info_icon_supports_fints_30_height"

View File

@ -7,7 +7,7 @@
android:icon="@drawable/ic_search_white_24dp"
android:title="@string/search"
app:showAsAction="always|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView"
app:actionViewClass="androidx.appcompat.widget.SearchView"
android:orderInCategory="10"
android:visible="false"
/>

View File

@ -70,7 +70,7 @@
<string name="dialog_enter_tan_enter_tan">Enter TAN:</string>
<string name="dialog_enter_tan_error_could_not_decode_tan_image">Could not decode flicker code or QR code / PhotoTan. Most likely an internal error:\n%s.</string>
<string name="dialog_enter_tan_tan_medium_successfully_changed">TAN medium successfully changed to \'%s\'.</string>
<string name="dialog_enter_tan_error_changing_tan_medium">Could not change TAN medium to \'%s\':\n%s.</string>
<string formatted="false" name="dialog_enter_tan_error_changing_tan_medium">Could not change TAN medium to \'%s\':\n%s.</string>
<!-- Removed <p></p> from last paragraph as otherwise TextView has some padding at the end -->
<string name="dialog_enter_atc_explanation"><![CDATA[

View File

@ -1 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true
kotlin.code.style=official