Fix conflicts
|
@ -1,689 +1,6 @@
|
||||||
package carbon.crypto.com.carbon;
|
package carbon.crypto.com.carbon;
|
||||||
|
|
||||||
import android.app.Activity;
|
public class Application{
|
||||||
import android.content.Context;
|
|
||||||
import android.net.ConnectivityManager;
|
|
||||||
import android.net.NetworkInfo;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.multidex.MultiDex;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import de.bitshares_munich.autobahn.WebSocketConnection;
|
|
||||||
import de.bitshares_munich.autobahn.WebSocketException;
|
|
||||||
import de.bitshares_munich.interfaces.AssetDelegate;
|
|
||||||
import de.bitshares_munich.interfaces.IAccount;
|
|
||||||
import de.bitshares_munich.interfaces.IAccountID;
|
|
||||||
import de.bitshares_munich.interfaces.IAccountObject;
|
|
||||||
import de.bitshares_munich.interfaces.IAssetObject;
|
|
||||||
import de.bitshares_munich.interfaces.IBalancesDelegate;
|
|
||||||
import de.bitshares_munich.interfaces.IExchangeRate;
|
|
||||||
import de.bitshares_munich.interfaces.IRelativeHistory;
|
|
||||||
import de.bitshares_munich.interfaces.ITransactionObject;
|
|
||||||
import de.bitshares_munich.smartcoinswallet.Constants;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by qasim on 5/9/16.
|
|
||||||
*/
|
|
||||||
public class Application extends android.app.Application implements de.bitshares_munich.autobahn.WebSocket.WebSocketConnectionObserver,
|
|
||||||
android.app.Application.ActivityLifecycleCallbacks {
|
|
||||||
public static Context context;
|
|
||||||
public static String blockHead = "";
|
|
||||||
public static int refBlockNum;
|
|
||||||
public static long refBlockPrefix;
|
|
||||||
public static long blockTime;
|
|
||||||
public static String urlsSocketConnection[] =
|
|
||||||
{
|
|
||||||
"wss://bitshares.openledger.info/ws", // Openledger node
|
|
||||||
"wss://eu.openledger.info/ws", // Openledger EU node
|
|
||||||
"ws://128.0.69.157:8090", // Henry node
|
|
||||||
"ws://128.0.69.157:8091", // Henry node
|
|
||||||
"wss://de.blockpay.ch/node" // German node
|
|
||||||
};
|
|
||||||
public static String faucetUrl = "http://128.0.69.157:5000";
|
|
||||||
public static String monitorAccountId;
|
|
||||||
public static int nodeIndex = 0;
|
|
||||||
public static Boolean isReady = false;
|
|
||||||
static IAccount iAccount;
|
|
||||||
static IExchangeRate iExchangeRate;
|
|
||||||
static IBalancesDelegate iBalancesDelegate_transactionActivity;
|
|
||||||
static IBalancesDelegate iBalancesDelegate_ereceiptActivity;
|
|
||||||
static IBalancesDelegate iBalancesDelegate_assetsActivity;
|
|
||||||
static AssetDelegate iAssetDelegate;
|
|
||||||
static IAccountID iAccountID;
|
|
||||||
static ITransactionObject iTransactionObject;
|
|
||||||
static IAccountObject iAccountObject;
|
|
||||||
static IAssetObject iAssetObject;
|
|
||||||
static IRelativeHistory iRelativeHistory;
|
|
||||||
static String connectedSocket;
|
|
||||||
private static String TAG = "Application";
|
|
||||||
private static Activity currentActivity;
|
|
||||||
private static Handler warningHandler = new Handler();
|
|
||||||
private static boolean mIsConnected = false;
|
|
||||||
private static WebSocketConnection mConnection;
|
|
||||||
private static URI mServerURI;
|
|
||||||
/**
|
|
||||||
* Constant used to specify how long will the app wait for another activity to go through its starting life
|
|
||||||
* cycle events before create the lock pin screen.
|
|
||||||
* <p>
|
|
||||||
* This is used as a means to detect whether or not the user has left the app.
|
|
||||||
*/
|
|
||||||
private final int LOCK_DELAY = 10000;
|
|
||||||
Handler connectionHandler = new Handler();
|
|
||||||
/* Attribute used to indicate that funds must be updated (primarilly used at SendScreen and BalanceFragments */
|
|
||||||
private boolean mUpdateFunds = false;
|
|
||||||
/* Internal attribute used to keep track of the application state */
|
|
||||||
private boolean mAppLock = true;
|
|
||||||
/**
|
|
||||||
* Handler instance used to schedule tasks back to the main thread
|
|
||||||
*/
|
|
||||||
private Handler mHandler;
|
|
||||||
/**
|
|
||||||
* Runnable that will set to lock the app with the PIN.
|
|
||||||
*/
|
|
||||||
private Runnable lockApp = new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
mAppLock = true;
|
|
||||||
Log.i(TAG, "App Locked");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static Activity getCurrentActivity() {
|
|
||||||
return Application.currentActivity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCurrentActivity(Activity _activity) {
|
|
||||||
Application.currentActivity = _activity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerCallback(IAccount callbackClass) {
|
|
||||||
iAccount = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerCallbackIAccountID(IAccountID callbackClass) {
|
|
||||||
iAccountID = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerExchangeRateCallback(IExchangeRate callbackClass) {
|
|
||||||
iExchangeRate = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBalancesDelegateTransaction(IBalancesDelegate callbackClass) {
|
|
||||||
iBalancesDelegate_transactionActivity = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBalancesDelegateEReceipt(IBalancesDelegate callbackClass) {
|
|
||||||
iBalancesDelegate_ereceiptActivity = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerBalancesDelegateAssets(IBalancesDelegate callbackClass) {
|
|
||||||
iBalancesDelegate_assetsActivity = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerAssetDelegate(AssetDelegate callbackClass) {
|
|
||||||
iAssetDelegate = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerTransactionObject(ITransactionObject callbackClass) {
|
|
||||||
iTransactionObject = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerAccountObjectCallback(IAccountObject callbackClass) {
|
|
||||||
iAccountObject = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerAssetObjectCallback(IAssetObject callbackClass) {
|
|
||||||
iAssetObject = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void registerRelativeHistoryCallback(IRelativeHistory callbackClass) {
|
|
||||||
iRelativeHistory = callbackClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void showWarningMessage(final String myEx) {
|
|
||||||
if (getCurrentActivity() != null) {
|
|
||||||
Log.d("exception websocket", "inside again");
|
|
||||||
getCurrentActivity().runOnUiThread(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
Toast.makeText(context, "Your system does not supports new SSL ciphering. Error : " + myEx, Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void stringTextRecievedWs(String s) {
|
|
||||||
try {
|
|
||||||
JSONObject jsonObject = new JSONObject(s);
|
|
||||||
|
|
||||||
if (jsonObject.has("id")) {
|
|
||||||
int id = jsonObject.getInt("id");
|
|
||||||
Log.d(TAG, "Got response. id: " + id);
|
|
||||||
if (id == 1) {
|
|
||||||
if (s.contains("true")) {
|
|
||||||
Application.send(context.getString(R.string.database_indentifier));
|
|
||||||
} else {
|
|
||||||
Application.send(context.getString(R.string.login_api));
|
|
||||||
}
|
|
||||||
} else if (id == 2) {
|
|
||||||
Helper.storeIntSharePref(context, context.getString(R.string.sharePref_database), jsonObject.getInt("result"));
|
|
||||||
Application.send(context.getString(R.string.network_broadcast_identifier));
|
|
||||||
} else if (id == 3) {
|
|
||||||
Helper.storeIntSharePref(context, context.getString(R.string.sharePref_network_broadcast), jsonObject.getInt("result"));
|
|
||||||
Application.send(context.getString(R.string.history_identifier));
|
|
||||||
} else if (id == 4) {
|
|
||||||
Helper.storeIntSharePref(context, context.getString(R.string.sharePref_history), jsonObject.getInt("result"));
|
|
||||||
Application.send(context.getString(R.string.subscribe_callback));
|
|
||||||
isReady = true;
|
|
||||||
} else if (id == 6) {
|
|
||||||
if (iAccount != null) {
|
|
||||||
iAccount.checkAccount(jsonObject);
|
|
||||||
}
|
|
||||||
} else if (id == 100 || id == 200) {
|
|
||||||
JSONArray jsonArray = (JSONArray) jsonObject.get("result");
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
if (jsonArray.length() != 0) {
|
|
||||||
obj = (JSONObject) jsonArray.get(1);
|
|
||||||
}
|
|
||||||
iExchangeRate.callback_exchange_rate(obj, id);
|
|
||||||
} else if (id == 8) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 20) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 21) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 22) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 23) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 12) {
|
|
||||||
if (iTransactionObject != null) {
|
|
||||||
iTransactionObject.checkTransactionObject(jsonObject);
|
|
||||||
}
|
|
||||||
} else if (id == 13) {
|
|
||||||
if (iAccountObject != null) {
|
|
||||||
iAccountObject.accountObjectCallback(jsonObject);
|
|
||||||
}
|
|
||||||
} else if (id == 14) {
|
|
||||||
if (iAssetObject != null) {
|
|
||||||
iAssetObject.assetObjectCallback(jsonObject);
|
|
||||||
}
|
|
||||||
} else if (id == 9) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 10) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 11) {
|
|
||||||
if (iBalancesDelegate_transactionActivity != null) {
|
|
||||||
iBalancesDelegate_transactionActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 99) {
|
|
||||||
if (iBalancesDelegate_assetsActivity != null) {
|
|
||||||
iBalancesDelegate_assetsActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 999) {
|
|
||||||
if (iBalancesDelegate_assetsActivity != null) {
|
|
||||||
iBalancesDelegate_assetsActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 15) {
|
|
||||||
if (iAssetDelegate != null) {
|
|
||||||
iAssetDelegate.getLifetime(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 151) {
|
|
||||||
if (iAccountID != null) {
|
|
||||||
iAccountID.accountId(s);
|
|
||||||
}
|
|
||||||
} else if (id == 160 || id == 161) {
|
|
||||||
if (iRelativeHistory != null) {
|
|
||||||
iRelativeHistory.relativeHistoryCallback(jsonObject);
|
|
||||||
}
|
|
||||||
} else if (id == 17) {
|
|
||||||
} else if (id == 18) {
|
|
||||||
if (iBalancesDelegate_ereceiptActivity != null) {
|
|
||||||
iBalancesDelegate_ereceiptActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
} else if (id == 19) {
|
|
||||||
if (iBalancesDelegate_ereceiptActivity != null) {
|
|
||||||
iBalancesDelegate_ereceiptActivity.OnUpdate(s, id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (jsonObject.has("method")) {
|
|
||||||
if (jsonObject.getString("method").equals("notice")) {
|
|
||||||
if (jsonObject.has("params")) {
|
|
||||||
int id = jsonObject.getJSONArray("params").getInt(0);
|
|
||||||
JSONArray values = jsonObject.getJSONArray("params").getJSONArray(1);
|
|
||||||
|
|
||||||
if (id == 7) {
|
|
||||||
headBlockNumber(values.toString());
|
|
||||||
|
|
||||||
if (monitorAccountId != null && !monitorAccountId.isEmpty() && values.toString().contains(monitorAccountId)) {
|
|
||||||
if (iAssetDelegate != null) {
|
|
||||||
iAssetDelegate.loadAll();
|
|
||||||
}
|
|
||||||
Log.d("Notice Update", values.toString());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.d("other notice", values.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (JSONException e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void sendInitialSocket(final Context context) {
|
|
||||||
|
|
||||||
if (Application.mIsConnected) {
|
|
||||||
Application.send(context.getString(R.string.login_api));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String headBlockNumber(String json) {
|
|
||||||
final String BLOCK_REFERENCE_ID = "head_block_id";
|
|
||||||
final String HEAD_BLOCK_NUMBER = "head_block_number";
|
|
||||||
final String TIME = "time";
|
|
||||||
try {
|
|
||||||
JSONArray array = new JSONArray(json);
|
|
||||||
String rawBlockId = "";
|
|
||||||
String blockNumber = "";
|
|
||||||
if (array.length() == 1) {
|
|
||||||
JSONArray subArray = array.getJSONArray(0);
|
|
||||||
for (int i = 0; i < subArray.length(); i++) {
|
|
||||||
if (subArray.get(i) instanceof JSONObject) {
|
|
||||||
JSONObject element = (JSONObject) subArray.get(i);
|
|
||||||
if (element.has(BLOCK_REFERENCE_ID)) {
|
|
||||||
rawBlockId = element.getString(BLOCK_REFERENCE_ID);
|
|
||||||
}
|
|
||||||
if (element.has(HEAD_BLOCK_NUMBER)) {
|
|
||||||
blockNumber = element.getString(HEAD_BLOCK_NUMBER);
|
|
||||||
}
|
|
||||||
if (element.has(TIME)) {
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
|
||||||
try {
|
|
||||||
Date date = simpleDateFormat.parse(element.getString(TIME));
|
|
||||||
blockTime = date.getTime() / 1000;
|
|
||||||
} catch (ParseException e) {
|
|
||||||
Log.e(TAG, "ParseException while trying to parse time. time string: " + element.getString(TIME));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
String element = (String) subArray.get(i);
|
|
||||||
Log.d(TAG, "Could not cast string: " + element);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rawBlockId.equals("")) {
|
|
||||||
return blockHead;
|
|
||||||
}
|
|
||||||
// Setting block number
|
|
||||||
blockHead = "block# " + blockNumber;
|
|
||||||
|
|
||||||
// Setting reference block number (lower 16 bits of block number)
|
|
||||||
refBlockNum = Integer.valueOf(blockNumber) & 0xffff;
|
|
||||||
|
|
||||||
// Setting block prefix
|
|
||||||
String hashData = rawBlockId.substring(8, 16);
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
for (int i = 0; i < 8; i = i + 2) {
|
|
||||||
builder.append(hashData.substring(6 - i, 8 - i));
|
|
||||||
}
|
|
||||||
refBlockPrefix = Long.parseLong(builder.toString(), 16);
|
|
||||||
}
|
|
||||||
} catch (JSONException e) {
|
|
||||||
Log.e(TAG, "JSONException at headBlockNumber");
|
|
||||||
}
|
|
||||||
return blockHead;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//WebSocketConnection
|
|
||||||
|
|
||||||
public static void send(String message) {
|
|
||||||
if (mIsConnected) {
|
|
||||||
mConnection.sendTextMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void disconnect() {
|
|
||||||
Log.i("internetBlockpay", "Disconnect");
|
|
||||||
if (mConnection != null) {
|
|
||||||
mConnection.disconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public static Boolean isConnected() {
|
|
||||||
return mConnection != null && (mConnection.isConnected());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void timeStamp() {
|
|
||||||
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", false);
|
|
||||||
setTimeStamp();
|
|
||||||
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", true);
|
|
||||||
|
|
||||||
}
|
|
||||||
}, 10 * 60000);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
public static Boolean accountCanCreate() {
|
|
||||||
return Helper.fetchBoolianSharePref(context, "account_can_create");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setTimeStamp() {
|
|
||||||
Calendar c = Calendar.getInstance();
|
|
||||||
long time = c.getTimeInMillis();
|
|
||||||
Helper.storeLongSharePref(context, "account_create_timestamp", time);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void getTimeStamp() {
|
|
||||||
try {
|
|
||||||
Calendar c = Calendar.getInstance();
|
|
||||||
long currentTime = c.getTimeInMillis();
|
|
||||||
;
|
|
||||||
long oldTime = Helper.fetchLongSharePref(context, "account_create_timestamp");
|
|
||||||
long diff = currentTime - oldTime;
|
|
||||||
if (diff < TimeUnit.MINUTES.toMillis(10)) {
|
|
||||||
new Handler().postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", true);
|
|
||||||
}
|
|
||||||
}, TimeUnit.MINUTES.toMillis(10) - diff);
|
|
||||||
} else {
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", true);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the state of the application(If locked or not).
|
|
||||||
*/
|
|
||||||
public Boolean getLock() {
|
|
||||||
return mAppLock;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the state of the application(If locked or not).
|
|
||||||
*/
|
|
||||||
public void setLock(Boolean value) {
|
|
||||||
mAppLock = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
MultiDex.install(this);
|
|
||||||
ButterKnife.setDebug(true);
|
|
||||||
context = getApplicationContext();
|
|
||||||
blockHead = "";
|
|
||||||
|
|
||||||
mHandler = new Handler();
|
|
||||||
/*
|
|
||||||
* Registering this class as a listener to all activitie's callback cycle events, in order to
|
|
||||||
* better estimate when the user has left the app and it is safe to lock the app or not
|
|
||||||
*/
|
|
||||||
registerActivityLifecycleCallbacks(this);
|
|
||||||
|
|
||||||
|
|
||||||
//SETUP LOCALE AND DEFAULT PREFERENCES
|
|
||||||
|
|
||||||
//Setup Country
|
|
||||||
String country = Helper.fetchStringSharePref(getApplicationContext(), getString(R.string.pref_country), "");
|
|
||||||
//If not at preferences yet it will setup device country or constant default
|
|
||||||
//(It is expected that this "if" will be executed only one time, at first start up)
|
|
||||||
if (country.equals("")) {
|
|
||||||
Log.w(TAG, "Could not resolve country information, trying with the telephony manager");
|
|
||||||
//If the locale mechanism fails to give us a country, we try
|
|
||||||
//to get it from the TelephonyManager.
|
|
||||||
country = Helper.getDeviceCountry(getApplicationContext());
|
|
||||||
//If device don't respond with any country set it to the default (app constant)
|
|
||||||
if (country == null || country.equals("")) {
|
|
||||||
Log.w(TAG, "Could not resolve country information again, falling back to the default");
|
|
||||||
country = Constants.DEFAULT_COUNTRY_CODE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Helper.setCountry(getApplicationContext(), country);
|
|
||||||
|
|
||||||
//Setup Language
|
|
||||||
String language = Helper.fetchStringSharePref(getApplicationContext(), getString(R.string.pref_language));
|
|
||||||
//If app language preferences aren't set, set default as device/os language (telephony language)
|
|
||||||
//(It is expected that this "if" will be executed only one time, at first start up)
|
|
||||||
if (language.equals("")) {
|
|
||||||
language = Locale.getDefault().getLanguage();
|
|
||||||
//Just checking if we still don't have a language setup in the locale, in which
|
|
||||||
//case we fallback to english as the default (the app constant .
|
|
||||||
if (language.equals("")) {
|
|
||||||
Log.w(TAG, "Could not resolve language information, falling back to english");
|
|
||||||
language = Constants.DEFAULT_LANGUAGE_CODE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Helper.setLanguage(getApplicationContext(), language);
|
|
||||||
|
|
||||||
|
|
||||||
//Check automatically close app behavior (after 3 min) is set and if not, put true by default
|
|
||||||
Boolean closeAppPref = Helper.checkSharedPref(getApplicationContext(), "close_bitshare");
|
|
||||||
if (!closeAppPref) {
|
|
||||||
Helper.storeBoolianSharePref(getApplicationContext(), "close_bitshare", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
init();
|
|
||||||
accountCreateInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init() {
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (mConnection == null) {
|
|
||||||
mConnection = new WebSocketConnection();
|
|
||||||
checkConnection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void webSocketConnection() {
|
|
||||||
isReady = false;
|
|
||||||
new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
nodeIndex = nodeIndex % urlsSocketConnection.length;
|
|
||||||
|
|
||||||
Log.i(TAG, "preparing to connect to:" + urlsSocketConnection[nodeIndex]);
|
|
||||||
|
|
||||||
connect(urlsSocketConnection[nodeIndex]);
|
|
||||||
nodeIndex++;
|
|
||||||
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onOpen() {
|
|
||||||
Log.i("internetBlockpay", "open internet");
|
|
||||||
mIsConnected = true;
|
|
||||||
// Toast.makeText(context, getResources().getString(R.string.connected_to)+ ": "+connectedSocket,Toast.LENGTH_SHORT).show();
|
|
||||||
sendInitialSocket(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void checkConnection() {
|
|
||||||
connectionHandler.removeCallbacksAndMessages(null);
|
|
||||||
connectionHandler.postDelayed(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
|
|
||||||
if (checkInternetConnection()) {
|
|
||||||
{
|
|
||||||
webSocketConnection();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
connectionHandler.postDelayed(this, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClose(WebSocketCloseNotification code, String reason) {
|
|
||||||
Log.i("internetBlockpay", "close internet");
|
|
||||||
mIsConnected = false;
|
|
||||||
checkConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextMessage(String payload) {
|
|
||||||
stringTextRecievedWs(payload);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRawTextMessage(byte[] payload) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBinaryMessage(byte[] payload) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private void connect(String node) {
|
|
||||||
Log.i("internetBlockpay", "connecting to internet");
|
|
||||||
Log.i("Connect", "connect(String node) called");
|
|
||||||
try {
|
|
||||||
if (!mIsConnected) {
|
|
||||||
Log.i("Connect", "Inside when not mIsConnected");
|
|
||||||
mServerURI = new URI(node);
|
|
||||||
connectedSocket = node;
|
|
||||||
mConnection.connect(mServerURI, this);
|
|
||||||
}
|
|
||||||
} catch (URISyntaxException e) {
|
|
||||||
String message = e.getLocalizedMessage();
|
|
||||||
Log.i("Connect", "Inside catch block when not mIsConnected, got exception, msg is:" + message);
|
|
||||||
checkConnection();
|
|
||||||
} catch (WebSocketException e) {
|
|
||||||
String message = e.getLocalizedMessage();
|
|
||||||
Log.i("Connect", "Inside catch block when not mIsConnected, got exception, msg is:" + message);
|
|
||||||
if (!mIsConnected) {
|
|
||||||
checkConnection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Boolean checkInternetConnection() {
|
|
||||||
ConnectivityManager cm =
|
|
||||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
|
||||||
|
|
||||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
|
||||||
return activeNetwork != null &&
|
|
||||||
activeNetwork.isConnectedOrConnecting();
|
|
||||||
}
|
|
||||||
|
|
||||||
void accountCreateInit() {
|
|
||||||
if (Helper.containKeySharePref(context, "account_can_create")) {
|
|
||||||
if (!accountCanCreate()) {
|
|
||||||
getTimeStamp();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Helper.storeBoolianSharePref(context, "account_can_create", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get attribute used to indicate if UI should update the funds or not after an update (Send funds primarily)
|
|
||||||
*
|
|
||||||
* @return The boolean value of update UI state
|
|
||||||
*/
|
|
||||||
public boolean getUpdateFunds() {
|
|
||||||
return this.mUpdateFunds;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set attribute used to indicate if UI should update the funds or not after an update (Send funds primarily)
|
|
||||||
*
|
|
||||||
* @param update The boolean value of update UI state
|
|
||||||
*/
|
|
||||||
public void setUpdateFunds(boolean update) {
|
|
||||||
this.mUpdateFunds = update;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
|
||||||
mHandler.removeCallbacks(this.lockApp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityStarted(Activity activity) {
|
|
||||||
mHandler.removeCallbacks(this.lockApp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityResumed(Activity activity) {
|
|
||||||
mHandler.removeCallbacks(this.lockApp);
|
|
||||||
Application.setCurrentActivity(activity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityPaused(Activity activity) {
|
|
||||||
//Call the handler only if app is not already locked
|
|
||||||
if (!mAppLock) {
|
|
||||||
mHandler.postDelayed(this.lockApp, LOCK_DELAY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityStopped(Activity activity) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActivityDestroyed(Activity activity) {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
app/src/main/res/anim/animation.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shareInterpolator="false">
|
||||||
|
<translate
|
||||||
|
android:fromXDelta="100%" android:toXDelta="0%"
|
||||||
|
android:fromYDelta="0%" android:toYDelta="0%"
|
||||||
|
android:duration="666" />
|
||||||
|
</set>
|
25
app/src/main/res/anim/coin_animation.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fromDegrees="0"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="50"
|
||||||
|
android:repeatCount="1"
|
||||||
|
android:repeatMode="reverse"
|
||||||
|
android:toDegrees="30" />
|
||||||
|
<scale xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fromXScale="1"
|
||||||
|
android:toXScale="1.05"
|
||||||
|
android:fromYScale="1"
|
||||||
|
android:toYScale="1.05"
|
||||||
|
android:duration="50"
|
||||||
|
android:repeatCount="1"
|
||||||
|
android:repeatMode="reverse"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%" >
|
||||||
|
</scale>
|
||||||
|
|
||||||
|
</set>
|
9
app/src/main/res/anim/fade_in.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator">
|
||||||
|
<alpha
|
||||||
|
android:fromAlpha="0.1"
|
||||||
|
android:toAlpha="1.0"
|
||||||
|
android:duration="333"
|
||||||
|
/>
|
||||||
|
</set>
|
9
app/src/main/res/anim/fade_out.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:interpolator="@android:anim/linear_interpolator">
|
||||||
|
<alpha
|
||||||
|
android:fromAlpha="1.0"
|
||||||
|
android:toAlpha="0.1"
|
||||||
|
android:duration="333"
|
||||||
|
/>
|
||||||
|
</set>
|
10
app/src/main/res/anim/flash.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<alpha android:fromAlpha="0.0"
|
||||||
|
android:toAlpha="1.0"
|
||||||
|
android:interpolator="@android:anim/accelerate_interpolator"
|
||||||
|
android:duration="500"
|
||||||
|
android:repeatMode="reverse"
|
||||||
|
android:repeatCount="infinite"
|
||||||
|
/>
|
||||||
|
</set>
|
8
app/src/main/res/anim/home_anim.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shareInterpolator="false">
|
||||||
|
<translate
|
||||||
|
android:fromXDelta="130%" android:toXDelta="0%"
|
||||||
|
android:fromYDelta="0%" android:toYDelta="0%"
|
||||||
|
android:duration="666" />
|
||||||
|
</set>
|
13
app/src/main/res/anim/rotate360.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fromDegrees="0"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
|
||||||
|
android:duration="1000"
|
||||||
|
android:repeatCount="0"
|
||||||
|
android:toDegrees="360" />
|
||||||
|
|
||||||
|
</set>
|
41
app/src/main/res/animator/my_animated_button.xml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true" android:state_enabled="true">
|
||||||
|
<set>
|
||||||
|
<objectAnimator android:propertyName="translationZ"
|
||||||
|
android:duration="100"
|
||||||
|
android:valueTo="0.0"
|
||||||
|
android:valueType="floatType"/>
|
||||||
|
<objectAnimator android:propertyName="elevation"
|
||||||
|
android:duration="100"
|
||||||
|
android:valueTo="0.0"
|
||||||
|
android:valueType="floatType"/>
|
||||||
|
</set>
|
||||||
|
</item>
|
||||||
|
<!-- base state -->
|
||||||
|
<item android:state_enabled="true">
|
||||||
|
<set>
|
||||||
|
<objectAnimator android:propertyName="translationZ"
|
||||||
|
android:duration="100"
|
||||||
|
android:valueTo="5"
|
||||||
|
android:startDelay="0"
|
||||||
|
android:valueType="floatType"/>
|
||||||
|
<objectAnimator android:propertyName="elevation"
|
||||||
|
android:duration="0"
|
||||||
|
android:valueTo="5"
|
||||||
|
android:valueType="floatType" />
|
||||||
|
</set>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<set>
|
||||||
|
<objectAnimator android:propertyName="translationZ"
|
||||||
|
android:duration="0"
|
||||||
|
android:valueTo="5"
|
||||||
|
android:valueType="floatType"/>
|
||||||
|
<objectAnimator android:propertyName="elevation"
|
||||||
|
android:duration="0"
|
||||||
|
android:valueTo="5"
|
||||||
|
android:valueType="floatType"/>
|
||||||
|
</set>
|
||||||
|
</item>
|
||||||
|
</selector>
|
BIN
app/src/main/res/drawable-hdpi/add_contact.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/drawable-hdpi/back_button_image.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_send_button.png
Executable file
After Width: | Height: | Size: 616 B |
BIN
app/src/main/res/drawable-hdpi/icon_help.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-hdpi/receive.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-hdpi/send.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
app/src/main/res/drawable-hdpi/share.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-mdpi/add_contact.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-mdpi/back_button_image.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_send_button.png
Executable file
After Width: | Height: | Size: 348 B |
BIN
app/src/main/res/drawable-mdpi/receive.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-mdpi/send.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-mdpi/share.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/add_contact.png
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/back_button_image.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/deleteicon.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
app/src/main/res/drawable-xhdpi/editicon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_send_button.png
Executable file
After Width: | Height: | Size: 633 B |
BIN
app/src/main/res/drawable-xhdpi/receive.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/send.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/share.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
app/src/main/res/drawable-xhdpi/share_group.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/add_contact.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/back_button_image.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_send_button.png
Executable file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/receive.png
Normal file
After Width: | Height: | Size: 2.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/send.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/share.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/add_contact.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/back_button_image.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_send_button.png
Executable file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/receive.png
Normal file
After Width: | Height: | Size: 3 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/send.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/share.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
5
app/src/main/res/drawable/add_contact_background.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<solid android:color="#ffffff" />
|
||||||
|
<stroke android:width="3sp" android:color="@color/gray"/>
|
||||||
|
<!--<padding android:left="9dp" android:right="9dp" android:top="9dp" android:bottom="9dp"/>-->
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/back_icon.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable/backup_ic.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
5
app/src/main/res/drawable/border.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<solid android:color="#ffffff" />
|
||||||
|
<stroke android:width="0.1dp" android:color="#BFE4F4"/>
|
||||||
|
<!--<padding android:left="9dp" android:right="9dp" android:top="9dp" android:bottom="9dp"/>-->
|
||||||
|
</shape>
|
4
app/src/main/res/drawable/border_digtis.xml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
|
||||||
|
<solid android:color="#ffffff" />
|
||||||
|
<stroke android:width="0.1dp" android:color="#BFE4F4"/>
|
||||||
|
</shape>
|
16
app/src/main/res/drawable/border_set.xml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:state_pressed="true"
|
||||||
|
android:state_enabled="true"
|
||||||
|
android:drawable="@color/red" />
|
||||||
|
<item
|
||||||
|
android:state_focused="true"
|
||||||
|
android:state_enabled="true"
|
||||||
|
android:drawable="@color/white" />
|
||||||
|
<item
|
||||||
|
android:state_focused="false"
|
||||||
|
android:state_enabled="false"
|
||||||
|
android:drawable="@color/white" />
|
||||||
|
<item android:drawable="@drawable/border_digtis"/>
|
||||||
|
</selector>
|
BIN
app/src/main/res/drawable/brainkey_ic.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
9
app/src/main/res/drawable/btn_txt.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true"
|
||||||
|
android:color="@color/greencolor"/> <!-- pressed -->
|
||||||
|
<item android:state_focused="true"
|
||||||
|
android:color="#ff0000ff"/> <!-- focused -->
|
||||||
|
<item android:color="#fff"/> <!-- default -->
|
||||||
|
</selector>
|
BIN
app/src/main/res/drawable/bts.png
Normal file
After Width: | Height: | Size: 47 KiB |
18
app/src/main/res/drawable/button_border.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item
|
||||||
|
android:state_pressed="true"
|
||||||
|
android:state_enabled="true"
|
||||||
|
android:drawable="@color/whiteColor" />
|
||||||
|
<item
|
||||||
|
android:state_focused="true"
|
||||||
|
android:state_enabled="true"
|
||||||
|
android:drawable="@color/greencolor" />
|
||||||
|
<item
|
||||||
|
android:state_focused="false"
|
||||||
|
android:state_enabled="false"
|
||||||
|
android:drawable="@color/white" />
|
||||||
|
<item android:drawable="@color/greencolor"
|
||||||
|
android:elevation="50dp"
|
||||||
|
/>
|
||||||
|
</selector>
|
9
app/src/main/res/drawable/button_text.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_pressed="true"
|
||||||
|
android:color="#fff"/> <!-- pressed -->
|
||||||
|
<item android:state_focused="true"
|
||||||
|
android:color="#ff0000ff"/> <!-- focused -->
|
||||||
|
<item android:color="#ff000000"/> <!-- default -->
|
||||||
|
</selector>
|
25
app/src/main/res/drawable/cameracircle.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
<solid
|
||||||
|
android:color="@color/whiteColor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
<corners
|
||||||
|
android:radius="2dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<padding
|
||||||
|
android:left="0dp"
|
||||||
|
android:top="0dp"
|
||||||
|
android:right="0dp"
|
||||||
|
android:bottom="0dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<size
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/change_icon.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
app/src/main/res/drawable/default_gravatar_image.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
14
app/src/main/res/drawable/edittext_background_layer.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
|
||||||
|
<item android:top="-2dp" android:right="-2dp" android:left="-2dp">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
<stroke
|
||||||
|
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#70882E" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</layer-list>
|
6
app/src/main/res/drawable/edittext_bg.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#ffffff" />
|
||||||
|
<stroke android:width="1dp" android:color="#000000" />
|
||||||
|
<padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp" />
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/erorricon.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable/erorricon2.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
app/src/main/res/drawable/fresh_icon.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
8
app/src/main/res/drawable/gradient_background.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<gradient
|
||||||
|
android:angle="90"
|
||||||
|
android:startColor="@color/light_blue"
|
||||||
|
android:endColor="@color/white"
|
||||||
|
android:type="linear"/>
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/gravtr.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/drawable/groupicon.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
25
app/src/main/res/drawable/ic_done_24dp.xml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright 2016 Google Inc. All Rights Reserved.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF00FF00"
|
||||||
|
android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||||
|
</vector>
|
9
app/src/main/res/drawable/ic_error_24dp.xml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24.0"
|
||||||
|
android:viewportHeight="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#ff0000"
|
||||||
|
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-2h2v2zM13,13h-2L11,7h2v6z"/>
|
||||||
|
</vector>
|
BIN
app/src/main/res/drawable/ic_next.png
Normal file
After Width: | Height: | Size: 436 B |
BIN
app/src/main/res/drawable/icon_camera.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/drawable/icon_connecting.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable/icon_disconnecting.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable/icon_receive.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/drawable/icon_send.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable/icon_setting.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable/icon_sg.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
28
app/src/main/res/drawable/loader_homescreen.xml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:fromDegrees="0"
|
||||||
|
android:pivotX="50%"
|
||||||
|
android:pivotY="50%"
|
||||||
|
android:duration="1"
|
||||||
|
android:toDegrees="360" >
|
||||||
|
|
||||||
|
<shape
|
||||||
|
android:innerRadiusRatio="3"
|
||||||
|
android:shape="ring"
|
||||||
|
android:thicknessRatio="8"
|
||||||
|
android:useLevel="false" >
|
||||||
|
<size
|
||||||
|
android:height="48dip"
|
||||||
|
android:width="48dip" />
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:centerColor="@color/color_preloader_center"
|
||||||
|
android:centerY="0.50"
|
||||||
|
android:endColor="@color/color_preloader_end"
|
||||||
|
android:startColor="@color/color_preloader_start"
|
||||||
|
android:type="sweep"
|
||||||
|
android:useLevel="false" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
</rotate>
|
BIN
app/src/main/res/drawable/logoicon.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable/next_icon.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
app/src/main/res/drawable/people.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/drawable/personicon.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
app/src/main/res/drawable/photo_icon.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable/pin_ic.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable/qricon.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/drawable/qricon2.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable/qrimage.png
Normal file
After Width: | Height: | Size: 96 KiB |
BIN
app/src/main/res/drawable/radio_btn.png
Normal file
After Width: | Height: | Size: 790 B |
24
app/src/main/res/drawable/rcvcircle.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<solid
|
||||||
|
android:color="@color/whiteColor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
<corners
|
||||||
|
android:radius="0dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<padding
|
||||||
|
android:left="0dp"
|
||||||
|
android:top="0dp"
|
||||||
|
android:right="0dp"
|
||||||
|
android:bottom="0dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<size
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/rcvicon.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable/righticon.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable/righticon2.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
6
app/src/main/res/drawable/rounded_corners.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="#fff"/>
|
||||||
|
<stroke android:width="1dip" android:color="@color/gray" />
|
||||||
|
<corners android:radius="10dip"/>
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/sample.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
app/src/main/res/drawable/send_button.png
Normal file
After Width: | Height: | Size: 15 KiB |
5
app/src/main/res/drawable/send_button_background.xml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="true" android:drawable="@color/redcolor"/>
|
||||||
|
<item android:state_enabled="false" android:drawable="@color/gray"/>
|
||||||
|
</selector>
|
24
app/src/main/res/drawable/sendcircle.xml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
<solid
|
||||||
|
android:color="@color/whiteColor"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
<corners
|
||||||
|
android:radius="2dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<padding
|
||||||
|
android:left="0dp"
|
||||||
|
android:top="0dp"
|
||||||
|
android:right="0dp"
|
||||||
|
android:bottom="0dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
<size
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent" />
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/sendicon.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable/sendicon2.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
21
app/src/main/res/drawable/shadow_background.xml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="5dp"
|
||||||
|
android:color="#EBDDE2" />
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:bottom="2dp"
|
||||||
|
android:left="2dp"
|
||||||
|
android:right="2dp"
|
||||||
|
android:top="2dp" />
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:centerColor="@color/white"
|
||||||
|
android:endColor="@color/white"
|
||||||
|
android:startColor="@color/white" />
|
||||||
|
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
|
||||||
|
</shape>
|
BIN
app/src/main/res/drawable/share_icon.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
14
app/src/main/res/drawable/simple_line.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
|
||||||
|
<item android:top="-2dp" android:right="-2dp" android:left="-2dp">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@android:color/transparent" />
|
||||||
|
<stroke
|
||||||
|
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="#d3d3d3" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</layer-list>
|