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
# Ensure that you replace the arguments. Then enter your store and key passwords when prompted. | |
java -jar pepk.jar --keystore=foo.keystore --alias=foo --output=output.zip --encryptionkey=xxx --include-cert |
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
default_platform(:android) | |
platform :android do | |
desc "Runs all the tests" | |
lane :test do | |
gradle(task: "test") | |
desc "Deploy a new build to Huawei App Gallery" | |
lane :deploy_huawei_app_gallery do | |
huawei_appgallery_connect( |
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
fun computeTipAndTotal() { | |
// 10 - Conditional check to fix java.lang.NumberFormatException: empty String crash, | |
// when edit text is empty. | |
if (billEditText.text.isEmpty()) { | |
// 10b) Update values of tip and total to empty & return here | |
tvTipAmount.text = "$INITIAL_EMPTY_VALUE" | |
tvTotalAmount.text = "$INITIAL_EMPTY_VALUE" | |
return // This ensures the logic in 7b isn't run. 👍 |
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
billEditText.addTextChangedListener(object : TextWatcher { | |
// Called after the user has changed some text | |
override fun afterTextChanged(editable: Editable?) { | |
// Log statement to verify the functionality of this method. | |
// Log the method name and the value (What the user has been typing). | |
Log.i(TAG, "afterTextChanged $editable") | |
computeTipAndTotal() |
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
tipSeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { | |
override fun onProgressChanged(p0: SeekBar?, progress: Int, p2: Boolean) { | |
// 2. Print out the int value of progress that is coming through. | |
Log.i(TAG, "onProgressChanged $progress") | |
// 3. Update value of the tip as we interact with the SeekBar | |
// Kotlin - replace this with the actual integer progress and append % | |
// Convert the progress value to a string and concatenate a % symbol after the value | |
tvTipPercent.text = "$progress%" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<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" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView | |
android:id="@+id/tvTotalAmount" |
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
<TextView | |
android:id="@+id/tvTipAmount" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="64dp" | |
android:textAppearance="@style/TextAppearance.AppCompat.Display1" | |
app:layout_constraintBaseline_toBaselineOf="@+id/tvTipLabel" | |
app:layout_constraintStart_toEndOf="@+id/tvTipLabel" | |
tools:text="4.50" /> |
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
<TextView | |
android:id="@+id/tvTipLabel" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="32dp" | |
android:text="Tip:" | |
android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
android:textStyle="bold" | |
app:layout_constraintStart_toStartOf="@+id/tvTotalAmount" | |
app:layout_constraintTop_toBottomOf="@+id/tvTotalLabel" /> |
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
<TextView | |
android:id="@+id/tvTotalLabel" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginTop="8dp" | |
android:fontFamily="@font/avenir_bold" | |
android:text="@string/total_amount" | |
android:textAppearance="@style/TextAppearance.AppCompat.Large" | |
android:textStyle="bold" | |
app:layout_constraintEnd_toEndOf="@+id/tvTotalAmount" |
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
<TextView | |
android:id="@+id/tvTotalAmount" | |
android:layout_width="0dp" | |
android:layout_height="wrap_content" | |
android:layout_marginStart="32dp" | |
android:layout_marginTop="16dp" | |
android:layout_marginEnd="32dp" | |
android:textAppearance="@style/TextAppearance.AppCompat.Display4" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintStart_toStartOf="parent" |
NewerOlder