diff --git a/app/src/beta/res/values/strings.xml b/app/src/beta/res/values/strings.xml
index e97d05c..29cb590 100644
--- a/app/src/beta/res/values/strings.xml
+++ b/app/src/beta/res/values/strings.xml
@@ -1,4 +1,4 @@
- MyNero Beta
+ Mysu [beta]
\ No newline at end of file
diff --git a/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java b/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java
index ecf8379..c832fe1 100644
--- a/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java
+++ b/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java
@@ -84,7 +84,6 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
RecyclerView txHistoryRecyclerView = view.findViewById(R.id.transaction_history_recyclerview);
TextView unlockedBalanceTextView = view.findViewById(R.id.balance_unlocked_textview);
TextView lockedBalanceTextView = view.findViewById(R.id.balance_locked_textview);
- ConstraintLayout noHistoryLayout = view.findViewById(R.id.no_history_layout);
BalanceService balanceService = BalanceService.getInstance();
HistoryService historyService = HistoryService.getInstance();
@@ -132,10 +131,21 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
if (historyService != null) {
historyService.history.observe(getViewLifecycleOwner(), history -> {
if (history.isEmpty()) {
+ // DISPLAYING EMPTY WALLET HISTORY
+ Wallet wallet = WalletManager.getInstance().getWallet();
+ int textResId, botImgResId = 0;
+ if(wallet != null && wallet.isSynchronized()) {
+ textResId = R.string.no_history_nget_some_monero_in_here;
+ botImgResId = R.drawable.xmrchan_empty; // img for synchronized
+ } else {
+ textResId = R.string.no_history_loading;
+ botImgResId = R.drawable.xmrchan_loading; // img for loading
+ }
+
txHistoryRecyclerView.setVisibility(View.GONE);
- noHistoryLayout.setVisibility(View.VISIBLE);
- displayEmptyHistory(view);
+ displayEmptyHistory(true, view, textResId, botImgResId);
} else {
+ // POPULATED WALLET HISTORY
Collections.sort(history);
if (history.size() > 100) {
adapter.submitList(history.subList(0, 99));
@@ -143,7 +153,7 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
adapter.submitList(history);
}
txHistoryRecyclerView.setVisibility(View.VISIBLE);
- noHistoryLayout.setVisibility(View.GONE);
+ displayEmptyHistory(false, view, R.string.no_history_nget_some_monero_in_here, R.drawable.xmrchan_loading);
}
});
}
@@ -167,16 +177,24 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI
}
}
- private void displayEmptyHistory(View view) {
+ private void displayEmptyHistory(boolean display, View view, int textResId, int botImgResId) {
+ TextView mnrjTextView = view.findViewById(R.id.monerochan_empty_tx_textview);
+ TextView textView = view.findViewById(R.id.empty_tx_textview);
+ ImageView botImageView = view.findViewById(R.id.monerochan_imageview);
+ view.findViewById(R.id.no_history_layout).setVisibility(display ? View.VISIBLE : View.GONE);
boolean displayMonerochan = PrefService.getInstance().getBoolean(Constants.PREF_MONEROCHAN, true);
if(displayMonerochan) {
- view.findViewById(R.id.monerochan_imageview).setVisibility(View.VISIBLE);
- view.findViewById(R.id.monerochan_empty_tx_textview).setVisibility(View.VISIBLE);
- view.findViewById(R.id.empty_tx_textview).setVisibility(View.GONE);
+ botImageView.setVisibility(View.VISIBLE);
+ mnrjTextView.setVisibility(View.VISIBLE);
+ textView.setVisibility(View.GONE);
} else {
- view.findViewById(R.id.monerochan_imageview).setVisibility(View.GONE);
- view.findViewById(R.id.monerochan_empty_tx_textview).setVisibility(View.GONE);
- view.findViewById(R.id.empty_tx_textview).setVisibility(View.VISIBLE);
+ botImageView.setVisibility(View.GONE);
+ mnrjTextView.setVisibility(View.GONE);
+ textView.setVisibility(View.VISIBLE);
}
+
+ botImageView.setImageResource(botImgResId);
+ mnrjTextView.setText(textResId);
+ textView.setText(textResId);
}
}
\ No newline at end of file
diff --git a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
index f15bb88..91c239f 100644
--- a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
+++ b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
@@ -14,11 +14,13 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
+import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SwitchCompat;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.ViewModelProvider;
import net.mynero.wallet.MainActivity;
@@ -131,12 +133,19 @@ public class OnboardingFragment extends Fragment implements NodeSelectionBottomS
}
private void bindListeners() {
+ // Disable onBack click
+ OnBackPressedCallback onBackPressedCallback = new OnBackPressedCallback(true) { @Override public void handleOnBackPressed() { } };
+ FragmentActivity activity = getActivity();
+ if(activity != null)
+ activity.getOnBackPressedDispatcher().addCallback(getViewLifecycleOwner(), onBackPressedCallback);
+
moreOptionsDropdownTextView.setOnClickListener(view12 -> mViewModel.onMoreOptionsClicked());
moreOptionsChevronImageView.setOnClickListener(view12 -> mViewModel.onMoreOptionsClicked());
seedOffsetCheckbox.setOnCheckedChangeListener((compoundButton, b) -> useOffset = b);
createWalletButton.setOnClickListener(view1 -> {
prepareDefaultNode();
+ onBackPressedCallback.setEnabled(false);
((MoneroApplication)getActivity().getApplication()).getExecutor().execute(() -> {
createOrImportWallet(
walletPasswordEditText.getText().toString(),
diff --git a/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveFragment.java b/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveFragment.java
index 67a6963..05202d5 100644
--- a/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveFragment.java
+++ b/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveFragment.java
@@ -98,9 +98,8 @@ public class ReceiveFragment extends Fragment {
int[] pixels = new int[width * height];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
- boolean night = NightmodeHelper.getPreferredNightmode() == DayNightMode.NIGHT;
if (bitMatrix.get(j, i)) {
- pixels[i * width + j] = night ? 0xffffffff : 0x00000000;
+ pixels[i * width + j] = 0xffffffff;
} else {
pixels[i * height + j] = getResources().getColor(R.color.oled_colorBackground);
}
diff --git a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java
index d93fba0..3cacbef 100644
--- a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java
+++ b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java
@@ -98,7 +98,6 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
Button displayUtxosButton = view.findViewById(R.id.display_utxos_button);
selectNodeButton = view.findViewById(R.id.select_node_button);
- SwitchCompat nightModeSwitch = view.findViewById(R.id.day_night_switch);
SwitchCompat streetModeSwitch = view.findViewById(R.id.street_mode_switch);
SwitchCompat monerochanSwitch = view.findViewById(R.id.monerochan_switch);
SwitchCompat donationSwitch = view.findViewById(R.id.donate_per_tx_switch);
@@ -107,15 +106,6 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia
walletProxyAddressEditText = view.findViewById(R.id.wallet_proxy_address_edittext);
walletProxyPortEditText = view.findViewById(R.id.wallet_proxy_port_edittext);
- nightModeSwitch.setChecked(NightmodeHelper.getPreferredNightmode() == DayNightMode.NIGHT);
- nightModeSwitch.setOnCheckedChangeListener((compoundButton, b) -> {
- if (b) {
- NightmodeHelper.setAndSavePreferredNightmode(DayNightMode.NIGHT);
- } else {
- NightmodeHelper.setAndSavePreferredNightmode(DayNightMode.DAY);
- }
- });
-
streetModeSwitch.setChecked(PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false));
streetModeSwitch.setOnCheckedChangeListener((compoundButton, b) -> {
PrefService.getInstance().edit().putBoolean(Constants.PREF_STREET_MODE, b).apply();
diff --git a/app/src/main/java/net/mynero/wallet/util/NightmodeHelper.java b/app/src/main/java/net/mynero/wallet/util/NightmodeHelper.java
index 0eb1afa..61db511 100644
--- a/app/src/main/java/net/mynero/wallet/util/NightmodeHelper.java
+++ b/app/src/main/java/net/mynero/wallet/util/NightmodeHelper.java
@@ -23,17 +23,8 @@ import androidx.appcompat.app.AppCompatDelegate;
import net.mynero.wallet.service.PrefService;
public class NightmodeHelper {
- public static DayNightMode getPreferredNightmode() {
- return DayNightMode.valueOf(PrefService.getInstance().getString(Constants.PREF_NIGHT_MODE, DayNightMode.NIGHT.name()));
- }
-
public static void getAndSetPreferredNightmode() {
- setNightMode(getPreferredNightmode());
- }
-
- public static void setAndSavePreferredNightmode(DayNightMode mode) {
- PrefService.getInstance().edit().putString(Constants.PREF_NIGHT_MODE, mode.name()).apply();
- setNightMode(mode);
+ setNightMode(DayNightMode.NIGHT);
}
@SuppressLint("WrongConstant")
diff --git a/app/src/main/res/drawable/xmrchan_empty.png b/app/src/main/res/drawable/xmrchan_empty.png
new file mode 100644
index 0000000..479c512
Binary files /dev/null and b/app/src/main/res/drawable/xmrchan_empty.png differ
diff --git a/app/src/main/res/drawable/xmrchan_half.png b/app/src/main/res/drawable/xmrchan_half.png
new file mode 100644
index 0000000..e7ae47c
Binary files /dev/null and b/app/src/main/res/drawable/xmrchan_half.png differ
diff --git a/app/src/main/res/drawable/xmrchan_png.png b/app/src/main/res/drawable/xmrchan_loading.png
similarity index 99%
rename from app/src/main/res/drawable/xmrchan_png.png
rename to app/src/main/res/drawable/xmrchan_loading.png
index 6dd759c..4f8de0c 100644
Binary files a/app/src/main/res/drawable/xmrchan_png.png and b/app/src/main/res/drawable/xmrchan_loading.png differ
diff --git a/app/src/main/res/drawable/xmrchan_rifle.png b/app/src/main/res/drawable/xmrchan_rifle.png
new file mode 100644
index 0000000..efb8192
Binary files /dev/null and b/app/src/main/res/drawable/xmrchan_rifle.png differ
diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml
index 10240cb..cb160fc 100644
--- a/app/src/main/res/layout/fragment_home.xml
+++ b/app/src/main/res/layout/fragment_home.xml
@@ -64,12 +64,13 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/balance_locked_textview"
- android:visibility="gone">
+ android:visibility="gone"
+ tools:visibility="visible">
@@ -77,16 +78,18 @@
android:id="@+id/monerochan_empty_tx_textview"
android:layout_width="0dp"
android:layout_height="wrap_content"
+ android:layout_marginTop="24dp"
android:text="@string/no_history_nget_some_monero_in_here"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/monerochan_imageview"
- app:layout_constraintTop_toTopOf="@id/monerochan_imageview"
- app:layout_constraintBottom_toBottomOf="@id/monerochan_imageview"/>
+ app:layout_constraintTop_toTopOf="@id/monerochan_imageview"/>
-
+ android:paddingEnd="24dp"
+ android:paddingStart="24dp"
+ android:paddingTop="24dp">
+
-
-
-
-
+ app:layout_constraintTop_toBottomOf="@id/appearance_settings_textview" />
+ tools:layout="@layout/fragment_onboarding">
+
+
+
]>
- MyNero
-
-
-
-
+ Mysu
Incorrect password!
-
Not a valid address
@@ -43,7 +38,7 @@
Street mode (hide balances)
Show Monerochan
Add occasional donation
- Randomly adds a 0.5%-1.5% MyNero donation to Txns. It\'s random so Txns don\'t have a consistently uncommon fingerprint, and the % is random so MyNero doesn\'t know the exact Txn amount.
+ Randomly adds a 0.5%-1.5% Mysu donation to Txns. It\'s random so Txns don\'t have a consistently uncommon fingerprint, and the % is random so Mysu doesn\'t know the exact Txn amount.
Display wallet keys
Connect to proxy
Connection failed
@@ -86,7 +81,8 @@
127.0.0.1
9050
- No history!\nGet some Monero in here!
+ Loading your wallet…
+ No transactions to display.\nAcquire coins by doing jobs, selling products, mining it, or buying some peer-to-peer.
Node: %1$s
Connected
Disconnected
@@ -124,7 +120,7 @@
Use password as seed offset
#%1$d: %2$s
Previous addresses
- Donate to MyNero
+ Donate to Mysu
Transactions
[ auth ]