Skip to content

Commit

Permalink
Merge pull request #54 from cryptape/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
BaojunCZ authored Aug 15, 2018
2 parents e763d9c + 46419d4 commit c9cdda5
Show file tree
Hide file tree
Showing 303 changed files with 8,385 additions and 3,375 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Thumbs.db
.idea
**/.idea/workspace.xml
workspace.xml
release/

# .idea/workspace.xml # - remove # and delete .idea if it better suit your needs.
.gradle
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
![](https://img.shields.io/badge/made%20for-Nervos%20AppChain-blue.svg)

Welcome to Neuron's open source Android app!
# Neuron Walllet (Android)

Welcome to Neuron's open source Android app!

Getting Started
===============
Expand All @@ -12,9 +15,9 @@ Getting Started
Making a new build for App store (Dev only)
============================================

1. Open app/build.gradle
2. Increase the versionCode by 1.
3. Optionally change the versionName to whatever you want.
1. Clone source code to local
2. Open app/config.gradle
3. Increase the versionCode by 1.
4. Build the APK however you want (in Android Studio or via gradle)
- You'll need the release certificate, alias and password.
5. Commit the changes to build.gradle, upload the APKs to App store
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'io.reactivex:rxandroid:1.2.0'
implementation 'org.slf4j:slf4j-api:1.7.25'
Expand Down
1 change: 0 additions & 1 deletion app/release/output.json

This file was deleted.

181 changes: 117 additions & 64 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.USE_FINGERPRINT" />

<application
android:name=".NeuronApplication"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:hardwareAccelerated="false"
android:largeHeap="true"
android:name=".NeuronApplication"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activity.SplashActivity"
<activity
android:name=".activity.SplashActivity"
android:noHistory="true"
android:theme="@style/Theme.SPLASH"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:theme="@style/Theme.SPLASH">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -38,85 +41,135 @@
<activity
android:name=".activity.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
</activity>
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.AddTokenActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.AddTokenActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.TransactionDetailActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.TransactionListActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.TransferActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.TransactionDetailActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.WalletManageActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.TransferActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.AddWalletActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.WalletManageActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.CreateWalletActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.AddWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.BackupMnemonicActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.CreateWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.ConfirmMnemonicActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.BackupMnemonicActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.ImportWalletActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.ConfirmMnemonicActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.AppWebActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.ImportWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.TokenManageActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.AppWebActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.ReceiveQrCodeActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.TokenManageActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.ChangePasswordActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.ReceiveQrCodeActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.AddWebsiteActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.ChangePasswordActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.PayTokenActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.AddWebsiteActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.QrCodeActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.PayTokenActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.ExportKeystoreActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.QrCodeActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<activity android:name=".activity.SimpleWebActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"/>
<activity
android:name=".activity.ExportKeystoreActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

</application>
<activity
android:name=".activity.SimpleWebActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.AboutUsActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.CurrencyActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.ChangeWalletActivity"
android:theme="@style/transparent_activity" />
<activity
android:name=".activity.PwdUnlockActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".activity.FingerPrintActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="org.nervos.neuron.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

</application>


</manifest>
72 changes: 72 additions & 0 deletions app/src/main/java/org/nervos/neuron/activity/AboutUsActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package org.nervos.neuron.activity;

import android.content.pm.PackageManager;
import android.os.Build;
import android.view.View;
import android.widget.TextView;

import org.nervos.neuron.R;
import org.nervos.neuron.custom.SettingButtonView;
import org.nervos.neuron.custom.TitleBar;
import org.nervos.neuron.service.HttpUrls;

/**
* Created by 包俊 on 2018/7/30.
*/
public class AboutUsActivity extends NBaseActivity {

private TextView versionText;
private TitleBar title;
private SettingButtonView sourceCodeSBV, serverPrivateSBV, NervosSBV, InfuraSBV, openSeaSBV;

@Override
protected int getContentLayout() {
return R.layout.activity_about_us;
}

@Override
protected void initView() {
versionText = findViewById(R.id.app_version);
sourceCodeSBV = findViewById(R.id.sbv_source_code);
serverPrivateSBV = findViewById(R.id.sbv_server_private);
NervosSBV = findViewById(R.id.sbv_nervos_network);
InfuraSBV = findViewById(R.id.sbv_infura);
openSeaSBV = findViewById(R.id.sbv_open_sea);
title = findViewById(R.id.title);
}

@Override
protected void initAction() {
initListener();
}

@Override
protected void initData() {
try {
String versionName = getPackageManager()
.getPackageInfo(getPackageName(), 0).versionName;
versionText.setText(String.format("V %s", versionName));
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
title.setLeftImage(R.drawable.ic_toptitle_back_white);
}

private void initListener() {
sourceCodeSBV.setOpenListener(() -> {
SimpleWebActivity.gotoSimpleWeb(AboutUsActivity.this, HttpUrls.SOURCE_CODE_GITHUB_URL);
});
serverPrivateSBV.setOpenListener(() -> {
SimpleWebActivity.gotoSimpleWeb(AboutUsActivity.this, HttpUrls.PRODUCT_AGREEMENT_URL);
});
NervosSBV.setOpenListener(() -> {
SimpleWebActivity.gotoSimpleWeb(AboutUsActivity.this, HttpUrls.NERVOS_NETWORK);
});
InfuraSBV.setOpenListener(() -> {
SimpleWebActivity.gotoSimpleWeb(AboutUsActivity.this, HttpUrls.INFURA);
});
openSeaSBV.setOpenListener(() -> {
SimpleWebActivity.gotoSimpleWeb(AboutUsActivity.this, HttpUrls.OPEN_SEA);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import org.nervos.neuron.item.ChainItem;
import org.nervos.neuron.item.WalletItem;
import org.nervos.neuron.service.EthRpcService;
import org.nervos.neuron.service.HttpUrls;
import org.nervos.neuron.service.NervosRpcService;
import org.nervos.neuron.R;
import org.nervos.neuron.item.TokenItem;
import org.nervos.neuron.util.AddressUtil;
import org.nervos.neuron.util.ConstUtil;
import org.nervos.neuron.util.db.DBTokenUtil;
import org.nervos.neuron.util.permission.PermissionUtil;
import org.nervos.neuron.util.permission.RuntimeRationale;
Expand Down Expand Up @@ -61,7 +61,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
initView();
initData();
initListener();
NervosRpcService.init(this, ConstUtil.NERVOS_NODE_IP);
NervosRpcService.init(this, HttpUrls.NERVOS_NODE_IP);
}

private void initView() {
Expand Down
Loading

0 comments on commit c9cdda5

Please sign in to comment.