mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-30 01:23:16 +00:00
Redesign/rebrand some stuff.
This commit is contained in:
parent
064eada022
commit
f046a1d165
15 changed files with 70 additions and 74 deletions
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">MyNero Beta</string>
|
||||
<string name="app_name" translatable="false">Mysu [beta]</string>
|
||||
</resources>
|
|
@ -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()) {
|
||||
txHistoryRecyclerView.setVisibility(View.GONE);
|
||||
noHistoryLayout.setVisibility(View.VISIBLE);
|
||||
displayEmptyHistory(view);
|
||||
// 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);
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -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(),
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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")
|
||||
|
|
BIN
app/src/main/res/drawable/xmrchan_empty.png
Normal file
BIN
app/src/main/res/drawable/xmrchan_empty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
BIN
app/src/main/res/drawable/xmrchan_half.png
Normal file
BIN
app/src/main/res/drawable/xmrchan_half.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 818 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
app/src/main/res/drawable/xmrchan_rifle.png
Normal file
BIN
app/src/main/res/drawable/xmrchan_rifle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
|
@ -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">
|
||||
<ImageView
|
||||
android:id="@+id/monerochan_imageview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="400dp"
|
||||
android:src="@drawable/xmrchan_png"
|
||||
android:src="@drawable/xmrchan_empty"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/monerochan_empty_tx_textview"/>
|
||||
|
@ -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"/>
|
||||
<TextView
|
||||
android:id="@+id/empty_tx_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/no_history_nget_some_monero_in_here"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
@ -4,9 +4,15 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="24dp"
|
||||
tools:context="net.mynero.wallet.fragment.settings.SettingsFragment">
|
||||
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="24dp">
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="fitEnd"
|
||||
android:src="@drawable/xmrchan_half"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/create_wallet_textview"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -138,28 +138,6 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/donate_per_tx_desc_textview" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/day_night_textview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/night_mode"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginStart="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/day_night_switch"
|
||||
app:layout_constraintEnd_toStartOf="@id/day_night_switch"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/day_night_switch" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/day_night_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/appearance_settings_textview" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/street_mode_label_textview"
|
||||
android:layout_width="0dp"
|
||||
|
@ -178,8 +156,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:minHeight="48dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/day_night_switch" />
|
||||
app:layout_constraintTop_toBottomOf="@id/appearance_settings_textview" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/monerochan_label_textview"
|
||||
|
|
|
@ -55,7 +55,12 @@
|
|||
android:id="@+id/onboarding_fragment"
|
||||
android:name="net.mynero.wallet.fragment.onboarding.OnboardingFragment"
|
||||
android:label="fragment_onboarding"
|
||||
tools:layout="@layout/fragment_onboarding" />
|
||||
tools:layout="@layout/fragment_onboarding">
|
||||
<action
|
||||
android:id="@+id/nav_to_home"
|
||||
app:destination="@id/main_fragment">
|
||||
</action>
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/transaction_fragment"
|
||||
android:name="net.mynero.wallet.fragment.transaction.TransactionFragment"
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE resources [<!ENTITY nbsp " ">]>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en">
|
||||
<string name="app_name" translatable="false">MyNero</string>
|
||||
|
||||
<!--TODO deleteme-->
|
||||
<!--TODO deleteme-->
|
||||
<!--TODO deleteme-->
|
||||
<string name="app_name" translatable="false">Mysu</string>
|
||||
|
||||
<string name="bad_password">Incorrect password!</string>
|
||||
<!--TODO deleteme-->
|
||||
|
||||
<string name="send_address_invalid">Not a valid address</string>
|
||||
|
||||
|
@ -43,7 +38,7 @@
|
|||
<string name="street_mode">Street mode (hide balances)</string>
|
||||
<string name="option_hide_xmrchan">Show Monerochan</string>
|
||||
<string name="option_donate_per_tx">Add occasional donation</string>
|
||||
<string name="option_donate_per_tx_desc">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.</string>
|
||||
<string name="option_donate_per_tx_desc">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.</string>
|
||||
<string name="display_recovery_phrase">Display wallet keys</string>
|
||||
<string name="tor_switch_label">Connect to proxy</string>
|
||||
<string name="connection_failed">Connection failed</string>
|
||||
|
@ -86,7 +81,8 @@
|
|||
|
||||
<string name="wallet_proxy_address_hint">127.0.0.1</string>
|
||||
<string name="wallet_proxy_port_hint">9050</string>
|
||||
<string name="no_history_nget_some_monero_in_here">No history!\nGet some Monero in here!</string>
|
||||
<string name="no_history_loading">Loading your wallet…</string>
|
||||
<string name="no_history_nget_some_monero_in_here">No transactions to display.\nAcquire coins by doing jobs, selling products, mining it, or buying some peer-to-peer.</string>
|
||||
<string name="node_button_text">Node: %1$s</string>
|
||||
<string name="connected">Connected</string>
|
||||
<string name="disconnected">Disconnected</string>
|
||||
|
@ -124,7 +120,7 @@
|
|||
<string name="use_password_as_seed_offset">Use password as seed offset</string>
|
||||
<string name="subbaddress_info_subtitle" translatable="false">#%1$d: %2$s</string>
|
||||
<string name="previous_addresses">Previous addresses</string>
|
||||
<string name="donate_label">Donate to MyNero</string>
|
||||
<string name="donate_label">Donate to Mysu</string>
|
||||
<string name="transactions">Transactions</string>
|
||||
<string name="auth">[ auth ]</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue