1
mirror of https://github.com/m2049r/xmrwallet synced 2025-03-21 13:04:22 +01:00

hide receive button before wallet is loaded ()

This commit is contained in:
m2049r 2017-11-04 15:31:34 +01:00 committed by GitHub
parent 2cb87bab8e
commit cfb3c23003
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 5 deletions
app

@ -8,8 +8,8 @@ android {
applicationId "com.m2049r.xmrwallet" applicationId "com.m2049r.xmrwallet"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 25 targetSdkVersion 25
versionCode 38 versionCode 39
versionName "1.1.7" versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild { externalNativeBuild {
cmake { cmake {

@ -447,6 +447,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
} else { } else {
haveWallet = true; haveWallet = true;
invalidateOptionsMenu(); invalidateOptionsMenu();
final WalletFragment walletFragment = (WalletFragment)
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
runOnUiThread(new Runnable() {
public void run() {
if (walletFragment != null) {
walletFragment.onLoaded();
}
}
});
} }
} }

@ -244,6 +244,20 @@ public class WalletFragment extends Fragment
} }
} }
boolean walletLoaded = false;
public void onLoaded() {
walletLoaded = true;
showReceive();
}
private void showReceive() {
if (walletLoaded) {
bReceive.setVisibility(View.VISIBLE);
bReceive.setEnabled(true);
}
}
public void setProgressText(final String text) { public void setProgressText(final String text) {
tvProgress.setText(text); tvProgress.setText(text);
} }
@ -373,5 +387,6 @@ public class WalletFragment extends Fragment
Log.d(TAG, "onResume()"); Log.d(TAG, "onResume()");
activityCallback.setTitle(walletTitle, walletSubtitle); activityCallback.setTitle(walletTitle, walletSubtitle);
activityCallback.setToolbarButton(Toolbar.BUTTON_CLOSE); activityCallback.setToolbarButton(Toolbar.BUTTON_CLOSE);
showReceive();
} }
} }

@ -137,11 +137,11 @@
android:layout_margin="8dp" android:layout_margin="8dp"
android:layout_weight="1" android:layout_weight="1"
android:drawableStart="@drawable/ic_hand" android:drawableStart="@drawable/ic_hand"
android:enabled="true" android:enabled="false"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingStart="16dp" android:paddingStart="16dp"
android:text="@string/label_wallet_receive" android:text="@string/label_wallet_receive"
android:visibility="visible" /> android:visibility="invisible" />
<Button <Button
android:id="@+id/bSend" android:id="@+id/bSend"
@ -151,7 +151,7 @@
android:layout_margin="8dp" android:layout_margin="8dp"
android:layout_weight="1" android:layout_weight="1"
android:drawableStart="@drawable/ic_send" android:drawableStart="@drawable/ic_send"
android:enabled="true" android:enabled="false"
android:paddingEnd="16dp" android:paddingEnd="16dp"
android:paddingStart="16dp" android:paddingStart="16dp"
android:text="@string/label_wallet_send" android:text="@string/label_wallet_send"