This file contains hidden or 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
| // 1. In the project-level build.gradle file | |
| buildscript { | |
| ... | |
| ext { | |
| ... | |
| beagleVersion = "2.9.10" // Check GitHub (https://github.com/pandulapeter/beagle/releases) for the latest version | |
| beagleUiType = "ui-drawer" // Could also be "ui-activity", "ui-bottom-sheet", "ui-dialog" or "ui-view" | |
| } | |
| } |
This file contains hidden or 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
| data class Account( | |
| override val name: String, | |
| val password: String | |
| ) : BeagleListItemContract | |
| val testAccounts = listOf( | |
| Account("User 1", "password1"), | |
| Account("User 2", "password2"), | |
| Account("User 3", "password3") | |
| ) |
This file contains hidden or 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
| Trick.SingleSelectionList( | |
| title = "Backend environment", | |
| items = environments, | |
| isInitiallyExpanded = true, | |
| initialSelectionId = preferenceManager.environmentId, | |
| onItemSelectionChanged = { environment -> changeEnvironment(environment.id) } | |
| ) |
This file contains hidden or 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
| Trick.SimpleList( | |
| id = TEST_ACCOUNTS_MODULE_ID, | |
| title = "Test accounts", | |
| items = testAccounts, | |
| onItemSelected = { account -> | |
| findViewById<EditText>(R.id.username_input).setText(account.name) | |
| findViewById<EditText>(R.id.password_input).setText(account.password) | |
| Beagle.dismiss(this@LoginActivity) | |
| } | |
| ) |
This file contains hidden or 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
| Trick.NetworkLogList( | |
| baseUrl = NetworkingManager.BASE_URL, | |
| shouldShowHeaders = true, | |
| shouldShowTimestamp = true | |
| ) |
This file contains hidden or 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
| android { | |
| … | |
| defaultConfig { | |
| … | |
| buildConfigField("String", "BUILD_DATE", "\"${new Date().format("yyyy.MM.dd")}\"") | |
| } | |
| } |
This file contains hidden or 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
| Trick.Header( | |
| title = getString(R.string.app_name), | |
| subtitle = "v${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})", | |
| text = "Built on ${BuildConfig.BUILD_DATE}" | |
| ) |
This file contains hidden or 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
| class YourApplication : Application() { | |
| override fun onCreate() { | |
| super.onCreate() | |
| Beagle.imprint(this) | |
| } | |
| } |
This file contains hidden or 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
| dependencies { | |
| … | |
| def beagleVersion = "1.1.0" | |
| debugImplementation "com.github.pandulapeter.beagle:beagle:$beagleVersion" | |
| releaseImplementation "com.github.pandulapeter.beagle:beagle-noop:$beagleVersion" | |
| } |
This file contains hidden or 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
| allprojects { | |
| repositories { | |
| … | |
| maven { url "https://jitpack.io" } | |
| } | |
| } |
NewerOlder