1
mirror of https://github.com/m2049r/xmrwallet synced 2025-09-02 15:53:04 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
m2049r
6678222202 Bugfix: Generate screen is now scrollable (#84)
* generate+detail screens made scrollable

* new version
2017-09-23 22:26:12 +02:00
m2049r
793d984200 Bugfix: crashing on android 5 & 6 (new wallet, receive, ...) (#83)
* getAddress() mess fixed

* v0.8.0.3
2017-09-23 18:23:41 +02:00
m2049r
cc46dc06c4 Bugfixes (#82)
* cache getAddress()

* savedInstanceState handling

* v0.8.0.2
2017-09-23 14:16:30 +02:00
26 changed files with 230 additions and 221 deletions

2
.idea/misc.xml generated
View File

@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@@ -8,8 +8,8 @@ android {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 14
versionName "0.8.0.1"
versionCode 17
versionName "0.8.0.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {

View File

@@ -531,8 +531,7 @@ Java_com_m2049r_xmrwallet_model_Wallet_setPassword(JNIEnv *env, jobject instance
JNIEXPORT jstring JNICALL
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
const char *address = wallet->address().c_str();
return env->NewStringUTF(address);
return env->NewStringUTF(wallet->address().c_str());
}
JNIEXPORT jstring JNICALL

View File

@@ -75,13 +75,13 @@ public class LoginActivity extends AppCompatActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.login_activity);
setContentView(R.layout.login_activity);
if (savedInstanceState != null) {
return;
// we don't store anything ourselves
}
setContentView(R.layout.login_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);

View File

@@ -150,14 +150,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "onCreate()");
super.onCreate(savedInstanceState);
setContentView(R.layout.wallet_activity);
if (savedInstanceState != null) {
return;
// we don't store anything ourselves
}
setContentView(R.layout.wallet_activity);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle(R.string.app_name);
setSupportActionBar(toolbar);
toolbar.setTitle(R.string.app_name);
boolean testnet = WalletManager.getInstance().isTestNet();
if (testnet) {
toolbar.setBackgroundResource(R.color.colorPrimaryDark);

View File

@@ -50,8 +50,6 @@ public class Wallet {
ConnectionStatus_WrongVersion
}
//public native long createWalletListenerJ();
public native String getSeed();
public native String getSeedLanguage();
@@ -68,11 +66,11 @@ public class Wallet {
public native boolean setPassword(String password);
private String address = null;
public String getAddress() {
String address = getAddressJ();
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
// just die!
throw new IllegalStateException("Wallet returned invalid address!");
if (address == null) {
address = getAddressJ();
}
return address;
}

View File

@@ -1,107 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:id="@+id/etWalletName"
style="@style/MoneroEdit"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_name_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:textAlignment="center" />
android:orientation="horizontal"
android:weightSum="2">
<EditText
android:id="@+id/etWalletName"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_name_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:maxLines="1"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletPassword"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_password_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletPassword"
style="@style/MoneroEdit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/generate_password_hint"
android:imeOptions="actionNext"
android:inputType="text"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletMnemonic"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_mnemonic_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletAddress"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_address_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<LinearLayout
android:id="@+id/llRestoreKeys"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:id="@+id/etWalletViewKey"
android:id="@+id/etWalletMnemonic"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_viewkey_hint"
android:hint="@string/generate_mnemonic_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletSpendKey"
android:id="@+id/etWalletAddress"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_spendkey_hint"
android:hint="@string/generate_address_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center"/>
android:textAlignment="center" />
<LinearLayout
android:id="@+id/llRestoreKeys"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<EditText
android:id="@+id/etWalletViewKey"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_viewkey_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
<EditText
android:id="@+id/etWalletSpendKey"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_spendkey_hint"
android:imeOptions="actionNext"
android:inputType="textMultiLine"
android:textAlignment="center" />
</LinearLayout>
<EditText
android:id="@+id/etWalletRestoreHeight"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_restoreheight_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:visibility="gone" />
<Button
android:id="@+id/bGenerate"
style="@style/MoneroButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:text="@string/generate_buttonGenerate" />
</LinearLayout>
<EditText
android:id="@+id/etWalletRestoreHeight"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/generate_restoreheight_hint"
android:imeOptions="actionDone"
android:inputType="number"
android:textAlignment="center"
android:visibility="gone" />
<Button
android:id="@+id/bGenerate"
style="@style/MoneroButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:enabled="false"
android:text="@string/generate_buttonGenerate" />
</LinearLayout>
</ScrollView>

File diff suppressed because it is too large Load Diff