forked from openMF/mifos-passcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor openMF#50: java to kotlin migration
- Loading branch information
1 parent
7ec5095
commit 31536c3
Showing
24 changed files
with
895 additions
and
1,002 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.mifos.passcode | ||
|
||
import com.mifos.mobile.passcode.BasePassCodeActivity | ||
|
||
/** | ||
* Created by dilpreet on 19/01/18. | ||
*/ | ||
class BaseActivity : BasePassCodeActivity() { | ||
override val passCodeClass: Class<*> | ||
get() =//name of the activity which extends MifosPassCodeActivity | ||
PassCodeActivity::class.java | ||
} |
19 changes: 0 additions & 19 deletions
19
app/src/main/java/com/mifos/passcode/MifosApplication.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.mifos.passcode | ||
|
||
import android.app.Application | ||
import com.mifos.mobile.passcode.utils.ForegroundChecker.Companion.init | ||
|
||
/** | ||
* Created by dilpreet on 19/01/18. | ||
*/ | ||
class MifosApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
//need to initialize this | ||
init(this) | ||
} | ||
} |
47 changes: 0 additions & 47 deletions
47
app/src/main/java/com/mifos/passcode/PassCodeActivity.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.mifos.passcode | ||
|
||
import android.view.View | ||
import android.widget.Toast | ||
import com.mifos.mobile.passcode.MifosPassCodeActivity | ||
|
||
/** | ||
* Created by dilpreet on 19/01/18. | ||
*/ | ||
class PassCodeActivity : MifosPassCodeActivity() { | ||
|
||
override val logo: Int | ||
get() =//logo to be shown on the top | ||
R.drawable.mifos_logo | ||
|
||
override fun startNextActivity() { | ||
//start intent for the next activity | ||
} | ||
|
||
override fun startLoginActivity() { | ||
//start intent for the login activity | ||
} | ||
|
||
override fun showToaster(view: View?, msg: Int) { | ||
//show prompts in toast or using snackbar | ||
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show() | ||
} | ||
|
||
override val encryptionType: Int = 1 | ||
|
||
override val fpDialogTitle: String | ||
get() =//Title to be shown for Fingerprint Dialog | ||
getString(R.string.fingerprint_dialog_title) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,10 @@ android { | |
} | ||
} | ||
|
||
buildFeatures { | ||
viewBinding = true | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
|
36 changes: 0 additions & 36 deletions
36
mifos-passcode/src/main/java/com/mifos/mobile/passcode/BasePassCodeActivity.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
mifos-passcode/src/main/java/com/mifos/mobile/passcode/BasePassCodeActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.mifos.mobile.passcode | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import com.mifos.mobile.passcode.utils.ForegroundChecker | ||
import com.mifos.mobile.passcode.utils.ForegroundChecker.Companion.get | ||
|
||
/** | ||
* Created by dilpreet on 19/01/18. | ||
*/ | ||
abstract class BasePassCodeActivity : AppCompatActivity(), ForegroundChecker.Listener { | ||
override fun onResume() { | ||
super.onResume() | ||
get()!!.addListener(this) | ||
get()!!.onActivityResumed() | ||
} | ||
|
||
override fun onPause() { | ||
super.onPause() | ||
get()!!.onActivityPaused() | ||
} | ||
|
||
override fun onBecameForeground() { | ||
MifosPassCodeActivity.startMifosPassCodeActivity( | ||
this, passCodeClass, | ||
false | ||
) | ||
} | ||
|
||
abstract val passCodeClass: Class<*>? | ||
} |
Oops, something went wrong.