1
mirror of https://github.com/m2049r/xmrwallet synced 2024-11-28 17:43:22 +01:00

hide receive button before wallet is loaded (#115)

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

View File

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

View File

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

View File

@ -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) {
tvProgress.setText(text);
}
@ -373,5 +387,6 @@ public class WalletFragment extends Fragment
Log.d(TAG, "onResume()");
activityCallback.setTitle(walletTitle, walletSubtitle);
activityCallback.setToolbarButton(Toolbar.BUTTON_CLOSE);
showReceive();
}
}

View File

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