This repository has been archived by the owner on Dec 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit 974a585.
- Loading branch information
Elise Richards
authored
Jul 30, 2019
1 parent
65279d8
commit 19ddc12
Showing
35 changed files
with
546 additions
and
79 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
app/src/androidTest/java/mozilla/lockbox/robots/DeleteCredentialDisclaimerRobot.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,22 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package mozilla.lockbox.robots | ||
|
||
import br.com.concretesolutions.kappuccino.actions.ClickActions | ||
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions | ||
import mozilla.lockbox.R | ||
|
||
// DeleteCredentialDisclaimer | ||
class DeleteCredentialDisclaimerRobot : BaseTestRobot { | ||
|
||
override fun exists() = VisibilityAssertions.displayed { id(R.id.alertTitle) } | ||
|
||
fun tapCancelButton() = ClickActions.click { text(R.string.cancel) } | ||
fun tapDeleteButton() = ClickActions.click { text("DELETE") } | ||
} | ||
|
||
fun deleteCredentialDisclaimer(f: DeleteCredentialDisclaimerRobot.() -> Unit) = DeleteCredentialDisclaimerRobot().apply(f) |
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
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/mozilla/lockbox/robots/KebabMenuRobot.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,21 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package mozilla.lockbox.robots | ||
|
||
import br.com.concretesolutions.kappuccino.actions.ClickActions | ||
import br.com.concretesolutions.kappuccino.assertions.VisibilityAssertions | ||
import mozilla.lockbox.R | ||
|
||
// KebabMenu | ||
class KebabMenuRobot : BaseTestRobot { | ||
override fun exists() = VisibilityAssertions.displayed { text("Delete") } | ||
|
||
fun tapEditButton() = ClickActions.click { text(R.string.edit) } | ||
fun tapDeleteButton() = ClickActions.click { text(R.string.delete) } | ||
} | ||
|
||
fun kebabMenu(f: KebabMenuRobot.() -> Unit) = KebabMenuRobot().apply(f) |
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
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
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
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
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
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
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
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
45 changes: 45 additions & 0 deletions
45
app/src/main/java/mozilla/lockbox/adapter/DeleteItemAdapter.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,45 @@ | ||
package mozilla.lockbox.adapter | ||
|
||
import android.content.Context | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.ArrayAdapter | ||
import android.widget.TextView | ||
import mozilla.lockbox.R | ||
import mozilla.lockbox.action.ItemDetailAction | ||
|
||
class DeleteItemAdapter( | ||
context: Context, | ||
textViewResourceId: Int, | ||
val values: ArrayList<ItemDetailAction.EditItemMenu> | ||
) : ArrayAdapter<ItemDetailAction.EditItemMenu>(context, textViewResourceId, values) { | ||
|
||
private var selectedIndex = -1 | ||
|
||
fun setSelection(position: Int) { | ||
selectedIndex = position | ||
notifyDataSetChanged() | ||
} | ||
|
||
override fun getView(position: Int, convertView: View?, parent: ViewGroup): View { | ||
val label = super.getView(position, convertView, parent) as TextView | ||
label.setTextAppearance(R.style.TextAppearanceWidgetEventToolbarTitle) | ||
label.setTextColor(label.resources.getColor(R.color.text_white, null)) | ||
label.setBackgroundColor(label.resources.getColor(R.color.color_primary, null)) | ||
label.text = context.resources.getString(values[position].titleId) | ||
label.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_menu_kebab, 0) | ||
|
||
return label | ||
} | ||
|
||
override fun getDropDownView(position: Int, convertView: View?, parent: ViewGroup): View { | ||
val label = super.getDropDownView(position, convertView, parent) as TextView | ||
label.setTextAppearance(R.style.TextAppearanceSortMenuItem) | ||
label.text = context.resources.getString(values[position].titleId) | ||
label.background = context.resources.getDrawable(R.drawable.button_pressed_white, null) | ||
val padding = label.resources.getDimensionPixelSize(R.dimen.sort_item_padding) | ||
label.setPadding(padding, padding, padding, padding) | ||
|
||
return label | ||
} | ||
} |
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
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
Oops, something went wrong.