Skip to content

Commit

Permalink
- add dev mode copy to toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
vsima committed Jan 27, 2023
1 parent bb6d58a commit 5db18c0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.telephony.TelephonyManager;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.animation.AnimationUtils;
import android.widget.Button;
Expand Down Expand Up @@ -307,6 +308,7 @@ protected void onResume() {
mHandler.postDelayed(() -> updateUI(), 1000);

BRWalletManager.getInstance().refreshBalance(this);
refreshDevMode();
}

private void setupNetworking() {
Expand Down Expand Up @@ -460,4 +462,10 @@ public void addNotificationBar() {
barFlipper.addView(view);
barFlipper.setDisplayedChild(1);
}

private void refreshDevMode() {
findViewById(R.id.menuDevMode).setVisibility(
BRSharedPrefs.isApiServerModeDev(getApplicationContext()) ?
View.VISIBLE : View.GONE);
}
}
17 changes: 16 additions & 1 deletion app/src/main/res/layout/activity_bread.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,22 @@
android:src="@drawable/ic_menu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
/>

<TextView
android:id="@+id/menuDevMode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:fontFamily="@font/barlowsemicondensed_medium"
android:text="@string/ManageWallet.devMode"
android:textColor="@color/white"
android:textSize="14sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/menuBut"
app:layout_constraintEnd_toStartOf="@+id/menuBut"
app:layout_constraintTop_toTopOf="@+id/menuBut" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,8 @@
<string name="Error.wrong2faTokenProvided">Wrong 2FA provided</string>

<!-- Balance -->
<string name="ManageWallet.balance">Balance</string>
<string name="ManageWallet.balance">Balance</string>
<string name="ManageWallet.devMode">In Developer Mode</string>

<!-- Features and limitations -->
<string name="LitecoinCard.Disclaimer.bullets">"- Registration &amp; Login\n- Available card balance\n- Reset password\n- No transfer to Litewallet\n- US Only"</string>
Expand Down

0 comments on commit 5db18c0

Please sign in to comment.